added artists, comments

This commit is contained in:
albert
2010-02-15 13:59:58 -05:00
parent 3d9d6e229a
commit e9c2d1e636
28 changed files with 1044 additions and 7 deletions

View File

@@ -0,0 +1,20 @@
class CreateWikiPages < ActiveRecord::Migration
def self.up
create_table :wiki_pages do |t|
t.column :creator_id, :integer, :null => false
t.column :title, :string, :null => false
t.column :body, :text, :null => false
t.column :body_index, "tsvector", :null => false
t.column :is_locked, :boolean, :null => false, :default => false
t.timestamps
end
add_index :wiki_pages, :title, :unique => true
execute "CREATE INDEX index_wiki_pages_on_body_index_index ON wiki_pages USING GIN (body_index)"
execute "CREATE TRIGGER trigger_wiki_pages_on_update BEFORE INSERT OR UPDATE ON wiki_pages FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'public.danbooru', 'body', 'title')"
end
def self.down
drop_table :wiki_pages
end
end