Start implementation of branches, new form element tabledropdown, model improvements
This commit is contained in:
34
backend/models/falukant/data/branch.js
Normal file
34
backend/models/falukant/data/branch.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Model, DataTypes } from 'sequelize';
|
||||
import { sequelize } from '../../../utils/sequelize.js';
|
||||
|
||||
class Branch extends Model { }
|
||||
|
||||
Branch.init({
|
||||
branchTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
regionId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
falukantUserId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
modelName: 'BranchType',
|
||||
tableName: 'branch',
|
||||
schema: 'falukant_data',
|
||||
timestamps: false,
|
||||
underscored: true,
|
||||
indexes: [
|
||||
{
|
||||
unique: true,
|
||||
fields: ['region_id', 'falukant_user_id']
|
||||
}
|
||||
],
|
||||
});
|
||||
|
||||
export default Branch;
|
||||
Reference in New Issue
Block a user