Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Failure to dump schema.rb when model is using enums #181

Closed
zedalaye opened this issue Oct 22, 2014 · 1 comment
Closed

Failure to dump schema.rb when model is using enums #181

zedalaye opened this issue Oct 22, 2014 · 1 comment

Comments

@zedalaye
Copy link

I started using enums to track Order statuses

My migration looks like :

  def up
    create_enum :order_status, 'created', 'processing', 'sent', 'delivered', 'cancelled'

    create_table :orders do |t|
      ...
      t.column :status, :order_status, null: false
      ...
    end

    create_table :order_trackings do |t|
      t.references :order,   index: true, on_update: :cascade, on_delete: :cascade

      t.column :old_status, :order_status
      t.column :new_status, :order_status, null: false

      t.datetime :created_at
    end
  end

And this is what is dumped into my schema.rb instead of Orders and OrderTrackings tables dumps :

# Could not dump table "orders" because of following StandardError
#   Unknown type 'order_status' for column 'status'
...
# Could not dump table "order_trackings" because of following StandardError
#   Unknown type 'order_status' for column 'old_status'

Did I made somehting wrong ?

@ronen
Copy link
Member

ronen commented Mar 13, 2015

Closed in favor of SchemaPlus/schema_plus_enums#2

@ronen ronen closed this as completed Mar 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants