move database into folder
This commit is contained in:
parent
12a0c7563e
commit
55a57444f8
1 changed files with 0 additions and 0 deletions
26
src/database/database.js
Normal file
26
src/database/database.js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
const { Sequelize } = require('sequelize');
|
||||
const dotenv = require('dotenv');
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const sequelize = new Sequelize({
|
||||
dialect: 'postgres',
|
||||
host: process.env.POSTGRES_HOST,
|
||||
port: 5432,
|
||||
database: process.env.POSTGRES_DB,
|
||||
username: process.env.POSTGRES_USER,
|
||||
password: process.env.POSTGRES_PASSWORD,
|
||||
/* logging: (msg) => {
|
||||
if (msg && (msg.includes('ERROR') || msg.includes('error'))) {
|
||||
console.error(msg);
|
||||
}
|
||||
}, */
|
||||
define: {
|
||||
timestamps: false,
|
||||
freezeTableName: true,
|
||||
underscored: true,
|
||||
quoteIdentifiers: false,
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = sequelize;
|
||||
Loading…
Add table
Add a link
Reference in a new issue