Files
tunarr/server/mikro-orm.base.config.ts
Christian Benincasa 5570631adc Packaging v0: Build and run server in a docker container (#139)
* This is a nightmare

* Checkpointing.... getting closer

* First cut - packaging the server in a docker container

* Remove busted bundles

* Minify build

* Some common commands for building - we're going to look into proper monorepo solutions soon

* Remove dependency on serve-static

* Add web serving, full-stack docker target, and Nvidia container support

* Remove test action graph for now
2024-03-05 13:13:26 -05:00

47 lines
1.5 KiB
TypeScript

import {
UnderscoreNamingStrategy,
defineConfig,
} from '@mikro-orm/better-sqlite';
import { Migrator } from '@mikro-orm/migrations';
import { fileURLToPath } from 'node:url';
import path, { dirname } from 'path';
import { CachedImage } from './src/dao/entities/CachedImage.js';
import { Channel } from './src/dao/entities/Channel.js';
import { ChannelFillerShow } from './src/dao/entities/ChannelFillerShow.js';
import { CustomShow } from './src/dao/entities/CustomShow.js';
import { CustomShowContent } from './src/dao/entities/CustomShowContent.js';
import { FillerListContent } from './src/dao/entities/FillerListContent.js';
import { FillerShow } from './src/dao/entities/FillerShow.js';
import { PlexServerSettings } from './src/dao/entities/PlexServerSettings.js';
import { Program } from './src/dao/entities/Program.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const dbPath = path.join(process.env.DB_PATH ?? '.dizquetv', 'db.db');
export default defineConfig({
dbName: dbPath,
baseDir: __dirname,
entities: [
CachedImage,
Channel,
ChannelFillerShow,
CustomShow,
CustomShowContent,
FillerListContent,
FillerShow,
PlexServerSettings,
Program,
],
debug: !!process.env['DATABASE_DEBUG_LOGGING'],
namingStrategy: UnderscoreNamingStrategy,
forceUndefined: true,
dynamicImportProvider: (id) => import(id),
migrations: {
path: './migrations',
pathTs: './src/migrations',
},
extensions: [Migrator],
});