migration.sql 639 B

12345678910111213141516171819
  1. -- CreateTable
  2. CREATE TABLE "executives_histories" (
  3. "id" TEXT NOT NULL,
  4. "hospital_id" TEXT NOT NULL,
  5. "executive_name" TEXT,
  6. "contact" TEXT,
  7. "status" TEXT,
  8. "start_term" TIMESTAMP(3),
  9. "end_term" TIMESTAMP(3),
  10. "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  11. "updatedAt" TIMESTAMP(3) NOT NULL,
  12. "deletedAt" TIMESTAMP(3),
  13. CONSTRAINT "executives_histories_pkey" PRIMARY KEY ("id")
  14. );
  15. -- AddForeignKey
  16. ALTER TABLE "executives_histories" ADD CONSTRAINT "executives_histories_hospital_id_fkey" FOREIGN KEY ("hospital_id") REFERENCES "hospitals"("id") ON DELETE RESTRICT ON UPDATE CASCADE;