Merge branch 'main' of https://github.com/HeyPuter/puter into main

This commit is contained in:
Nariman Jelveh 2024-07-07 20:44:04 -07:00
commit 30f9f29982
2 changed files with 10 additions and 1 deletions

View File

@ -42,7 +42,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
this.db = new Database(this.config.path);
// Database upgrade logic
const TARGET_VERSION = 19;
const TARGET_VERSION = 20;
if ( do_setup ) {
this.log.noticeme(`SETUP: creating database at ${this.config.path}`);
@ -68,6 +68,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
'0019_fix-0016.sql',
'0020_dev-center.sql',
'0021_app-owner-id.sql',
'0022_dev-center-max.sql',
].map(p => path_.join(__dirname, 'sqlite_setup', p));
const fs = require('fs');
for ( const filename of sql_files ) {
@ -160,6 +161,10 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
upgrade_files.push('0021_app-owner-id.sql');
}
if ( user_version <= 19 ) {
upgrade_files.push('0022_dev-center-max.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}`);

View File

@ -0,0 +1,4 @@
-- fixing owner IDs for default apps;
-- they should all be owned by 'default_user'
UPDATE `apps` SET `maximize_on_start`=1 WHERE `uid`='app-0b37f054-07d4-4627-8765-11bd23e889d4';