We were using the `timestamps` method most of the time, but sometimes we were creating the columns manually. Note editing past migrations if fine as long as the SQL they generate remains identical, which is the case here.
19 lines
420 B
Ruby
19 lines
420 B
Ruby
class CreateBanners < ActiveRecord::Migration[4.2]
|
|
def change
|
|
create_table :banners do |t|
|
|
t.string :title, limit: 80
|
|
t.string :description
|
|
t.string :target_url
|
|
t.string :style
|
|
t.string :image
|
|
t.date :post_started_at
|
|
t.date :post_ended_at
|
|
t.datetime :hidden_at
|
|
|
|
t.timestamps null: false
|
|
end
|
|
|
|
add_index :banners, :hidden_at
|
|
end
|
|
end
|