Sequel.migration do up do add_column :passbook_passes, :tsv, 'TSVector' add_index :passbook_passes, :tsv, type: "GIN" create_trigger :passbook_passes, :tsv, :tsvector_update_trigger, args: [:tsv, :'pg_catalog.english', :pass_type_identifier, :serial_number], events: [:insert, :update], each_row: true end down do drop_column :passbook_passes, :tsv drop_index :passbook_passes, :tsv_GIN drop_trigger :passbook_passes, :TS_tsv end end