mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
fix: add missing columns for public directory update
This commit is contained in:
parent
88d6bee954
commit
b10302ad74
@ -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}`);
|
||||
|
@ -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;
|
Loading…
Reference in New Issue
Block a user