initial upload
This commit is contained in:
parent
ac114da487
commit
7c1cfdff51
63 changed files with 6883 additions and 0 deletions
54
sequelize/media.model.mjs
Normal file
54
sequelize/media.model.mjs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
|
||||
import {
|
||||
DataTypes
|
||||
} from 'sequelize';
|
||||
|
||||
import {
|
||||
DBLogger,
|
||||
LabelDB
|
||||
} from './db_conn.mjs'
|
||||
|
||||
import {
|
||||
Template
|
||||
} from "./template.model.mjs";
|
||||
|
||||
|
||||
export const Medium = LabelDB.define('medium', {
|
||||
id: {
|
||||
type: DataTypes.UUID,
|
||||
defaultValue: DataTypes.UUIDV4,
|
||||
primaryKey: true
|
||||
},
|
||||
name: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
},
|
||||
columns: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
},
|
||||
spacing: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
},
|
||||
width: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
}
|
||||
}, {
|
||||
timestamps: false
|
||||
});
|
||||
|
||||
Medium.belongsToMany(Template, {
|
||||
through: 'media_templates',
|
||||
onDelete: 'CASCADE',
|
||||
onUpdate: 'CASCADE',
|
||||
timestamps: false
|
||||
});
|
||||
|
||||
Template.belongsToMany(Medium, {
|
||||
through: 'media_templates',
|
||||
onDelete: 'CASCADE',
|
||||
onUpdate: 'CASCADE',
|
||||
timestamps: false
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue