wasp/examples/thoughts/migrations/20210713180928_attached_entities_to_user/migration.sql
2021-07-13 21:09:18 +02:00

19 lines
691 B
SQL

/*
Warnings:
- Added the required column `userId` to the `Tag` table without a default value. This is not possible if the table is not empty.
- Added the required column `userId` to the `Thought` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Tag" ADD COLUMN "userId" INTEGER NOT NULL;
-- AlterTable
ALTER TABLE "Thought" ADD COLUMN "userId" INTEGER NOT NULL;
-- AddForeignKey
ALTER TABLE "Tag" ADD FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE "Thought" ADD FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;