fixed tag and pending post tests, added category multiget helper to tag, post/unapproval/post version in progress still
This commit is contained in:
@@ -7,25 +7,34 @@ class CreatePosts < ActiveRecord::Migration
|
||||
t.column :source, :string
|
||||
t.column :md5, :string, :null => false
|
||||
t.column :rating, :character, :null => false, :default => 'q'
|
||||
|
||||
# Statuses
|
||||
t.column :is_note_locked, :boolean, :null => false, :default => false
|
||||
t.column :is_rating_locked, :boolean, :null => false, :default => false
|
||||
t.column :is_pending, :boolean, :null => false, :default => false
|
||||
t.column :is_flagged, :boolean, :null => false, :default => false
|
||||
t.column :is_deleted, :boolean, :null => false, :default => false
|
||||
t.column :approver_id, :integer
|
||||
t.column :change_seq, :integer, :default => "nextval('post_change_seq'::regclass)"
|
||||
|
||||
# Uploader
|
||||
t.column :uploader_id, :integer, :null => false
|
||||
t.column :uploader_string, :string, :null => false
|
||||
t.column :uploader_ip_addr, "inet", :null => false
|
||||
|
||||
# Approver
|
||||
t.column :approver_string, :string, :null => false, :default => ""
|
||||
|
||||
# Favorites
|
||||
t.column :fav_string, :text, :null => false, :default => ""
|
||||
|
||||
# Pools
|
||||
t.column :pool_string, :text, :null => false, :default => ""
|
||||
|
||||
# Cached
|
||||
t.column :fav_count, :integer
|
||||
t.column :view_count, :integer, :null => false, :default => 0
|
||||
t.column :last_noted_at, :datetime
|
||||
t.column :last_commented_at, :datetime
|
||||
|
||||
# Tags
|
||||
t.column :tag_string, :text, :null => false
|
||||
t.column :tag_string, :text, :null => false, :default => ""
|
||||
t.column :tag_index, "tsvector"
|
||||
t.column :tag_count, :integer, :null => false, :default => 0
|
||||
t.column :tag_count_general, :integer, :null => false, :default => 0
|
||||
@@ -35,22 +44,20 @@ class CreatePosts < ActiveRecord::Migration
|
||||
|
||||
# File
|
||||
t.column :file_ext, :string, :null => false
|
||||
t.column :file_size, :integer, :null => false
|
||||
t.column :image_width, :integer, :null => false
|
||||
t.column :image_height, :integer, :null => false
|
||||
t.column :file_size, :integer, :null => false
|
||||
end
|
||||
|
||||
add_index :posts, :md5, :unique => true
|
||||
add_index :posts, :created_at
|
||||
add_index :posts, :last_commented_at
|
||||
add_index :posts, :last_noted_at
|
||||
add_index :posts, :uploader_id
|
||||
add_index :posts, :approver_id
|
||||
add_index :posts, :change_seq
|
||||
add_index :posts, :file_size
|
||||
add_index :posts, :image_width
|
||||
add_index :posts, :image_height
|
||||
add_index :posts, :source
|
||||
add_index :posts, :view_count
|
||||
|
||||
execute "CREATE INDEX index_posts_on_mpixels ON posts (((image_width * image_height)::numeric / 1000000.0))"
|
||||
|
||||
@@ -89,7 +96,7 @@ class CreatePosts < ActiveRecord::Migration
|
||||
execute "CREATE TEXT SEARCH CONFIGURATION public.danbooru (PARSER = public.testparser)"
|
||||
execute "ALTER TEXT SEARCH CONFIGURATION public.danbooru ADD MAPPING FOR WORD WITH SIMPLE"
|
||||
execute "SET default_text_search_config = 'public.danbooru'"
|
||||
execute "CREATE TRIGGER trigger_posts_on_tag_index_update BEFORE INSERT OR UPDATE ON posts FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('tag_index', 'public.danbooru', 'tag_string')"
|
||||
execute "CREATE TRIGGER trigger_posts_on_tag_index_update BEFORE INSERT OR UPDATE ON posts FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('tag_index', 'public.danbooru', 'tag_string', 'fav_string', 'pool_string', 'uploader_string', 'approver_string')"
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
Reference in New Issue
Block a user