From 6bea7f61eb4ecdb4df62a3d1754c9aa7a79cedcd Mon Sep 17 00:00:00 2001 From: FranGuam <53105842+FranGuam@users.noreply.github.com> Date: Mon, 27 May 2024 12:34:24 +0800 Subject: [PATCH] chore: delete aid & scholarship table (#181) * chore: delete aid & scholarship table * chore: remove id fields for all tables --- metadata/tables.yaml | 283 ++++-------------- .../down.sql | 3 + .../up.sql | 1 + .../down.sql | 3 + .../up.sql | 1 + .../down.sql | 1 + .../up.sql | 1 + .../down.sql | 2 + .../up.sql | 1 + .../down.sql | 1 + .../up.sql | 1 + .../down.sql | 1 + .../up.sql | 1 + .../down.sql | 2 + .../up.sql | 1 + .../down.sql | 2 + .../up.sql | 1 + .../down.sql | 2 + .../up.sql | 1 + .../down.sql | 3 + .../up.sql | 1 + .../down.sql | 1 + .../up.sql | 1 + .../down.sql | 1 + .../up.sql | 1 + .../down.sql | 2 + .../up.sql | 1 + .../down.sql | 2 + .../up.sql | 1 + .../down.sql | 3 + .../up.sql | 1 + 31 files changed, 95 insertions(+), 232 deletions(-) create mode 100644 migrations/1716776522560_drop_table_public_aid_application/down.sql create mode 100644 migrations/1716776522560_drop_table_public_aid_application/up.sql create mode 100644 migrations/1716776556359_drop_table_public_scholarship_application/down.sql create mode 100644 migrations/1716776556359_drop_table_public_scholarship_application/up.sql create mode 100644 migrations/1716781029624_alter_table_public_honor_application_alter_column_student_uuid/down.sql create mode 100644 migrations/1716781029624_alter_table_public_honor_application_alter_column_student_uuid/up.sql create mode 100644 migrations/1716781165593_alter_table_public_honor_application_drop_column_student_id/down.sql create mode 100644 migrations/1716781165593_alter_table_public_honor_application_drop_column_student_id/up.sql create mode 100644 migrations/1716781441705_alter_table_public_mentor_application_alter_column_mentor_uuid/down.sql create mode 100644 migrations/1716781441705_alter_table_public_mentor_application_alter_column_mentor_uuid/up.sql create mode 100644 migrations/1716781456647_alter_table_public_mentor_application_alter_column_student_uuid/down.sql create mode 100644 migrations/1716781456647_alter_table_public_mentor_application_alter_column_student_uuid/up.sql create mode 100644 migrations/1716781593880_alter_table_public_mentor_application_drop_column_mentor_id/down.sql create mode 100644 migrations/1716781593880_alter_table_public_mentor_application_drop_column_mentor_id/up.sql create mode 100644 migrations/1716781613783_alter_table_public_mentor_application_drop_column_student_id/down.sql create mode 100644 migrations/1716781613783_alter_table_public_mentor_application_drop_column_student_id/up.sql create mode 100644 migrations/1716781905611_alter_table_public_mentor_available_drop_column_mentor_id/down.sql create mode 100644 migrations/1716781905611_alter_table_public_mentor_available_drop_column_mentor_id/up.sql create mode 100644 migrations/1716782262682_alter_table_public_mentor_info_drop_column_mentor_id/down.sql create mode 100644 migrations/1716782262682_alter_table_public_mentor_info_drop_column_mentor_id/up.sql create mode 100644 migrations/1716782305099_alter_table_public_mentor_message_alter_column_from_uuid/down.sql create mode 100644 migrations/1716782305099_alter_table_public_mentor_message_alter_column_from_uuid/up.sql create mode 100644 migrations/1716782315609_alter_table_public_mentor_message_alter_column_to_uuid/down.sql create mode 100644 migrations/1716782315609_alter_table_public_mentor_message_alter_column_to_uuid/up.sql create mode 100644 migrations/1716782479166_alter_table_public_mentor_message_drop_column_from_id/down.sql create mode 100644 migrations/1716782479166_alter_table_public_mentor_message_drop_column_from_id/up.sql create mode 100644 migrations/1716782503129_alter_table_public_mentor_message_drop_column_to_id/down.sql create mode 100644 migrations/1716782503129_alter_table_public_mentor_message_drop_column_to_id/up.sql create mode 100644 migrations/1716783150254_alter_table_public_users_drop_column_id/down.sql create mode 100644 migrations/1716783150254_alter_table_public_users_drop_column_id/up.sql diff --git a/metadata/tables.yaml b/metadata/tables.yaml index 3ab62b5..bde7e4f 100644 --- a/metadata/tables.yaml +++ b/metadata/tables.yaml @@ -1,76 +1,3 @@ -- table: - name: aid_application - schema: public - object_relationships: - - name: user - using: - foreign_key_constraint_on: student_uuid - insert_permissions: - - role: counselor - permission: - check: {} - columns: - - aid - - amount - - code - - created_at - - form_url - - id - - status - - student_id - - student_uuid - - thank_letter - - updated_at - select_permissions: - - role: counselor - permission: - columns: - - aid - - amount - - code - - created_at - - form_url - - id - - status - - student_id - - student_uuid - - thank_letter - - updated_at - filter: {} - - role: student - permission: - columns: - - aid - - amount - - code - - created_at - - form_url - - id - - status - - student_id - - student_uuid - - thank_letter - - updated_at - filter: - student_uuid: - _eq: X-Hasura-User-Id - update_permissions: - - role: student - permission: - columns: - - form_url - - thank_letter - filter: - student_uuid: - _eq: X-Hasura-User-Id - check: - student_uuid: - _eq: X-Hasura-User-Id - delete_permissions: - - role: counselor - permission: - backend_only: false - filter: {} - table: name: contest schema: public @@ -3086,7 +3013,7 @@ name: honor_application schema: public object_relationships: - - name: student_byuuid + - name: student using: foreign_key_constraint_on: student_uuid insert_permissions: @@ -3105,7 +3032,6 @@ - honor - statement - status - - student_id - student_uuid select_permissions: - role: counselor @@ -3117,7 +3043,6 @@ - id - statement - status - - student_id - student_uuid - updated_at filter: {} @@ -3130,7 +3055,6 @@ - id - statement - status - - student_id - student_uuid - updated_at filter: @@ -3150,7 +3074,6 @@ - honor - statement - status - - student_id - student_uuid filter: _and: @@ -3248,10 +3171,10 @@ name: mentor_application schema: public object_relationships: - - name: mentor_byuuid + - name: mentor using: foreign_key_constraint_on: mentor_uuid - - name: student_byuuid + - name: student using: foreign_key_constraint_on: student_uuid insert_permissions: @@ -3259,71 +3182,61 @@ permission: check: {} columns: - - id + - chat_status - created_at - - updated_at + - id + - mentor_uuid - statement - - mentor_id - - student_id - status - - chat_status - - mentor_uuid - student_uuid + - updated_at - role: student permission: check: student_uuid: _eq: X-Hasura-User-Id columns: - - mentor_id - mentor_uuid - statement - - student_id - student_uuid select_permissions: - role: counselor permission: columns: - chat_status - - mentor_id - - statement - - student_id - created_at - - updated_at - id - mentor_uuid - - student_uuid + - statement - status + - student_uuid + - updated_at filter: {} allow_aggregations: true - role: student permission: columns: - chat_status - - mentor_id - - statement - - student_id - created_at - - updated_at - id - mentor_uuid - - student_uuid + - statement - status + - student_uuid + - updated_at filter: {} allow_aggregations: true - role: teacher permission: columns: - chat_status - - mentor_id - - statement - - student_id - created_at - - updated_at - id - mentor_uuid - - student_uuid + - statement - status + - student_uuid + - updated_at filter: mentor_uuid: _eq: X-Hasura-User-Id @@ -3332,15 +3245,13 @@ permission: columns: - chat_status - - mentor_id - - statement - - student_id - created_at - - updated_at - id - mentor_uuid - - student_uuid + - statement - status + - student_uuid + - updated_at filter: {} check: {} - role: student @@ -3391,7 +3302,7 @@ name: mentor_available schema: public object_relationships: - - name: mentor_byuuid + - name: mentor using: foreign_key_constraint_on: mentor_uuid insert_permissions: @@ -3402,35 +3313,31 @@ _eq: X-Hasura-User-Id columns: - available - - mentor_id - mentor_uuid select_permissions: - role: counselor permission: columns: - - created_at - - updated_at - - mentor_id - available + - created_at - mentor_uuid + - updated_at filter: {} - role: student permission: columns: - available - - mentor_id - created_at - - updated_at - mentor_uuid + - updated_at filter: {} - role: teacher permission: columns: - available - - mentor_id - created_at - - updated_at - mentor_uuid + - updated_at filter: mentor_uuid: _eq: X-Hasura-User-Id @@ -3449,7 +3356,7 @@ name: mentor_info schema: public object_relationships: - - name: userByMentorUuid + - name: user using: foreign_key_constraint_on: mentor_uuid insert_permissions: @@ -3457,14 +3364,13 @@ permission: check: {} columns: - - mentor_id - - intro - - background - - field - achievement + - background - created_at - - updated_at + - field + - intro - mentor_uuid + - updated_at - role: teacher permission: check: @@ -3476,21 +3382,19 @@ - created_at - field - intro - - mentor_id - mentor_uuid - updated_at select_permissions: - role: counselor permission: columns: - - mentor_id - - created_at - - updated_at - - mentor_uuid - achievement - background + - created_at - field - intro + - mentor_uuid + - updated_at filter: {} allow_aggregations: true - role: student @@ -3500,7 +3404,6 @@ - background - field - intro - - mentor_id - mentor_uuid filter: {} - role: teacher @@ -3511,7 +3414,6 @@ - created_at - field - intro - - mentor_id - mentor_uuid - updated_at filter: @@ -3521,14 +3423,13 @@ - role: counselor permission: columns: - - mentor_id - - created_at - - updated_at - - mentor_uuid - achievement - background + - created_at - field - intro + - mentor_uuid + - updated_at filter: {} check: {} - role: teacher @@ -3554,13 +3455,6 @@ - table: name: mentor_message schema: public - object_relationships: - - name: from_userbyuuid - using: - foreign_key_constraint_on: from_uuid - - name: to_userbyuuid - using: - foreign_key_constraint_on: to_uuid insert_permissions: - role: student permission: @@ -3568,10 +3462,8 @@ from_uuid: _eq: X-Hasura-User-Id columns: - - from_id - from_uuid - payload - - to_id - to_uuid - role: teacher permission: @@ -3579,23 +3471,19 @@ from_uuid: _eq: X-Hasura-User-Id columns: - - from_id - from_uuid - payload - - to_id - to_uuid select_permissions: - role: student permission: columns: - - from_id - - payload - - to_id - created_at - - updated_at - from_uuid - id + - payload - to_uuid + - updated_at filter: _or: - from_uuid: @@ -3606,11 +3494,9 @@ permission: columns: - created_at - - from_id - from_uuid - id - payload - - to_id - to_uuid - updated_at filter: @@ -4022,82 +3908,6 @@ permission: backend_only: false filter: {} -- table: - name: scholarship_application - schema: public - object_relationships: - - name: student_byuuid - using: - foreign_key_constraint_on: student_uuid - insert_permissions: - - role: counselor - permission: - check: {} - columns: - - id - - created_at - - updated_at - - scholarship - - amount - - status - - student_id - - thank_letter - - code - - honor - - form_url - - student_uuid - select_permissions: - - role: counselor - permission: - columns: - - amount - - code - - form_url - - honor - - scholarship - - status - - student_id - - thank_letter - - created_at - - updated_at - - id - - student_uuid - filter: {} - - role: student - permission: - columns: - - amount - - code - - created_at - - form_url - - honor - - id - - scholarship - - status - - student_id - - student_uuid - - thank_letter - - updated_at - filter: - student_uuid: - _eq: X-Hasura-User-Id - update_permissions: - - role: student - permission: - columns: - - form_url - - thank_letter - filter: - student_uuid: - _eq: X-Hasura-User-Id - check: - student_uuid: - _eq: X-Hasura-User-Id - delete_permissions: - - role: counselor - permission: - backend_only: false - filter: {} - table: name: scholarships_aids schema: public @@ -4209,7 +4019,6 @@ - department - email - github_id - - id - phone - realname - role @@ -4227,7 +4036,6 @@ - department - email - github_id - - id - phone - realname - role @@ -4245,7 +4053,6 @@ - department - email - github_id - - id - phone - realname - role @@ -4263,7 +4070,6 @@ - department - email - github_id - - id - phone - realname - role @@ -4281,7 +4087,6 @@ - department - email - github_id - - id - phone - realname - role @@ -4292,6 +4097,20 @@ - uuid filter: {} update_permissions: + - role: anonymous + permission: + columns: + - class + - department + - github_id + - phone + - realname + - student_no + - username + filter: + uuid: + _eq: X-Hasura-User-Id + check: null - role: counselor permission: columns: diff --git a/migrations/1716776522560_drop_table_public_aid_application/down.sql b/migrations/1716776522560_drop_table_public_aid_application/down.sql new file mode 100644 index 0000000..2ed303f --- /dev/null +++ b/migrations/1716776522560_drop_table_public_aid_application/down.sql @@ -0,0 +1,3 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- DROP table "public"."aid_application"; diff --git a/migrations/1716776522560_drop_table_public_aid_application/up.sql b/migrations/1716776522560_drop_table_public_aid_application/up.sql new file mode 100644 index 0000000..eb46b96 --- /dev/null +++ b/migrations/1716776522560_drop_table_public_aid_application/up.sql @@ -0,0 +1 @@ +DROP table "public"."aid_application"; diff --git a/migrations/1716776556359_drop_table_public_scholarship_application/down.sql b/migrations/1716776556359_drop_table_public_scholarship_application/down.sql new file mode 100644 index 0000000..3beb500 --- /dev/null +++ b/migrations/1716776556359_drop_table_public_scholarship_application/down.sql @@ -0,0 +1,3 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- DROP table "public"."scholarship_application"; diff --git a/migrations/1716776556359_drop_table_public_scholarship_application/up.sql b/migrations/1716776556359_drop_table_public_scholarship_application/up.sql new file mode 100644 index 0000000..c8a9683 --- /dev/null +++ b/migrations/1716776556359_drop_table_public_scholarship_application/up.sql @@ -0,0 +1 @@ +DROP table "public"."scholarship_application"; diff --git a/migrations/1716781029624_alter_table_public_honor_application_alter_column_student_uuid/down.sql b/migrations/1716781029624_alter_table_public_honor_application_alter_column_student_uuid/down.sql new file mode 100644 index 0000000..5a48354 --- /dev/null +++ b/migrations/1716781029624_alter_table_public_honor_application_alter_column_student_uuid/down.sql @@ -0,0 +1 @@ +alter table "public"."honor_application" alter column "student_uuid" drop not null; diff --git a/migrations/1716781029624_alter_table_public_honor_application_alter_column_student_uuid/up.sql b/migrations/1716781029624_alter_table_public_honor_application_alter_column_student_uuid/up.sql new file mode 100644 index 0000000..d91f131 --- /dev/null +++ b/migrations/1716781029624_alter_table_public_honor_application_alter_column_student_uuid/up.sql @@ -0,0 +1 @@ +alter table "public"."honor_application" alter column "student_uuid" set not null; diff --git a/migrations/1716781165593_alter_table_public_honor_application_drop_column_student_id/down.sql b/migrations/1716781165593_alter_table_public_honor_application_drop_column_student_id/down.sql new file mode 100644 index 0000000..ad62f5b --- /dev/null +++ b/migrations/1716781165593_alter_table_public_honor_application_drop_column_student_id/down.sql @@ -0,0 +1,2 @@ +alter table "public"."honor_application" alter column "student_id" drop not null; +alter table "public"."honor_application" add column "student_id" text; diff --git a/migrations/1716781165593_alter_table_public_honor_application_drop_column_student_id/up.sql b/migrations/1716781165593_alter_table_public_honor_application_drop_column_student_id/up.sql new file mode 100644 index 0000000..1420a1b --- /dev/null +++ b/migrations/1716781165593_alter_table_public_honor_application_drop_column_student_id/up.sql @@ -0,0 +1 @@ +alter table "public"."honor_application" drop column "student_id" cascade; diff --git a/migrations/1716781441705_alter_table_public_mentor_application_alter_column_mentor_uuid/down.sql b/migrations/1716781441705_alter_table_public_mentor_application_alter_column_mentor_uuid/down.sql new file mode 100644 index 0000000..9b5c797 --- /dev/null +++ b/migrations/1716781441705_alter_table_public_mentor_application_alter_column_mentor_uuid/down.sql @@ -0,0 +1 @@ +alter table "public"."mentor_application" alter column "mentor_uuid" drop not null; diff --git a/migrations/1716781441705_alter_table_public_mentor_application_alter_column_mentor_uuid/up.sql b/migrations/1716781441705_alter_table_public_mentor_application_alter_column_mentor_uuid/up.sql new file mode 100644 index 0000000..6a1b958 --- /dev/null +++ b/migrations/1716781441705_alter_table_public_mentor_application_alter_column_mentor_uuid/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_application" alter column "mentor_uuid" set not null; diff --git a/migrations/1716781456647_alter_table_public_mentor_application_alter_column_student_uuid/down.sql b/migrations/1716781456647_alter_table_public_mentor_application_alter_column_student_uuid/down.sql new file mode 100644 index 0000000..c153d6a --- /dev/null +++ b/migrations/1716781456647_alter_table_public_mentor_application_alter_column_student_uuid/down.sql @@ -0,0 +1 @@ +alter table "public"."mentor_application" alter column "student_uuid" drop not null; diff --git a/migrations/1716781456647_alter_table_public_mentor_application_alter_column_student_uuid/up.sql b/migrations/1716781456647_alter_table_public_mentor_application_alter_column_student_uuid/up.sql new file mode 100644 index 0000000..792955b --- /dev/null +++ b/migrations/1716781456647_alter_table_public_mentor_application_alter_column_student_uuid/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_application" alter column "student_uuid" set not null; diff --git a/migrations/1716781593880_alter_table_public_mentor_application_drop_column_mentor_id/down.sql b/migrations/1716781593880_alter_table_public_mentor_application_drop_column_mentor_id/down.sql new file mode 100644 index 0000000..ceec51c --- /dev/null +++ b/migrations/1716781593880_alter_table_public_mentor_application_drop_column_mentor_id/down.sql @@ -0,0 +1,2 @@ +alter table "public"."mentor_application" alter column "mentor_id" drop not null; +alter table "public"."mentor_application" add column "mentor_id" text; diff --git a/migrations/1716781593880_alter_table_public_mentor_application_drop_column_mentor_id/up.sql b/migrations/1716781593880_alter_table_public_mentor_application_drop_column_mentor_id/up.sql new file mode 100644 index 0000000..b6e391a --- /dev/null +++ b/migrations/1716781593880_alter_table_public_mentor_application_drop_column_mentor_id/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_application" drop column "mentor_id" cascade; diff --git a/migrations/1716781613783_alter_table_public_mentor_application_drop_column_student_id/down.sql b/migrations/1716781613783_alter_table_public_mentor_application_drop_column_student_id/down.sql new file mode 100644 index 0000000..59bb509 --- /dev/null +++ b/migrations/1716781613783_alter_table_public_mentor_application_drop_column_student_id/down.sql @@ -0,0 +1,2 @@ +alter table "public"."mentor_application" alter column "student_id" drop not null; +alter table "public"."mentor_application" add column "student_id" text; diff --git a/migrations/1716781613783_alter_table_public_mentor_application_drop_column_student_id/up.sql b/migrations/1716781613783_alter_table_public_mentor_application_drop_column_student_id/up.sql new file mode 100644 index 0000000..aeaef68 --- /dev/null +++ b/migrations/1716781613783_alter_table_public_mentor_application_drop_column_student_id/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_application" drop column "student_id" cascade; diff --git a/migrations/1716781905611_alter_table_public_mentor_available_drop_column_mentor_id/down.sql b/migrations/1716781905611_alter_table_public_mentor_available_drop_column_mentor_id/down.sql new file mode 100644 index 0000000..58cb5d0 --- /dev/null +++ b/migrations/1716781905611_alter_table_public_mentor_available_drop_column_mentor_id/down.sql @@ -0,0 +1,2 @@ +alter table "public"."mentor_available" alter column "mentor_id" drop not null; +alter table "public"."mentor_available" add column "mentor_id" text; diff --git a/migrations/1716781905611_alter_table_public_mentor_available_drop_column_mentor_id/up.sql b/migrations/1716781905611_alter_table_public_mentor_available_drop_column_mentor_id/up.sql new file mode 100644 index 0000000..c0ae4b8 --- /dev/null +++ b/migrations/1716781905611_alter_table_public_mentor_available_drop_column_mentor_id/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_available" drop column "mentor_id" cascade; diff --git a/migrations/1716782262682_alter_table_public_mentor_info_drop_column_mentor_id/down.sql b/migrations/1716782262682_alter_table_public_mentor_info_drop_column_mentor_id/down.sql new file mode 100644 index 0000000..f45f961 --- /dev/null +++ b/migrations/1716782262682_alter_table_public_mentor_info_drop_column_mentor_id/down.sql @@ -0,0 +1,3 @@ +comment on column "public"."mentor_info"."mentor_id" is E'新生导师信息'; +alter table "public"."mentor_info" alter column "mentor_id" drop not null; +alter table "public"."mentor_info" add column "mentor_id" text; diff --git a/migrations/1716782262682_alter_table_public_mentor_info_drop_column_mentor_id/up.sql b/migrations/1716782262682_alter_table_public_mentor_info_drop_column_mentor_id/up.sql new file mode 100644 index 0000000..d101435 --- /dev/null +++ b/migrations/1716782262682_alter_table_public_mentor_info_drop_column_mentor_id/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_info" drop column "mentor_id" cascade; diff --git a/migrations/1716782305099_alter_table_public_mentor_message_alter_column_from_uuid/down.sql b/migrations/1716782305099_alter_table_public_mentor_message_alter_column_from_uuid/down.sql new file mode 100644 index 0000000..5e93538 --- /dev/null +++ b/migrations/1716782305099_alter_table_public_mentor_message_alter_column_from_uuid/down.sql @@ -0,0 +1 @@ +alter table "public"."mentor_message" alter column "from_uuid" drop not null; diff --git a/migrations/1716782305099_alter_table_public_mentor_message_alter_column_from_uuid/up.sql b/migrations/1716782305099_alter_table_public_mentor_message_alter_column_from_uuid/up.sql new file mode 100644 index 0000000..2649b0b --- /dev/null +++ b/migrations/1716782305099_alter_table_public_mentor_message_alter_column_from_uuid/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_message" alter column "from_uuid" set not null; diff --git a/migrations/1716782315609_alter_table_public_mentor_message_alter_column_to_uuid/down.sql b/migrations/1716782315609_alter_table_public_mentor_message_alter_column_to_uuid/down.sql new file mode 100644 index 0000000..6de2df9 --- /dev/null +++ b/migrations/1716782315609_alter_table_public_mentor_message_alter_column_to_uuid/down.sql @@ -0,0 +1 @@ +alter table "public"."mentor_message" alter column "to_uuid" drop not null; diff --git a/migrations/1716782315609_alter_table_public_mentor_message_alter_column_to_uuid/up.sql b/migrations/1716782315609_alter_table_public_mentor_message_alter_column_to_uuid/up.sql new file mode 100644 index 0000000..777da50 --- /dev/null +++ b/migrations/1716782315609_alter_table_public_mentor_message_alter_column_to_uuid/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_message" alter column "to_uuid" set not null; diff --git a/migrations/1716782479166_alter_table_public_mentor_message_drop_column_from_id/down.sql b/migrations/1716782479166_alter_table_public_mentor_message_drop_column_from_id/down.sql new file mode 100644 index 0000000..bac9b82 --- /dev/null +++ b/migrations/1716782479166_alter_table_public_mentor_message_drop_column_from_id/down.sql @@ -0,0 +1,2 @@ +alter table "public"."mentor_message" alter column "from_id" drop not null; +alter table "public"."mentor_message" add column "from_id" text; diff --git a/migrations/1716782479166_alter_table_public_mentor_message_drop_column_from_id/up.sql b/migrations/1716782479166_alter_table_public_mentor_message_drop_column_from_id/up.sql new file mode 100644 index 0000000..65778dd --- /dev/null +++ b/migrations/1716782479166_alter_table_public_mentor_message_drop_column_from_id/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_message" drop column "from_id" cascade; diff --git a/migrations/1716782503129_alter_table_public_mentor_message_drop_column_to_id/down.sql b/migrations/1716782503129_alter_table_public_mentor_message_drop_column_to_id/down.sql new file mode 100644 index 0000000..9dfe708 --- /dev/null +++ b/migrations/1716782503129_alter_table_public_mentor_message_drop_column_to_id/down.sql @@ -0,0 +1,2 @@ +alter table "public"."mentor_message" alter column "to_id" drop not null; +alter table "public"."mentor_message" add column "to_id" text; diff --git a/migrations/1716782503129_alter_table_public_mentor_message_drop_column_to_id/up.sql b/migrations/1716782503129_alter_table_public_mentor_message_drop_column_to_id/up.sql new file mode 100644 index 0000000..859c4d0 --- /dev/null +++ b/migrations/1716782503129_alter_table_public_mentor_message_drop_column_to_id/up.sql @@ -0,0 +1 @@ +alter table "public"."mentor_message" drop column "to_id" cascade; diff --git a/migrations/1716783150254_alter_table_public_users_drop_column_id/down.sql b/migrations/1716783150254_alter_table_public_users_drop_column_id/down.sql new file mode 100644 index 0000000..415f13a --- /dev/null +++ b/migrations/1716783150254_alter_table_public_users_drop_column_id/down.sql @@ -0,0 +1,3 @@ +alter table "public"."users" add constraint "users_id_key" unique (id); +alter table "public"."users" alter column "id" drop not null; +alter table "public"."users" add column "id" text; diff --git a/migrations/1716783150254_alter_table_public_users_drop_column_id/up.sql b/migrations/1716783150254_alter_table_public_users_drop_column_id/up.sql new file mode 100644 index 0000000..4d4c065 --- /dev/null +++ b/migrations/1716783150254_alter_table_public_users_drop_column_id/up.sql @@ -0,0 +1 @@ +alter table "public"."users" drop column "id" cascade;