onions: add onion service management
This commit is contained in:
parent
9987c996c9
commit
8efb7d9186
11 changed files with 327 additions and 2 deletions
54
migrations/versions/c3d6e95caa79_onion_services.py
Normal file
54
migrations/versions/c3d6e95caa79_onion_services.py
Normal file
|
@ -0,0 +1,54 @@
|
|||
"""onion services
|
||||
|
||||
Revision ID: c3d6e95caa79
|
||||
Revises: 56fbcfa1138c
|
||||
Create Date: 2022-05-04 15:03:52.406674
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c3d6e95caa79'
|
||||
down_revision = '56fbcfa1138c'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('eotk',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('added', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated', sa.DateTime(), nullable=False),
|
||||
sa.Column('deprecated', sa.DateTime(), nullable=True),
|
||||
sa.Column('deprecation_reason', sa.String(), nullable=True),
|
||||
sa.Column('destroyed', sa.DateTime(), nullable=True),
|
||||
sa.Column('group_id', sa.Integer(), nullable=False),
|
||||
sa.Column('instance_id', sa.String(length=100), nullable=True),
|
||||
sa.Column('region', sa.String(length=20), nullable=False),
|
||||
sa.ForeignKeyConstraint(['group_id'], ['group.id'], name=op.f('fk_eotk_group_id_group')),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_eotk'))
|
||||
)
|
||||
op.create_table('onion',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('description', sa.String(length=255), nullable=False),
|
||||
sa.Column('added', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated', sa.DateTime(), nullable=False),
|
||||
sa.Column('destroyed', sa.DateTime(), nullable=True),
|
||||
sa.Column('group_id', sa.Integer(), nullable=False),
|
||||
sa.Column('domain_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('onion_name', sa.String(length=56), nullable=False),
|
||||
sa.ForeignKeyConstraint(['group_id'], ['group.id'], name=op.f('fk_onion_group_id_group')),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_onion')),
|
||||
sa.UniqueConstraint('onion_name', name=op.f('uq_onion_onion_name'))
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('onion')
|
||||
op.drop_table('eotk')
|
||||
# ### end Alembic commands ###
|
Loading…
Add table
Add a link
Reference in a new issue