Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cmd/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ func init() {
dbDumpCmd.MarkFlagsMutuallyExclusive("keep-comments", "data-only")
dumpFlags.StringVarP(&file, "file", "f", "", "File path to save the dumped contents.")
dumpFlags.String("db-url", "", "Dumps from the database specified by the connection string (must be percent-encoded).")
dumpFlags.Bool("linked", true, "Dumps from the linked project.")
dumpFlags.Bool("local", false, "Dumps from the local database.")
dumpFlags.Bool("linked", false, "Dumps from the linked project.")
dumpFlags.Bool("local", true, "Dumps from the local database.")
dbDumpCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
dumpFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", dumpFlags.Lookup("password")))
Expand All @@ -409,8 +409,8 @@ func init() {
pushFlags.BoolVar(&includeSeed, "include-seed", false, "Include seed data from your config.")
pushFlags.BoolVar(&dryRun, "dry-run", false, "Print the migrations that would be applied, but don't actually apply them.")
pushFlags.String("db-url", "", "Pushes to the database specified by the connection string (must be percent-encoded).")
pushFlags.Bool("linked", true, "Pushes to the linked project.")
pushFlags.Bool("local", false, "Pushes to the local database.")
pushFlags.Bool("linked", false, "Pushes to the linked project.")
pushFlags.Bool("local", true, "Pushes to the local database.")
dbPushCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
pushFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", pushFlags.Lookup("password")))
Expand All @@ -423,8 +423,8 @@ func init() {
pullFlags.Var(&pullDiffEngine, "diff-engine", "Diff engine to use for migration-style db pull.")
pullFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "Comma separated list of schema to include.")
pullFlags.String("db-url", "", "Pulls from the database specified by the connection string (must be percent-encoded).")
pullFlags.Bool("linked", true, "Pulls from the linked project.")
pullFlags.Bool("local", false, "Pulls from the local database.")
pullFlags.Bool("linked", false, "Pulls from the linked project.")
pullFlags.Bool("local", true, "Pulls from the local database.")
dbPullCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
dbPullCmd.MarkFlagsMutuallyExclusive("use-pg-delta", "diff-engine")
pullFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
Expand All @@ -434,7 +434,7 @@ func init() {
remoteFlags := dbRemoteCmd.PersistentFlags()
remoteFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "Comma separated list of schema to include.")
remoteFlags.String("db-url", "", "Connect using the specified Postgres URL (must be percent-encoded).")
remoteFlags.Bool("linked", true, "Connect to the linked project.")
remoteFlags.Bool("linked", false, "Connect to the linked project.")
dbRemoteCmd.MarkFlagsMutuallyExclusive("db-url", "linked")
remoteFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", remoteFlags.Lookup("password")))
Expand Down
2 changes: 1 addition & 1 deletion cmd/db_schema_declarative.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ func init() {
generateFlags.StringSliceVarP(&schema, "schema", "s", []string{}, "Comma separated list of schema to include.")
generateFlags.String("db-url", "", "Generates declarative schema from the database specified by the connection string (must be percent-encoded).")
generateFlags.Bool("linked", false, "Generates declarative schema from the linked project.")
generateFlags.BoolVar(&declarativeLocal, "local", false, "Generates declarative schema from the local database.")
generateFlags.BoolVar(&declarativeLocal, "local", true, "Generates declarative schema from the local database.")
dbDeclarativeGenerateCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
generateFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", generateFlags.Lookup("password")))
Expand Down
2 changes: 1 addition & 1 deletion cmd/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ Supported algorithms:

func init() {
typeFlags := genTypesCmd.Flags()
typeFlags.Bool("local", false, "Generate types from the local dev database.")
typeFlags.Bool("linked", false, "Generate types from the linked project.")
typeFlags.Bool("local", true, "Generate types from the local dev database.")
typeFlags.String("db-url", "", "Generate types from a database url.")
typeFlags.StringVar(&flags.ProjectRef, "project-id", "", "Generate types from a project ID.")
markFlagTelemetrySafe(typeFlags.Lookup("project-id"))
Expand Down
4 changes: 2 additions & 2 deletions cmd/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ var (
func init() {
inspectFlags := inspectCmd.PersistentFlags()
inspectFlags.String("db-url", "", "Inspect the database specified by the connection string (must be percent-encoded).")
inspectFlags.Bool("linked", true, "Inspect the linked project.")
inspectFlags.Bool("local", false, "Inspect the local database.")
inspectFlags.Bool("linked", false, "Inspect the linked project.")
inspectFlags.Bool("local", true, "Inspect the local database.")
inspectCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
inspectDBCmd.AddCommand(inspectReplicationSlotsCmd)
inspectDBCmd.AddCommand(inspectIndexStatsCmd)
Expand Down
12 changes: 6 additions & 6 deletions cmd/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func init() {
// Build list command
listFlags := migrationListCmd.Flags()
listFlags.String("db-url", "", "Lists migrations of the database specified by the connection string (must be percent-encoded).")
listFlags.Bool("linked", true, "Lists migrations applied to the linked project.")
listFlags.Bool("local", false, "Lists migrations applied to the local database.")
listFlags.Bool("linked", false, "Lists migrations applied to the linked project.")
listFlags.Bool("local", true, "Lists migrations applied to the local database.")
migrationListCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
listFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", listFlags.Lookup("password")))
Expand All @@ -121,8 +121,8 @@ func init() {
repairFlags.Var(&targetStatus, "status", "Version status to update.")
cobra.CheckErr(migrationRepairCmd.MarkFlagRequired("status"))
repairFlags.String("db-url", "", "Repairs migrations of the database specified by the connection string (must be percent-encoded).")
repairFlags.Bool("linked", true, "Repairs the migration history of the linked project.")
repairFlags.Bool("local", false, "Repairs the migration history of the local database.")
repairFlags.Bool("linked", false, "Repairs the migration history of the linked project.")
repairFlags.Bool("local", true, "Repairs the migration history of the local database.")
migrationRepairCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
repairFlags.StringVarP(&dbPassword, "password", "p", "", "Password to your remote Postgres database.")
cobra.CheckErr(viper.BindPFlag("DB_PASSWORD", repairFlags.Lookup("password")))
Expand Down Expand Up @@ -158,8 +158,8 @@ func init() {
// Build up command
fetchFlags := migrationFetchCmd.Flags()
fetchFlags.String("db-url", "", "Fetches migrations from the database specified by the connection string (must be percent-encoded).")
fetchFlags.Bool("linked", true, "Fetches migration history from the linked project.")
fetchFlags.Bool("local", false, "Fetches migration history from the local database.")
fetchFlags.Bool("linked", false, "Fetches migration history from the linked project.")
fetchFlags.Bool("local", true, "Fetches migration history from the local database.")
migrationFetchCmd.MarkFlagsMutuallyExclusive("db-url", "linked", "local")
migrationCmd.AddCommand(migrationFetchCmd)
// Build new command
Expand Down
4 changes: 2 additions & 2 deletions cmd/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ rm ss:///bucket/docs/example.md ss:///bucket/readme.md

func init() {
storageFlags := storageCmd.PersistentFlags()
storageFlags.Bool("linked", true, "Connects to Storage API of the linked project.")
storageFlags.Bool("local", false, "Connects to Storage API of the local database.")
storageFlags.Bool("linked", false, "Connects to Storage API of the linked project.")
storageFlags.Bool("local", true, "Connects to Storage API of the local database.")
storageCmd.MarkFlagsMutuallyExclusive("linked", "local")
lsCmd.Flags().BoolVarP(&recursive, "recursive", "r", false, "Recursively list a directory.")
storageCmd.AddCommand(lsCmd)
Expand Down