diff --git a/packages/adapter-pg/schema.sql b/packages/adapter-pg/schema.sql index 2c70d2db22..cae70d49a7 100644 --- a/packages/adapter-pg/schema.sql +++ b/packages/adapter-pg/schema.sql @@ -14,7 +14,7 @@ CREATE TABLE users CREATE TABLE accounts ( id SERIAL, - "userId" INTEGER NOT NULL REFERENCES users ON DELETE CASCADE, + "userId" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE, type VARCHAR(255) NOT NULL, provider VARCHAR(255) NOT NULL, "providerAccountId" VARCHAR(255) NOT NULL, @@ -32,7 +32,7 @@ CREATE TABLE accounts CREATE TABLE sessions ( id SERIAL, - "userId" INTEGER NOT NULL REFERENCES users ON DELETE CASCADE, + "userId" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE, expires TIMESTAMPTZ NOT NULL, "sessionToken" VARCHAR(255) UNIQUE NOT NULL,