You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
523 B

10 months ago
  1. -- CreateTable
  2. CREATE TABLE "dept_users" (
  3. "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
  4. "deptId" INTEGER NOT NULL,
  5. "userId" INTEGER NOT NULL,
  6. "createdAt" DATETIME DEFAULT CURRENT_TIMESTAMP,
  7. "updatedAt" DATETIME DEFAULT CURRENT_TIMESTAMP,
  8. CONSTRAINT "dept_users_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE NO ACTION,
  9. CONSTRAINT "dept_users_deptId_fkey" FOREIGN KEY ("deptId") REFERENCES "dept" ("deptId") ON DELETE CASCADE ON UPDATE NO ACTION
  10. );