updated tag unit tests

This commit is contained in:
albert
2010-02-11 14:59:58 -05:00
parent 2f3a6e4a8b
commit bed94a4e30
21 changed files with 731 additions and 269 deletions

View File

@@ -0,0 +1,31 @@
class CreatePools < ActiveRecord::Migration
def self.up
create_table :pools do |t|
t.column :name, :string
t.column :creator_id, :integer, :null => false
t.column :description, :text
t.column :is_public, :boolean, :null => false, :default => true
t.column :is_active, :boolean, :null => false, :default => true
t.column :post_ids, :text, :null => false, :default => ""
t.timestamps
end
add_index :pools, :name
add_index :pools, :creator_id
create_table :pool_versions do |t|
t.column :pool_id, :integer
t.column :post_ids, :text, :null => false, :default => ""
t.column :updater_id, :integer, :null => false
t.column :updater_ip_addr, "inet", :null => false
t.timestamps
end
add_index :pool_versions, :pool_id
end
def self.down
drop_table :pools
end
end

View File

@@ -0,0 +1,19 @@
class CreateFavorites < ActiveRecord::Migration
def self.up
(0..9).each do |number|
create_table "favorites_#{number}" do |t|
t.column :post_id, :integer
t.column :user_id, :integer
end
add_index "favorites_#{number}", :post_id
add_index "favorites_#{number}", :user_id
end
end
def self.down
(0..9).each do |number|
drop_table "favorites_#{number}"
end
end
end

View File

@@ -0,0 +1,17 @@
class CreateTagAliases < ActiveRecord::Migration
def self.up
create_table :tag_aliases do |t|
t.column :antecedent_name, :string, :null => false
t.column :consequent_name, :string, :null => false
t.column :creator_id, :integer, :null => false
t.column :request_ids, :string
t.timestamps
end
add_index :tag_aliases, :antecedent_name
end
def self.down
drop_table :tag_aliases
end
end

View File

@@ -0,0 +1,18 @@
class CreateTagImplications < ActiveRecord::Migration
def self.up
create_table :tag_implications do |t|
t.column :antecedent_name, :string, :null => false
t.column :consequent_name, :string, :null => false
t.column :descendant_names, :text, :null => false
t.column :creator_id, :integer, :null => false
t.column :request_ids, :string
t.timestamps
end
add_index :tag_implications, :antecedent_name
end
def self.down
drop_table :tag_implications
end
end