|
9 | 9 | Multi-Provider Support (Issue #715) |
10 | 10 | ======================================================================================= |
11 | 11 |
|
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. |
16 | 16 |
|
17 | 17 | ID collision prevention is handled at the application layer via ID negation |
18 | 18 | (all GitLab entity IDs are negated before storage). The provider column |
19 | 19 | enables provider-scoped queries and provider-aware unique constraints. |
20 | 20 |
|
21 | 21 | 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 |
22 | 26 | ======================================================================================= |
23 | 27 | --> |
24 | 28 |
|
25 | 29 | <!-- ==================== Step 1: Add provider column to all entity tables ==================== --> |
26 | 30 |
|
27 | | - <changeSet author="issue-715" id="1772200000000-1"> |
| 31 | + <changeSet author="issue-715" id="1772284124265-1"> |
28 | 32 | <preConditions onFail="MARK_RAN"> |
29 | 33 | <not><columnExists tableName="user" columnName="provider"/></not> |
30 | 34 | </preConditions> |
|
35 | 39 | </addColumn> |
36 | 40 | </changeSet> |
37 | 41 |
|
38 | | - <changeSet author="issue-715" id="1772200000000-2"> |
| 42 | + <changeSet author="issue-715" id="1772284124265-2"> |
39 | 43 | <preConditions onFail="MARK_RAN"> |
40 | 44 | <not><columnExists tableName="repository" columnName="provider"/></not> |
41 | 45 | </preConditions> |
|
46 | 50 | </addColumn> |
47 | 51 | </changeSet> |
48 | 52 |
|
49 | | - <changeSet author="issue-715" id="1772200000000-3"> |
| 53 | + <changeSet author="issue-715" id="1772284124265-3"> |
50 | 54 | <preConditions onFail="MARK_RAN"> |
51 | 55 | <not><columnExists tableName="organization" columnName="provider"/></not> |
52 | 56 | </preConditions> |
|
57 | 61 | </addColumn> |
58 | 62 | </changeSet> |
59 | 63 |
|
60 | | - <changeSet author="issue-715" id="1772200000000-4"> |
| 64 | + <changeSet author="issue-715" id="1772284124265-4"> |
61 | 65 | <preConditions onFail="MARK_RAN"> |
62 | 66 | <not><columnExists tableName="issue" columnName="provider"/></not> |
63 | 67 | </preConditions> |
|
68 | 72 | </addColumn> |
69 | 73 | </changeSet> |
70 | 74 |
|
71 | | - <changeSet author="issue-715" id="1772200000000-6"> |
| 75 | + <changeSet author="issue-715" id="1772284124265-5"> |
72 | 76 | <preConditions onFail="MARK_RAN"> |
73 | 77 | <not><columnExists tableName="milestone" columnName="provider"/></not> |
74 | 78 | </preConditions> |
|
79 | 83 | </addColumn> |
80 | 84 | </changeSet> |
81 | 85 |
|
82 | | - <changeSet author="issue-715" id="1772200000000-7"> |
| 86 | + <changeSet author="issue-715" id="1772284124265-6"> |
83 | 87 | <preConditions onFail="MARK_RAN"> |
84 | 88 | <not><columnExists tableName="issue_comment" columnName="provider"/></not> |
85 | 89 | </preConditions> |
|
90 | 94 | </addColumn> |
91 | 95 | </changeSet> |
92 | 96 |
|
93 | | - <changeSet author="issue-715" id="1772200000000-9"> |
| 97 | + <changeSet author="issue-715" id="1772284124265-7"> |
94 | 98 | <preConditions onFail="MARK_RAN"> |
95 | 99 | <not><columnExists tableName="pull_request_review_comment" columnName="provider"/></not> |
96 | 100 | </preConditions> |
|
101 | 105 | </addColumn> |
102 | 106 | </changeSet> |
103 | 107 |
|
104 | | - <changeSet author="issue-715" id="1772200000000-10"> |
| 108 | + <changeSet author="issue-715" id="1772284124265-8"> |
105 | 109 | <preConditions onFail="MARK_RAN"> |
106 | 110 | <not><columnExists tableName="pull_request_review_thread" columnName="provider"/></not> |
107 | 111 | </preConditions> |
|
112 | 116 | </addColumn> |
113 | 117 | </changeSet> |
114 | 118 |
|
115 | | - <changeSet author="issue-715" id="1772200000000-11"> |
| 119 | + <changeSet author="issue-715" id="1772284124265-9"> |
116 | 120 | <preConditions onFail="MARK_RAN"> |
117 | 121 | <not><columnExists tableName="discussion" columnName="provider"/></not> |
118 | 122 | </preConditions> |
|
123 | 127 | </addColumn> |
124 | 128 | </changeSet> |
125 | 129 |
|
126 | | - <changeSet author="issue-715" id="1772200000000-12"> |
| 130 | + <changeSet author="issue-715" id="1772284124265-10"> |
127 | 131 | <preConditions onFail="MARK_RAN"> |
128 | 132 | <not><columnExists tableName="discussion_comment" columnName="provider"/></not> |
129 | 133 | </preConditions> |
|
134 | 138 | </addColumn> |
135 | 139 | </changeSet> |
136 | 140 |
|
137 | | - <changeSet author="issue-715" id="1772200000000-13"> |
| 141 | + <changeSet author="issue-715" id="1772284124265-11"> |
138 | 142 | <preConditions onFail="MARK_RAN"> |
139 | 143 | <not><columnExists tableName="team" columnName="provider"/></not> |
140 | 144 | </preConditions> |
|
145 | 149 | </addColumn> |
146 | 150 | </changeSet> |
147 | 151 |
|
148 | | - <changeSet author="issue-715" id="1772200000000-14"> |
| 152 | + <changeSet author="issue-715" id="1772284124265-12"> |
149 | 153 | <preConditions onFail="MARK_RAN"> |
150 | 154 | <not><columnExists tableName="project" columnName="provider"/></not> |
151 | 155 | </preConditions> |
|
156 | 160 | </addColumn> |
157 | 161 | </changeSet> |
158 | 162 |
|
159 | | - <changeSet author="issue-715" id="1772200000000-15"> |
| 163 | + <changeSet author="issue-715" id="1772284124265-13"> |
160 | 164 | <preConditions onFail="MARK_RAN"> |
161 | 165 | <not><columnExists tableName="project_item" columnName="provider"/></not> |
162 | 166 | </preConditions> |
|
167 | 171 | </addColumn> |
168 | 172 | </changeSet> |
169 | 173 |
|
170 | | - <changeSet author="issue-715" id="1772200000000-16"> |
| 174 | + <changeSet author="issue-715" id="1772284124265-14"> |
171 | 175 | <preConditions onFail="MARK_RAN"> |
172 | 176 | <not><columnExists tableName="project_status_update" columnName="provider"/></not> |
173 | 177 | </preConditions> |
|
180 | 184 |
|
181 | 185 | <!-- ==================== Step 2: Rename organization.github_id → provider_id ==================== --> |
182 | 186 |
|
183 | | - <changeSet author="issue-715" id="1772200000000-20"> |
| 187 | + <changeSet author="issue-715" id="1772284124265-15"> |
184 | 188 | <preConditions onFail="MARK_RAN"> |
185 | 189 | <columnExists tableName="organization" columnName="github_id"/> |
186 | 190 | </preConditions> |
|
191 | 195 | <!-- ==================== Step 3: Update unique constraints for multi-provider ==================== --> |
192 | 196 |
|
193 | 197 | <!-- 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"> |
195 | 199 | <preConditions onFail="MARK_RAN"> |
196 | 200 | <indexExists indexName="uk_user_login_lower"/> |
197 | 201 | </preConditions> |
198 | 202 | <dropIndex tableName="user" indexName="uk_user_login_lower"/> |
199 | 203 | </changeSet> |
200 | | - <changeSet author="issue-715" id="1772200000000-31"> |
| 204 | + <changeSet author="issue-715" id="1772284124265-17"> |
201 | 205 | <preConditions onFail="MARK_RAN"> |
202 | 206 | <not><indexExists indexName="uk_user_provider_login"/></not> |
203 | 207 | </preConditions> |
|
209 | 213 | </rollback> |
210 | 214 | </changeSet> |
211 | 215 |
|
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"> |
214 | 218 | <preConditions onFail="MARK_RAN"> |
215 | 219 | <indexExists indexName="uq_organization_github_id"/> |
216 | 220 | </preConditions> |
217 | 221 | <dropUniqueConstraint tableName="organization" constraintName="uq_organization_github_id"/> |
218 | 222 | </changeSet> |
219 | | - <changeSet author="issue-715" id="1772200000000-33"> |
| 223 | + <changeSet author="issue-715" id="1772284124265-19"> |
220 | 224 | <preConditions onFail="MARK_RAN"> |
221 | 225 | <not><indexExists indexName="uq_organization_provider_provider_id"/></not> |
222 | 226 | </preConditions> |
|
225 | 229 | </changeSet> |
226 | 230 |
|
227 | 231 | <!-- Organization: uq_organization_login → uq_organization_provider_login --> |
228 | | - <changeSet author="issue-715" id="1772200000000-34"> |
| 232 | + <changeSet author="issue-715" id="1772284124265-20"> |
229 | 233 | <preConditions onFail="MARK_RAN"> |
230 | 234 | <indexExists indexName="uq_organization_login"/> |
231 | 235 | </preConditions> |
232 | 236 | <dropUniqueConstraint tableName="organization" constraintName="uq_organization_login"/> |
233 | 237 | </changeSet> |
234 | | - <changeSet author="issue-715" id="1772200000000-35"> |
| 238 | + <changeSet author="issue-715" id="1772284124265-21"> |
235 | 239 | <preConditions onFail="MARK_RAN"> |
236 | 240 | <not><indexExists indexName="uq_organization_provider_login"/></not> |
237 | 241 | </preConditions> |
|
240 | 244 | </changeSet> |
241 | 245 |
|
242 | 246 | <!-- 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"> |
244 | 248 | <preConditions onFail="MARK_RAN"> |
245 | 249 | <indexExists indexName="uq_repository_name_with_owner"/> |
246 | 250 | </preConditions> |
247 | 251 | <dropUniqueConstraint tableName="repository" constraintName="uq_repository_name_with_owner"/> |
248 | 252 | </changeSet> |
249 | | - <changeSet author="issue-715" id="1772200000000-37"> |
| 253 | + <changeSet author="issue-715" id="1772284124265-23"> |
250 | 254 | <preConditions onFail="MARK_RAN"> |
251 | 255 | <not><indexExists indexName="uq_repository_provider_name_with_owner"/></not> |
252 | 256 | </preConditions> |
|
0 commit comments