import "dotenv/config"; import "reflect-metadata"; import { DataSource } from "typeorm"; import { award } from "./entities/award"; import { communication } from "./entities/communication"; import { executive_position } from "./entities/executive_position"; import { member_awards } from "./entities/member_awards"; import { member_executive_positions } from "./entities/member_executive_positions"; import { member_qualifications } from "./entities/member_qualifications"; import { member } from "./entities/member"; import { membership } from "./entities/membership"; import { membership_status } from "./entities/membership_status"; import { qualification } from "./entities/qualification"; import { Initial1724242210553 } from "./migrations/1724242210553-initial"; const dataSource = new DataSource({ type: "mysql", host: process.env.NODE_ENV || process.env.PKGMODE ? "localhost" : process.env.DB_HOST, port: 3306, username: process.env.DB_USERNAME, password: process.env.DB_PASSWORD, database: "members", synchronize: false, logging: process.env.NODE_ENV ? true : ["schema", "error", "warn", "log", "migration"], bigNumberStrings: false, entities: [ award, communication, executive_position, member_awards, member_executive_positions, member_qualifications, member, membership, membership_status, qualification, ], migrations: [Initial1724242210553], migrationsRun: true, migrationsTransactionMode: "each", subscribers: [], }); export { dataSource };