Files
grecia/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb
Javi Martín 688aa88366 Make migrations independent of globalize
There are two reasons for this change:

1. Past migrations depending on models will not work once a model is
removed, and they won't work if we remove Globalize either
2. We were getting a conflict in the schema file; when run under Rails
5.0, these migrations were generating a different schema than in Rails
5.1, due to the way the `create_translation_table!` method handles the
`id: :serial` attribute.
2020-04-24 15:43:54 +02:00

28 lines
665 B
Ruby

class MakeInvestmentMilestonesPolymorphic < ActiveRecord::Migration[4.2]
def change
create_table :milestones, id: :serial do |t|
t.string :milestoneable_type
t.integer :milestoneable_id
t.string "title", limit: 80
t.text "description"
t.datetime "publication_date"
t.integer :status_id, index: true
t.timestamps null: false
end
create_table :milestone_translations do |t|
t.integer :milestone_id, null: false
t.string :locale, null: false
t.timestamps null: false
t.string :title
t.text :description
t.index :locale
t.index :milestone_id
end
end
end