Skip to content

Commit 23e6f46

Browse files
refactor(gitprovider): consolidate migration changelog
Replace 1772200000000 (fake timestamp) with 1772284124265 (real epoch millis). Renumber changesets sequentially (1-23, no gaps). Content is identical — same 14 provider columns, 1 rename, 8 constraint updates. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a5d4634 commit 23e6f46

2 files changed

Lines changed: 33 additions & 29 deletions

File tree

server/application-server/src/main/resources/db/changelog/1772200000000_changelog.xml renamed to server/application-server/src/main/resources/db/changelog/1772284124265_changelog.xml

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,26 @@
99
Multi-Provider Support (Issue #715)
1010
=======================================================================================
1111
12-
Adds a provider discriminator column to all git service entity tables so that
13-
GitHub and GitLab entities can coexist in the same database. Updates unique
14-
constraints that previously assumed a single provider to include the provider
15-
column. Renames organization.github_id to organization.provider_id.
12+
Adds a provider discriminator column to all BaseGitServiceEntity tables so
13+
that GitHub and GitLab entities can coexist in the same database. Updates
14+
unique constraints that previously assumed a single provider to include the
15+
provider column. Renames organization.github_id to organization.provider_id.
1616
1717
ID collision prevention is handled at the application layer via ID negation
1818
(all GitLab entity IDs are negated before storage). The provider column
1919
enables provider-scoped queries and provider-aware unique constraints.
2020
2121
Existing data defaults to 'GITHUB' — no data migration needed.
22+
23+
Tables that do NOT get a provider column:
24+
- label, pull_request_review: plain entities, not BaseGitServiceEntity
25+
- pull_request: extends Issue (JPA SINGLE_TABLE), shares issue table
2226
=======================================================================================
2327
-->
2428

2529
<!-- ==================== Step 1: Add provider column to all entity tables ==================== -->
2630

27-
<changeSet author="issue-715" id="1772200000000-1">
31+
<changeSet author="issue-715" id="1772284124265-1">
2832
<preConditions onFail="MARK_RAN">
2933
<not><columnExists tableName="user" columnName="provider"/></not>
3034
</preConditions>
@@ -35,7 +39,7 @@
3539
</addColumn>
3640
</changeSet>
3741

38-
<changeSet author="issue-715" id="1772200000000-2">
42+
<changeSet author="issue-715" id="1772284124265-2">
3943
<preConditions onFail="MARK_RAN">
4044
<not><columnExists tableName="repository" columnName="provider"/></not>
4145
</preConditions>
@@ -46,7 +50,7 @@
4650
</addColumn>
4751
</changeSet>
4852

49-
<changeSet author="issue-715" id="1772200000000-3">
53+
<changeSet author="issue-715" id="1772284124265-3">
5054
<preConditions onFail="MARK_RAN">
5155
<not><columnExists tableName="organization" columnName="provider"/></not>
5256
</preConditions>
@@ -57,7 +61,7 @@
5761
</addColumn>
5862
</changeSet>
5963

60-
<changeSet author="issue-715" id="1772200000000-4">
64+
<changeSet author="issue-715" id="1772284124265-4">
6165
<preConditions onFail="MARK_RAN">
6266
<not><columnExists tableName="issue" columnName="provider"/></not>
6367
</preConditions>
@@ -68,7 +72,7 @@
6872
</addColumn>
6973
</changeSet>
7074

71-
<changeSet author="issue-715" id="1772200000000-6">
75+
<changeSet author="issue-715" id="1772284124265-5">
7276
<preConditions onFail="MARK_RAN">
7377
<not><columnExists tableName="milestone" columnName="provider"/></not>
7478
</preConditions>
@@ -79,7 +83,7 @@
7983
</addColumn>
8084
</changeSet>
8185

82-
<changeSet author="issue-715" id="1772200000000-7">
86+
<changeSet author="issue-715" id="1772284124265-6">
8387
<preConditions onFail="MARK_RAN">
8488
<not><columnExists tableName="issue_comment" columnName="provider"/></not>
8589
</preConditions>
@@ -90,7 +94,7 @@
9094
</addColumn>
9195
</changeSet>
9296

93-
<changeSet author="issue-715" id="1772200000000-9">
97+
<changeSet author="issue-715" id="1772284124265-7">
9498
<preConditions onFail="MARK_RAN">
9599
<not><columnExists tableName="pull_request_review_comment" columnName="provider"/></not>
96100
</preConditions>
@@ -101,7 +105,7 @@
101105
</addColumn>
102106
</changeSet>
103107

104-
<changeSet author="issue-715" id="1772200000000-10">
108+
<changeSet author="issue-715" id="1772284124265-8">
105109
<preConditions onFail="MARK_RAN">
106110
<not><columnExists tableName="pull_request_review_thread" columnName="provider"/></not>
107111
</preConditions>
@@ -112,7 +116,7 @@
112116
</addColumn>
113117
</changeSet>
114118

115-
<changeSet author="issue-715" id="1772200000000-11">
119+
<changeSet author="issue-715" id="1772284124265-9">
116120
<preConditions onFail="MARK_RAN">
117121
<not><columnExists tableName="discussion" columnName="provider"/></not>
118122
</preConditions>
@@ -123,7 +127,7 @@
123127
</addColumn>
124128
</changeSet>
125129

126-
<changeSet author="issue-715" id="1772200000000-12">
130+
<changeSet author="issue-715" id="1772284124265-10">
127131
<preConditions onFail="MARK_RAN">
128132
<not><columnExists tableName="discussion_comment" columnName="provider"/></not>
129133
</preConditions>
@@ -134,7 +138,7 @@
134138
</addColumn>
135139
</changeSet>
136140

137-
<changeSet author="issue-715" id="1772200000000-13">
141+
<changeSet author="issue-715" id="1772284124265-11">
138142
<preConditions onFail="MARK_RAN">
139143
<not><columnExists tableName="team" columnName="provider"/></not>
140144
</preConditions>
@@ -145,7 +149,7 @@
145149
</addColumn>
146150
</changeSet>
147151

148-
<changeSet author="issue-715" id="1772200000000-14">
152+
<changeSet author="issue-715" id="1772284124265-12">
149153
<preConditions onFail="MARK_RAN">
150154
<not><columnExists tableName="project" columnName="provider"/></not>
151155
</preConditions>
@@ -156,7 +160,7 @@
156160
</addColumn>
157161
</changeSet>
158162

159-
<changeSet author="issue-715" id="1772200000000-15">
163+
<changeSet author="issue-715" id="1772284124265-13">
160164
<preConditions onFail="MARK_RAN">
161165
<not><columnExists tableName="project_item" columnName="provider"/></not>
162166
</preConditions>
@@ -167,7 +171,7 @@
167171
</addColumn>
168172
</changeSet>
169173

170-
<changeSet author="issue-715" id="1772200000000-16">
174+
<changeSet author="issue-715" id="1772284124265-14">
171175
<preConditions onFail="MARK_RAN">
172176
<not><columnExists tableName="project_status_update" columnName="provider"/></not>
173177
</preConditions>
@@ -180,7 +184,7 @@
180184

181185
<!-- ==================== Step 2: Rename organization.github_id → provider_id ==================== -->
182186

183-
<changeSet author="issue-715" id="1772200000000-20">
187+
<changeSet author="issue-715" id="1772284124265-15">
184188
<preConditions onFail="MARK_RAN">
185189
<columnExists tableName="organization" columnName="github_id"/>
186190
</preConditions>
@@ -191,13 +195,13 @@
191195
<!-- ==================== Step 3: Update unique constraints for multi-provider ==================== -->
192196

193197
<!-- User: uk_user_login_lower → uk_user_provider_login (provider, LOWER(login)) -->
194-
<changeSet author="issue-715" id="1772200000000-30">
198+
<changeSet author="issue-715" id="1772284124265-16">
195199
<preConditions onFail="MARK_RAN">
196200
<indexExists indexName="uk_user_login_lower"/>
197201
</preConditions>
198202
<dropIndex tableName="user" indexName="uk_user_login_lower"/>
199203
</changeSet>
200-
<changeSet author="issue-715" id="1772200000000-31">
204+
<changeSet author="issue-715" id="1772284124265-17">
201205
<preConditions onFail="MARK_RAN">
202206
<not><indexExists indexName="uk_user_provider_login"/></not>
203207
</preConditions>
@@ -209,14 +213,14 @@
209213
</rollback>
210214
</changeSet>
211215

212-
<!-- Organization: uq_organization_github_id → uq_organization_provider_id -->
213-
<changeSet author="issue-715" id="1772200000000-32">
216+
<!-- Organization: uq_organization_github_id → uq_organization_provider_provider_id -->
217+
<changeSet author="issue-715" id="1772284124265-18">
214218
<preConditions onFail="MARK_RAN">
215219
<indexExists indexName="uq_organization_github_id"/>
216220
</preConditions>
217221
<dropUniqueConstraint tableName="organization" constraintName="uq_organization_github_id"/>
218222
</changeSet>
219-
<changeSet author="issue-715" id="1772200000000-33">
223+
<changeSet author="issue-715" id="1772284124265-19">
220224
<preConditions onFail="MARK_RAN">
221225
<not><indexExists indexName="uq_organization_provider_provider_id"/></not>
222226
</preConditions>
@@ -225,13 +229,13 @@
225229
</changeSet>
226230

227231
<!-- Organization: uq_organization_login → uq_organization_provider_login -->
228-
<changeSet author="issue-715" id="1772200000000-34">
232+
<changeSet author="issue-715" id="1772284124265-20">
229233
<preConditions onFail="MARK_RAN">
230234
<indexExists indexName="uq_organization_login"/>
231235
</preConditions>
232236
<dropUniqueConstraint tableName="organization" constraintName="uq_organization_login"/>
233237
</changeSet>
234-
<changeSet author="issue-715" id="1772200000000-35">
238+
<changeSet author="issue-715" id="1772284124265-21">
235239
<preConditions onFail="MARK_RAN">
236240
<not><indexExists indexName="uq_organization_provider_login"/></not>
237241
</preConditions>
@@ -240,13 +244,13 @@
240244
</changeSet>
241245

242246
<!-- Repository: uq_repository_name_with_owner → uq_repository_provider_name_with_owner -->
243-
<changeSet author="issue-715" id="1772200000000-36">
247+
<changeSet author="issue-715" id="1772284124265-22">
244248
<preConditions onFail="MARK_RAN">
245249
<indexExists indexName="uq_repository_name_with_owner"/>
246250
</preConditions>
247251
<dropUniqueConstraint tableName="repository" constraintName="uq_repository_name_with_owner"/>
248252
</changeSet>
249-
<changeSet author="issue-715" id="1772200000000-37">
253+
<changeSet author="issue-715" id="1772284124265-23">
250254
<preConditions onFail="MARK_RAN">
251255
<not><indexExists indexName="uq_repository_provider_name_with_owner"/></not>
252256
</preConditions>

server/application-server/src/main/resources/db/master.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@
4141
<include file="./changelog/1771542830539_changelog.xml" relativeToChangelogFile="true"/>
4242
<include file="./changelog/1772037098233_changelog.xml" relativeToChangelogFile="true"/>
4343
<include file="./changelog/1772101828808_changelog.xml" relativeToChangelogFile="true"/>
44-
<include file="./changelog/1772200000000_changelog.xml" relativeToChangelogFile="true"/>
44+
<include file="./changelog/1772284124265_changelog.xml" relativeToChangelogFile="true"/>
4545
</databaseChangeLog>

0 commit comments

Comments
 (0)