Exclude cancelled reservations before ARR field review

This commit is contained in:
Wyndham ARR committed 2026-10-08 20:19:27 +08:00
1 parent 36235e7d8d
commit 0c057a8e75
39 files changed
+1546 -56

No files matched your search

+5 -3
View File
@@ -76,7 +76,9 @@ class TemporaryPostgres:
connection.close()
raise
def reset_database(self):
def reset_database(self, *, schema_version=20):
if schema_version not in (19, 20):
raise ValueError("unsupported fixture schema version")
# Only this owned cluster has passed data_directory/socket checks above.
with self.connect(database="postgres", autocommit=True) as connection:
connection.execute("DROP DATABASE booking_test WITH (FORCE)")
@@ -86,8 +88,8 @@ class TemporaryPostgres:
if existing:
raise RuntimeError("schema bootstrap requires an empty fixture database")
paths = sorted(p for p in (PROJECT / "database").glob("[0-9][0-9][0-9]_*.sql")
if ".down." not in p.name and 8 <= int(p.name[:3]) <= 19)
if len(paths) != 12:
if ".down." not in p.name and 8 <= int(p.name[:3]) <= schema_version)
if len(paths) != schema_version - 7:
raise RuntimeError("unexpected fixture migration set")
for path in paths:
connection.execute(path.read_text(), prepare=False)