Skip to content

Commit

Permalink
fix(migration): make compatible with initial sql (#242)
Browse files Browse the repository at this point in the history
Make compatible with initial SQL by adding if_not_exists for tables that
were defined by the initial SQL file.
  • Loading branch information
dsonck92 authored Jul 27, 2024
1 parent a974410 commit 3a1fde6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions migrations/src/m20240718_000003_create_workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl MigrationTrait for Migration {
.create_table(
Table::create()
.table(Workspace::Table)
.if_not_exists()
.col(
ColumnDef::new(Workspace::Id)
.text()
Expand Down
1 change: 1 addition & 0 deletions migrations/src/m20240718_000007_create_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ impl Migration {
.create_table(
Table::create()
.table(SnapshotFile::Table)
.if_not_exists()
.col(ColumnDef::new(SnapshotFile::SnapshotId).text())
.foreign_key(
ForeignKey::create()
Expand Down
1 change: 1 addition & 0 deletions migrations/src/m20240718_000008_create_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl MigrationTrait for Migration {
.create_table(
Table::create()
.table(Task::Table)
.if_not_exists()
.col(
ColumnDef::new(Task::Id)
.text()
Expand Down
1 change: 1 addition & 0 deletions migrations/src/m20240718_000009_create_grouppermission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl MigrationTrait for Migration {
.create_table(
Table::create()
.table(Grouppermission::Table)
.if_not_exists()
.col(
ColumnDef::new(Grouppermission::Id)
.text()
Expand Down
1 change: 1 addition & 0 deletions migrations/src/m20240718_000010_create_userpermission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl MigrationTrait for Migration {
.create_table(
Table::create()
.table(Userpermission::Table)
.if_not_exists()
.col(
ColumnDef::new(Userpermission::Id)
.text()
Expand Down

0 comments on commit 3a1fde6

Please sign in to comment.