星期四, 2月 22, 2007

DB Schema for acts_as_taggable_on_steroids


class AddTagSupport < force =""> true do t
t.column :name, :string
end

create_table :taggings, :force => true do t
t.column :tag_id, :integer
t.column :taggable_id, :integer
t.column :taggable_type, :string
t.column :created_at, :datetime
end

create_table :products_tags, :id => false, :force => true do t
t.column :tag_id, :integer, :default => "0", :null => false
t.column :product_id, :integer, :default => 0, :null => false
end

# Index your tags/taggings
add_index :tags, :name
add_index :taggings, [:tag_id, :taggable_id, :taggable_type]
end

def self.down
drop_table "tags"
drop_table "taggings"
drop_table "products_tags
end

end


You really only need the first two tables to have it up and working.

1 則留言:

WK 說...

issue this for this plugin installation

script/plugin install http://svn.viney.net.nz/things/rails/plugins/acts_as_taggable_on_steroids