Files
grecia/db/migrate/20160518141543_create_banners.rb
Javi Martín 91a3184281 Simplify creating timestamps in migrations
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.
2019-10-24 21:20:16 +02:00

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