forked from openlp/openlp
remove old redundant keys
This commit is contained in:
parent
14c3d27fed
commit
5e8ad1710b
@ -45,6 +45,7 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'Version'
|
metadata_table.c.key == 'Version'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Version'))
|
||||||
# Copy "Copyright" to "copyright"
|
# Copy "Copyright" to "copyright"
|
||||||
session.execute(insert(metadata_table).values(
|
session.execute(insert(metadata_table).values(
|
||||||
key='copyright',
|
key='copyright',
|
||||||
@ -53,6 +54,7 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'Copyright'
|
metadata_table.c.key == 'Copyright'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Copyright'))
|
||||||
# Copy "Permissions" to "permissions"
|
# Copy "Permissions" to "permissions"
|
||||||
session.execute(insert(metadata_table).values(
|
session.execute(insert(metadata_table).values(
|
||||||
key='permissions',
|
key='permissions',
|
||||||
@ -61,6 +63,7 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'Permissions'
|
metadata_table.c.key == 'Permissions'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Permissions'))
|
||||||
# Copy "Bookname language" to "book_name_language"
|
# Copy "Bookname language" to "book_name_language"
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
@ -76,6 +79,7 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'Bookname language'
|
metadata_table.c.key == 'Bookname language'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'Bookname language'))
|
||||||
# Copy "download source" to "download_source"
|
# Copy "download source" to "download_source"
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
@ -92,6 +96,7 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'download source'
|
metadata_table.c.key == 'download source'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'download source'))
|
||||||
# Copy "download name" to "download_name"
|
# Copy "download name" to "download_name"
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
@ -108,6 +113,7 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'download name'
|
metadata_table.c.key == 'download name'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'download name'))
|
||||||
# Copy "proxy server" to "proxy_server"
|
# Copy "proxy server" to "proxy_server"
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
@ -124,6 +130,7 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'proxy server'
|
metadata_table.c.key == 'proxy server'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy server'))
|
||||||
# Copy "proxy username" to "proxy_username"
|
# Copy "proxy username" to "proxy_username"
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
@ -140,6 +147,7 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'proxy username'
|
metadata_table.c.key == 'proxy username'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy username'))
|
||||||
# Copy "proxy password" to "proxy_password"
|
# Copy "proxy password" to "proxy_password"
|
||||||
value_count = session.execute(
|
value_count = session.execute(
|
||||||
select(
|
select(
|
||||||
@ -156,6 +164,6 @@ def upgrade_1(session, metadata):
|
|||||||
metadata_table.c.key == 'proxy password'
|
metadata_table.c.key == 'proxy password'
|
||||||
).as_scalar()
|
).as_scalar()
|
||||||
))
|
))
|
||||||
session.execute(delete(metadata_table)\
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'proxy password'))
|
||||||
.where(metadata_table.c.key == 'dbversion'))
|
session.execute(delete(metadata_table).where(metadata_table.c.key == 'dbversion'))
|
||||||
session.commit()
|
session.commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user