Skip to content
Snippets Groups Projects
Verified Commit 7d830658 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Allow migration cli to work ignoring historically misnamed scripts

Historic files are present in our sql modules which cannot be executed by the migration
cli (without complicating too much the code). So simply ignore those when listing the
files to execute. That will stop making the cli refuse to work on some modules (e.g.
scheduler and its 30-bis.sql script).

Refs. swh/infra/sysadm-environment#4933
parent 984da898
No related branches found
No related tags found
No related merge requests found
# Copyright (C) 2015-2022 The Software Heritage developers
# Copyright (C) 2015-2023 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
......@@ -179,7 +179,7 @@ def swh_db_upgrade(
sqlfiles = [
fname
for fname in get_sql_for_package(modname, upgrade=True)
if db_version < int(fname.stem) <= to_version
if "-" not in fname.stem and db_version < int(fname.stem) <= to_version
]
if not sqlfiles:
......
--
-- This file is added but not executed by the migration cli. It's present to reflect the
-- current status on some of our modules declaring some on-the-side sql migration script
-- that need to be deal with manually
insert into origin(url, hash)
values ('version005-bis', hash_sha1('version005-bis'));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment