From f30a53b042c0d9cecc5ac7cd09c242a3c2597ec6 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 16 Aug 2016 10:29:31 +0200 Subject: [PATCH] Improved migrations. --- db/migrate/20160810000003_update_activity_stream.rb | 3 +++ db/migrate/20160811000001_update_role.rb | 3 +++ db/migrate/20160815000001_update_setting_auth.rb | 3 +++ 3 files changed, 9 insertions(+) diff --git a/db/migrate/20160810000003_update_activity_stream.rb b/db/migrate/20160810000003_update_activity_stream.rb index 11a2a4e82..36a08e75e 100644 --- a/db/migrate/20160810000003_update_activity_stream.rb +++ b/db/migrate/20160810000003_update_activity_stream.rb @@ -7,6 +7,9 @@ class UpdateActivityStream < ActiveRecord::Migration add_column :activity_streams, :permission_id, :integer, null: true remove_column :activity_streams, :role_id + ActivityStream.connection.schema_cache.clear! + ActivityStream.reset_column_information + Setting.create_or_update( title: 'sipgate.io integration', name: 'sipgate_integration', diff --git a/db/migrate/20160811000001_update_role.rb b/db/migrate/20160811000001_update_role.rb index 690244212..ce31d8c8b 100644 --- a/db/migrate/20160811000001_update_role.rb +++ b/db/migrate/20160811000001_update_role.rb @@ -7,6 +7,9 @@ class UpdateRole < ActiveRecord::Migration add_column :roles, :preferences, :text, limit: 500.kilobytes + 1, null: true add_column :roles, :default_at_signup, :boolean, null: true, default: false + Role.connection.schema_cache.clear! + Role.reset_column_information + Role.create_or_update( id: 1, name: 'Admin', diff --git a/db/migrate/20160815000001_update_setting_auth.rb b/db/migrate/20160815000001_update_setting_auth.rb index dd41b9b76..71e0c830f 100644 --- a/db/migrate/20160815000001_update_setting_auth.rb +++ b/db/migrate/20160815000001_update_setting_auth.rb @@ -7,6 +7,9 @@ class UpdateSettingAuth < ActiveRecord::Migration change_column :settings, :preferences, :text, limit: 200.kilobytes + 1, null: true change_column :settings, :state_current, :text, limit: 200.kilobytes + 1, null: true + Setting.connection.schema_cache.clear! + Setting.reset_column_information + Setting.create_if_not_exists( title: 'Authentication via %s', name: 'auth_ldap',