@@ -24,6 +24,7 @@ import (
24
24
25
25
"github.com/sqlc-dev/sqlc/internal/config"
26
26
"github.com/sqlc-dev/sqlc/internal/debug"
27
+ "github.com/sqlc-dev/sqlc/internal/migrations"
27
28
"github.com/sqlc-dev/sqlc/internal/opts"
28
29
"github.com/sqlc-dev/sqlc/internal/plugin"
29
30
"github.com/sqlc-dev/sqlc/internal/quickdb"
@@ -414,7 +415,7 @@ func (c *checker) fetchDatabaseUri(ctx context.Context, s config.SQL) (string, f
414
415
c .Client = client
415
416
}
416
417
417
- var migrations []string
418
+ var ddl []string
418
419
files , err := sqlpath .Glob (s .Schema )
419
420
if err != nil {
420
421
return "" , cleanup , err
@@ -424,13 +425,13 @@ func (c *checker) fetchDatabaseUri(ctx context.Context, s config.SQL) (string, f
424
425
if err != nil {
425
426
return "" , cleanup , fmt .Errorf ("read file: %w" , err )
426
427
}
427
- migrations = append (migrations , string (contents ))
428
+ ddl = append (ddl , migrations . RemoveRollbackStatements ( string (contents ) ))
428
429
}
429
430
430
431
resp , err := c .Client .CreateEphemeralDatabase (ctx , & pb.CreateEphemeralDatabaseRequest {
431
432
Engine : "postgresql" ,
432
433
Region : quickdb .GetClosestRegion (),
433
- Migrations : migrations ,
434
+ Migrations : ddl ,
434
435
})
435
436
if err != nil {
436
437
return "" , cleanup , fmt .Errorf ("managed: create database: %w" , err )
0 commit comments