Comments (2)
Sure!
generated & not working:
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"email" TEXT NOT NULL,
"name" TEXT,
"newField" TEXT
);
INSERT INTO "new_User" ("createdAt", "email", "id", "name") SELECT "createdAt", "email", "id", "name" FROM "User";
DROP TABLE "User";
ALTER TABLE "new_User" RENAME TO "User";
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
PRAGMA foreign_key_check("User");
PRAGMA foreign_keys=ON;
expected & working:
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
CREATE TABLE "new_User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"email" TEXT NOT NULL,
"name" TEXT,
"newField" TEXT
);
INSERT INTO "new_User" ("createdAt", "email", "id", "name") SELECT "createdAt", "email", "id", "name" FROM "User";
DROP TABLE "User";
ALTER TABLE "new_User" RENAME TO "User";
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
PRAGMA foreign_key_check("User");
PRAGMA defer_foreign_keys=OFF;
from prisma.
For completeness, can you include the generated migration SQL that is causing problems? Thanks.
from prisma.
Related Issues (20)
- Support nested queries in `query` extension
- Not possible to omit optional fields in Mongo HOT 2
- Slow generate, then add new models and it got faster ( °o°) HOT 6
- called `Option::unwrap()` on a `None` value HOT 1
- Bug (D1 migrations): IDs of optional relations are lost quietly during migration HOT 3
- prisma migrate dev fails with Error: P1017 (prisma > 5.9.1) HOT 2
- MySQL migration invalid default value @default(now())
- Bug: [D1] Error in performIO: Error: D1_ERROR: too many SQL variables HOT 1
- Support Couchbase HOT 1
- prisma-cli should correctly prompt the current loaded ENV file HOT 3
- Running queries in Promise.all() leads to idle zombie database sessions HOT 2
- Enable parameters for data source to be provided as fields on `datasource` instead of connection string arguments
- prisma migrate * commands not working HOT 3
- Schema enum Support Chinese HOT 3
- transaction: bulk ops already in a transaction should not be executed in a new sub transaction HOT 2
- Could not figure out an ID in create HOT 3
- Cannot read properties of undefined (reading 'kind') HOT 2
- Prisma is returning the DateTime in ISOstring() HOT 2
- Generalize and Enhance Readability of "RecordNotFound" Error Message in Prisma Client HOT 1
- Log query params are not escaped
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prisma.