diff --git a/migrations/src/m20240718_000003_create_workspace.rs b/migrations/src/m20240718_000003_create_workspace.rs index 735ed0a9a..532ecd809 100644 --- a/migrations/src/m20240718_000003_create_workspace.rs +++ b/migrations/src/m20240718_000003_create_workspace.rs @@ -75,6 +75,7 @@ impl MigrationTrait for Migration { .create_index( Index::create() .name("workspace_organization_id_idx") + .if_not_exists() .table(Workspace::Table) .col(Workspace::OrganizationId) .to_owned(), diff --git a/migrations/src/m20240718_000004_create_group.rs b/migrations/src/m20240718_000004_create_group.rs index c6e6c1e03..781c6e400 100644 --- a/migrations/src/m20240718_000004_create_group.rs +++ b/migrations/src/m20240718_000004_create_group.rs @@ -58,6 +58,8 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("group_organization_id_idx") + .if_not_exists() .table(Group::Table) .col(Group::OrganizationId) .to_owned(), diff --git a/migrations/src/m20240718_000005_create_invitation.rs b/migrations/src/m20240718_000005_create_invitation.rs index e38daff39..01c3eb061 100644 --- a/migrations/src/m20240718_000005_create_invitation.rs +++ b/migrations/src/m20240718_000005_create_invitation.rs @@ -63,6 +63,8 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("invitation_organization_id_idx") + .if_not_exists() .table(Invitation::Table) .col(Invitation::OrganizationId) .to_owned(), @@ -71,6 +73,8 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("invitation_user_id_idx") + .if_not_exists() .table(Invitation::Table) .col(Invitation::OwnerId) .to_owned(), diff --git a/migrations/src/m20240718_000007_create_file.rs b/migrations/src/m20240718_000007_create_file.rs index b77793512..4208a8eab 100644 --- a/migrations/src/m20240718_000007_create_file.rs +++ b/migrations/src/m20240718_000007_create_file.rs @@ -95,6 +95,8 @@ impl Migration { manager .create_index( Index::create() + .name("file_parent_id_idx") + .if_not_exists() .table(File::Table) .col(File::ParentId) .to_owned(), @@ -103,6 +105,8 @@ impl Migration { manager .create_index( Index::create() + .name("file_workspace_id_idx") + .if_not_exists() .table(File::Table) .col(File::WorkspaceId) .to_owned(), diff --git a/migrations/src/m20240718_000009_create_grouppermission.rs b/migrations/src/m20240718_000009_create_grouppermission.rs index c9f89b72b..f9513985b 100644 --- a/migrations/src/m20240718_000009_create_grouppermission.rs +++ b/migrations/src/m20240718_000009_create_grouppermission.rs @@ -51,6 +51,7 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("grouppermission_group_id_resource_id_idx") .table(Grouppermission::Table) .col(Grouppermission::GroupId) .col(Grouppermission::ResourceId) @@ -62,6 +63,8 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("grouppermission_group_id_idx") + .if_not_exists() .table(Grouppermission::Table) .col(Grouppermission::GroupId) .to_owned(), @@ -70,6 +73,8 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("grouppermission_resource_id_idx") + .if_not_exists() .table(Grouppermission::Table) .col(Grouppermission::ResourceId) .to_owned(), diff --git a/migrations/src/m20240718_000010_create_userpermission.rs b/migrations/src/m20240718_000010_create_userpermission.rs index c41bb87c6..478ee35c6 100644 --- a/migrations/src/m20240718_000010_create_userpermission.rs +++ b/migrations/src/m20240718_000010_create_userpermission.rs @@ -51,6 +51,8 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("userpermission_user_id_resource_id_idx") + .if_not_exists() .table(Userpermission::Table) .col(Userpermission::UserId) .col(Userpermission::ResourceId) @@ -62,6 +64,8 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("userpermission_user_id_idx") + .if_not_exists() .table(Userpermission::Table) .col(Userpermission::UserId) .to_owned(), @@ -70,6 +74,8 @@ impl MigrationTrait for Migration { manager .create_index( Index::create() + .name("userpermission_resource_id_idx") + .if_not_exists() .table(Userpermission::Table) .col(Userpermission::ResourceId) .to_owned(),