Fixed migration.
This commit is contained in:
parent
e3277a3b8a
commit
8c9daded0e
2 changed files with 12 additions and 7 deletions
|
@ -2,12 +2,5 @@ class UpdateTicketState < ActiveRecord::Migration
|
|||
def up
|
||||
add_column :ticket_states, :ignore_escalation, :boolean, null: false, default: false
|
||||
|
||||
return if !Ticket::State.first
|
||||
Ticket::State.create_or_update( id: 3, name: 'pending reminder', state_type_id: Ticket::StateType.find_by(name: 'pending reminder').id, ignore_escalation: true )
|
||||
Ticket::State.create_or_update( id: 4, name: 'closed', state_type_id: Ticket::StateType.find_by(name: 'closed').id, ignore_escalation: true )
|
||||
Ticket::State.create_or_update( id: 5, name: 'merged', state_type_id: Ticket::StateType.find_by(name: 'merged').id, ignore_escalation: true )
|
||||
Ticket::State.create_or_update( id: 6, name: 'removed', state_type_id: Ticket::StateType.find_by(name: 'removed').id, active: false, ignore_escalation: true )
|
||||
Ticket::State.create_or_update( id: 7, name: 'pending close', state_type_id: Ticket::StateType.find_by(name: 'pending action').id, next_state_id: 4, ignore_escalation: true )
|
||||
|
||||
end
|
||||
end
|
||||
|
|
12
db/migrate/20150976000001_update_ticket_state2.rb
Normal file
12
db/migrate/20150976000001_update_ticket_state2.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class UpdateTicketState2 < ActiveRecord::Migration
|
||||
def up
|
||||
|
||||
return if !Ticket::State.first
|
||||
Ticket::State.create_or_update( id: 3, name: 'pending reminder', state_type_id: Ticket::StateType.find_by(name: 'pending reminder').id, ignore_escalation: true )
|
||||
Ticket::State.create_or_update( id: 4, name: 'closed', state_type_id: Ticket::StateType.find_by(name: 'closed').id, ignore_escalation: true )
|
||||
Ticket::State.create_or_update( id: 5, name: 'merged', state_type_id: Ticket::StateType.find_by(name: 'merged').id, ignore_escalation: true )
|
||||
Ticket::State.create_or_update( id: 6, name: 'removed', state_type_id: Ticket::StateType.find_by(name: 'removed').id, active: false, ignore_escalation: true )
|
||||
Ticket::State.create_or_update( id: 7, name: 'pending close', state_type_id: Ticket::StateType.find_by(name: 'pending action').id, next_state_id: 4, ignore_escalation: true )
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue