Steps I took, are essentially what the create a new project guide showed me.
npm install -g forest-cli@latest -s
forest login
forest projects:create "uvadmin" --databaseConnectionURL ....
The above command ran fine and I got the following output at the end
create app.js
create docker-compose.yml
create Dockerfile
create package.json
create server.js
√ Creating your project files
√ Hooray, installation success!
npm install -s
npm start
After running npm start, I got the following stack trace.
Model creation error: Error: ARRAY is missing type definition for its values.
D:\Projects\uvadmin\node_modules\sequelize\lib\associations\mixin.js:93
throw new Error(`${source.name}.${_.lowerFirst(Type.name)} called with something that's not a subclass of Sequelize.Model`);
^
Error: changelogEntryToRoadmapItem.belongsTo called with something that's not a subclass of Sequelize.Model
at Function.<anonymous> (D:\Projects\uvadmin\node_modules\sequelize\lib\associations\mixin.js:93:13)
at Function.ChangelogEntryToRoadmapItem.associate (D:\Projects\uvadmin\models\changelog-entry-to-roadmap-item.js:23:33)
at D:\Projects\uvadmin\models\index.js:30:19
at Array.forEach (<anonymous>)
at Object.<anonymous> (D:\Projects\uvadmin\models\index.js:28:17)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (D:\Projects\uvadmin\routes\changelog-email-notification.js:3:40)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at D:\Projects\uvadmin\node_modules\require-all\index.js:56:46
at Array.forEach (<anonymous>)
at requireAll (D:\Projects\uvadmin\node_modules\require-all\index.js:34:9)
at Object.<anonymous> (D:\Projects\uvadmin\app.js:56:1)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Module.require (internal/modules/cjs/loader.js:961:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (D:\Projects\uvadmin\server.js:5:13)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
Here is the changelogEntryToRoadmapItem
// This model was generated by Forest CLI. However, you remain in control of your models.
// Learn how here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models
module.exports = (sequelize, DataTypes) => {
const { Sequelize } = sequelize;
// This section contains the fields of your model, mapped to your table's columns.
// Learn more here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models#declaring-a-new-field-in-a-model
const ChangelogEntryToRoadmapItem = sequelize.define('changelogEntryToRoadmapItem', {
}, {
tableName: '_ChangelogEntryToRoadmapItem',
timestamps: false,
schema: process.env.DATABASE_SCHEMA,
});
ChangelogEntryToRoadmapItem.removeAttribute('id');
// This section contains the relationships for this model. See: https://docs.forestadmin.com/documentation/v/v6/reference-guide/relationships#adding-relationships.
ChangelogEntryToRoadmapItem.associate = (models) => {
ChangelogEntryToRoadmapItem.belongsTo(models.changelogEntry, {
foreignKey: {
name: 'aKey',
field: 'A',
},
as: 'a',
});
ChangelogEntryToRoadmapItem.belongsTo(models.roadmapItem, {
foreignKey: {
name: 'bKey',
field: 'B',
},
as: 'b',
});
};
return ChangelogEntryToRoadmapItem;
};
This is changelogEntry
// This model was generated by Forest CLI. However, you remain in control of your models.
// Learn how here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models
module.exports = (sequelize, DataTypes) => {
const { Sequelize } = sequelize;
// This section contains the fields of your model, mapped to your table's columns.
// Learn more here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models#declaring-a-new-field-in-a-model
const ChangelogEntry = sequelize.define('changelogEntry', {
id: {
type: DataTypes.STRING,
primaryKey: true,
allowNull: false,
},
title: {
type: DataTypes.STRING,
allowNull: false,
},
slug: {
type: DataTypes.STRING,
allowNull: false,
},
desc: {
type: DataTypes.STRING,
},
status: {
type: DataTypes.ENUM(
'DRAFT',
'PUBLISHED',
'SCHEDULED',
),
defaultValue: Sequelize.literal('\'DRAFT\'::"ChangelogStatus"'),
allowNull: false,
},
createdAt: {
type: DataTypes.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
},
updatedAt: {
type: DataTypes.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
},
publishAt: {
type: DataTypes.DATE,
},
type: {
type: DataTypes.ENUM(
'FIX',
'ANNOUCEMENT',
'IMPROVEMENT',
'NEW',
),
},
heroImage: {
type: DataTypes.STRING,
},
number: {
type: DataTypes.INTEGER,
defaultValue: 0,
allowNull: false,
},
}, {
tableName: 'ChangelogEntry',
schema: process.env.DATABASE_SCHEMA,
});
// This section contains the relationships for this model. See: https://docs.forestadmin.com/documentation/v/v6/reference-guide/relationships#adding-relationships.
ChangelogEntry.associate = (models) => {
ChangelogEntry.belongsTo(models.user, {
foreignKey: {
name: 'createdByIdKey',
field: 'createdById',
},
as: 'createdBy',
});
ChangelogEntry.belongsTo(models.membership, {
foreignKey: {
name: 'createdByMemberIdKey',
field: 'createdByMemberId',
},
as: 'createdByMember',
});
ChangelogEntry.belongsTo(models.team, {
foreignKey: {
name: 'teamIdKey',
field: 'teamId',
},
as: 'team',
});
ChangelogEntry.belongsToMany(models.roadmapItem, {
through: 'changelogEntryToRoadmapItem',
foreignKey: 'A',
otherKey: 'B',
as: 'roadmapItemThroughChangelogEntryToRoadmapItems',
});
ChangelogEntry.belongsToMany(models.emailPreference, {
through: 'changelogEmailNotification',
foreignKey: 'changelogEntryId',
otherKey: 'prefId',
as: 'emailPreferenceThroughChangelogEmailNotifications',
});
ChangelogEntry.hasMany(models.changelogEntryLabel, {
foreignKey: {
name: 'changelogEntryIdKey',
field: 'changelogEntryId',
},
as: 'changelogEntryChangelogEntryLabels',
});
};
return ChangelogEntry;
};
There are many other models - but not sure it makes sense to share them all on this public forum. I can DM you the project files - if you let me know how I can share it securely for your internal team only.
Also, is there a workaround for this issue?
For example, Is there a command I can use to specify exactly which models I want imported after the analysis. So that way I can include the most important models and see which ones break.