msh
msh
DTDrizzle Team
Created by msh on 4/16/2024 in #help
adding a new table column with default value drops all table data without warning
could this be because i have a custom default function on one of the columns? .$default(() => Number(customAlphabet('123456789')(16))),
2 replies
DTDrizzle Team
Created by msh on 6/29/2023 in #help
no issues anymore
4 replies
DTDrizzle Team
Created by msh on 6/29/2023 in #help
upgrading drizzle-orm to 0.27.0 and adding dbCredentials instead of flat connectionString and ts-ignoring the type error somehow worked? push/pull/generate/insert/select all work now
import * as dotenv from "dotenv"
import type { Config } from "drizzle-kit"

dotenv.config()

export default {
schema: "./drizzle/schema.ts",
out: "./drizzle/migrations",
dbCredentials: {
// @ts-ignore
connectionString: process.env.DATABASE_URL, // typescript: Type 'string | undefined' is not assignable to type 'string'.
// Type 'undefined' is not assignable to type 'string'. [2322]
// ^ this error occurs both on typescript version 4.9.5 and 5.1.6
},
breakpoints: true,
tablesFilter: ["playground_*"],
} satisfies Config
import * as dotenv from "dotenv"
import type { Config } from "drizzle-kit"

dotenv.config()

export default {
schema: "./drizzle/schema.ts",
out: "./drizzle/migrations",
dbCredentials: {
// @ts-ignore
connectionString: process.env.DATABASE_URL, // typescript: Type 'string | undefined' is not assignable to type 'string'.
// Type 'undefined' is not assignable to type 'string'. [2322]
// ^ this error occurs both on typescript version 4.9.5 and 5.1.6
},
breakpoints: true,
tablesFilter: ["playground_*"],
} satisfies Config
4 replies