chore: run black on migrations file

This commit is contained in:
dogeystamp 2023-07-18 13:28:52 -04:00
parent 7f5021c568
commit 472b17caca
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38

View File

@ -11,7 +11,7 @@ import sqlalchemy_utils
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = 'e8d2a7570f70' revision = "e8d2a7570f70"
down_revision = None down_revision = None
branch_labels = None branch_labels = None
depends_on = None depends_on = None
@ -19,64 +19,79 @@ depends_on = None
def upgrade(): def upgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.create_table('blacklist_tokens', op.create_table(
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), "blacklist_tokens",
sa.Column('token', sa.String(length=500), nullable=False), sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column('expires', sa.DateTime(), nullable=False), sa.Column("token", sa.String(length=500), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_blacklist_tokens')), sa.Column("expires", sa.DateTime(), nullable=False),
sa.UniqueConstraint('token', name=op.f('uq_blacklist_tokens_token')) sa.PrimaryKeyConstraint("id", name=op.f("pk_blacklist_tokens")),
sa.UniqueConstraint("token", name=op.f("uq_blacklist_tokens_token")),
) )
op.create_table('server_settings', op.create_table(
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), "server_settings",
sa.Column('default_permissions_number', sa.BigInteger(), nullable=False), sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_server_settings')) sa.Column("default_permissions_number", sa.BigInteger(), nullable=False),
sa.PrimaryKeyConstraint("id", name=op.f("pk_server_settings")),
) )
op.create_table('users', op.create_table(
sa.Column('username', sa.String(length=255), nullable=False), "users",
sa.Column('password_hash', sa.String(length=255), nullable=False), sa.Column("username", sa.String(length=255), nullable=False),
sa.Column('register_date', sa.DateTime(), nullable=False), sa.Column("password_hash", sa.String(length=255), nullable=False),
sa.Column('permissions_number', sa.BigInteger(), nullable=False), sa.Column("register_date", sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('username', name=op.f('pk_users')), sa.Column("permissions_number", sa.BigInteger(), nullable=False),
sa.UniqueConstraint('username', name=op.f('uq_users_username')) sa.PrimaryKeyConstraint("username", name=op.f("pk_users")),
sa.UniqueConstraint("username", name=op.f("uq_users_username")),
) )
op.create_table('shares', op.create_table(
sa.Column('share_id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=False), "shares",
sa.Column('owner_name', sa.String(), nullable=True), sa.Column("share_id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
sa.Column('initialized', sa.Boolean(), nullable=False), sa.Column("owner_name", sa.String(), nullable=True),
sa.Column('locked', sa.Boolean(), nullable=False), sa.Column("initialized", sa.Boolean(), nullable=False),
sa.Column('create_date', sa.DateTime(), nullable=False), sa.Column("locked", sa.Boolean(), nullable=False),
sa.Column('file_name', sa.String(), nullable=False), sa.Column("create_date", sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['owner_name'], ['users.username'], name=op.f('fk_shares_owner_name_users')), sa.Column("file_name", sa.String(), nullable=False),
sa.PrimaryKeyConstraint('share_id', name=op.f('pk_shares')) sa.ForeignKeyConstraint(
["owner_name"], ["users.username"], name=op.f("fk_shares_owner_name_users")
),
sa.PrimaryKeyConstraint("share_id", name=op.f("pk_shares")),
) )
op.create_table('uploads', op.create_table(
sa.Column('upload_id', sa.String(), nullable=False), "uploads",
sa.Column('share_id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=True), sa.Column("upload_id", sa.String(), nullable=False),
sa.Column('create_date', sa.DateTime(), nullable=False), sa.Column("share_id", sqlalchemy_utils.types.uuid.UUIDType(), nullable=True),
sa.Column('total_chunks', sa.Integer(), nullable=False), sa.Column("create_date", sa.DateTime(), nullable=False),
sa.Column('recv_chunks', sa.Integer(), nullable=False), sa.Column("total_chunks", sa.Integer(), nullable=False),
sa.Column('completed', sa.Boolean(), nullable=False), sa.Column("recv_chunks", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['share_id'], ['shares.share_id'], name=op.f('fk_uploads_share_id_shares')), sa.Column("completed", sa.Boolean(), nullable=False),
sa.PrimaryKeyConstraint('upload_id', name=op.f('pk_uploads')) sa.ForeignKeyConstraint(
["share_id"], ["shares.share_id"], name=op.f("fk_uploads_share_id_shares")
),
sa.PrimaryKeyConstraint("upload_id", name=op.f("pk_uploads")),
) )
op.create_table('chunks', op.create_table(
sa.Column('chunk_id', sa.Integer(), autoincrement=True, nullable=False), "chunks",
sa.Column('create_date', sa.DateTime(), nullable=False), sa.Column("chunk_id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column('index', sa.Integer(), nullable=False), sa.Column("create_date", sa.DateTime(), nullable=False),
sa.Column('upload_id', sa.String(), nullable=True), sa.Column("index", sa.Integer(), nullable=False),
sa.Column('filename', sa.String(), nullable=False), sa.Column("upload_id", sa.String(), nullable=True),
sa.ForeignKeyConstraint(['upload_id'], ['uploads.upload_id'], name=op.f('fk_chunks_upload_id_uploads'), ondelete='CASCADE'), sa.Column("filename", sa.String(), nullable=False),
sa.PrimaryKeyConstraint('chunk_id', name=op.f('pk_chunks')) sa.ForeignKeyConstraint(
["upload_id"],
["uploads.upload_id"],
name=op.f("fk_chunks_upload_id_uploads"),
ondelete="CASCADE",
),
sa.PrimaryKeyConstraint("chunk_id", name=op.f("pk_chunks")),
) )
# ### end Alembic commands ### # ### end Alembic commands ###
def downgrade(): def downgrade():
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
op.drop_table('chunks') op.drop_table("chunks")
op.drop_table('uploads') op.drop_table("uploads")
op.drop_table('shares') op.drop_table("shares")
op.drop_table('users') op.drop_table("users")
op.drop_table('server_settings') op.drop_table("server_settings")
op.drop_table('blacklist_tokens') op.drop_table("blacklist_tokens")
# ### end Alembic commands ### # ### end Alembic commands ###