Skip to content
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

sql/migrate: add support for baseline/tags files #1971

Merged
merged 1 commit into from
Aug 10, 2023
Merged
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
6 changes: 0 additions & 6 deletions cmd/atlas/internal/cmdapi/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ type migrateApplyFlags struct {
logFormat string
lockTimeout time.Duration
allowDirty bool // allow working on a database that already has resources
fromVersion string // compute pending files based on this version
baselineVersion string // apply with this version as baseline
txMode string // (none, file, all)
}
Expand All @@ -87,9 +86,6 @@ func (f *migrateApplyFlags) migrateOptions() (opts []migrate.ExecutorOption) {
if v := f.baselineVersion; v != "" {
opts = append(opts, migrate.WithBaselineVersion(v))
}
if v := f.fromVersion; v != "" {
opts = append(opts, migrate.WithFromVersion(v))
}
return
}

Expand Down Expand Up @@ -141,11 +137,9 @@ If run with the "--dry-run" flag, atlas will not execute any SQL.`,
addFlagRevisionSchema(cmd.Flags(), &flags.revisionSchema)
addFlagDryRun(cmd.Flags(), &flags.dryRun)
addFlagLockTimeout(cmd.Flags(), &flags.lockTimeout)
cmd.Flags().StringVarP(&flags.fromVersion, flagFrom, "", "", "calculate pending files from the given version (including it)")
cmd.Flags().StringVarP(&flags.baselineVersion, flagBaseline, "", "", "start the first migration after the given baseline version")
cmd.Flags().StringVarP(&flags.txMode, flagTxMode, "", txModeFile, "set transaction mode [none, file, all]")
cmd.Flags().BoolVarP(&flags.allowDirty, flagAllowDirty, "", false, "allow start working on a non-clean database")
cmd.MarkFlagsMutuallyExclusive(flagFrom, flagBaseline)
cmd.MarkFlagsMutuallyExclusive(flagLog, flagFormat)
return cmd
}
Expand Down
1 change: 0 additions & 1 deletion doc/md/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ If run with the "--dry-run" flag, atlas will not execute any SQL.
--revisions-schema string name of the schema the revisions table resides in
--dry-run print SQL without executing it
--lock-timeout duration set how long to wait for the database lock (default 10s)
--from string calculate pending files from the given version (including it)
--baseline string start the first migration after the given baseline version
--tx-mode string set transaction mode [none, file, all] (default "file")
--allow-dirty allow start working on a non-clean database
Expand Down
Loading
Loading