From 6af54e9d358121d9d26bcd9ad4ef4adc708d11a0 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 20 Oct 2015 11:44:26 +0200 Subject: [PATCH] Fixed initial setups. --- db/migrate/20151019000001_create_report.rb | 42 +++------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/db/migrate/20151019000001_create_report.rb b/db/migrate/20151019000001_create_report.rb index a72935f60..2e41fbbd1 100644 --- a/db/migrate/20151019000001_create_report.rb +++ b/db/migrate/20151019000001_create_report.rb @@ -10,6 +10,9 @@ class CreateReport < ActiveRecord::Migration end add_index :report_profiles, [:name], unique: true + # return if it's a new setup + return if !Setting.find_by(name: 'system_init_done') + Report::Profile.create_if_not_exists( name: '-all-', condition: {}, @@ -17,44 +20,7 @@ class CreateReport < ActiveRecord::Migration updated_by_id: 1, created_by_id: 1, ) - - Role.create_if_not_exists( name: 'Report', created_by_id: 1, updated_by_id: 1 ) - Translation.create_if_not_exists( - locale: 'de-de', - source: 'Ticket Count', - target: 'Ticket Anzahl', - updated_by_id: 1, - created_by_id: 1, - ) - Translation.create_if_not_exists( - locale: 'de-de', - source: 'Ticket Count', - target: 'Ticket Anzahl', - updated_by_id: 1, - created_by_id: 1, - ) - Translation.create_if_not_exists( - locale: 'de-de', - source: 'Create Channels', - target: 'Erstellkanäle', - updated_by_id: 1, - created_by_id: 1, - ) - Translation.create_if_not_exists( - locale: 'de-de', - source: 'Times', - target: 'Zeiten', - updated_by_id: 1, - created_by_id: 1, - ) - Translation.create_if_not_exists( - locale: 'de-de', - source: 'Communication', - target: 'Kommunikation', - updated_by_id: 1, - created_by_id: 1, - ) - + Role.create_if_not_exists(name: 'Report', created_by_id: 1, updated_by_id: 1) end def down