MCPcopy
hub / github.com/hasura/graphql-engine / runDryRun

Method runDryRun

cli/migrate/migrate.go:1328–1352  ·  view source on GitHub ↗
(ret <-chan interface{})

Source from the content-addressed store, hash-verified

1326}
1327
1328func (m *Migrate) runDryRun(ret <-chan interface{}) error {
1329 var op herrors.Op = "migrate.Migrate.runDryRun"
1330 migrations := make([]*Migration, 0)
1331 var lastInsertVersion int64
1332 for r := range ret {
1333 if m.stop() {
1334 return nil
1335 }
1336
1337 switch r := r.(type) {
1338 case error:
1339 return herrors.E(op, r)
1340 case *Migration:
1341 if r.Body != nil {
1342 version := int64(r.Version)
1343 if version != lastInsertVersion {
1344 migrations = append(migrations, r)
1345 lastInsertVersion = version
1346 }
1347 }
1348 }
1349 }
1350 fmt.Fprintf(os.Stdout, "%s", printDryRunStatus(migrations))
1351 return nil
1352}
1353
1354func (m *Migrate) squashMigrations(retUp <-chan interface{}, retDown <-chan interface{}, dataUp chan<- interface{}, dataDown chan<- interface{}, versions chan<- int64) error {
1355 var latestVersion int64

Callers 5

MigrateMethod · 0.95
StepsMethod · 0.95
UpMethod · 0.95
DownMethod · 0.95
GotoVersionMethod · 0.95

Calls 2

stopMethod · 0.95
printDryRunStatusFunction · 0.85

Tested by

no test coverage detected