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