Class: CreateTaboosAndTabooPosts
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateTaboosAndTabooPosts
- Defined in:
- lib/generators/big_brotha/templates/migrations/create_taboos_and_taboo_posts.rb
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/big_brotha/templates/migrations/create_taboos_and_taboo_posts.rb', line 2 def change create_table :taboos do |t| t.string :keyword, null: false, unique: true t. end create_table :taboo_posts do |t| t.text :content, null: false t.string :content_column t.belongs_to :user t. end create_join_table :taboo_posts, :taboos do |t| t.index [:taboo_post_id, :taboo_id] t.index [:taboo_id, :taboo_post_id] end end |