From 7f4095b77f5eb10da0af4ffbef22444255c90d94 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Thu, 23 Jun 2016 00:12:41 -0700 Subject: [PATCH] moved migrations around --- server/migrations/20160619080644-initial.js | 202 ++++++++++---------- 1 file changed, 101 insertions(+), 101 deletions(-) diff --git a/server/migrations/20160619080644-initial.js b/server/migrations/20160619080644-initial.js index 5e5592830..bc3c6373a 100644 --- a/server/migrations/20160619080644-initial.js +++ b/server/migrations/20160619080644-initial.js @@ -2,6 +2,35 @@ module.exports = { up: function (queryInterface, Sequelize) { + queryInterface.createTable('teams', { + id: { + type: 'UUID', + allowNull: false, + primaryKey: true + }, + name: { + type: 'CHARACTER VARYING', + allowNull: true, + }, + slackId: { + type: 'CHARACTER VARYING', + allowNull: true, + unique: true + }, + slackData: { + type: 'JSONB', + allowNull: true, + }, + createdAt: { + type: 'TIMESTAMP WITH TIME ZONE', + allowNull: false, + }, + updatedAt: { + type: 'TIMESTAMP WITH TIME ZONE', + allowNull: false, + } + }); + queryInterface.createTable('atlases', { id: { type: 'UUID', @@ -35,103 +64,10 @@ module.exports = { teamId: { type: 'UUID', allowNull: false, - references: { - model: "teams", - key: "id", - } - } - }); - - queryInterface.createTable('documents', { - id: - { type: 'UUID', - allowNull: false, - primaryKey: true }, - urlId: - { type: 'CHARACTER VARYING', - allowNull: false, - unique: true, }, - private: - { type: 'BOOLEAN', - allowNull: false, - defaultValue: true, - }, - title: - { type: 'CHARACTER VARYING', - allowNull: false, - }, - text: - { type: 'TEXT', - allowNull: true, - }, - html: - { type: 'TEXT', - allowNull: true, - }, - preview: - { type: 'TEXT', - allowNull: true, - }, - createdAt: - { type: 'TIMESTAMP WITH TIME ZONE', - allowNull: false, - }, - updatedAt: - { type: 'TIMESTAMP WITH TIME ZONE', - allowNull: false, - }, - userId: { - type: 'UUID', - allowNull: true, - references: { - model: "users", - key: "id", - } - }, - atlasId: { - type: 'UUID', - allowNull: true, - references: { - model: "atlases", - key: "id", - } - }, - teamId: { - type: 'UUID', - allowNull: true, - references: { - model: "teams", - key: "id", - } - } - }); - - queryInterface.createTable('teams', { - id: { - type: 'UUID', - allowNull: false, - primaryKey: true - }, - name: { - type: 'CHARACTER VARYING', - allowNull: true, - }, - slackId: { - type: 'CHARACTER VARYING', - allowNull: true, - unique: true - }, - slackData: { - type: 'JSONB', - allowNull: true, - }, - createdAt: { - type: 'TIMESTAMP WITH TIME ZONE', - allowNull: false, - }, - updatedAt: { - type: 'TIMESTAMP WITH TIME ZONE', - allowNull: false, + // references: { + // model: "teams", + // key: "id", + // } } }); @@ -185,10 +121,74 @@ module.exports = { teamId: { type: 'UUID', allowNull: true, - references: { - model: "teams", - key: "id", - } + // references: { + // model: "teams", + // key: "id", + // } + } + }); + + queryInterface.createTable('documents', { + id: + { type: 'UUID', + allowNull: false, + primaryKey: true }, + urlId: + { type: 'CHARACTER VARYING', + allowNull: false, + unique: true, }, + private: + { type: 'BOOLEAN', + allowNull: false, + defaultValue: true, + }, + title: + { type: 'CHARACTER VARYING', + allowNull: false, + }, + text: + { type: 'TEXT', + allowNull: true, + }, + html: + { type: 'TEXT', + allowNull: true, + }, + preview: + { type: 'TEXT', + allowNull: true, + }, + createdAt: + { type: 'TIMESTAMP WITH TIME ZONE', + allowNull: false, + }, + updatedAt: + { type: 'TIMESTAMP WITH TIME ZONE', + allowNull: false, + }, + userId: { + type: 'UUID', + allowNull: true, + // references: { + // model: "users", + // key: "id", + // } + }, + atlasId: { + type: 'UUID', + allowNull: true, + // references: { + // model: "atlases", + // key: "id", + // } + }, + teamId: { + type: 'UUID', + allowNull: true, + // references: { + // model: "teams", + // key: "id", + // } } }); },