Files
TetaRdPG/src/database/data-source.ts

41 lines
1.4 KiB
TypeScript

import 'reflect-metadata';
import { DataSource } from 'typeorm';
import { User } from '../user/user.entity';
import { Character } from '../character/entities/character.entity';
import { LevelThreshold } from '../character/entities/level-threshold.entity';
import { CombatLog } from '../combat/combat-log.entity';
import { Item } from '../item/item.entity';
import { CharacterItem } from '../item/character-item.entity';
import { Material } from '../material/material.entity';
import { CharacterMaterial } from '../material/character-material.entity';
import { Transaction } from '../economy/entities/transaction.entity';
import { TetardCoin } from '../economy/entities/tetard-coin.entity';
import { ProcessedEvent } from '../twitch/entities/processed-event.entity';
import { Recipe } from '../craft/recipe.entity';
import { CraftJob } from '../craft/craft-job.entity';
import { Monster } from '../monster/monster.entity';
// DataSource pour le CLI TypeORM (migrations manuelles)
export const AppDataSource = new DataSource({
type: 'mysql',
url: process.env.DATABASE_URL ?? 'mysql://tetardpg:password@172.17.0.1:3306/tetardpg',
entities: [
User,
Character,
LevelThreshold,
CombatLog,
Item,
CharacterItem,
Material,
CharacterMaterial,
Transaction,
TetardCoin,
ProcessedEvent,
Recipe,
CraftJob,
Monster,
],
migrations: ['src/migrations/*.ts'],
synchronize: false,
});