change database table name organization to house
This commit is contained in:
36
prisma/migrations/20260224033323_change_name/migration.sql
Normal file
36
prisma/migrations/20260224033323_change_name/migration.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the `organization` table. If the table is not empty, all the data it contains will be lost.
|
||||
|
||||
*/
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "invitation" DROP CONSTRAINT "invitation_organizationId_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "member" DROP CONSTRAINT "member_organizationId_fkey";
|
||||
|
||||
-- DropTable
|
||||
DROP TABLE "organization";
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "house" (
|
||||
"id" TEXT NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"slug" TEXT NOT NULL,
|
||||
"logo" TEXT,
|
||||
"createdAt" TIMESTAMPTZ NOT NULL,
|
||||
"metadata" TEXT,
|
||||
"color" TEXT DEFAULT '#000000',
|
||||
|
||||
CONSTRAINT "house_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "house_slug_key" ON "house"("slug");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "member" ADD CONSTRAINT "member_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "house"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "invitation" ADD CONSTRAINT "invitation_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "house"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
Reference in New Issue
Block a user