Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 891bb248c8 | |||
| 81f89fd14e |
@@ -40,7 +40,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Clone repository
|
- name: Clone repository
|
||||||
run: |
|
run: |
|
||||||
apk add --no-cache git curl jq
|
apk add --no-cache git curl jq docker-cli
|
||||||
git clone https://${{ secrets.GITEA_TOKEN }}@gitea.jeanlucmakiola.de/${{ gitea.repository }}.git repo
|
git clone https://${{ secrets.GITEA_TOKEN }}@gitea.jeanlucmakiola.de/${{ gitea.repository }}.git repo
|
||||||
cd repo
|
cd repo
|
||||||
git checkout ${{ gitea.ref_name }}
|
git checkout ${{ gitea.ref_name }}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
bun run db:push
|
bun run src/db/migrate.ts
|
||||||
exec bun run src/server/index.ts
|
exec bun run src/server/index.ts
|
||||||
|
|||||||
13
src/db/migrate.ts
Normal file
13
src/db/migrate.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { Database } from "bun:sqlite";
|
||||||
|
import { drizzle } from "drizzle-orm/bun-sqlite";
|
||||||
|
import { migrate } from "drizzle-orm/bun-sqlite/migrator";
|
||||||
|
|
||||||
|
const sqlite = new Database(process.env.DATABASE_PATH || "gearbox.db");
|
||||||
|
sqlite.run("PRAGMA journal_mode = WAL");
|
||||||
|
sqlite.run("PRAGMA foreign_keys = ON");
|
||||||
|
|
||||||
|
const db = drizzle(sqlite);
|
||||||
|
migrate(db, { migrationsFolder: "./drizzle" });
|
||||||
|
|
||||||
|
sqlite.close();
|
||||||
|
console.log("Migrations applied successfully");
|
||||||
Reference in New Issue
Block a user