{"action":"closed","issue":{"url":"https://api.github.com/repos/Solid-Interactive/swarm/issues/13","labels_url":"https://api.github.com/repos/Solid-Interactive/swarm/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/Solid-Interactive/swarm/issues/13/comments","events_url":"https://api.github.com/repos/Solid-Interactive/swarm/issues/13/events","html_url":"https://github.com/Solid-Interactive/swarm/issues/13","id":63256922,"number":13,"title":"can't complete migration","user":{"login":"aberrios85","id":4758370,"avatar_url":"https://avatars.githubusercontent.com/u/4758370?v=3","gravatar_id":"","url":"https://api.github.com/users/aberrios85","html_url":"https://github.com/aberrios85","followers_url":"https://api.github.com/users/aberrios85/followers","following_url":"https://api.github.com/users/aberrios85/following{/other_user}","gists_url":"https://api.github.com/users/aberrios85/gists{/gist_id}","starred_url":"https://api.github.com/users/aberrios85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aberrios85/subscriptions","organizations_url":"https://api.github.com/users/aberrios85/orgs","repos_url":"https://api.github.com/users/aberrios85/repos","events_url":"https://api.github.com/users/aberrios85/events{/privacy}","received_events_url":"https://api.github.com/users/aberrios85/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-20T16:16:29Z","updated_at":"2015-03-20T16:22:38Z","closed_at":"2015-03-20T16:22:38Z","body":"When running the migration running into this error: \r\n\r\n```\r\n[aberrios@localhost ghetti]$ rake db:migrate                        \r\n  ActiveRecord::SchemaMigration Load (0.5ms)  SELECT \"schema_migrations\".* FROM \"schema_migrations\"\r\nMigrating to Group (20150320143918)\r\n   (0.2ms)  BEGIN\r\n== 20150320143918 Group: migrating ============================================\r\n-- create_table(:groups)\r\n   (11.3ms)  CREATE TABLE \"groups\" (\"id\" serial primary key, \"type\" character varying(255)) \r\n   -> 0.0129s\r\n-- create_table(:group_memberships)\r\n   (1.9ms)          SELECT f.conname, pg_get_constraintdef(f.oid), t.relname\r\n          FROM pg_class t, pg_constraint f\r\n         WHERE f.conrelid = t.oid\r\n           AND f.contype = 'f'\r\n           AND t.relname = 'group_memberships'\r\n           AND t.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) )\r\n\r\n   (1.1ms)          SELECT f.conname, pg_get_constraintdef(f.oid), t.relname\r\n          FROM pg_class t, pg_constraint f\r\n         WHERE f.conrelid = t.oid\r\n           AND f.contype = 'f'\r\n           AND t.relname = 'group_memberships'\r\n           AND t.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) )\r\n\r\n   (21.3ms)  CREATE TABLE \"group_memberships\" (\"id\" serial primary key, \"member_type\" character varying(255), \"member_id\" integer, \"group_id\" integer, \"group_name\" character varying(255), \"membership_type\" character varying(255), CONSTRAINT fk_group_memberships_member_id FOREIGN KEY (\"member_id\") REFERENCES \"members\" (\"id\"), CONSTRAINT fk_group_memberships_group_id FOREIGN KEY (\"group_id\") REFERENCES \"groups\" (\"id\")) \r\nPG::UndefinedTable: ERROR:  relation \"members\" does not exist\r\n```\r\n\r\n# Migration\r\n```\r\n[aberrios@localhost ghetti]$ cat db/migrate/20150320143918_group.rb \r\nclass Group < ActiveRecord::Migration\r\n  def change\r\n    create_table :groups do |t|\r\n      t.string     :type      # Only needed if using single table inheritance\r\n    end\r\n\r\n    create_table :group_memberships do |t|\r\n      t.string     :member_type     # Necessary to make polymorphic members work\r\n      t.integer    :member_id       # The id of the member that belongs to this group\r\n      t.integer    :group_id        # The group to which the member belongs\r\n      t.string     :group_name      # The named group to which a member belongs (if using)\r\n      t.string     :membership_type # The type of membership the member belongs with\r\n    end\r\n\r\n    add_index :group_memberships, [:member_id, :member_type]\r\n    add_index :group_memberships, :group_id\r\n    add_index :group_memberships, :group_name\r\n  end\r\nend\r\n```"}}