Permalink
Browse files

migrate-project-memberships

Run the migration generator to have the required foreign keys added to
the database:

    $ hobo g migration
  • Loading branch information...
bryanlarsen authored and iox committed Jun 3, 2013
1 parent 4a43a86 commit 0d3b8ffb35a9f0c2aa704996412ecf5ef8e777b2
Showing with 27 additions and 1 deletion.
  1. +16 −0 db/migrate/20130109030838_add_project_membership.rb
  2. +11 −1 db/schema.rb
@@ -0,0 +1,16 @@
+class AddProjectMembership < ActiveRecord::Migration
+ def self.up
+ create_table :project_memberships do |t|
+ t.datetime :created_at
+ t.datetime :updated_at
+ t.integer :project_id
+ t.integer :user_id
+ end
+ add_index :project_memberships, [:project_id]
+ add_index :project_memberships, [:user_id]
+ end
+
+ def self.down
+ drop_table :project_memberships
+ end
+end
View
@@ -11,7 +11,17 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130109025834) do
+ActiveRecord::Schema.define(:version => 20130109030838) do
+
+ create_table "project_memberships", :force => true do |t|
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "project_id"
+ t.integer "user_id"
+ end
+
+ add_index "project_memberships", ["project_id"], :name => "index_project_memberships_on_project_id"
+ add_index "project_memberships", ["user_id"], :name => "index_project_memberships_on_user_id"
create_table "projects", :force => true do |t|
t.string "name"

0 comments on commit 0d3b8ff

Please sign in to comment.