Do proper downgrades to reset the database
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
Somehow the table for the alembic migrations was not dropped before, leading to an inconsistent state
This commit is contained in:
@@ -31,7 +31,8 @@ class ApiTest(unittest.TestCase):
|
||||
|
||||
def tearDown(self):
|
||||
with app.app_context():
|
||||
db.drop_all()
|
||||
config = migrate.get_config()
|
||||
command.downgrade(config, "base")
|
||||
db.engine.dispose()
|
||||
|
||||
def login(self, username, password):
|
||||
|
||||
@@ -22,3 +22,10 @@ def upgrade():
|
||||
existing_type=sa.VARCHAR(length=25),
|
||||
type_=sa.String(length=50),
|
||||
existing_nullable=False)
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table("skill") as batch_op:
|
||||
batch_op.alter_column('name',
|
||||
existing_type=sa.String(length=50),
|
||||
type_=sa.VARCHAR(length=25),
|
||||
existing_nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user