diff --git a/openapi/__init__.py b/openapi/__init__.py index 0e40a57..0f4c485 100644 --- a/openapi/__init__.py +++ b/openapi/__init__.py @@ -1,4 +1,4 @@ """Minimal OpenAPI asynchronous server application """ -__version__ = '0.5.1' +__version__ = '0.5.2' diff --git a/openapi/db/commands.py b/openapi/db/commands.py index c8d6a7e..4c2f158 100644 --- a/openapi/db/commands.py +++ b/openapi/db/commands.py @@ -69,10 +69,9 @@ def upgrade(ctx, revision, drop_tables): """ if drop_tables: app = ctx.obj['app'] - metadata = app['metadata'] engine = app['store'] - metadata.reflect(engine) - metadata.drop_all(engine) + engine.execute("DROP SCHEMA IF EXISTS public CASCADE") + engine.execute("CREATE SCHEMA IF NOT EXISTS public") click.echo("tables dropped") migration(ctx).upgrade(revision) click.echo("upgraded sucessfuly")