Skip to content

Commit 55bc326

Browse files
committed
Development: Drop the two unused result and build log order columns
result.results_order and build_log_entry.build_log_entries_order no longer have a reader. The correction round moved onto the result and the build log entries are ordered by the timestamp they already carry, so neither column is mapped. They were deliberately kept at the time so that rolling the application back would still work. This drops them one release later, guarded by a column-exists precondition so it is idempotent.
1 parent bd57e6d commit 55bc326

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
4+
5+
<!--
6+
Drop the two position columns that no longer have a reader.
7+
8+
A submission's results used to be an ordered list whose position carried the correction round, and a submission's
9+
build log entries used to be an ordered list as well. Both positions were maintained by Hibernate through an
10+
@OrderColumn, which forced every write in those areas to go through a save of the whole submission, and saving a
11+
submission selects it together with its participation, its exercise and the exercise's course because all three
12+
associations are eager.
13+
14+
The correction round now lives on result.correction_round and the build log entries are ordered by the timestamp
15+
they already carry, so neither column is mapped or read any more. They were deliberately left in place at the
16+
time so that rolling the application back would still work; this drops them one release later.
17+
18+
Deferred on purpose: do not merge this before the release that contains the change which stopped using them.
19+
-->
20+
21+
<changeSet id="20260825-03-drop-results-order" author="krusche">
22+
<preConditions onFail="MARK_RAN">
23+
<columnExists tableName="result" columnName="results_order"/>
24+
</preConditions>
25+
<dropColumn tableName="result" columnName="results_order"/>
26+
</changeSet>
27+
28+
<changeSet id="20260825-04-drop-build-log-entries-order" author="krusche">
29+
<preConditions onFail="MARK_RAN">
30+
<columnExists tableName="build_log_entry" columnName="build_log_entries_order"/>
31+
</preConditions>
32+
<dropColumn tableName="build_log_entry" columnName="build_log_entries_order"/>
33+
</changeSet>
34+
35+
</databaseChangeLog>

src/main/resources/config/liquibase/master.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<include file="classpath:config/liquibase/changelog/20260820091251_changelog.xml" relativeToChangelogFile="false"/>
4848
<include file="classpath:config/liquibase/changelog/20260825120000_changelog.xml" relativeToChangelogFile="false"/>
4949
<include file="classpath:config/liquibase/changelog/20260825165553_changelog.xml" relativeToChangelogFile="false"/>
50+
<include file="classpath:config/liquibase/changelog/20260825202411_changelog.xml" relativeToChangelogFile="false"/>
5051
<!-- NOTE: please use the format "YYYYMMDDhhmmss_changelog.xml", i.e. year month day hour minutes seconds and not something else! -->
5152
<!-- we should also stay in a chronological order! -->
5253
<!-- you can use the command "date '+%Y%m%d%H%M%S'" to get the current date and time in the correct format -->

0 commit comments

Comments
 (0)