adds device handling functionality from the browser

This commit is contained in:
2020-05-28 12:00:05 +02:00
parent 5d1edbc6fc
commit 7b82086ff0
6 changed files with 68 additions and 47 deletions

View File

@ -1,23 +0,0 @@
"""empty message
Revision ID: 3b829a27bc337
Revises: 1e8205594ac1
Create Date: 2020-05-27 19:30:54.384047
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '3b829a27bc337'
down_revision = '1e8205594ac1'
branch_labels = None
depends_on = None
def upgrade():
op.alter_column('User', 'google_credentials', existing_type=sa.Relationship(), new_column_name='google_token')
def downgrade():
op.alter_column('User', 'google_token', existing_type=sa.Relationship(), new_column_name='google_credentials')

View File

@ -0,0 +1,28 @@
"""empty message
Revision ID: e5ef5e4a807b
Revises: 1e8205594ac1
Create Date: 2020-05-28 09:01:09.268270
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e5ef5e4a807b'
down_revision = '1e8205594ac1'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('device', sa.Column('connection', sa.Boolean(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('device', 'connection')
# ### end Alembic commands ###

View File

@ -60,6 +60,7 @@ class Device(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
deviceName = db.Column(db.String(64), unique=True)
connection = db.Column(db.Boolean)
class Calendar(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)