Skip to content

Commit 4d0ad25

Browse files
committed
Fix wrong migration in 1.6.0
1 parent 518e426 commit 4d0ad25

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

src/main/resources/update/gitbucket-ci_1.5.0.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,4 @@
66
<update tableName="CI_CONFIG">
77
<column name="BUILD_TYPE" value="script"/>
88
</update>
9-
<addColumn tableName="CI_RESULT">
10-
<column name="QUEUED_TIME" type="datetime" nullable="true"/>
11-
<column name="EXIT_CODE" type="int" nullable="true"/>
12-
<column name="BUILD_SCRIPT" type="text" nullable="false" defaultValue = ""/>
13-
</addColumn>
14-
<sql>
15-
UPDATE CI_RESULT SET QUEUED_TIME = START_TIME
16-
</sql>
17-
<sql>
18-
UPDATE CI_RESULT SET EXIT_CODE = 0 WHERE STATUS = 'success'
19-
</sql>
20-
<sql>
21-
UPDATE CI_RESULT SET EXIT_CODE = -1 WHERE STATUS = 'failure'
22-
</sql>
23-
<addNotNullConstraint tableName="CI_RESULT" columnName="QUEUED_TIME"/>
24-
<addNotNullConstraint tableName="CI_RESULT" columnName="EXIT_CODE"/>
259
</changeSet>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<changeSet>
3+
<addColumn tableName="CI_RESULT">
4+
<column name="QUEUED_TIME" type="datetime" nullable="true"/>
5+
<column name="EXIT_CODE" type="int" nullable="true"/>
6+
<column name="BUILD_SCRIPT" type="text" nullable="false" defaultValue = ""/>
7+
</addColumn>
8+
<sql>
9+
UPDATE CI_RESULT SET QUEUED_TIME = START_TIME
10+
</sql>
11+
<sql>
12+
UPDATE CI_RESULT SET EXIT_CODE = 0 WHERE STATUS = 'success'
13+
</sql>
14+
<sql>
15+
UPDATE CI_RESULT SET EXIT_CODE = -1 WHERE STATUS = 'failure'
16+
</sql>
17+
<addNotNullConstraint tableName="CI_RESULT" columnName="QUEUED_TIME"/>
18+
<addNotNullConstraint tableName="CI_RESULT" columnName="EXIT_CODE"/>
19+
</changeSet>

src/main/scala/Plugin.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ class Plugin extends gitbucket.core.plugin.Plugin with CIService with AccountSer
5555
new LiquibaseMigration("update/gitbucket-ci_1.4.0.xml")),
5656
new Version("1.5.0",
5757
new LiquibaseMigration("update/gitbucket-ci_1.5.0.xml")),
58-
new Version("1.6.0"),
58+
new Version("1.6.0",
59+
new LiquibaseMigration("update/gitbucket-ci_1.6.0.xml")),
5960
new Version("1.6.1")
6061
)
6162

0 commit comments

Comments
 (0)