Open
Description
I'm trying to add a new field associate n: m, but it is not working.
Tounament model simple:
module.exports = class Tournament extends Model {
static config () {
return {
store: 'mysql',
options: {
classMethods: {
associate: models => {
models.Tournament.hasMany(models.Awards)
models.Tournament.belongsToMany(models.User, { through: 'organizer' })
}
}
}
}
}
User model simple:
module.exports = class User extends Model {
static config () {
return {
store: 'mysql',
options: {
classMethods: {
associate: models => {
models.User.belongsToMany(models.Tournament, { through: 'organizer' })
}
}
}
}
}
Organizer complet:
'use strict'
const Model = require('trails/model')
/**
* @module Organizer
* @description Organizers tournaments
*/
module.exports = class Organizer extends Model {
static config () {
return {
store: 'mysql'
}
}
static schema (app, Sequelize) {
return {
permission: { type: Sequelize.STRING, allowNull: false, defaultValue: 'support' }
}
}
}
This permission
field is not appearing in my database.
Metadata
Metadata
Assignees
Labels
No labels
Activity