Coder Social home page Coder Social logo

Comments (12)

AndriiSherman avatar AndriiSherman commented on June 21, 2024 3

This should be fixed in [email protected]. If the issue persists, feel free to reopen it!

from drizzle-orm.

AndriiSherman avatar AndriiSherman commented on June 21, 2024 1

Looking into it, thanks!

from drizzle-orm.

dkmooers avatar dkmooers commented on June 21, 2024 1

+1 here!

from drizzle-orm.

TuanManhCao avatar TuanManhCao commented on June 21, 2024 1

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.

AlonMiz avatar AlonMiz commented on June 21, 2024

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.

nigelnindodev avatar nigelnindodev commented on June 21, 2024

+1, ran into the same issue.

from drizzle-orm.

svemat01 avatar svemat01 commented on June 21, 2024

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.

serhii-kucherenko avatar serhii-kucherenko commented on June 21, 2024

same problem here

from drizzle-orm.

cillajelf avatar cillajelf commented on June 21, 2024

+1, ran into the same issue.

Versions
"drizzle-orm": "0.30.6",
"drizzle-kit": "0.21.2",

from drizzle-orm.

XantreDev avatar XantreDev commented on June 21, 2024

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.

XantreDev avatar XantreDev commented on June 21, 2024

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.

serhii-kucherenko avatar serhii-kucherenko commented on June 21, 2024

This should be fixed in [email protected]. If the issue persists, feel free to reopen it!

lifesaver, thanks

from drizzle-orm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.