Skip to content

Commit 048f770

Browse files
Eduard Čubaj-mracek
authored andcommitted
[swdb]: remove unused installonly column from the database
This attribute can change over time and shouldn't be stored in persistent history database
1 parent b5816b6 commit 048f770

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

dnf/db/swdb_transformer.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
def PACKAGE_DATA_INSERT(cursor, data):
30-
cursor.execute('INSERT INTO PACKAGE_DATA VALUES (null,?,?,?,?,?,?,?)', data)
30+
cursor.execute('INSERT INTO PACKAGE_DATA VALUES (null,?,?,?,?,?,?)', data)
3131

3232

3333
# create binding with OUTPUT_TYPE - returns ID
@@ -81,11 +81,10 @@ def get_yumdb_packages(cursor, yumdb_path, pid_to_pdid, repo_fn):
8181
yumdata[yumfile] = f.read()
8282
pkgs[nvra] = yumdata
8383

84-
PDSTRINGS = ['from_repo_timestamp',
84+
PDSTRINGS = ('from_repo_timestamp',
8585
'from_repo_revision',
8686
'changed_by',
87-
'installonly',
88-
'installed_by']
87+
'installed_by')
8988

9089
# crate PD_ID to T_ID dictionary for further use
9190
pdid_to_tid = {}
@@ -225,12 +224,10 @@ def bind_repo(cursor, name):
225224
return False
226225

227226
# value distribution in tables
228-
PACKAGE_DATA = ['P_ID', 'R_ID', 'from_repo_revision',
229-
'from_repo_timestamp', 'installed_by', 'changed_by',
230-
'installonly']
227+
PACKAGE_DATA = ['P_ID', 'R_ID', 'from_repo_revision', 'from_repo_timestamp',
228+
'installed_by', 'changed_by']
231229

232-
TRANS_DATA = ['T_ID', 'PD_ID', 'TG_ID', 'done', 'obsoleting', 'reason',
233-
'state']
230+
TRANS_DATA = ['T_ID', 'PD_ID', 'TG_ID', 'done', 'obsoleting', 'reason', 'state']
234231

235232
GROUPS = ['name_id', 'name', 'ui_name', 'installed', 'pkg_types']
236233

@@ -293,7 +290,7 @@ def bind_repo(cursor, name):
293290
cursor.execute('SELECT P_ID FROM PACKAGE WHERE P_ID NOT IN (SELECT P_ID FROM PACKAGE_DATA)')
294291
tmp_row = cursor.fetchall()
295292
for row in tmp_row:
296-
cursor.execute("INSERT INTO PACKAGE_DATA VALUES(null,?,'','','','','','')", (row[0],))
293+
cursor.execute("INSERT INTO PACKAGE_DATA VALUES(null,?,'','','','','')", (row[0],))
297294

298295
# save changes
299296
database.commit()

0 commit comments

Comments
 (0)