Answer the question
In order to leave comments, you need to log in
How to create a table in postgres in a specific schema using sequelize?
Good evening everyone! Can you please tell me how to create a table in the schema I need? The code below creates a table in the default public schema, if someone advises me to read the Sequelize documentation, then it is always in front of me, there I figured out how to remove the automatically added 2 fields, and registered timestamps, I also searched everything in Google and nothing I managed to find it (I’m not saying that it doesn’t exist 100%, but I couldn’t find it), please help!
const Sequelize = require('sequelize');
const db = new Sequelize('postgres://лог:пасс@localhost:5434/bd');
const auth = db.define('taba', {
username: Sequelize.TEXT,
password: Sequelize.TEXT
//email: Sequelize.TEXT
}, {
timestamps: false,
});
db.sync({force: true}).then(()=>{
auth.create({
username: 'test',
password: 'test',
email: 'test'
})
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question