Registration and activation
This commit is contained in:
37
backend/models/community/user_param.js
Normal file
37
backend/models/community/user_param.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import { sequelize } from '../../utils/sequelize.js';
|
||||
import { DataTypes } from 'sequelize';
|
||||
import User from './user.js';
|
||||
import UserParamType from '../type/user_param.js';
|
||||
|
||||
const UserParam = sequelize.define('user_param', {
|
||||
userId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: User,
|
||||
key: 'id'
|
||||
}
|
||||
},
|
||||
paramTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: UserParamType,
|
||||
key: 'id'
|
||||
},
|
||||
|
||||
},
|
||||
value: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
}
|
||||
}, {
|
||||
tableName: 'user_param',
|
||||
schema: 'community',
|
||||
underscored: true
|
||||
});
|
||||
|
||||
UserParam.belongsTo(User, { foreignKey: 'userId' });
|
||||
UserParam.belongsTo(UserParamType, { foreignKey: 'param_type_id' });
|
||||
|
||||
export default UserParam;
|
||||
Reference in New Issue
Block a user