Add loginservice for Google
This commit is contained in:
parent
b9a4d2835f
commit
6fa5a365b3
1 changed files with 17 additions and 0 deletions
|
@ -12,6 +12,9 @@ down_revision = 'f42b0ea7a4d'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
from data.model.sqlalchemybridge import gen_sqlalchemy_metadata
|
||||
from data.database import all_models
|
||||
|
||||
|
||||
def upgrade():
|
||||
|
@ -19,8 +22,22 @@ def upgrade():
|
|||
op.add_column('federatedlogin', sa.Column('metadata_json', sa.Text(), nullable=False))
|
||||
### end Alembic commands ###
|
||||
|
||||
schema = gen_sqlalchemy_metadata(all_models)
|
||||
|
||||
op.bulk_insert(schema.tables['loginservice'],
|
||||
[
|
||||
{'id':4, 'name':'google'},
|
||||
])
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('federatedlogin', 'metadata_json')
|
||||
### end Alembic commands ###
|
||||
|
||||
schema = gen_sqlalchemy_metadata(all_models)
|
||||
loginservice = schema.table['loginservice']
|
||||
|
||||
op.execute(
|
||||
(loginservice.delete()
|
||||
.where(loginservice.c.name == op.inline_literal('google')))
|
||||
)
|
||||
|
|
Reference in a new issue