
\connect tasks;


CREATE TABLE task_manager.project (
  "id" SERIAL PRIMARY KEY,
  "name" TEXT NOT NULL,
  "description" TEXT NOT NULL,
  "date" TEXT NOT NULL
);

CREATE TABLE task_manager.user_project (
  "users" INTEGER NOT NULL,
  "projects" INTEGER NOT NULL,
  PRIMARY KEY ("users", "projects"),
  FOREIGN KEY ("projects") REFERENCES "project" ("id") ON DELETE CASCADE,
  FOREIGN KEY ("users") REFERENCES "user" ("id") ON DELETE CASCADE
);
