Sha256: cc22f6cdc1e2ba5766ad61f4797830f373db040b52dee7d896a154217e2463de

Contents?: true

Size: 457 Bytes

Versions: 3

Compression:

Stored size: 457 Bytes

Contents

class CreatePersonalBlogTaggings < ActiveRecord::Migration
  def change
    create_table :personal_blog_taggings do |t|
      t.integer :post_id, null: false
      t.integer :tag_id, null: false
    end
    
    add_index :personal_blog_taggings, [:tag_id, :post_id], unique: true
    add_foreign_key :personal_blog_taggings, :personal_blog_posts, column: :post_id
    add_foreign_key :personal_blog_taggings, :personal_blog_tags, column: :tag_id
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
personal_blog-0.0.3 db/migrate/20160220172622_create_personal_blog_taggings.rb
personal_blog-0.0.2 db/migrate/20160220172622_create_personal_blog_taggings.rb
personal_blog-0.0.1 db/migrate/20160220172622_create_personal_blog_taggings.rb