"""add static origins

Revision ID: 2d747ffb9928
Revises: 431704bac57a
Create Date: 2023-05-25 14:23:30.568572

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '2d747ffb9928'
down_revision = '431704bac57a'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('static_origin',
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('storage_cloud_account_id', sa.Integer(), nullable=False),
    sa.Column('source_cloud_account_id', sa.Integer(), nullable=False),
    sa.Column('source_project', sa.String(length=255), nullable=False),
    sa.Column('auto_rotate', sa.Boolean(), nullable=False),
    sa.Column('matrix_homeserver', sa.String(length=255), nullable=True),
    sa.Column('keanu_convene_path', sa.String(length=255), nullable=True),
    sa.Column('keanu_convene_config', sa.String(), nullable=True),
    sa.Column('clean_insights_backend', sa.String(length=255), nullable=True),
    sa.Column('origin_domain_name', sa.String(length=255), nullable=True),
    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.ForeignKeyConstraint(['group_id'], ['group.id'], name=op.f('fk_static_origin_group_id_group')),
    sa.ForeignKeyConstraint(['source_cloud_account_id'], ['cloud_account.id'], name=op.f('fk_static_origin_source_cloud_account_id_cloud_account')),
    sa.ForeignKeyConstraint(['storage_cloud_account_id'], ['cloud_account.id'], name=op.f('fk_static_origin_storage_cloud_account_id_cloud_account')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_static_origin'))
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('static_origin')
    # ### end Alembic commands ###
