Skip to content

Commit f07c506

Browse files
authored
document RawSQL operations
1 parent 0f9f308 commit f07c506

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

docs/migrations/migration_files.md

+28
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,34 @@ Name = "foo"
223223
Name = "counter"
224224
```
225225

226+
#### Raw SQL Operation
227+
228+
This operation performs raw SQL statements on the database.
229+
230+
!!! warning
231+
`make-migrations` can no longer generate any migration files once you have a raw SQL operation in your migration steps.
232+
233+
```toml
234+
[[Migration.Operations]]
235+
Type = "RawSQL"
236+
237+
# Set this to true to indicate that this SQL statement does not affect the
238+
# internal model representation.
239+
# Setting this to true will also keep `make-migrations` working, since it will
240+
# generate future migrations assuming that this SQL statement did not change
241+
# the model state.
242+
StructureSafe = false
243+
244+
# single SQL statement on SQLite databases
245+
SQLite = ""
246+
247+
# single SQL statement on PostgreSQL databases
248+
Postgres = ""
249+
250+
# single SQL statement on MySQL databases
251+
MySQL = ""
252+
```
253+
226254
### Field types
227255

228256
### Annotation types

0 commit comments

Comments
 (0)