Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions leapp/cli/upgrade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def fetch_last_upgrade_context():
"""
with get_connection(None) as db:
cursor = db.execute(
"SELECT context, stamp, configuration FROM execution WHERE kind = 'upgrade' ORDER BY stamp DESC LIMIT 1")
"SELECT context, stamp, configuration FROM execution WHERE kind = 'upgrade' ORDER BY id DESC LIMIT 1")
row = cursor.fetchone()
if row:
return row[0], json.loads(row[2])
Expand All @@ -90,7 +90,7 @@ def fetch_all_upgrade_contexts():
"""
with get_connection(None) as db:
cursor = db.execute(
"SELECT context, stamp, configuration FROM execution WHERE kind = 'upgrade' ORDER BY stamp DESC")
"SELECT context, stamp, configuration FROM execution WHERE kind = 'upgrade' ORDER BY id DESC")
row = cursor.fetchall()
if row:
return row
Expand Down
2 changes: 1 addition & 1 deletion leapp/snactor/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def last_snactor_context(connection=None):
"""
with get_connection(db=connection) as db:
cursor = db.execute('''
SELECT context, stamp FROM execution WHERE kind = 'snactor-run' ORDER BY stamp DESC LIMIT 1
SELECT context, stamp FROM execution WHERE kind = 'snactor-run' ORDER BY id DESC LIMIT 1
''')
row = cursor.fetchone()
if row:
Expand Down
2 changes: 1 addition & 1 deletion leapp/utils/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def get_checkpoints(context):
data_source ON data_source.id = audit.data_source_id
WHERE
audit.context = ? AND audit.event = ?
ORDER BY stamp ASC;
ORDER BY audit.id ASC;
''', (context, _AUDIT_CHECKPOINT_EVENT))
cursor.row_factory = _dict_factory
return cursor.fetchall()