diff --git a/packages/backend/src/services/database/SqliteDatabaseAccessService.js b/packages/backend/src/services/database/SqliteDatabaseAccessService.js index 3485f421..ca189d95 100644 --- a/packages/backend/src/services/database/SqliteDatabaseAccessService.js +++ b/packages/backend/src/services/database/SqliteDatabaseAccessService.js @@ -42,7 +42,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService { this.db = new Database(this.config.path); // Database upgrade logic - const TARGET_VERSION = 14; + const TARGET_VERSION = 15; if ( do_setup ) { this.log.noticeme(`SETUP: creating database at ${this.config.path}`); @@ -63,6 +63,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService { '0014_share.sql', '0015_group.sql', '0016_group-permissions.sql', + '0017_publicdirs.sql', ].map(p => path_.join(__dirname, 'sqlite_setup', p)); const fs = require('fs'); for ( const filename of sql_files ) { @@ -135,6 +136,10 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService { upgrade_files.push('0016_group-permissions.sql'); } + if ( user_version <= 14 ) { + upgrade_files.push('0017_publicdirs.sql'); + } + if ( upgrade_files.length > 0 ) { this.log.noticeme(`Database out of date: ${this.config.path}`); this.log.noticeme(`UPGRADING DATABASE: ${user_version} -> ${TARGET_VERSION}`); diff --git a/packages/backend/src/services/database/sqlite_setup/0017_publicdirs.sql b/packages/backend/src/services/database/sqlite_setup/0017_publicdirs.sql new file mode 100644 index 00000000..425ce369 --- /dev/null +++ b/packages/backend/src/services/database/sqlite_setup/0017_publicdirs.sql @@ -0,0 +1,4 @@ +ALTER TABLE user ADD COLUMN + "public_uuid" CHAR(36) NULL DEFAULT NULL; +ALTER TABLE user ADD COLUMN + "public_id" INT NULL DEFAULT NULL;