Skip to content

Commit

Permalink
chore: move db location to data
Browse files Browse the repository at this point in the history
  • Loading branch information
taciturnaxolotl committed Jul 6, 2024
1 parent fc3bb7e commit 593facd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ dist
.DS_Store

dist
db/users.db
data
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS release
COPY --from=build /temp/prod/. .
RUN chown -R bun:bun .
RUN mkdir data && chown -R bun:bun data

# run the app
USER bun
Expand Down
2 changes: 1 addition & 1 deletion db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Database } from "bun:sqlite";
import { migrate } from "drizzle-orm/bun-sqlite/migrator";


const sqlite = new Database("db/users.db");
const sqlite = new Database("data/users.db");
const db = drizzle(sqlite);
await migrate(db, { migrationsFolder: "./drizzle" });
export { db };
2 changes: 1 addition & 1 deletion db/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { migrate } from "drizzle-orm/bun-sqlite/migrator";
import { drizzle } from "drizzle-orm/bun-sqlite";
import { Database } from "bun:sqlite";

const sqlite = new Database("db/users.db");
const sqlite = new Database("data/users.db");
const db = drizzle(sqlite);
await migrate(db, { migrationsFolder: "./drizzle", migrationsSchema: "./db/schema.ts", migrationsTable: "users" });

0 comments on commit 593facd

Please sign in to comment.