Skip to content

Commit

Permalink
Merge pull request #1849 from ardriveapp/PE-6734
Browse files Browse the repository at this point in the history
PE-6734: handle 'no such column snapshot_entries'
  • Loading branch information
thiagocarvalhodev authored Sep 12, 2024
2 parents 5018cd1 + 52b69c1 commit ba91a80
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void main() async {
await _initializeServices();

await _startApp();
}, (error, stackTrace) {
}, (error, stackTrace) async {
logger.e('Error caught.', error, stackTrace);
});
}
Expand Down
15 changes: 13 additions & 2 deletions lib/models/database/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ part 'database.g.dart';
'../tables/licenses.drift',
'../tables/network_transactions.drift',
'../tables/profiles.drift',
'../tables/snapshot_entries.drift',
'../tables/arns_records.drift',
'../tables/ant_records.drift',
},
Expand All @@ -31,7 +30,7 @@ class Database extends _$Database {
Database([QueryExecutor? e]) : super(e ?? openConnection());

@override
int get schemaVersion => 21;
int get schemaVersion => 22;
@override
MigrationStrategy get migration => MigrationStrategy(
onCreate: (Migrator m) {
Expand Down Expand Up @@ -131,6 +130,18 @@ class Database extends _$Database {
await m.createTable(arnsRecords);
await m.createTable(antRecords);
}

if (from < 22) {
logger.d('Migrating schema from v21 to v22');

logger.d('Dropping snapshot_entries table');

await customStatement('''
DROP TABLE IF EXISTS snapshot_entries;
''');

logger.d('snapshot_entries table dropped');
}
} catch (e, stacktrace) {
logger.e(
'CRITICAL! Failed to migrate database from $from to $to',
Expand Down
13 changes: 0 additions & 13 deletions lib/models/tables/snapshot_entries.drift

This file was deleted.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Secure, permanent storage

publish_to: 'none'

version: 2.54.0
version: 2.54.2

environment:
sdk: '>=3.2.0 <4.0.0'
Expand Down

0 comments on commit ba91a80

Please sign in to comment.