diff --git a/cmd/db.go b/cmd/db.go index 99d1f8134..56c140f7a 100644 --- a/cmd/db.go +++ b/cmd/db.go @@ -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"))) @@ -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"))) @@ -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.") @@ -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"))) diff --git a/cmd/db_schema_declarative.go b/cmd/db_schema_declarative.go index 8cb98b991..cf304e147 100644 --- a/cmd/db_schema_declarative.go +++ b/cmd/db_schema_declarative.go @@ -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"))) diff --git a/cmd/gen.go b/cmd/gen.go index c9d2510f5..e2b634102 100644 --- a/cmd/gen.go +++ b/cmd/gen.go @@ -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")) diff --git a/cmd/inspect.go b/cmd/inspect.go index 160c73303..6ceb3ec66 100644 --- a/cmd/inspect.go +++ b/cmd/inspect.go @@ -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) diff --git a/cmd/migration.go b/cmd/migration.go index cd93012bb..6ca007ac4 100644 --- a/cmd/migration.go +++ b/cmd/migration.go @@ -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"))) @@ -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"))) @@ -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 diff --git a/cmd/storage.go b/cmd/storage.go index aa3876e92..0f42b35cf 100644 --- a/cmd/storage.go +++ b/cmd/storage.go @@ -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)