mirror of https://github.com/TZGyn/shortener
added migration script
parent
0221191be1
commit
5c7a66881a
@ -0,0 +1,10 @@
|
|||||||
|
import { drizzle } from 'drizzle-orm/postgres-js'
|
||||||
|
import { migrate } from 'drizzle-orm/postgres-js/migrator'
|
||||||
|
import postgres from 'postgres'
|
||||||
|
|
||||||
|
const sql = postgres(Bun.env.DATABASE_URL ?? '', { max: 1 })
|
||||||
|
const db = drizzle(sql)
|
||||||
|
|
||||||
|
await migrate(db, { migrationsFolder: 'drizzle' })
|
||||||
|
|
||||||
|
await sql.end()
|
||||||
Loading…
Reference in New Issue