nodejs/www/ormconfig.js
module.exports = [
{
name: "default",
type: "mysql",
host: process.env.MYSQL_HOST,
port: 3306,
username: process.env.MYSQL_USER,
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE,
synchronize: false,
logging: false,
entities: ["models/typeorm/entities/**/*.ts"],
migrations: ["models/typeorm/migrations/**/*.ts"],
subscribers: ["models/typeorm/subscribers/**/*.ts"],
cli: {
entitiesDir: "models/typeorm/entities",
migrationsDir: "models/typeorm/migrations",
subscribers: "models/typeorm/subscribers",
},
},
{
name: "test",
type: "mysql",
host: "127.0.0.1",
port: 3306,
username: "root",
password: process.env.MYSQL_ROOT_PASSWORD,
database: "testdb",
synchronize: true,
dropSchema: true,
logging: false,
entities: ["models/typeorm/entities/**/*.ts"],
migrations: ["models/typeorm/migrations/**/*.ts"],
subscribers: ["models/typeorm/subscribers/**/*.ts"],
cli: {
entitiesDir: "models/typeorm/entities",
migrationsDir: "models/typeorm/migrations",
subscribers: "models/typeorm/subscribers",
},
},
];