From 3de1ed62cae299ada9c6ad067df3415927aefe2f Mon Sep 17 00:00:00 2001 From: Per-Arne Andersen Date: Wed, 30 Dec 2020 22:10:13 +0100 Subject: [PATCH] * Added missing keep_alive for peer (Migration) --- .../versions/010_create_keep_alive_peer.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 wg_dashboard_backend/migrations/versions/010_create_keep_alive_peer.py diff --git a/wg_dashboard_backend/migrations/versions/010_create_keep_alive_peer.py b/wg_dashboard_backend/migrations/versions/010_create_keep_alive_peer.py new file mode 100644 index 0000000..6431f5f --- /dev/null +++ b/wg_dashboard_backend/migrations/versions/010_create_keep_alive_peer.py @@ -0,0 +1,21 @@ +from sqlalchemy import * +from migrate import * + + +def upgrade(migrate_engine): + try: + meta = MetaData(bind=migrate_engine) + peer = Table('peer', meta, autoload=True) + keep_alive = Column('keep_alive', Integer) + keep_alive.create(peer) + except: + pass + + +def downgrade(migrate_engine): + try: + meta = MetaData(bind=migrate_engine) + peer = Table('peer', meta, autoload=True) + peer.c.keep_alive.drop() + except: + pass