Open Mixermachine opened 5 years ago
If you have a .sequelizerc
file it will respect that and load from there.
@Scimonster Thanks, after renaming my config js to .sequelizerc it starts. Sadly sequelize-auto-migrations does not seem to like my database model. I only get empty tables.
var migrationCommands = [{
fn: "createTable",
params: [
"Creators",
{
},
{}
]
},
{
fn: "createTable",
params: [
"Participants",
{
},
{}
]
},
{
fn: "createTable",
params: [
"Payees",
{
},
{}
]
},
{
fn: "createTable",
params: [
"PaymentMethods",
{
},
{}
]
},
Having the same issue as @Mixermachine. Generated migrations file has empty tables.
var migrationCommands = [{
fn: "createTable",
params: [
"Table1",
{
},
{}
]
},
{
fn: "createTable",
params: [
"Table2",
{
},
{}
]
},
{
fn: "createTable",
params: [
"Table3",
{
},
{}
]
},
...
This is the model file example:
module.exports = (Sequelize, {
BOOLEAN, DOUBLE, INTEGER, STRING,
}) => Sequelize.define('Data', {
// some data
data: {
type: BOOLEAN,
defaultValue: false,
},
// mark record as deleted
isDeleted: {
type: BOOLEAN,
defaultValue: false,
},
// 10 digits timestamp
created: {
type: INTEGER,
},
// 10 digits timestamp
updated: {
type: INTEGER,
},
// model name
entity: {
type: STRING,
defaultValue: 'modelName',
},
});
Hy there,
I use sequelize in an existing project which forces me to put everything that is not configuration in a src folder.
(+ for folders, - for files)
For sequelize I define this in the package.json "sequelize": "sequelize --options-path=config/sequelize_init.js",
sequelize_init.json:
Is this possible with sequelize-auto-migrations? Passing the sequelize_init.js failed.
Would be great as a feature :)
Greetings from Munich