move schemas to folder

This commit is contained in:
miloschwartz
2025-10-13 14:12:53 -07:00
parent b6b9c71c5e
commit 9af206b69a
10 changed files with 9 additions and 11 deletions

View File

@@ -18,9 +18,9 @@ RUN echo "export const build = \"$BUILD\" as any;" > server/build.ts
# if the build is oss then remove the server/private directory
RUN if [ "$BUILD" = "oss" ]; then rm -rf server/private; fi
RUN if [ "$DATABASE" = "pg" ]; then npx drizzle-kit generate --dialect postgresql --schema ./server/db/pg/schema.ts --out init; else npx drizzle-kit generate --dialect $DATABASE --schema ./server/db/$DATABASE/schema.ts --out init; fi
RUN if [ "$DATABASE" = "pg" ]; then npx drizzle-kit generate --dialect postgresql --schema ./server/db/pg/schema --out init; else npx drizzle-kit generate --dialect $DATABASE --schema ./server/db/$DATABASE/schema --out init; fi
RUN mkdir -p dist
RUN mkdir -p dist
RUN npm run next:build
RUN node esbuild.mjs -e server/index.ts -o dist/server.mjs -b $BUILD
RUN if [ "$DATABASE" = "pg" ]; then \

View File

@@ -2,8 +2,7 @@ import { defineConfig } from "drizzle-kit";
import path from "path";
const schema = [
path.join("server", "db", "pg", "schema.ts"),
path.join("server", "db", "pg", "privateSchema.ts")
path.join("server", "db", "pg", "schema"),
];
export default defineConfig({

View File

@@ -3,8 +3,7 @@ import { defineConfig } from "drizzle-kit";
import path from "path";
const schema = [
path.join("server", "db", "sqlite", "schema.ts"),
path.join("server", "db", "sqlite", "privateSchema.ts")
path.join("server", "db", "sqlite", "schema"),
];
export default defineConfig({

View File

@@ -1,3 +1,3 @@
export * from "./driver";
export * from "./schema";
export * from "./privateSchema";
export * from "./schema/schema";
export * from "./schema/privateSchema";

View File

@@ -1,6 +1,6 @@
import { drizzle as DrizzleSqlite } from "drizzle-orm/better-sqlite3";
import Database from "better-sqlite3";
import * as schema from "./schema";
import * as schema from "./schema/schema";
import path from "path";
import fs from "fs";
import { APP_PATH } from "@server/lib/consts";

View File

@@ -1,3 +1,3 @@
export * from "./driver";
export * from "./schema";
export * from "./privateSchema";
export * from "./schema/schema";
export * from "./schema/privateSchema";