mirror of
https://github.com/pacnpal/markov-discord.git
synced 2025-12-20 11:01:04 -05:00
Initial rough working draft of v3
This commit is contained in:
40
ormconfig.js
Normal file
40
ormconfig.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const devConfig = {
|
||||
type: 'better-sqlite3',
|
||||
database: process.env.CONFIG_DIR
|
||||
? `${process.env.CONFIG_DIR}/db/db.sqlite3`
|
||||
: 'config/db/db.sqlite3',
|
||||
synchronize: true,
|
||||
migrationsRun: false,
|
||||
// logging: true,
|
||||
// logging: "all",
|
||||
enableWAL: true,
|
||||
entities: ['src/entity/**/*.ts'],
|
||||
migrations: ['src/migration/**/*.ts'],
|
||||
subscribers: ['src/subscriber/**/*.ts'],
|
||||
cli: {
|
||||
entitiesDir: 'src/entity',
|
||||
migrationsDir: 'src/migration',
|
||||
},
|
||||
};
|
||||
|
||||
const prodConfig = {
|
||||
type: 'better-sqlite3',
|
||||
database: process.env.CONFIG_DIR
|
||||
? `${process.env.CONFIG_DIR}/db/db.sqlite3`
|
||||
: 'config/db/db.sqlite3',
|
||||
synchronize: false,
|
||||
logging: false,
|
||||
enableWAL: true,
|
||||
entities: ['dist/entity/**/*.js'],
|
||||
migrations: ['dist/migration/**/*.js'],
|
||||
migrationsRun: false,
|
||||
subscribers: ['dist/subscriber/**/*.js'],
|
||||
cli: {
|
||||
entitiesDir: 'dist/entity',
|
||||
migrationsDir: 'dist/migration',
|
||||
},
|
||||
};
|
||||
|
||||
const finalConfig = process.env.NODE_ENV !== 'production' ? devConfig : prodConfig;
|
||||
|
||||
module.exports = finalConfig;
|
||||
Reference in New Issue
Block a user