* Added note version controller and test
* Added pool version controller and test * Refactored unit tests for post disapprovals * Renamed PostModerationDetail to PostDisapproval
This commit is contained in:
@@ -28,7 +28,6 @@ class CreatePosts < ActiveRecord::Migration
|
||||
t.column :pool_string, :text, :null => false, :default => ""
|
||||
|
||||
# Cached
|
||||
t.column :view_count, :integer, :null => false, :default => 0
|
||||
t.column :last_noted_at, :datetime
|
||||
t.column :last_commented_at, :datetime
|
||||
|
||||
@@ -60,7 +59,6 @@ class CreatePosts < ActiveRecord::Migration
|
||||
add_index :posts, :image_width
|
||||
add_index :posts, :image_height
|
||||
add_index :posts, :source
|
||||
add_index :posts, :view_count
|
||||
add_index :posts, :parent_id
|
||||
|
||||
execute "CREATE INDEX index_posts_on_mpixels ON posts (((image_width * image_height)::numeric / 1000000.0))"
|
||||
|
||||
16
db/migrate/20100223001012_create_post_disapprovals.rb
Normal file
16
db/migrate/20100223001012_create_post_disapprovals.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class CreatePostDisapprovals < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :post_disapprovals do |t|
|
||||
t.column :user_id, :integer, :null => false
|
||||
t.column :post_id, :integer, :null => false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :post_disapprovals, :user_id
|
||||
add_index :post_disapprovals, :post_id
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :post_disapprovals
|
||||
end
|
||||
end
|
||||
@@ -1,16 +0,0 @@
|
||||
class CreatePostModerationDetails < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table :post_moderation_details do |t|
|
||||
t.column :user_id, :integer, :null => false
|
||||
t.column :post_id, :integer, :null => false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :post_moderation_details, :user_id
|
||||
add_index :post_moderation_details, :post_id
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :post_moderation_details
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user