Lukas
PPrisma
•Created by Lukas on 5/24/2024 in #help-and-questions
prisma db push is failing on relation
Hello 👋, when trying to apply a new SQLite schema it throws this error complaining something is wrong with the relation. I hope someone experienced can help me, thanks for taking your time!
Error: SQLite database error
near "(": syntax error in CREATE TABLE "sessions" (
"session_token" TEXT NOT NULL,
"user_id" TEXT NOT NULL,
"created_at" INTEGER NOT NULL DEFAULT strftime('%s', 'now'),
"expires_at" INTEGER NOT NULL,
PRIMARY KEY ("user_id", "session_token"),
CONSTRAINT "sessions_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
) at offset 140
0: sql_schema_connector::apply_migration::apply_migration
at schema-engine\connectors\sql-schema-connector\src\apply_migration.rs:10
1: schema_core::state::SchemaPush
at schema-engine\core\src\state.rs:434
Prisma Schema:
6 replies