fixes #123: Tags aren't alphabetized
This commit is contained in:
@@ -9,14 +9,14 @@ class CreateNotes < ActiveRecord::Migration
|
||||
t.column :height, :integer, :null => false
|
||||
t.column :is_active, :boolean, :null => false, :default => true
|
||||
t.column :body, :text, :null => false
|
||||
t.column :text_index, "tsvector", :null => false
|
||||
t.column :body_index, "tsvector", :null => false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :notes, :creator_id
|
||||
add_index :notes, :post_id
|
||||
execute "CREATE INDEX index_notes_on_text_index ON notes USING GIN (text_index)"
|
||||
execute "CREATE TRIGGER trigger_notes_on_update BEFORE INSERT OR UPDATE ON notes FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('text_index', 'pg_catalog.english', 'body')"
|
||||
execute "CREATE INDEX index_notes_on_body_index ON notes USING GIN (body_index)"
|
||||
execute "CREATE TRIGGER trigger_notes_on_update BEFORE INSERT OR UPDATE ON notes FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('body_index', 'pg_catalog.english', 'body')"
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
Reference in New Issue
Block a user