diff options
| author | Alban Peignier | 2018-01-08 09:26:04 +0100 | 
|---|---|---|
| committer | Alban Peignier | 2018-01-08 09:26:04 +0100 | 
| commit | db678948aba130425b2a4651e46ea7a7cc75721e (patch) | |
| tree | da83b05594d6be1f3d380ded690e91ec1cf2acba | |
| parent | 12b9e4cc871dbd518c57b21b81369ad2972dce49 (diff) | |
| download | chouette-core-5485-first-docker-scripts.tar.bz2 | |
Avoid error into Referetial#create_schema can't read migration count5485-first-docker-scripts
| -rw-r--r-- | app/models/referential.rb | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/app/models/referential.rb b/app/models/referential.rb index a5d5acbf9..4cddd502e 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -156,7 +156,7 @@ class Referential < ActiveRecord::Base    def stop_points      Chouette::StopPoint.all    end -   +    def compliance_check_sets      ComplianceCheckSet.all    end @@ -356,7 +356,13 @@ class Referential < ActiveRecord::Base        end        Rails.logger.info("Schema create benchmark: '#{slug}'\t#{report}") -      Rails.logger.error( "Schema migrations count for Referential #{slug} " + Referential.connection.select_value("select count(*) from #{slug}.schema_migrations;").to_s ) +      Rails.logger.info("Schema migrations count for Referential #{slug}: #{migration_count || '-'}") +    end +  end + +  def migration_count +    if self.class.connection.table_exists?("#{slug}.schema_migrations") +      self.class.connection.select_value("select count(*) from #{slug}.schema_migrations;")      end    end | 
