Class: CreateSegments
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateSegments
- Defined in:
- lib/generators/segments/templates/segments_migration.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
12 13 14 15 |
# File 'lib/generators/segments/templates/segments_migration.rb', line 12 def self.down drop_index :segments, :key drop_table :segments end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/generators/segments/templates/segments_migration.rb', line 2 def self.up create_table :segments do |t| t.string :key, :null => false t.string :locale, :null => false t.text :content end add_index :segments, :key, :unique => true end |