Merged migrations.
This commit is contained in:
parent
7aaceda8bd
commit
aaaf79120d
5 changed files with 11 additions and 66 deletions
|
@ -3,11 +3,13 @@ class CreateBase < ActiveRecord::Migration
|
||||||
|
|
||||||
create_table :sessions do |t|
|
create_table :sessions do |t|
|
||||||
t.string :session_id, null: false
|
t.string :session_id, null: false
|
||||||
|
t.boolean :persistent, null: true
|
||||||
t.text :data
|
t.text :data
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
add_index :sessions, :session_id
|
add_index :sessions, :session_id
|
||||||
add_index :sessions, :updated_at
|
add_index :sessions, :updated_at
|
||||||
|
add_index :sessions, :persistent
|
||||||
|
|
||||||
create_table :users do |t|
|
create_table :users do |t|
|
||||||
t.references :organization, null: true
|
t.references :organization, null: true
|
||||||
|
|
|
@ -60,6 +60,8 @@ class CreateTicket < ActiveRecord::Migration
|
||||||
t.column :create_article_sender_id, :integer, null: true
|
t.column :create_article_sender_id, :integer, null: true
|
||||||
t.column :article_count, :integer, null: true
|
t.column :article_count, :integer, null: true
|
||||||
t.column :escalation_time, :timestamp, null: true
|
t.column :escalation_time, :timestamp, null: true
|
||||||
|
t.column :pending_time, :timestamp, null: true
|
||||||
|
t.column :type, :string, limit: 100, null: true
|
||||||
t.column :updated_by_id, :integer, null: false
|
t.column :updated_by_id, :integer, null: false
|
||||||
t.column :created_by_id, :integer, null: false
|
t.column :created_by_id, :integer, null: false
|
||||||
t.timestamps
|
t.timestamps
|
||||||
|
@ -89,6 +91,8 @@ class CreateTicket < ActiveRecord::Migration
|
||||||
add_index :tickets, [:create_article_type_id]
|
add_index :tickets, [:create_article_type_id]
|
||||||
add_index :tickets, [:create_article_sender_id]
|
add_index :tickets, [:create_article_sender_id]
|
||||||
add_index :tickets, [:created_by_id]
|
add_index :tickets, [:created_by_id]
|
||||||
|
add_index :tickets, [:pending_time]
|
||||||
|
add_index :tickets, [:type]
|
||||||
|
|
||||||
create_table :ticket_flags do |t|
|
create_table :ticket_flags do |t|
|
||||||
t.references :tickets, null: false
|
t.references :tickets, null: false
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
class UpdateSession < ActiveRecord::Migration
|
|
||||||
def up
|
|
||||||
add_column :sessions, :request_type, :integer, null: true
|
|
||||||
add_index :sessions, :request_type
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,28 +0,0 @@
|
||||||
class ProcessPendingTickets < ActiveRecord::Migration
|
|
||||||
def up
|
|
||||||
|
|
||||||
# fix wrong next_state_id for state 'pending close'
|
|
||||||
pending_close_state = Ticket::State.find_by(
|
|
||||||
name: 'pending close',
|
|
||||||
)
|
|
||||||
|
|
||||||
if pending_close_state
|
|
||||||
closed_state = Ticket::State.find_by(
|
|
||||||
name: 'closed',
|
|
||||||
)
|
|
||||||
pending_close_state.next_state_id = closed_state.id
|
|
||||||
pending_close_state.save!
|
|
||||||
end
|
|
||||||
|
|
||||||
# add Ticket.process_pending
|
|
||||||
Scheduler.create_or_update(
|
|
||||||
name: 'Process pending tickets',
|
|
||||||
method: 'Ticket.process_pending',
|
|
||||||
period: 60 * 15,
|
|
||||||
prio: 1,
|
|
||||||
active: true,
|
|
||||||
updated_by_id: 1,
|
|
||||||
created_by_id: 1,
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,24 +0,0 @@
|
||||||
class SessionChanges < ActiveRecord::Migration
|
|
||||||
def up
|
|
||||||
|
|
||||||
ActiveRecord::SessionStore::Session.delete_all
|
|
||||||
|
|
||||||
remove_index :sessions, :request_type
|
|
||||||
remove_column :sessions, :request_type
|
|
||||||
|
|
||||||
add_column :sessions, :persistent, :boolean, null: true
|
|
||||||
add_index :sessions, :persistent
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
|
|
||||||
ActiveRecord::SessionStore::Session.delete_all
|
|
||||||
|
|
||||||
remove_index :sessions, :persistent
|
|
||||||
remove_column :sessions, :persistent
|
|
||||||
|
|
||||||
add_column :sessions, :request_type, :integer, null: true
|
|
||||||
add_index :sessions, :request_type
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
Loading…
Reference in a new issue