Skip to content

Commit

Permalink
column_metadata nullable (#3188)
Browse files Browse the repository at this point in the history
  • Loading branch information
harmbrugge authored Jan 10, 2024
1 parent 71a5fb1 commit 76d41f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public class Migrations {
// version the current software needs to work
private static final int SOFTWARE_DATABASE_VERSION = 15;
private static final int SOFTWARE_DATABASE_VERSION = 16;
private static Logger logger = LoggerFactory.getLogger(Migrations.class);

public static synchronized void initOrMigrate(SqlDatabase db) {
Expand Down Expand Up @@ -100,6 +100,10 @@ public static synchronized void initOrMigrate(SqlDatabase db) {
executeMigrationFile(tdb, "migration15.sql", "changed required field to varchar");
}

if (version < 16) {
executeMigrationFile(tdb, "migration16.sql", "make required nullable");
}

// if success, update version to SOFTWARE_DATABASE_VERSION
updateDatabaseVersion((SqlDatabase) tdb, SOFTWARE_DATABASE_VERSION);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE "MOLGENIS"."column_metadata"
ALTER COLUMN required drop not null;

0 comments on commit 76d41f5

Please sign in to comment.