hestia/prisma/migrations/20250206142847_add_residents/migration.sql
Baobeld 0f95f330ef
Create Residents table (#78)
* add resident table

* update prisma

* toc

* ignore md
2025-02-07 16:30:12 -05:00

14 lines
482 B
SQL

-- CreateTable
CREATE TABLE "Resident" (
"id" TEXT NOT NULL,
"tenantId" TEXT NOT NULL,
"name" TEXT NOT NULL,
"phoneNumber" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Resident_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Resident" ADD CONSTRAINT "Resident_tenantId_fkey" FOREIGN KEY ("tenantId") REFERENCES "Tenant"("id") ON DELETE RESTRICT ON UPDATE CASCADE;