From 58de72cfc156c7b20ed805ab6f0cadff5658bdf7 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 10 Nov 2015 15:05:11 +0100 Subject: [PATCH] Fixed initial setup. --- db/migrate/20151109000001_create_chat.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/migrate/20151109000001_create_chat.rb b/db/migrate/20151109000001_create_chat.rb index 85992f14c..d4658ceae 100644 --- a/db/migrate/20151109000001_create_chat.rb +++ b/db/migrate/20151109000001_create_chat.rb @@ -58,6 +58,9 @@ class CreateChat < ActiveRecord::Migration end add_index :chat_agents, [:created_by_id], unique: true + # return if it's a new setup + return if !Setting.find_by(name: 'system_init_done') + Role.create_if_not_exists( name: 'Chat', note: 'Access to chat feature.',