aboutsummaryrefslogtreecommitdiff
path: root/migrations/versions/4acd1ace5eb6_.py
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/versions/4acd1ace5eb6_.py')
-rw-r--r--migrations/versions/4acd1ace5eb6_.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/migrations/versions/4acd1ace5eb6_.py b/migrations/versions/4acd1ace5eb6_.py
new file mode 100644
index 0000000..da39eb2
--- /dev/null
+++ b/migrations/versions/4acd1ace5eb6_.py
@@ -0,0 +1,44 @@
+"""empty message
+
+Revision ID: 4acd1ace5eb6
+Revises: 946e687d2d42
+Create Date: 2022-09-21 10:20:39.896514
+
+"""
+from alembic import op
+import sqlalchemy as sa
+from sqlalchemy.dialects import postgresql
+
+# revision identifiers, used by Alembic.
+revision = '4acd1ace5eb6'
+down_revision = '946e687d2d42'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.create_table('network',
+ sa.Column('id', sa.String(), nullable=False),
+ sa.Column('subnet', postgresql.CIDR(), nullable=False),
+ sa.Column('description', sa.String(), nullable=True),
+ sa.PrimaryKeyConstraint('id')
+ )
+ op.create_table('peer',
+ sa.Column('id', sa.String(), nullable=False),
+ sa.Column('addr', postgresql.CIDR(), nullable=False),
+ sa.Column('public_key', sa.String(), nullable=False),
+ sa.PrimaryKeyConstraint('id')
+ )
+ op.drop_constraint('user_fs_uniquifier_key', 'user', type_='unique')
+ op.drop_column('user', 'fs_uniquifier')
+ # ### end Alembic commands ###
+
+
+def downgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.add_column('user', sa.Column('fs_uniquifier', sa.VARCHAR(), autoincrement=False, nullable=False))
+ op.create_unique_constraint('user_fs_uniquifier_key', 'user', ['fs_uniquifier'])
+ op.drop_table('peer')
+ op.drop_table('network')
+ # ### end Alembic commands ###