1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package de.kaiserpfalzedv.commons.api.liquibase.model;
19
20 import org.eclipse.microprofile.openapi.annotations.media.Schema;
21
22 import jakarta.validation.constraints.NotNull;
23 import jakarta.validation.constraints.Size;
24 import java.time.OffsetDateTime;
25
26
27
28
29
30
31
32
33
34
35
36 @Schema(
37 name = "Liquibase Changelog",
38 description = "This is the interface description to the changelog table as described in the liquibase documentation"
39 )
40 public interface ChangeLog {
41 @Schema(
42 title = "Id",
43 description = "Value from the changeset id attribute.",
44 required = true,
45 example = "20230118-rlichti-001",
46 maxLength = 255
47 )
48 @NotNull
49 @Size(max = 255)
50
51
52
53 String getId();
54
55
56
57
58 @Schema(
59 title = "Author",
60 description = "Value from the changeset author attribute.",
61 required = true,
62 example = "rlichti",
63 maxLength = 255
64 )
65 @Size(max = 255)
66 String getAuthor();
67
68
69
70
71
72
73
74
75 @Schema(
76 title = "Path to the changelog",
77 description = "Path to the changelog. This may be an absolute path or a relative path depending on how " +
78 "the changelog was passed to Liquibase. For best results, it should be a relative path. The " +
79 "logicalFilePath attribute can be used on the changelog or on individual changesets.",
80 required = true,
81 example = "db/changelog/base-structure.xml",
82 maxLength = 255
83 ) @Size(max = 255)
84 @NotNull
85 String getFilename();
86
87
88
89
90
91 @Schema(
92 title = "Execution Date",
93 description = "Date/time of when the changeset was executed. Used with {@link #getExecutionOrder()} to " +
94 "determine rollback order.",
95 required = true,
96 pattern = "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}(Z|(+|-)\\d{2}:\\d{2})$",
97 example = "2023-01-19T01:00:00.000Z",
98 maxLength = 255
99 )
100 @NotNull
101 @Size(max = 255)
102 OffsetDateTime getExecutionDate();
103
104
105
106
107
108
109
110
111
112
113 @Schema(
114 title = "Execution Order",
115 description = "Order that the changesets were executed. Used in addition to the Execution Date to " +
116 "ensure order is correct even when the databases datetime supports poor resolution. NOTE: The " +
117 "values are only guaranteed to be increasing within an individual update run. There are times " +
118 "where they will restart at zero.",
119 required = true,
120 example = "5",
121 minimum = "0"
122 )
123 int getExecutionOrder();
124
125
126
127
128
129
130 @NotNull
131 ExecType getExecutionType();
132
133
134
135
136
137
138
139 @Schema(
140 title = "MD5 Sum",
141 description = "Checksum of the changeset when it was executed. Used on each run to ensure there have " +
142 "been no unexpected changes to changesets in the changelog file.",
143 required = true,
144 example = "a3cca2b2aa1e3b5b3b5aad99a8529074",
145 minLength = 32,
146 maxLength = 35
147 )
148 @NotNull
149 @Size(max = 35)
150 String getMd5Sum();
151
152
153
154
155 @Schema(
156 title = "Description",
157 description = "Short auto-generated human-readable description of changeset.",
158 required = true,
159 minLength = 1,
160 maxLength = 255
161 )
162 @NotNull
163 @Size(max = 255)
164 String getDescription();
165
166
167
168
169 @Schema(
170 title = "Comments",
171 description = "Value from the changeset comment attribute.",
172 required = true,
173 maxLength = 255
174 )
175 @Size(max = 255)
176 String getComments();
177
178
179
180
181 @Schema(
182 title = "Tag",
183 description = "Tracks which changeset correspond to tag operations.",
184 maxLength = 255
185 )
186 @Size(max = 255)
187 String getTag();
188
189
190
191
192 @Schema(
193 title = "Liquibase Version",
194 description = "Version of Liquibase used to execute the changeset.",
195 required = true,
196 maxLength = 255
197 )
198 @NotNull
199 @Size(max = 20)
200 String getLiquibaseVersion();
201
202
203
204
205 @Schema(
206 title = "Context(s)",
207 description = "Context(s) used to execute the changeset.",
208 maxLength = 255
209 )
210 @Size(max = 255)
211 String getContexts();
212
213
214
215
216 @Schema(
217 title = "Label(s)",
218 description = "Label(s) used to execute the changeset.",
219 maxLength = 255
220 )
221 @Size(max = 255)
222 String getLabels();
223
224
225
226
227 @Schema(
228 title = "Deployment Id",
229 description = "changesets deployed together will have the same unique identifier.",
230 required = true,
231 maxLength = 10
232 )
233 @NotNull
234 @Size(max = 10)
235 String getDeploymentId();
236
237
238
239
240
241
242
243
244 @Schema(
245 title = "Execution Type",
246 description = "Description of how the changeset was executed.",
247 required = true,
248 example = "MARK_RAN",
249 enumeration = {"EXECUTED","FAILED","SKIPPED","RERAN","MARK_RAN"}
250 )
251 enum ExecType {
252 EXECUTED, FAILED, SKIPPED, RERAN, MARK_RAN
253 }
254 }