Skip to content

Commit 4962d6c

Browse files
authored
Migrate column Ids to camelCase (#50)
Signed-off-by: Ayoub LABIDI <[email protected]>
1 parent 174392b commit 4962d6c

File tree

3 files changed

+59
-43
lines changed

3 files changed

+59
-43
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
3+
<changeSet id="update-columnid-remove-dot-capitalize" author="labidiayo">
4+
<sql dbms="postgresql">
5+
UPDATE spreadsheet_column
6+
SET column_id =
7+
SUBSTRING(column_id, 1, POSITION('.' IN column_id) - 1) ||
8+
UPPER(SUBSTRING(column_id, POSITION('.' IN column_id) + 1, 1)) ||
9+
SUBSTRING(column_id, POSITION('.' IN column_id) + 2)
10+
WHERE POSITION('.' IN column_id) > 0;
11+
</sql>
12+
</changeSet>
13+
</databaseChangeLog>

src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ databaseChangeLog:
3838
- include:
3939
file: changesets/changelog_20250421T180538Z.xml
4040
relativeToChangelogFile: true
41+
- include:
42+
file: changesets/changelog_20250513T135500Z.xml
43+
relativeToChangelogFile: true

0 commit comments

Comments
 (0)