Class: CreateTweetsTable
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateTweetsTable
- Defined in:
- lib/generators/twisplay/templates/migration.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
17 18 19 |
# File 'lib/generators/twisplay/templates/migration.rb', line 17 def self.down drop_table :tweets end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/generators/twisplay/templates/migration.rb', line 2 def self.up create_table :tweets do |t| t.text :text t.datetime :tweet_created_at t.string :tweet_id t.string :user_name t.string :user_screen_name t.string :user_profile_image_url t. end add_index :tweets, :tweet_created_at add_index :tweets, :tweet_id, :unique => true end |