mirror of
https://github.com/xataio/pgroll.git
synced 2024-09-11 13:55:28 +03:00
16b1d75ee0
This change adds a new `sql` operation, that allows to define an `up` SQL statement to perform a migration on the schema. An optional `down` field can be provided, this will be used when trying to do a rollback after (for instance, in case of migration failure). A new trigger is installed to capture DDL events coming from direct user manipulations (not done by pg-roll), so they are stored as a migration, getting to know the resulting schema in all cases.
12 lines
188 B
JSON
12 lines
188 B
JSON
{
|
|
"name": "05_sql",
|
|
"operations": [
|
|
{
|
|
"sql": {
|
|
"up": "CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)",
|
|
"down": "DROP TABLE users"
|
|
}
|
|
}
|
|
]
|
|
}
|