summaryrefslogtreecommitdiffstats
path: root/server/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'server/migrations')
-rw-r--r--server/migrations/20190223034423-create-iprange.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/server/migrations/20190223034423-create-iprange.js b/server/migrations/20190223034423-create-iprange.js
new file mode 100644
index 0000000..75d6d6f
--- /dev/null
+++ b/server/migrations/20190223034423-create-iprange.js
@@ -0,0 +1,31 @@
+'use strict'
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.createTable('ipranges', {
+ id: {
+ allowNull: false,
+ autoIncrement: true,
+ primaryKey: true,
+ type: Sequelize.INTEGER
+ },
+ startIp: {
+ type: Sequelize.STRING
+ },
+ endIp: {
+ type: Sequelize.STRING(2048)
+ },
+ groupId: {
+ allowNull: false,
+ type: Sequelize.INTEGER,
+ onDelete: 'cascade',
+ references: {
+ model: 'groups',
+ key: 'id'
+ }
+ }
+ })
+ },
+ down: (queryInterface, Sequelize) => {
+ return queryInterface.dropTable('ipranges')
+ }
+}