Fixed db create issue

This commit is contained in:
Juan Gilsanz Polo 2023-10-05 09:15:19 +02:00
parent 525facc538
commit 210606306a
2 changed files with 2 additions and 2 deletions

View file

@ -176,7 +176,7 @@ class ServersProvider with ChangeNotifier {
final result = await client!.checkServerUpdates();
if (result['result'] == 'success') {
UpdateAvailableData data = UpdateAvailableData.fromJson(result['data']);
final gitHubResult = await client!.getUpdateChangelog(releaseTag: data.newVersion ?? data.currentVersion);
final gitHubResult = await client.getUpdateChangelog(releaseTag: data.newVersion ?? data.currentVersion);
if (gitHubResult['result'] == 'success') {
data.changelog = gitHubResult['body'];
}

View file

@ -122,7 +122,7 @@ Future<Map<String, dynamic>> loadDb(bool acceptsDynamicTheme) async {
onCreate: (Database db, int version) async {
await db.execute("CREATE TABLE servers (id TEXT PRIMARY KEY, name TEXT, connectionMethod TEXT, domain TEXT, path TEXT, port INTEGER, user TEXT, password TEXT, defaultServer INTEGER, authToken TEXT, runningOnHa INTEGER)");
await db.execute("CREATE TABLE appConfig (theme NUMERIC, overrideSslCheck NUMERIC, hideZeroValues NUMERIC, useDynamicColor NUMERIC, staticColor NUMERIC, useThemeColorForStatus NUMERIC, showTimeLogs NUMERIC, showIpLogs NUMERIC, combinedChart NUMERIC, doNotRememberVersion TEXT, hideServerAddress NUMERIC, homeTopItemsOrder TEXT)");
await db.execute("INSERT INTO appConfig (theme, overrideSslCheck, hideZeroValues, useDynamicColor, staticColor, useThemeColorForStatus, showTimeLogs, showIpLogs, combinedChart, hideServerAddress, homeTopItemsOrder) VALUES (0, 0, 0, ${acceptsDynamicTheme == true ? 1 : 0}, 0, 0, 0, 0, 0, 0, $homeTopItemsDefaultOrderString)");
await db.execute("INSERT INTO appConfig (theme, overrideSslCheck, hideZeroValues, useDynamicColor, staticColor, useThemeColorForStatus, showTimeLogs, showIpLogs, combinedChart, hideServerAddress, homeTopItemsOrder) VALUES (0, 0, 0, ${acceptsDynamicTheme == true ? 1 : 0}, 0, 0, 0, 0, 0, 0, '$homeTopItemsDefaultOrderString')");
},
onUpgrade: (Database db, int oldVersion, int newVersion) async {
if (oldVersion == 1) {