-
-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(db diff): add --local flag #1282
Conversation
Pull Request Test Coverage Report for Build 5461060811
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
@@ -237,7 +237,10 @@ func init() { | |||
diffFlags.BoolVar(&useMigra, "use-migra", true, "Use migra to generate schema diff.") | |||
diffFlags.BoolVar(&usePgAdmin, "use-pgadmin", false, "Use pgAdmin to generate schema diff.") | |||
dbDiffCmd.MarkFlagsMutuallyExclusive("use-migra", "use-pgadmin") | |||
diffFlags.BoolVar(&linked, "linked", false, "Diffs local schema against the linked project.") | |||
diffFlags.StringVar(&dbUrl, "db-url", "", "Diffs local migration files against the database specified by the connection string (must be percent-encoded).") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already defined as a persistent flag on L228.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but I couldn't use it as part of MarkFlagsMutuallyExclusive with the global flag
diffFlags.BoolVar(&linked, "linked", false, "Diffs local schema against the linked project.") | ||
diffFlags.StringVar(&dbUrl, "db-url", "", "Diffs local migration files against the database specified by the connection string (must be percent-encoded).") | ||
diffFlags.BoolVar(&linked, "linked", false, "Diffs local migration files against the linked project.") | ||
diffFlags.BoolVar(&local, "local", false, "Diffs local migration files against the local database.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diffFlags.BoolVar(&local, "local", false, "Diffs local migration files against the local database.") | |
diffFlags.BoolVar(&local, "local", true, "Diffs local migration files against the local database.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah true - will push a fix
What kind of change does this PR introduce?
feature
What is the current behavior?
supabase db diff
defaults to diffing against the local database, but there's no--local
flag, which makes it inconsistent with othersupabase db
subcommands.What is the new behavior?
Add
--local
flag (basically a noop vs. the existing behavior).