X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/32c2f3d808e0d4938f6a17b778c38f6d1ecd2f82..b7acf6db5beab0b082c863fe5a9692d68152a132:/services/api/Rakefile diff --git a/services/api/Rakefile b/services/api/Rakefile index 3136cdd9af..3de2d273bf 100644 --- a/services/api/Rakefile +++ b/services/api/Rakefile @@ -38,18 +38,27 @@ namespace :db do origfnm = File.expand_path('../db/structure.sql', __FILE__) tmpfnm = Tempfile.new 'structure.sql', File.expand_path('..', origfnm) copyright_done = false + started = false begin tmpfile = File.new tmpfnm, 'w' origfile = File.new origfnm origfile.each_line do |line| if !copyright_done - if !/Copyright .* Arvados/ + if !/Copyright .* Arvados/.match(line) tmpfile.write "-- Copyright (C) The Arvados Authors. All rights reserved.\n--\n-- SPDX-License-Identifier: AGPL-3.0\n\n" end copyright_done = true end - if /^SET lock_timeout = 0;/ =~ line - # Avoid edit wars between versions that do/don't write this line. + + if !started && /^[^-\n]/ !~ line + # Ignore the "PostgreSQL database dump" comment block, + # which varies from one client version to the next. + next + end + started = true + + if /^SET (lock_timeout|idle_in_transaction_session_timeout|row_security) = / =~ line + # Avoid edit wars between versions that do/don't write (and can/can't execute) this line. next elsif /^COMMENT ON EXTENSION/ =~ line # Avoid warning message when loading: