Add migration for changed wifi. Fix selection issue with unlinking repo.

This commit is contained in:
Manu 2018-11-03 01:55:13 +08:00
parent 9b98afe444
commit 78e4b6d8a7
2 changed files with 7 additions and 2 deletions

View File

@ -9,7 +9,7 @@ import json
from datetime import datetime
from playhouse.migrate import SqliteMigrator, migrate
SCHEMA_VERSION = 4
SCHEMA_VERSION = 5
db = pw.Proxy()
@ -172,4 +172,9 @@ def init_db(con):
migrator.add_column(SnapshotModel._meta.table_name, 'duration', pw.FloatField(null=True)),
migrator.add_column(SnapshotModel._meta.table_name, 'size', pw.IntegerField(null=True))
)
if current_schema.version < 5:
_apply_schema_update(
current_schema, 5,
migrator.drop_not_null(WifiSettingModel._meta.table_name, 'last_connected'),
)

View File

@ -165,7 +165,7 @@ class RepoTab(RepoBase, RepoUI, BackupProfileMixin):
msg.setParent(self, QtCore.Qt.Sheet)
selected_repo_id = self.repoSelector.currentData()
selected_repo_index = self.repoSelector.currentIndex()
if selected_repo_id is not None:
if selected_repo_index > 2:
repo = RepoModel.get(id=selected_repo_id)
repo.delete_instance()
profile.repo = None