Skip to content

Commit

Permalink
add migration table in alter (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsumura-h authored Jul 17, 2022
1 parent 90c5a70 commit 7ae1abe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/allographer/schema_builder/schema.nim
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ proc alter*(rdb:Rdb, tables:varargs[Table]) =
of PostgreSQL:
PostgreQuery.new(rdb).toInterface()

# migration table
let migrationTable = table("_migrations", [
Column.increments("id"),
Column.string("name"),
Column.text("query"),
Column.string("checksum").index(),
Column.datetime("created_at"),
Column.boolean("status")
])
generator.createTableSql(migrationTable)
generator.runQuery(migrationTable.query)

for i, table in tables:
# カラム変更
case table.migrationType
Expand Down

0 comments on commit 7ae1abe

Please sign in to comment.