|
88 | 88 | if err := parseDatabaseConfig(fsys); err != nil { |
89 | 89 | return err |
90 | 90 | } |
91 | | - } |
| 91 | + } // else use --local, which is the default |
92 | 92 | ctx, _ := signal.NotifyContext(cmd.Context(), os.Interrupt) |
93 | 93 | if usePgAdmin { |
94 | 94 | return diff.Run(ctx, schema, file, dbConfig, fsys) |
@@ -237,7 +237,10 @@ func init() { |
237 | 237 | diffFlags.BoolVar(&useMigra, "use-migra", true, "Use migra to generate schema diff.") |
238 | 238 | diffFlags.BoolVar(&usePgAdmin, "use-pgadmin", false, "Use pgAdmin to generate schema diff.") |
239 | 239 | dbDiffCmd.MarkFlagsMutuallyExclusive("use-migra", "use-pgadmin") |
240 | | - diffFlags.BoolVar(&linked, "linked", false, "Diffs local schema against the linked project.") |
| 240 | + diffFlags.StringVar(&dbUrl, "db-url", "", "Diffs local migration files against the database specified by the connection string (must be percent-encoded).") |
| 241 | + diffFlags.BoolVar(&linked, "linked", false, "Diffs local migration files against the linked project.") |
| 242 | + diffFlags.BoolVar(&local, "local", false, "Diffs local migration files against the local database.") |
| 243 | + dbDiffCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local") |
241 | 244 | diffFlags.StringVarP(&file, "file", "f", "", "Saves schema diff to a new migration file.") |
242 | 245 | diffFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "List of schema to include.") |
243 | 246 | diffFlags.Lookup("schema").DefValue = "all" |
|
0 commit comments