Comments (12)
This should be fixed in [email protected]
. If the issue persists, feel free to reopen it!
from drizzle-orm.
Looking into it, thanks!
from drizzle-orm.
+1 here!
from drizzle-orm.
having the same issue, upgraded from
"drizzle-kit": "^0.20.6",
"drizzle-orm": "^0.29.1",
To
"drizzle-orm": "0.30.10",
"drizzle-kit": "0.21.0",
here is my drizzle.config.ts if it help
import dotenv from "dotenv"
import type { Config } from "drizzle-kit"
dotenv.config({path: '.env.local'})
export default {
schema: "./src/db/schema.ts",
out: "./src/db/migrations",
dialect: 'postgresql',
dbCredentials: {
url: process.env.DB_CONNECTION_URL ?? ''
},
migrations: {
schema: 'public',
table: 'migrations'
}
} satisfies Config
from drizzle-orm.
same here
> drizzle-kit check
drizzle-kit: v0.21.1
drizzle-orm: v0.30.10
No config path provided, using default 'drizzle.config.ts'
Reading config file '/drizzle.config.ts'
_ZodError: [
{
"code": "invalid_union",
"unionErrors": [
{
"issues": [
{
"received": "6",
"code": "invalid_literal",
"expected": "5",
from drizzle-orm.
+1, ran into the same issue.
from drizzle-orm.
Got this issue aswell on 0.21.2. Following the stack trace, this seems to come from what I assume to be a dev test forgotten where it ignores the desired dialect from config/params and instead runs all three dialects.
Code snipped pulled from bin.cjs
line 113657 - 113682 in [email protected]. I also included the up command which seems to be doing it properly.
var checkCommand = new import_commander.Command("check").option("--config <config>", `Drizzle config file path`).option("--dialect <dialect>", "Database dialect").option("--out <out>", `Output folder`).action(async (options) => {
await printVersions();
await assertOrmCoreVersion();
const params = cliConfigCheck.parse(options);
const { out, dialect: dialect7 } = await assertOutFolder(params);
checkHandler(out, "postgresql");
checkHandler(out, "sqlite");
checkHandler(out, "mysql");
console.log("Everything's fine \u{1F436}\u{1F525}");
});
var upCommand = new import_commander.Command("up").option("--config <config>", `Drizzle config file path`).option("--dialect <dialect>", "Database dialect").option("--out <out>", `Output folder`).action(async (options) => {
await printVersions();
await assertOrmCoreVersion();
const params = cliConfigCheck.parse(options);
const { out, dialect: dialect7 } = await assertOutFolder(params);
await assertPackages("drizzle-orm");
if (dialect7 === "postgresql") {
upPgHandler(out);
}
if (dialect7 === "mysql") {
upMysqlHandler(out);
}
if (dialect7 === "sqlite") {
upSqliteHandler(out);
}
});
@AndriiSherman Might be useful information if you're still looking into this :)
from drizzle-orm.
same problem here
from drizzle-orm.
+1, ran into the same issue.
Versions
"drizzle-orm": "0.30.6",
"drizzle-kit": "0.21.2",
from drizzle-orm.
Same here
ZodError: [
{
"code": "invalid_union",
"unionErrors": [
{
"issues": [
{
"code": "invalid_literal",
"expected": "5",
"path": [
"version"
],
"message": "Invalid literal value, expected \"5\""
},
{
"code": "invalid_literal",
"expected": "pg",
"path": [
"dialect"
],
"message": "Invalid literal value, expected \"pg\""
},
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"tables",
"segment",
"schema"
],
"message": "Required"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"index"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"startLat"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"startLng"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"endLat"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"endLng"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"startDate"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"endDate"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"tripId"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "invalid_type",
"expected": "object",
"received": "undefined",
"path": [
"schemas"
],
"message": "Required"
}
],
"name": "ZodError"
},
{
"issues": [
{
"code": "invalid_literal",
"expected": "postgresql",
"path": [
"dialect"
],
"message": "Invalid literal value, expected \"postgresql\""
},
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"tables",
"segment",
"schema"
],
"message": "Required"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"index"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"startLat"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"startLng"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"endLat"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"endLng"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"startDate"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"endDate"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "unrecognized_keys",
"keys": [
"autoincrement"
],
"path": [
"tables",
"segment",
"columns",
"tripId"
],
"message": "Unrecognized key(s) in object: 'autoincrement'"
},
{
"code": "invalid_type",
"expected": "object",
"received": "undefined",
"path": [
"schemas"
],
"message": "Required"
}
],
"name": "ZodError"
}
],
"path": [],
"message": "Invalid input"
}
]
from drizzle-orm.
Here is a patch (for pnpm)
patches/[email protected]
diff --git a/bin.cjs b/bin.cjs
index 02a2165a023b86ad1bbc2e3fef1193404b2c97f1..787b7830b3f6d88b19c916e2eed34d1b9b1ceeba 100644
--- a/bin.cjs
+++ b/bin.cjs
@@ -113659,9 +113659,7 @@ var checkCommand = new import_commander.Command("check").option("--config <confi
await assertOrmCoreVersion();
const params = cliConfigCheck.parse(options);
const { out, dialect: dialect7 } = await assertOutFolder(params);
- checkHandler(out, "postgresql");
- checkHandler(out, "sqlite");
- checkHandler(out, "mysql");
+ checkHandler(out, dialect7);
console.log("Everything's fine \u{1F436}\u{1F525}");
});
var upCommand = new import_commander.Command("up").option("--config <config>", `Drizzle config file path`).option("--dialect <dialect>", "Database dialect").option("--out <out>", `Output folder`).action(async (options) => {
from drizzle-orm.
This should be fixed in
[email protected]
. If the issue persists, feel free to reopen it!
lifesaver, thanks
from drizzle-orm.
Related Issues (20)
- [BUG]: `drizzle-kit generate` doesn't pick up changes in schema 🤔 HOT 2
- [BUG]: drizzle-kit generate for unique index produces incorrect migration HOT 1
- [BUG]: Index migration query is generated with parameter HOT 1
- [BUG]: BLOB json values are not being stringified before insert. HOT 2
- [BUG]: Drizzle migration does not rollback if it fails
- [BUG]: Execute Alter Sequence
- [FEATURE]: Subquery select column
- [BUG]: drizzle-kit generate creates broken SQL for postgres when creating compound primary key
- [FEATURE]: Manual control migrations
- [BUG]: `drizzle-typebox` fails to map geometry column to type-box schema HOT 1
- [BUG]: drizzle-valibot does not provide types for returned schemas
- [BUG]: The function of installation of neon database is was not working HOT 2
- [BUG]: Drizzle-typebox types SQLite real field to string
- [BUG]: Missing `index names` when running `introspect` command [MYSQL]
- [BUG]: Postgis `geometry` query select fails when using `with`
- [BUG]: Schema generation with custom schema not working for mysql
- [BUG]: Issues with nested conditions & placeholders in SQLite query
- [BUG]: `drizzle-kit introspect` produces diffs without underlying schema changes
- [BUG]: Cannot rename table with composite primary keys
- [FEATURE]: Track constraints in the type system
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 drizzle-orm.