From dd33330648ffc0c600a96c24d2aa8398e985d1ad Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Fri, 15 Mar 2024 13:04:48 -0600 Subject: [PATCH] Finish migration to role instead of `is_admin` (#9414) Release Notes: - Fixed a bug signing in for five users ([#4323](https://github.com/zed-industries/zed/issues/4323)). --- .../collab/migrations.sqlite/20221109000000_test_schema.sql | 5 ++--- .../migrations/20240315182903_non_null_channel_role.sql | 4 ++++ .../20240315183903_channel_parent_path_not_null.sql | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 crates/collab/migrations/20240315182903_non_null_channel_role.sql create mode 100644 crates/collab/migrations/20240315183903_channel_parent_path_not_null.sql diff --git a/crates/collab/migrations.sqlite/20221109000000_test_schema.sql b/crates/collab/migrations.sqlite/20221109000000_test_schema.sql index 4a4ba84663..ae26e219d0 100644 --- a/crates/collab/migrations.sqlite/20221109000000_test_schema.sql +++ b/crates/collab/migrations.sqlite/20221109000000_test_schema.sql @@ -198,7 +198,7 @@ CREATE TABLE "channels" ( "name" VARCHAR NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, "visibility" VARCHAR NOT NULL, - "parent_path" TEXT, + "parent_path" TEXT NOT NULL, "requires_zed_cla" BOOLEAN NOT NULL DEFAULT FALSE ); @@ -237,8 +237,7 @@ CREATE TABLE "channel_members" ( "id" INTEGER PRIMARY KEY AUTOINCREMENT, "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE, "user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE, - "admin" BOOLEAN NOT NULL DEFAULT false, - "role" VARCHAR, + "role" VARCHAR NOT NULL, "accepted" BOOLEAN NOT NULL DEFAULT false, "updated_at" TIMESTAMP NOT NULL DEFAULT now ); diff --git a/crates/collab/migrations/20240315182903_non_null_channel_role.sql b/crates/collab/migrations/20240315182903_non_null_channel_role.sql new file mode 100644 index 0000000000..2d359f8058 --- /dev/null +++ b/crates/collab/migrations/20240315182903_non_null_channel_role.sql @@ -0,0 +1,4 @@ +-- Add migration script here + +ALTER TABLE channel_members ALTER role SET NOT NULL; +ALTER TABLE channel_members DROP COLUMN admin; diff --git a/crates/collab/migrations/20240315183903_channel_parent_path_not_null.sql b/crates/collab/migrations/20240315183903_channel_parent_path_not_null.sql new file mode 100644 index 0000000000..5703578b00 --- /dev/null +++ b/crates/collab/migrations/20240315183903_channel_parent_path_not_null.sql @@ -0,0 +1,2 @@ +-- Add migration script here +ALTER TABLE channels ALTER parent_path SET NOT NULL;