diff options
| author | Luc Donnet | 2018-01-09 21:08:18 +0100 |
|---|---|---|
| committer | Luc Donnet | 2018-01-09 21:08:50 +0100 |
| commit | 00e3beef89ac53191dc4b18bad07c9a3d1ae09c0 (patch) | |
| tree | 9e6cc2664e20c1d4d93344d712365411c7201ea3 /app/models/referential.rb | |
| parent | 2170df505bcf39b857077f2784c880d963ca83bb (diff) | |
| download | chouette-core-00e3beef89ac53191dc4b18bad07c9a3d1ae09c0.tar.bz2 | |
Add log to count migration when we clone or create schema
Diffstat (limited to 'app/models/referential.rb')
| -rw-r--r-- | app/models/referential.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/referential.rb b/app/models/referential.rb index 4cddd502e..36fc2e680 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -355,11 +355,15 @@ class Referential < ActiveRecord::Base Apartment::Tenant.create slug end - Rails.logger.info("Schema create benchmark: '#{slug}'\t#{report}") - Rails.logger.info("Schema migrations count for Referential #{slug}: #{migration_count || '-'}") + check_migration_count end end + def check_migration_count + Rails.logger.info("Schema create benchmark: '#{slug}'\t#{report}") + Rails.logger.info("Schema migrations count for Referential #{slug}: #{migration_count || '-'}") + end + def migration_count if self.class.connection.table_exists?("#{slug}.schema_migrations") self.class.connection.select_value("select count(*) from #{slug}.schema_migrations;") |
