K
Kysely•2y ago
bun

is this uuid() correct in mysql?

export async function up(db: Kysely<any>): Promise<void> { await db.schema .createTable("Payment") .addColumn("id", "char", (col) => col.defaultTo(raw("UUID()")).primaryKey())
1 Reply
Igal
Igal•2y ago
Hey 👋 Try this out:
await db.schema
.createTable("Payment")
.addColumn("id", "varchar(36)", (cb) =>
cb.primaryKey().defaultTo(sql`(uuid())`),
)
.execute()
await db.schema
.createTable("Payment")
.addColumn("id", "varchar(36)", (cb) =>
cb.primaryKey().defaultTo(sql`(uuid())`),
)
.execute()
https://kyse.link/?p=s&i=G2STlnUKzAqM9heKsHES
Want results from more Discord servers?
Add your server