summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2019-06-24 14:31:56 +0200
committerAndreas Brandl <abrandl@gitlab.com>2019-06-24 14:31:56 +0200
commit79bb43979929bc8dbee9ceee4df6bc03c516f729 (patch)
treea7d8de2d1bde5869590a138a98743229d013d362
parent79d741508c3d3e165da14366f06e3c0256b72222 (diff)
downloadgitlab-ce-ab-structure-sql.tar.gz
CI changes for structure.sqlab-structure-sql
-rw-r--r--scripts/schema_changed.sh8
-rw-r--r--spec/migrations/active_record/schema_spec.rb8
2 files changed, 4 insertions, 12 deletions
diff --git a/scripts/schema_changed.sh b/scripts/schema_changed.sh
index b5e510c2367..e8c120e92e1 100644
--- a/scripts/schema_changed.sh
+++ b/scripts/schema_changed.sh
@@ -1,14 +1,14 @@
#!/bin/sh
schema_changed() {
- if [ ! -z "$(git diff --name-only -- db/schema.rb)" ]; then
- printf "db/schema.rb after rake db:migrate:reset is different from one in the repository"
+ if [ ! -z "$(git diff --name-only -- db/structure.sql)" ]; then
+ printf "db/structure.sql after rake db:migrate:reset is different from one in the repository"
printf "The diff is as follows:\n"
- diff=$(git diff -p --binary -- db/schema.rb)
+ diff=$(git diff -p --binary -- db/structure.sql)
printf "%s" "$diff"
exit 1
else
- printf "db/schema.rb after rake db:migrate:reset matches one in the repository"
+ printf "db/structure.sql after rake db:migrate:reset matches one in the repository"
fi
}
diff --git a/spec/migrations/active_record/schema_spec.rb b/spec/migrations/active_record/schema_spec.rb
index 9d35b3cd642..14eb7c5a7d4 100644
--- a/spec/migrations/active_record/schema_spec.rb
+++ b/spec/migrations/active_record/schema_spec.rb
@@ -13,14 +13,6 @@ describe ActiveRecord::Schema do
migrations.map { |migration| File.basename(migration).split('_').first.to_i }.max
end
- it '> schema version equals last migration timestamp' do
- defined_schema_version = File.open(Rails.root.join('db', 'schema.rb')) do |file|
- file.find { |line| line =~ /ActiveRecord::Schema.define/ }
- end.match(/(\d+)/)[0].to_i
-
- expect(defined_schema_version).to eq(latest_migration_timestamp)
- end
-
it '> schema version should equal the latest migration timestamp stored in schema_migrations table' do
expect(latest_migration_timestamp).to eq(ActiveRecord::Migrator.current_version.to_i)
end