From 636063c6cafdc287616310661da8a45a5a7c9c11 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 2 Nov 2015 17:22:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BB=84=E7=BB=87=E8=A1=A8?= =?UTF-8?q?=E5=92=8C=E7=BB=84=E7=BB=87=E6=88=90=E5=91=98=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20151102083844_drop_organization.rb | 8 ++++++++ .../20151102084419_create_organization.rb | 18 ++++++++++++++++++ .../20151102090519_create_org_members.rb | 14 ++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 db/migrate/20151102083844_drop_organization.rb create mode 100644 db/migrate/20151102084419_create_organization.rb create mode 100644 db/migrate/20151102090519_create_org_members.rb diff --git a/db/migrate/20151102083844_drop_organization.rb b/db/migrate/20151102083844_drop_organization.rb new file mode 100644 index 000000000..1abb0f6d9 --- /dev/null +++ b/db/migrate/20151102083844_drop_organization.rb @@ -0,0 +1,8 @@ +class DropOrganization < ActiveRecord::Migration + def up + drop_table :organizations + end + + def down + end +end diff --git a/db/migrate/20151102084419_create_organization.rb b/db/migrate/20151102084419_create_organization.rb new file mode 100644 index 000000000..af84ebee9 --- /dev/null +++ b/db/migrate/20151102084419_create_organization.rb @@ -0,0 +1,18 @@ +class CreateOrganization < ActiveRecord::Migration + def up + create_table :organizations do |t| + t.string :name + t.text :description + t.integer :creator_id + t.integer :home_id + t.string :domain + t.boolean :is_public + + t.timestamps + end + end + + def down + drop_table :organizations + end +end diff --git a/db/migrate/20151102090519_create_org_members.rb b/db/migrate/20151102090519_create_org_members.rb new file mode 100644 index 000000000..037d8a3c6 --- /dev/null +++ b/db/migrate/20151102090519_create_org_members.rb @@ -0,0 +1,14 @@ +class CreateOrgMembers < ActiveRecord::Migration + def up + create_table :org_members do |t| + t.integer :user_id + t.integer :organization_id + t.string :role + + end + end + + def down + drop_table :org_members + end +end