Skip to content

Commit 9b39309

Browse files
committed
fix: database migration
1 parent 6d1c1d3 commit 9b39309

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

+7-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 = 9;
45+
const TARGET_VERSION = 10;
4646

4747
if ( do_setup ) {
4848
this.log.noticeme(`SETUP: creating database at ${this.config.path}`);
@@ -57,6 +57,8 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
5757
'0008_otp.sql',
5858
'0009_app-prefix-fix.sql',
5959
'0010_add-git-app.sql',
60+
'0011_notification.sql',
61+
'0012_appmetadata.sql',
6062
].map(p => path_.join(__dirname, 'sqlite_setup', p));
6163
const fs = require('fs');
6264
for ( const filename of sql_files ) {
@@ -109,6 +111,10 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService {
109111
upgrade_files.push('0011_notification.sql');
110112
}
111113

114+
if ( user_version <= 9 ) {
115+
upgrade_files.push('0012_appmetadata.sql');
116+
}
117+
112118
if ( upgrade_files.length > 0 ) {
113119
this.log.noticeme(`Database out of date: ${this.config.path}`);
114120
this.log.noticeme(`UPGRADING DATABASE: ${user_version} -> ${TARGET_VERSION}`);

0 commit comments

Comments
 (0)