used Nodejs' SEQUELIZE to construct an Account table in the PostgreSQL database. The tables were made using npx commands.
$ npx sequelize db:create
$ npx sequelize db:migrate
Double-quotes are used while creating the table by default. For instance, the sql command might be as follows if I wanted to verify the entries in the Account table:
SELECT * FROM "Account";
I want to remove the double-quotes from the table name i.e.
SELECT * FROM Account;
The option (options.quoteIdentifiers) in the Sequelize Manual specifies that it should be set to false in order to have Postgres treat table names and attributes as case-insensitive and to avoid double quoting them.
The Account table is still formed with double quotes even after I added this option to my code. I'm unsure if I've made any mistakes. Check out my code down below. I appreciate it.
var sequelize = new Sequelize(dbConfig.DB, dbConfig.USER, dbConfig.PASSWORD,
options.quoteIdentifiers = false,
{
host: dbConfig.HOST,
dialect: dbConfig.dialect,
pool: {
max: dbConfig.pool.max,
min: dbConfig.pool.min,
acquire: dbConfig.pool.acquire,
idle: dbConfig.pool.idle
}
},
);
module.exports = (sequelize, DataTypes) => {
const Account = sequelize.define('Account', {
epprojectname: DataTypes.STRING,
username: DataTypes.STRING,
projectid: DataTypes.STRING,
vendorparameters: DataTypes.STRING,
credentials: DataTypes.STRING,
author: DataTypes.STRING,
localnumber: DataTypes.STRING,
loginid: DataTypes.INTEGER,
}, {
freezeTableName: true,
},
);