-
-
Save roblight/5a5003eb4059f0c294e32844d2a31d74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GSession = require('./schema') | |
module.exports = { | |
up(dbService) { | |
return dbService.createTable(GSession.options.tableName, GSession.schema)) | |
}, | |
down(dbService) { | |
return dbService.dropTable(Gsession.options.tableName) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const GSession = require('./schema') | |
module.exports = sequelize => sequelize.define('GSession', GSession.schema, GSession.options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { DataTypes } = require('sequelize') | |
module.exports = { | |
schema: { | |
id: { | |
type: DataTypes.INTEGER, | |
primaryKey: true, | |
allowNull: false, | |
autoIncrement: true, | |
}, | |
start_time: DataTypes.DATE, | |
end_time: DataTypes.DATE, | |
is_closed: { | |
type: DataTypes.BOOLEAN, | |
defaultValue: false, | |
}, | |
}, | |
options: { | |
tableName: 'gsessions', | |
timestamps: false, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment