updated tag unit tests
This commit is contained in:
31
db/migrate/20100211025616_create_pools.rb
Normal file
31
db/migrate/20100211025616_create_pools.rb
Normal 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
|
||||
19
db/migrate/20100211181944_create_favorites.rb
Normal file
19
db/migrate/20100211181944_create_favorites.rb
Normal 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
|
||||
17
db/migrate/20100211191709_create_tag_aliases.rb
Normal file
17
db/migrate/20100211191709_create_tag_aliases.rb
Normal 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
|
||||
18
db/migrate/20100211191716_create_tag_implications.rb
Normal file
18
db/migrate/20100211191716_create_tag_implications.rb
Normal 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
|
||||
Reference in New Issue
Block a user