umami/db/postgresql/migrations/04_team_redesign/migration.sql

29 lines
756 B
MySQL
Raw Normal View History

2024-01-16 21:32:27 +01:00
/*
Warnings:
- You are about to drop the `team_website` table. If the table is not empty, all the data it contains will be lost.
*/
-- AlterTable
2024-02-07 23:01:25 +01:00
ALTER TABLE "team" ADD COLUMN "deleted_at" TIMESTAMPTZ(6),
2024-01-25 20:15:11 +01:00
ADD COLUMN "logo_url" VARCHAR(2183);
-- AlterTable
2024-02-05 20:47:12 +01:00
ALTER TABLE "user" ADD COLUMN "display_name" VARCHAR(255),
ADD COLUMN "logo_url" VARCHAR(2183);
2024-01-16 21:32:27 +01:00
-- AlterTable
2024-02-05 20:47:12 +01:00
ALTER TABLE "website" ADD COLUMN "created_by" UUID,
ADD COLUMN "team_id" UUID;
2024-01-16 21:32:27 +01:00
-- MigrateData
UPDATE "website" SET created_by = user_id WHERE team_id IS NULL;
2024-01-16 21:32:27 +01:00
-- DropTable
DROP TABLE "team_website";
-- CreateIndex
CREATE INDEX "website_team_id_idx" ON "website"("team_id");
2024-02-05 20:47:12 +01:00
-- CreateIndex
2024-02-07 23:01:25 +01:00
CREATE INDEX "website_created_by_idx" ON "website"("created_by");