Commit d239c773 authored by echel0n's avatar echel0n
Browse files

Fixed cache database migration issues related to oauth2 and announcements tables

parent 36b6050a
......@@ -22,6 +22,19 @@ down_revision = '3'
def upgrade():
conn = op.get_bind()
meta = sa.MetaData(bind=conn)
op.create_table(
'oauth2_token',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('access_token', sa.String(255), unique=True, nullable=False),
sa.Column('refresh_token', sa.String(255), index=True),
sa.Column('expires_in', sa.Integer, nullable=False, default=0),
sa.Column('expires_at', sa.Integer, nullable=False, default=0),
sa.Column('scope', sa.Text, default=""),
sa.Column('session_state', sa.Text, default=""),
sa.Column('token_type', sa.Text, default="bearer"),
)
oauth2_token = sa.Table('oauth2_token', meta, autoload=True)
token_file = os.path.abspath(os.path.join(sickrage.app.data_dir, 'token.json'))
......@@ -45,4 +58,4 @@ def upgrade():
def downgrade():
# Operations to reverse the above upgrade go here.
pass
pass
\ No newline at end of file
......@@ -15,7 +15,12 @@ down_revision = '4'
def upgrade():
pass
op.create_table(
'announcements',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('hash', sa.String(255), unique=True, nullable=False),
sa.Column('seen', sa.Boolean, default=False)
)
def downgrade():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment