mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
populate created_by in migration script
This commit is contained in:
parent
e5e8d0acc8
commit
e915074c4b
@ -16,6 +16,9 @@ ALTER TABLE `user` ADD COLUMN `display_name` VARCHAR(255) NULL,
|
||||
ALTER TABLE `website` ADD COLUMN `created_by` VARCHAR(36) NULL,
|
||||
ADD COLUMN `team_id` VARCHAR(36) NULL;
|
||||
|
||||
-- MigrateData
|
||||
UPDATE "website" SET created_by = user_id WHERE team_id IS NULL;
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE `team_website`;
|
||||
|
||||
|
@ -16,6 +16,9 @@ ADD COLUMN "logo_url" VARCHAR(2183);
|
||||
ALTER TABLE "website" ADD COLUMN "created_by" UUID,
|
||||
ADD COLUMN "team_id" UUID;
|
||||
|
||||
-- MigrateData
|
||||
UPDATE "website" SET created_by = user_id WHERE team_id IS NULL;
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "team_website";
|
||||
|
||||
@ -24,3 +27,5 @@ CREATE INDEX "website_team_id_idx" ON "website"("team_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "website_created_by_idx" ON "website"("created_by");
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user