Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SiCKRAGE
sickrage
Commits
e7384019
Commit
e7384019
authored
Nov 18, 2020
by
echel0n
Browse files
Prevent null value when adding last_xem_refresh via alembic
parent
12e63166
Changes
1
Hide whitespace changes
Inline
Side-by-side
sickrage/core/databases/main/migrations/versions/014_Add_Last_XEM_Refresh_Column_To_TVShows_Table.py
View file @
e7384019
...
@@ -26,8 +26,9 @@ def upgrade():
...
@@ -26,8 +26,9 @@ def upgrade():
with
op
.
get_context
().
begin_transaction
():
with
op
.
get_context
().
begin_transaction
():
for
row
in
conn
.
execute
(
xem_refresh
.
select
()):
for
row
in
conn
.
execute
(
xem_refresh
.
select
()):
last_xem_refresh
=
row
.
last_refreshed
or
datetime
.
datetime
.
now
().
toordinal
()
conn
.
execute
(
'UPDATE tv_shows SET last_xem_refresh = {} WHERE tv_shows.indexer_id = {}'
conn
.
execute
(
'UPDATE tv_shows SET last_xem_refresh = {} WHERE tv_shows.indexer_id = {}'
.
format
(
row
.
last_refresh
ed
,
row
.
indexer_id
))
.
format
(
last_
xem_
refresh
,
row
.
indexer_id
))
op
.
drop_table
(
'xem_refresh'
)
op
.
drop_table
(
'xem_refresh'
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment