Class: SunriseCreateHeaders
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- SunriseCreateHeaders
- Defined in:
- lib/generators/sunrise/templates/migrate/create_headers.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
17 18 19 |
# File 'lib/generators/sunrise/templates/migrate/create_headers.rb', line 17 def self.down drop_table :headers end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/generators/sunrise/templates/migrate/create_headers.rb', line 2 def self.up create_table :headers do |t| t.string :title t.string :keywords t.text :description t.string :headerable_type, :limit => 30, :null => false t.integer :headerable_id, :null => false t. end add_index :headers, [:headerable_type, :headerable_id], :uniq => true, :name => "fk_headerable" end |