diff --git a/backend/db/migrations.sql b/backend/db/migrations.sql index ff8ff2d..46e27e5 100644 --- a/backend/db/migrations.sql +++ b/backend/db/migrations.sql @@ -18,3 +18,16 @@ CREATE TABLE IF NOT EXISTS "templates" ( REFERENCES users (id) ON DELETE CASCADE ); + +CREATE TABLE IF NOT EXISTS "cover_letters" ( + "id" SERIAL PRIMARY KEY, + "user_id" INTEGER NOT NULL, + "name" VARCHAR(50) NOT NULL UNIQUE, + "letter" TEXT NOT NULL, + "created_at" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT fk_user + FOREIGN KEY (user_id) + REFERENCES users (id) + ON DELETE CASCADE +);