Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = (sequelize, Sequelize) => {
- const Msisdn = sequelize.define(
- 'p_msisdn', {
- id: {
- type: Sequelize.INTEGER,
- primaryKey: true,
- autoIncrement: true,
- allowNull: false
- },
- group_id: {
- type: Sequelize.INTEGER,
- },
- msisdn: {
- type: Sequelize.INTEGER,
- validate:{
- isNumeric:true
- }
- },
- created_at: {
- type: 'TIMESTAMP',
- defaultValue: Sequelize.literal('CURRENT_TIMESTAMP')
- }
- },
- {
- timestamps: false,
- underscored: false,
- freezeTableName: true,
- tableName:'p_msisdn'
- }
- );
- Msisdn.associate = (models) => {
- Msisdn.belongsTo(models.Group,{foreignKey:'group_id',as:'group'});
- }
- return Msisdn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement