Add the has_many_polymorphs plugin
[cs356-p2-videostore.git] / vendor / plugins / has_many_polymorphs / generators / commenting / templates / migration.rb
1
2 # A migration to add tables for Comment and Commenting. This file is automatically generated and added to your app if you run the commenting generator.
3
4 class CreateCommentsAndCommentings < ActiveRecord::Migration
5
6   # Add the new tables.
7   def self.up
8     create_table :comments do |t|
9       t.column :name, :string, :null => false
10       t.column :url, :string
11       t.column :email, :string
12       t.column :body, :text
13     end
14
15     create_table :commentings do |t|
16       t.column :<%= parent_association_name -%>_id, :integer, :null => false
17       t.column :commentable_id, :integer, :null => false
18       t.column :commentable_type, :string, :null => false
19     end
20   end
21
22   # Remove the tables.
23   def self.down
24     drop_table :comments
25     drop_table :commentings
26   end
27
28 end