mirror of
https://github.com/khoaliber/dockhand.git
synced 2026-03-02 13:17:57 +00:00
proper src structure, dockerfile, entrypoint
This commit is contained in:
16
drizzle.config.ts
Normal file
16
drizzle.config.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { defineConfig } from 'drizzle-kit';
|
||||
|
||||
const databaseUrl = process.env.DATABASE_URL;
|
||||
const isPostgres = databaseUrl && (databaseUrl.startsWith('postgres://') || databaseUrl.startsWith('postgresql://'));
|
||||
|
||||
export default defineConfig({
|
||||
// Use different schema files for SQLite vs PostgreSQL
|
||||
schema: isPostgres
|
||||
? './src/lib/server/db/schema/pg-schema.ts'
|
||||
: './src/lib/server/db/schema/index.ts',
|
||||
out: isPostgres ? './drizzle-pg' : './drizzle',
|
||||
dialect: isPostgres ? 'postgresql' : 'sqlite',
|
||||
dbCredentials: isPostgres
|
||||
? { url: databaseUrl! }
|
||||
: { url: `file:${process.env.DATA_DIR || './data'}/dockhand.db` }
|
||||
});
|
||||
Reference in New Issue
Block a user