added db migrations and group support, still problems with json serialization

This commit is contained in:
Tobias Kurze
2019-04-02 16:10:46 +02:00
parent 024f063bea
commit 8cf8632c8c
10 changed files with 295 additions and 10 deletions

View File

@@ -0,0 +1,35 @@
"""empty message
Revision ID: 6f980d1e7ac5
Revises:
Create Date: 2019-04-02 13:33:29.319719
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6f980d1e7ac5'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('groups',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('name', sa.Unicode(length=64), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.add_column('user', sa.Column('external_user', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'external_user')
op.drop_table('groups')
# ### end Alembic commands ###