ga-wdi-exercises / project2

[project]
1 stars 30 forks source link

migration not being added to schema #377

Closed solowt closed 8 years ago

solowt commented 8 years ago

I generated a migration and filled it in. like this:

class CreateBookworks < ActiveRecord::Migration
  def change
    create_table :bookworks do |t|
      t.datetime :created_at
      t.datetime :updated_at
      t.integer :unique_id
      t.string :image_url
      t.string :author
      t.string :title
    end
  end
end

but in my schema, it looks like this, even after I ran rake db:migrate:

  create_table "bookworks", force: :cascade do |t|
  end

I feel like I've forgotten a step somewhere but I can't think what it is.

andrewsunglaekim commented 8 years ago

did you accidentally run a migration before updating and saving it by chance?

solowt commented 8 years ago

yeah, it looks like I created the table already somehow.

I deleted it from psql with DROP and removed it from the schema file and then just ran the migration again and it worked.

thanks