Browse Source

* Fixed migrations

pull/10/head
Per-Arne 5 years ago
parent
commit
cbced47e99
  1. 9
      wg_dashboard_backend/migrations/versions/001_add_dns_column.py
  2. 21
      wg_dashboard_backend/migrations/versions/002_remove_server_shared_key.py
  3. 10
      wg_dashboard_backend/migrations/versions/003_create_client_shared_key.py

9
wg_dashboard_backend/migrations/versions/001_add_dns_column.py

@ -12,6 +12,9 @@ def upgrade(migrate_engine):
def downgrade(migrate_engine): def downgrade(migrate_engine):
meta = MetaData(bind=migrate_engine) try:
dns = Table('peer', meta, autoload=True) meta = MetaData(bind=migrate_engine)
dns.c.email.drop() dns = Table('peer', meta, autoload=True)
dns.c.email.drop()
except:
pass

21
wg_dashboard_backend/migrations/versions/002_remove_server_shared_key.py

@ -3,14 +3,19 @@ from migrate import *
def upgrade(migrate_engine): def upgrade(migrate_engine):
meta = MetaData(bind=migrate_engine) try:
server = Table('server', meta, autoload=True) meta = MetaData(bind=migrate_engine)
server.c.shared_key.drop() server = Table('server', meta, autoload=True)
server.c.shared_key.drop()
except:
pass
def downgrade(migrate_engine): def downgrade(migrate_engine):
meta = MetaData(bind=migrate_engine) try:
account = Table('server', meta, autoload=True) meta = MetaData(bind=migrate_engine)
shared_key = Column('shared_key', Text) account = Table('server', meta, autoload=True)
shared_key.create(account) shared_key = Column('shared_key', Text)
shared_key.create(account)
except:
pass

10
wg_dashboard_backend/migrations/versions/003_create_client_shared_key.py

@ -13,7 +13,9 @@ def upgrade(migrate_engine):
def downgrade(migrate_engine): def downgrade(migrate_engine):
meta = MetaData(bind=migrate_engine) try:
dns = Table('peer', meta, autoload=True) meta = MetaData(bind=migrate_engine)
dns.c.shared_key.drop() dns = Table('peer', meta, autoload=True)
dns.c.shared_key.drop()
except:
pass

Loading…
Cancel
Save