Skip to content

Commit

Permalink
Fixed install on enrollment and connection in the DB upgrade code
Browse files Browse the repository at this point in the history
  • Loading branch information
brian7704 committed Sep 20, 2024
1 parent 2a445ad commit 861fbf5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@

def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('data_packages', schema=None) as batch_op:
batch_op.alter_column('install_on_enrollment',
existing_type=sa.BOOLEAN(),
nullable=False)
batch_op.alter_column('install_on_connection',
existing_type=sa.BOOLEAN(),
nullable=False)

with op.batch_alter_table('device_profiles', schema=None) as batch_op:
batch_op.add_column(sa.Column('id', sa.Integer(), nullable=False))
batch_op.alter_column('preference_key',
Expand Down Expand Up @@ -55,12 +47,4 @@ def downgrade():
nullable=False)
batch_op.drop_column('id')

with op.batch_alter_table('data_packages', schema=None) as batch_op:
batch_op.alter_column('install_on_connection',
existing_type=sa.BOOLEAN(),
nullable=True)
batch_op.alter_column('install_on_enrollment',
existing_type=sa.BOOLEAN(),
nullable=True)

# ### end Alembic commands ###
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def upgrade():
sa.Column('preference_key', sa.String(), nullable=False),
sa.Column('preference_value', sa.String(), nullable=False),
sa.Column('value_class', sa.String(), nullable=False),
sa.Column('enrollment', sa.Boolean(), nullable=False),
sa.Column('connection', sa.Boolean(), nullable=False),
sa.Column('enrollment', sa.Boolean(), nullable=True),
sa.Column('connection', sa.Boolean(), nullable=True),
sa.Column('tool', sa.String(), nullable=True),
sa.Column('active', sa.Boolean(), nullable=False),
sa.Column('publish_time', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False),
Expand All @@ -45,8 +45,8 @@ def upgrade():
sa.Column('file_size', sa.Integer(), nullable=False),
sa.Column('icon', sa.BLOB(), nullable=True),
sa.Column('icon_filename', sa.String(), nullable=True),
sa.Column('install_on_enrollment', sa.Boolean(), nullable=False),
sa.Column('install_on_connection', sa.Boolean(), nullable=False),
sa.Column('install_on_enrollment', sa.Boolean(), nullable=True),
sa.Column('install_on_connection', sa.Boolean(), nullable=True),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('package_name')
)
Expand Down

0 comments on commit 861fbf5

Please sign in to comment.