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)).
This commit is contained in:
Conrad Irwin 2024-03-15 13:04:48 -06:00 committed by GitHub
parent 123d3ee282
commit dd33330648
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 3 deletions

View file

@ -198,7 +198,7 @@ CREATE TABLE "channels" (
"name" VARCHAR NOT NULL, "name" VARCHAR NOT NULL,
"created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, "created_at" TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
"visibility" VARCHAR NOT NULL, "visibility" VARCHAR NOT NULL,
"parent_path" TEXT, "parent_path" TEXT NOT NULL,
"requires_zed_cla" BOOLEAN NOT NULL DEFAULT FALSE "requires_zed_cla" BOOLEAN NOT NULL DEFAULT FALSE
); );
@ -237,8 +237,7 @@ CREATE TABLE "channel_members" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT, "id" INTEGER PRIMARY KEY AUTOINCREMENT,
"channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE, "channel_id" INTEGER NOT NULL REFERENCES channels (id) ON DELETE CASCADE,
"user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE, "user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,
"admin" BOOLEAN NOT NULL DEFAULT false, "role" VARCHAR NOT NULL,
"role" VARCHAR,
"accepted" BOOLEAN NOT NULL DEFAULT false, "accepted" BOOLEAN NOT NULL DEFAULT false,
"updated_at" TIMESTAMP NOT NULL DEFAULT now "updated_at" TIMESTAMP NOT NULL DEFAULT now
); );

View file

@ -0,0 +1,4 @@
-- Add migration script here
ALTER TABLE channel_members ALTER role SET NOT NULL;
ALTER TABLE channel_members DROP COLUMN admin;

View file

@ -0,0 +1,2 @@
-- Add migration script here
ALTER TABLE channels ALTER parent_path SET NOT NULL;