Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 690ae75

Browse files
lgallgal
authored andcommitted
SORMAS-Foundation#3422 change varchar to text
1 parent 12e08ea commit 690ae75

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

sormas-app/app/src/main/java/de/symeda/sormas/app/backend/common/DatabaseHelper.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
151151
public static final String DATABASE_NAME = "sormas.db";
152152
// any time you make changes to your database objects, you may have to increase the database version
153153

154-
public static final int DATABASE_VERSION = 255;
154+
public static final int DATABASE_VERSION = 256;
155155

156156
private static DatabaseHelper instance = null;
157157

@@ -1815,7 +1815,15 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
18151815
currentVersion = 254;
18161816

18171817
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN salutation varchar(255)");
1818-
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN otherSalutation varchar(512)");
1818+
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN otherSalutation text");
1819+
1820+
// ATTENTION: break should only be done after last version
1821+
break;
1822+
1823+
case 255:
1824+
currentVersion = 255;
1825+
1826+
getDao(Person.class).executeRaw("ALTER TABLE person ADD COLUMN armedForcesRelationType varchar(255);");
18191827

18201828
// ATTENTION: break should only be done after last version
18211829
break;

sormas-backend/src/main/resources/sql/sormas_schema.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6087,11 +6087,11 @@ INSERT INTO schema_version (version_number, comment) VALUES (291, 'Add LabMessag
60876087
-- SurvNet Adaptations - Create new field “Salutation” for persons #3411
60886088
ALTER TABLE person
60896089
ADD COLUMN salutation varchar(255),
6090-
ADD COLUMN othersalutation varchar(512);
6090+
ADD COLUMN othersalutation text;
60916091

60926092
ALTER TABLE person_history
60936093
ADD COLUMN salutation varchar(255),
6094-
ADD COLUMN othersalutation varchar(512);
6094+
ADD COLUMN othersalutation text;
60956095

60966096
INSERT INTO schema_version (version_number, comment) VALUES (292, 'SurvNet Adaptations - Create new field “Salutation” for persons #3411');
60976097

0 commit comments

Comments
 (0)