Class: ModSpox::Migrations::ModeIndexFix
- Inherits:
-
Sequel::Migration
- Object
- Sequel::Migration
- ModSpox::Migrations::ModeIndexFix
- Defined in:
- lib/mod_spox/migrations/004_mode_index_fix.rb
Instance Method Summary collapse
Instance Method Details
#down ⇒ Object
12 13 14 15 |
# File 'lib/mod_spox/migrations/004_mode_index_fix.rb', line 12 def down Database.db.drop_index :nick_modes, [:nick_id, :channel_id] Database.db.add_index :nick_modes, [:nick_id, :channel_id] end |
#up ⇒ Object
5 6 7 8 9 10 |
# File 'lib/mod_spox/migrations/004_mode_index_fix.rb', line 5 def up Database.db.drop_index :nick_modes, [:nick_id, :channel_id] Database.db.add_index :nick_modes, [:nick_id, :channel_id], :unique => true Database.db.drop_column :nick_modes, :mode Database.db.add_column :nick_modes, :mode, :varchar, :null => true, :default => '' end |