From c085224a88ed7210a2d70e9f0752c752f65c9e8a Mon Sep 17 00:00:00 2001 From: Anup Cowkur Date: Wed, 17 Jul 2024 18:11:26 +0530 Subject: [PATCH] chore(backend): standardise migration file names closes #921 --- ....sql => 20231117020810_create_events_table.sql} | 0 ...n.sql => 20231117010312_create_teams_table.sql} | 0 ...on.sql => 20231117010526_create_apps_table.sql} | 0 ...n.sql => 20231117011737_create_roles_table.sql} | 0 ...20231117012011_create_build_mappings_table.sql} | 0 ...0231117012219_create_team_membership_table.sql} | 0 ...ql => 20231122211412_create_api_keys_table.sql} | 0 ...48_create_unhandled_exception_groups_table.sql} | 0 ... => 20231228044339_create_anr_groups_table.sql} | 0 ...=> 20240311054505_create_build_sizes_table.sql} | 0 ... => 20240502060117_create_event_reqs_table.sql} | 0 ...=> 20240703152041_create_auth_states_table.sql} | 0 ... 20240704051355_create_auth_sessions_table.sql} | 0 self-host/postgres/README.md | 14 +++++++------- 14 files changed, 7 insertions(+), 7 deletions(-) rename self-host/clickhouse/{20231117020810_create-events-table.sql => 20231117020810_create_events_table.sql} (100%) rename self-host/postgres/{20231117010312_create-teams-relation.sql => 20231117010312_create_teams_table.sql} (100%) rename self-host/postgres/{20231117010526_create-apps-relation.sql => 20231117010526_create_apps_table.sql} (100%) rename self-host/postgres/{20231117011737_create-roles-relation.sql => 20231117011737_create_roles_table.sql} (100%) rename self-host/postgres/{20231117012011_create-build_mappings-relation.sql => 20231117012011_create_build_mappings_table.sql} (100%) rename self-host/postgres/{20231117012219_create-team_membership-relation.sql => 20231117012219_create_team_membership_table.sql} (100%) rename self-host/postgres/{20231122211412_create-api_keys-relation.sql => 20231122211412_create_api_keys_table.sql} (100%) rename self-host/postgres/{20231228033348_create-unhandled_exception_groups-relation.sql => 20231228033348_create_unhandled_exception_groups_table.sql} (100%) rename self-host/postgres/{20231228044339_create-anr_groups-relation.sql => 20231228044339_create_anr_groups_table.sql} (100%) rename self-host/postgres/{20240311054505_create-build_sizes-relation.sql => 20240311054505_create_build_sizes_table.sql} (100%) rename self-host/postgres/{20240502060117_create-event_reqs-schema.sql => 20240502060117_create_event_reqs_table.sql} (100%) rename self-host/postgres/{20240703152041_create-auth_states-relation.sql => 20240703152041_create_auth_states_table.sql} (100%) rename self-host/postgres/{20240704051355_create-auth_sessions-relation.sql => 20240704051355_create_auth_sessions_table.sql} (100%) diff --git a/self-host/clickhouse/20231117020810_create-events-table.sql b/self-host/clickhouse/20231117020810_create_events_table.sql similarity index 100% rename from self-host/clickhouse/20231117020810_create-events-table.sql rename to self-host/clickhouse/20231117020810_create_events_table.sql diff --git a/self-host/postgres/20231117010312_create-teams-relation.sql b/self-host/postgres/20231117010312_create_teams_table.sql similarity index 100% rename from self-host/postgres/20231117010312_create-teams-relation.sql rename to self-host/postgres/20231117010312_create_teams_table.sql diff --git a/self-host/postgres/20231117010526_create-apps-relation.sql b/self-host/postgres/20231117010526_create_apps_table.sql similarity index 100% rename from self-host/postgres/20231117010526_create-apps-relation.sql rename to self-host/postgres/20231117010526_create_apps_table.sql diff --git a/self-host/postgres/20231117011737_create-roles-relation.sql b/self-host/postgres/20231117011737_create_roles_table.sql similarity index 100% rename from self-host/postgres/20231117011737_create-roles-relation.sql rename to self-host/postgres/20231117011737_create_roles_table.sql diff --git a/self-host/postgres/20231117012011_create-build_mappings-relation.sql b/self-host/postgres/20231117012011_create_build_mappings_table.sql similarity index 100% rename from self-host/postgres/20231117012011_create-build_mappings-relation.sql rename to self-host/postgres/20231117012011_create_build_mappings_table.sql diff --git a/self-host/postgres/20231117012219_create-team_membership-relation.sql b/self-host/postgres/20231117012219_create_team_membership_table.sql similarity index 100% rename from self-host/postgres/20231117012219_create-team_membership-relation.sql rename to self-host/postgres/20231117012219_create_team_membership_table.sql diff --git a/self-host/postgres/20231122211412_create-api_keys-relation.sql b/self-host/postgres/20231122211412_create_api_keys_table.sql similarity index 100% rename from self-host/postgres/20231122211412_create-api_keys-relation.sql rename to self-host/postgres/20231122211412_create_api_keys_table.sql diff --git a/self-host/postgres/20231228033348_create-unhandled_exception_groups-relation.sql b/self-host/postgres/20231228033348_create_unhandled_exception_groups_table.sql similarity index 100% rename from self-host/postgres/20231228033348_create-unhandled_exception_groups-relation.sql rename to self-host/postgres/20231228033348_create_unhandled_exception_groups_table.sql diff --git a/self-host/postgres/20231228044339_create-anr_groups-relation.sql b/self-host/postgres/20231228044339_create_anr_groups_table.sql similarity index 100% rename from self-host/postgres/20231228044339_create-anr_groups-relation.sql rename to self-host/postgres/20231228044339_create_anr_groups_table.sql diff --git a/self-host/postgres/20240311054505_create-build_sizes-relation.sql b/self-host/postgres/20240311054505_create_build_sizes_table.sql similarity index 100% rename from self-host/postgres/20240311054505_create-build_sizes-relation.sql rename to self-host/postgres/20240311054505_create_build_sizes_table.sql diff --git a/self-host/postgres/20240502060117_create-event_reqs-schema.sql b/self-host/postgres/20240502060117_create_event_reqs_table.sql similarity index 100% rename from self-host/postgres/20240502060117_create-event_reqs-schema.sql rename to self-host/postgres/20240502060117_create_event_reqs_table.sql diff --git a/self-host/postgres/20240703152041_create-auth_states-relation.sql b/self-host/postgres/20240703152041_create_auth_states_table.sql similarity index 100% rename from self-host/postgres/20240703152041_create-auth_states-relation.sql rename to self-host/postgres/20240703152041_create_auth_states_table.sql diff --git a/self-host/postgres/20240704051355_create-auth_sessions-relation.sql b/self-host/postgres/20240704051355_create_auth_sessions_table.sql similarity index 100% rename from self-host/postgres/20240704051355_create-auth_sessions-relation.sql rename to self-host/postgres/20240704051355_create_auth_sessions_table.sql diff --git a/self-host/postgres/README.md b/self-host/postgres/README.md index 2406df1c5..ab28dce9b 100644 --- a/self-host/postgres/README.md +++ b/self-host/postgres/README.md @@ -13,16 +13,16 @@ Schema migrations for postgres instances are managed using [dbmate](https://gith - Migrations **MUST** contain both `up` & `down` migrations - **NEVER** edit the generated `schema.sql` file manually - Follow this naming convention for naming migration files - - Syntax: `--` + - Syntax: `__` - `` should be `create` or `alter` etc sql commands - `` should be name of the relation or role or function or trigger etc - - `` should be name of the sql entity type, like `relation`(or `table`), `function`, `role`, `index`, `trigger` + - `` should be name of the sql entity type, like `table`, `function`, `role`, `index`, `trigger` - Examples: - - `dbmate new create-sessions-relation` - - `dbmate new create-sessions_attachments-relation` - - `dbmate new create-create_team-function` - - `dbmate new create-create_team_for_user-trigger` - - `dbmate new alter-teams-relation` - add a new column + - `dbmate new create_sessions_table` + - `dbmate new create_sessions_attachments_table` + - `dbmate new create_create_team_function` + - `dbmate new create_create_team_for_user_trigger` + - `dbmate new alter_teams_relation` - add a new column - When authoring migrations, always prefix the schema name in your objects ## Deleting old migrations