`db push` fails when attempting to push empty model that is `@@ignore`d
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- sqlite, typescript
- Domain
- database
Research direction
Reproduce the schema with the empty @@ignore model using SQLite, then read migration-engine/connectors/sql-migration-connector/src/sql_database_step_applier.rs and the SchemaPush entry point in migration-engine/core/src/api.rs. Done means db push no longer fails for this model, or reports a helpful validation error instead.
Written by the indexing model from the issue text.
Description
Bug description
prisma db push fails with the following cryptic error when attempting to push a schema with an ignored model which is empty.
However, generation works and the prisma VS code extension doesn't highlight any errors.
When including the following model:
model Test {
@@ignore
}
Generation will work, but db push will fail with the following error:
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database ".dev.db" at "file:.dev.db?connection_limit=1&socket_timeout=20&pool_timeout=20"
SQLite database .dev.db created at file:.dev.db?connection_limit=1&socket_timeout=20&pool_timeout=20
Error: near ")": syntax error
0: sql_migration_connector::sql_database_step_applier::apply_migration
at migration-engine/connectors/sql-migration-connector/src/sql_database_step_applier.rs:11
1: migration_core::api::SchemaPush
at migration-engine/core/src/api.rs:184
However, if the model is changed to:
model Test {
id Int
@@ignore
}
pushing will work again
How to reproduce
Include the following in your schema.prisma
model Test {
@@ignore
}
Expected behavior
One of:
- The ignored model doesn't cause db push to fail
prisma generatefails with helpful error message / VS code prisma extension shows an error
Prisma information
# .env
DATABASE_URL='file:.dev.db?connection_limit=1&socket_timeout=20&pool_timeout=20'
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
Environment & setup
- Ubuntu 20.04.2
- Prisma v3.6.0
- Node v16.3.0
Prisma Version
Environment variables loaded from .env
prisma : 3.6.0
@prisma/client : 3.6.0
Current platform : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine dc520b92b1ebb2d28dc3161f9f82e875bd35d727 (at node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine : migration-engine-cli dc520b92b1ebb2d28dc3161f9f82e875bd35d727 (at node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core dc520b92b1ebb2d28dc3161f9f82e875bd35d727 (at node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt dc520b92b1ebb2d28dc3161f9f82e875bd35d727 (at node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : dc520b92b1ebb2d28dc3161f9f82e875bd35d727
Studio : 0.440.0
- Dominant language
- TypeScript
- Stars
- 47.6k
- Forks
- 2.5k
- Avg merge
- 21h 59m
- Merged PRs (30d)
- 95
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from prisma/orm
-
fix(mongo-orm): .select() combined with .include() drops joined relation fields via $project stage Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·