<p>migrate.ts</p><p></p><div class="mockup-code"> <pre data-prefix="$"><code>import { migrate } from "drizzle-orm/libsql/migrator";
import { drizzle } from "drizzle-orm/libsql";
import { createClient } from "@libsql/client";
import * as dotenv from 'dotenv';
dotenv.config();
async function main() {
const db = drizzle(createClient({
url: process.env.TURSO_DATABASE_URL!,
authToken: process.env.TURSO_AUTH_TOKEN,
}));
console.log('Running migrations')
await migrate(db, { migrationsFolder: "drizzle" });
console.log('Migrated successfully')
process.exit(0)}
main().catch((e) =>{ console.error('Migration failed') console.error(e) process.exit(1)
});
</code></pre></div>