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)
- Prisma Migrate removes the results of custom migrations in the next `migrate dev` run HOT 8
- Types broken on void clients (no models) HOT 2
- RustPanic: RuntimeError HOT 1
- internal error: entered unreachable code HOT 1
- I'm using using prisma in auth.config.ts and Its giving vercel edge errors
- When using `pnpm` and deploying Prisma Client to Heroku, it fails at runtime with `Cannot find module '.prisma/client'` HOT 2
- Install fail! Error: [[email protected] › @prisma/[email protected]] Can't find package @prisma/engines's version: 5.14.0
- Error seeding DB via Prisma command, possible invocation error
- Query optimization is not compatible with PostgreSQL citext fields HOT 2
- PrismaClientInitializationError HOT 3
- resetting database data
- I want to use FK as id(as a composite key) HOT 3
- Add model inheritance HOT 3
- Remove validate call after format in CLI
- called `Result::unwrap()` on an `Err` value: Any { .. } HOT 2
- Split out the "fix" functionality of `prisma format`
- internal error: entered unreachable code HOT 1
- Migration is created for the `@default(dbgenerated(...))` value on `DateTime` although already migrated HOT 1
- Runtime error that occurs in `findUnique()` when unique constraint is composed of one field HOT 1
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.