Skip to content

Commit b10302a

Browse files
committed
fix: add missing columns for public directory update
1 parent 88d6bee commit b10302a

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/backend/src/services/database/SqliteDatabaseAccessService.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
4242
this.db = new Database(this.config.path);
4343

4444
// Database upgrade logic
45-
const TARGET_VERSION = 14;
45+
const TARGET_VERSION = 15;
4646

4747
if ( do_setup ) {
4848
this.log.noticeme(`SETUP: creating database at ${this.config.path}`);
@@ -63,6 +63,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
6363
'0014_share.sql',
6464
'0015_group.sql',
6565
'0016_group-permissions.sql',
66+
'0017_publicdirs.sql',
6667
].map(p => path_.join(__dirname, 'sqlite_setup', p));
6768
const fs = require('fs');
6869
for ( const filename of sql_files ) {
@@ -135,6 +136,10 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
135136
upgrade_files.push('0016_group-permissions.sql');
136137
}
137138

139+
if ( user_version <= 14 ) {
140+
upgrade_files.push('0017_publicdirs.sql');
141+
}
142+
138143
if ( upgrade_files.length > 0 ) {
139144
this.log.noticeme(`Database out of date: ${this.config.path}`);
140145
this.log.noticeme(`UPGRADING DATABASE: ${user_version} -> ${TARGET_VERSION}`);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTER TABLE user ADD COLUMN
2+
"public_uuid" CHAR(36) NULL DEFAULT NULL;
3+
ALTER TABLE user ADD COLUMN
4+
"public_id" INT NULL DEFAULT NULL;

0 commit comments

Comments
 (0)