mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Delete tables after upgrade
This commit is contained in:
parent
0d6ca9aa33
commit
359aa650fa
1 changed files with 8 additions and 0 deletions
|
@ -811,6 +811,7 @@ class Upgrade:
|
||||||
self.meta = _meta_
|
self.meta = _meta_
|
||||||
self.log_path = self.meta.log_path
|
self.log_path = self.meta.log_path
|
||||||
self.lib_path = self.meta.lib_path
|
self.lib_path = self.meta.lib_path
|
||||||
|
self.session = session
|
||||||
|
|
||||||
def run(self, repos):
|
def run(self, repos):
|
||||||
"""Removing and creating the packages lists
|
"""Removing and creating the packages lists
|
||||||
|
@ -825,6 +826,8 @@ class Upgrade:
|
||||||
|
|
||||||
changelogs = f"{self.log_path}{repo}/ChangeLog.txt"
|
changelogs = f"{self.log_path}{repo}/ChangeLog.txt"
|
||||||
|
|
||||||
|
self.del_tables(repo)
|
||||||
|
|
||||||
if os.path.isfile(changelogs):
|
if os.path.isfile(changelogs):
|
||||||
os.remove(changelogs)
|
os.remove(changelogs)
|
||||||
|
|
||||||
|
@ -843,6 +846,11 @@ class Upgrade:
|
||||||
update = Update()
|
update = Update()
|
||||||
update.run(repos)
|
update.run(repos)
|
||||||
|
|
||||||
|
def del_tables(self, repo):
|
||||||
|
if repo == 'sbo':
|
||||||
|
self.session.query(SBoTable).delete() # delete all data
|
||||||
|
self.session.commit()
|
||||||
|
|
||||||
|
|
||||||
class Update:
|
class Update:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue