Sha256: 1acda2dc05bc4188106c78bcf96b8ad61df33514f36aad3aef0157b2e4a67520
Contents?: true
Size: 602 Bytes
Versions: 13
Compression:
Stored size: 602 Bytes
Contents
class CreateBlogoTaggings < ActiveRecord::Migration def change taggings_table = "#{Blogo.table_name_prefix}taggings" create_table(taggings_table) do |t| t.integer :post_id, null: false t.integer :tag_id , null: false end add_index taggings_table, [:tag_id, :post_id], unique: true if defined?(Foreigner) tags_table = "#{Blogo.table_name_prefix}tags" posts_table = "#{Blogo.table_name_prefix}posts" add_foreign_key taggings_table, tags_table , column: :tag_id add_foreign_key taggings_table, posts_table, column: :post_id end end end
Version data entries
13 entries across 13 versions & 1 rubygems