Skip to content

Commit 4c0e28e

Browse files
authored
cmd/atlascmd: extend atlas migrate validate documentation (#784)
1 parent b29bb80 commit 4c0e28e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

cmd/atlascmd/migrate.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@ This command should be used whenever a manual change in the migration directory
103103
// MigrateValidateCmd represents the migrate validate command.
104104
MigrateValidateCmd = &cobra.Command{
105105
Use: "validate",
106-
Short: "Validates the migration directories checksum.",
106+
Short: "Validates the migration directories checksum and SQL statements.",
107107
Long: `'atlas migrate validate' computes the integrity hash sum of the migration directory and compares it to
108-
the atlas.sum file. If there is a mismatch it will be reported.`,
108+
the atlas.sum file. If there is a mismatch it will be reported. If the --dev-url flag is given, the migration files are
109+
executed on the connected database in order to validate SQL semantics.`,
109110
Example: ` atlas migrate validate
110-
atlas migrate validate --dir /path/to/migration/directory`,
111+
atlas migrate validate --dir /path/to/migration/directory
112+
atlas migrate validate --dir /path/to/migration/directory --dev-url mysql://user:pass@localhost:3306/dev`,
111113
RunE: CmdMigrateValidateRun,
112114
}
113115
)

doc/md/cli/reference.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ atlas migrate new
136136

137137
### atlas migrate validate
138138

139-
Validates the migration directories checksum.
139+
Validates the migration directories checksum and SQL statements.
140140

141141
#### Usage
142142
```
@@ -145,13 +145,15 @@ atlas migrate validate [flags]
145145

146146
#### Details
147147
'atlas migrate validate' computes the integrity hash sum of the migration directory and compares it to
148-
the atlas.sum file. If there is a mismatch it will be reported.
148+
the atlas.sum file. If there is a mismatch it will be reported. If the --dev-url flag is given, the migration files are
149+
executed on the connected database in order to validate SQL semantics.
149150

150151
#### Example
151152

152153
```
153154
atlas migrate validate
154155
atlas migrate validate --dir /path/to/migration/directory
156+
atlas migrate validate --dir /path/to/migration/directory --dev-url mysql://user:pass@localhost:3306/dev
155157
```
156158
#### Flags
157159
```

0 commit comments

Comments
 (0)