diff --git a/wg_dashboard_backend/migrations/versions/011_alter_server_ipv6_subnet_nullable.py b/wg_dashboard_backend/migrations/versions/011_alter_server_ipv6_subnet_nullable.py new file mode 100644 index 0000000..ff12b72 --- /dev/null +++ b/wg_dashboard_backend/migrations/versions/011_alter_server_ipv6_subnet_nullable.py @@ -0,0 +1,20 @@ +from sqlalchemy import * +from migrate import * + + +def upgrade(migrate_engine): + try: + meta = MetaData(bind=migrate_engine) + server = Table('server', meta, autoload=True) + server.c.v6_subnet.alter(nullable=True) + except: + pass + + +def downgrade(migrate_engine): + try: + meta = MetaData(bind=migrate_engine) + server = Table('server', meta, autoload=True) + server.c.v6_subnet.alter(nullable=False) + except: + pass