Prisma issue (Nov 30): Prisma SQLite: Optional DateTime @default(now()) Generates Invalid ALTER TABLE Statement
Is it fixed? Not yet.
Ongoing since Nov 30, 11:34 UTC. First reported Nov 30, 11:34 UTC. Not on the vendor’s status page yet.
What happened
Prisma 7.10.1 generates an invalid ALTER TABLE statement when adding an optional DateTime field with @default(now()) to an existing SQLite model. SQLite rejects the migration with a 'Cannot add a column with non-constant default' error because ALTER TABLE ADD COLUMN does not accept CURRENT_TIMESTAMP as a default.
What caused it?
Prisma generates ALTER TABLE "Post" ADD COLUMN ... DEFAULT CURRENT_TIMESTAMP for optional fields, which SQLite rejects since it does not accept CURRENT_TIMESTAMP as a default in ADD COLUMN operations.
Source: github.com
No verified workaround yet
None of the linked reports describe a mitigation. This page updates when one appears.
Outage timeline
- Investigating(current)
- Workaround available(upcoming)
- Resolved(upcoming)
- First report on GitHub issue
SQLite: adding an optional `DateTime @default(now())` field generates `ADD COLUMN ... DEFAULT CURRENT_TIMESTAMP`, which SQLite rejects
Source
Reports of this outage
1 report · 1 GitHubShow
- [1]GitHub First reportSQLite: adding an optional `DateTime @default(now())` field generates `ADD COLUMN ... DEFAULT CURRENT_TIMESTAMP`, which SQLite rejects(opens GitHub issue in a new tab)
Package and version prisma@7.10.1 What happened? Adding an optional field with @default(now()) to an existing model generates: ALTER TABLE "Post" ADD COLUMN "publishedAt" DATETIME DEFAULT CURRENT_TIMESTAMP; SQLite rejects this with Cannot add a column with non-constant default, because ALTER TABLE ... ADD COLUMN does not accept CURRENT_TIMESTAMP as a default. The same field declared as required (DateTime @default(now())) works, because in that case Prisma redefines the table. What did you…
by adcode9158 0upvotes 1comments
Prisma issue FAQ
What happened in the Prisma issue, and why?
Ongoing since Nov 30, 11:34 UTC. The cause: Prisma generates ALTER TABLE "Post" ADD COLUMN ... DEFAULT CURRENT_TIMESTAMP for optional fields, which SQLite rejects since it does not accept CURRENT_TIMESTAMP as a default in ADD COLUMN operations.
What is affected by the Prisma issue?
Prisma (versions: 7.10.1).
When did the Prisma issue start and end?
It started Nov 30, 11:34 UTC and is still ongoing (1 d so far). This page updates as it develops.
How do I get alerts for Prisma?
Subscribe to the Prisma RSS feed for every new Prisma incident, or connect an AI assistant to WhatBrokeToday over MCP and ask whether Prisma is down. Prisma feed
Where does this information come from?
WhatBrokeToday collects public status pages, developer community reports and security advisories, groups the ones about the same problem, and links every report under Evidence on this page. This one has 1 report from 1 independent source.