I want to sync all table a.k.a create table if not exists. i follow this official tutorial rather than call sync one by one each model. theres single call can sync all. sequelize.sync() but it do nothing. i try to try catch no error too. current sequelize version 6.25.2. setup.js to action to create table. its like sequelize instance doesn't resolve model.
sequelize-client.js
const sequelize = new Sequelize(username, password, database);
export { sequelize }
models folder user.js
import { sequelize } from "sequelize-client.js";
const User = sequelize.define("User", {
id: {
type: BIGINT.UNSIGNED,
autoIncrement: true,
primaryKey: true
},
username: {
type: STRING,
allowNull: false
},
password: {
type: STRING,
allowNull: false
}
});
models folder account.js
const Account = sequelize.define("Account", {
id: {
type: BIGINT.UNSIGNED,
autoIncrement: true,
primaryKey: true
},
accoundId: {
type: STRING,
allowNull: false
},
createdAt: {
type: DATE,
allowNull: false
}
});
setup.js
import { sequelize } from "sequelize-client.js";
sequelize.sync({ force: true });