010_add_tags.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:0k
源码类别:

Ajax

开发平台:

Others

  1. class AddTags < ActiveRecord::Migration
  2.   def self.up
  3.     create_table :tags do |t|
  4.       t.column :name, :string
  5.       t.column :created_at, :datetime
  6.       t.column :updated_at, :datetime
  7.     end
  8.     create_table :articles_tags, :id => false do |t|
  9.       t.column :article_id, :integer
  10.       t.column :tag_id, :integer
  11.     end
  12.   end
  13.   def self.down
  14.     drop_table :tags
  15.     drop_table :articles_tags
  16.   end
  17. end