2024-08-17 14:38:08 +00:00
|
|
|
import "dotenv/config";
|
|
|
|
import "reflect-metadata";
|
|
|
|
import { DataSource } from "typeorm";
|
2024-08-21 12:13:39 +00:00
|
|
|
import { award } from "./entities/award";
|
|
|
|
import { communication } from "./entities/communication";
|
2024-08-17 14:38:08 +00:00
|
|
|
import { executive_position } from "./entities/executive_position";
|
2024-08-19 10:47:10 +00:00
|
|
|
import { member_awards } from "./entities/member_awards";
|
2024-08-21 12:13:39 +00:00
|
|
|
import { member_executive_positions } from "./entities/member_executive_positions";
|
|
|
|
import { member_qualifications } from "./entities/member_qualifications";
|
|
|
|
import { member } from "./entities/member";
|
2024-08-19 10:47:10 +00:00
|
|
|
import { membership } from "./entities/membership";
|
2024-08-21 12:13:39 +00:00
|
|
|
import { membership_status } from "./entities/membership_status";
|
|
|
|
import { qualification } from "./entities/qualification";
|
|
|
|
import { Initial1724242210553 } from "./migrations/1724242210553-initial";
|
2024-08-17 14:38:08 +00:00
|
|
|
|
|
|
|
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,
|
2024-08-19 10:47:10 +00:00
|
|
|
entities: [
|
2024-08-21 12:13:39 +00:00
|
|
|
award,
|
|
|
|
communication,
|
2024-08-19 10:47:10 +00:00
|
|
|
executive_position,
|
|
|
|
member_awards,
|
2024-08-21 12:13:39 +00:00
|
|
|
member_executive_positions,
|
|
|
|
member_qualifications,
|
|
|
|
member,
|
2024-08-19 10:47:10 +00:00
|
|
|
membership,
|
2024-08-21 12:13:39 +00:00
|
|
|
membership_status,
|
|
|
|
qualification,
|
2024-08-19 10:47:10 +00:00
|
|
|
],
|
2024-08-21 12:13:39 +00:00
|
|
|
migrations: [Initial1724242210553],
|
2024-08-17 14:38:08 +00:00
|
|
|
migrationsRun: true,
|
|
|
|
migrationsTransactionMode: "each",
|
|
|
|
subscribers: [],
|
|
|
|
});
|
|
|
|
|
|
|
|
export { dataSource };
|