summaryrefslogtreecommitdiffstats
path: root/server/migrations/20180717202333-create-group_x_group.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/migrations/20180717202333-create-group_x_group.js')
-rw-r--r--server/migrations/20180717202333-create-group_x_group.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/server/migrations/20180717202333-create-group_x_group.js b/server/migrations/20180717202333-create-group_x_group.js
new file mode 100644
index 0000000..4263f9a
--- /dev/null
+++ b/server/migrations/20180717202333-create-group_x_group.js
@@ -0,0 +1,28 @@
+'use strict'
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.createTable('group_x_group', {
+ parentId: {
+ primaryKey: true,
+ allowNull: false,
+ type: Sequelize.INTEGER,
+ references: {
+ model: 'groups',
+ key: 'id'
+ }
+ },
+ childId: {
+ primaryKey: true,
+ allowNull: false,
+ type: Sequelize.INTEGER,
+ references: {
+ model: 'groups',
+ key: 'id'
+ }
+ }
+ })
+ },
+ down: (queryInterface, Sequelize) => {
+ return queryInterface.dropTable('group_x_group')
+ }
+}