chore(quality): apply ruff autofixes and formatting (29 fixes, 41 files reformatted)

This commit is contained in:
Agent Zero
2026-06-10 21:31:41 +00:00
parent 054d4041e6
commit 7c12a96cdc
43 changed files with 1096 additions and 524 deletions
@@ -5,6 +5,7 @@ Revises: f90ee7806a25
Create Date: 2026-05-31 10:35:56.717393
"""
from typing import Sequence, Union
from alembic import op
@@ -12,33 +13,36 @@ import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '714cc11a59c4'
down_revision: Union[str, None] = 'f90ee7806a25'
revision: str = "714cc11a59c4"
down_revision: Union[str, None] = "f90ee7806a25"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('roles',
sa.Column('id', sa.String(length=36), nullable=False),
sa.Column('account_id', sa.String(length=36), nullable=False),
sa.Column('name', sa.String(length=100), nullable=False),
sa.Column('description', sa.String(length=500), nullable=True),
sa.Column('permissions', sa.JSON(), nullable=False),
sa.ForeignKeyConstraint(['account_id'], ['accounts.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id')
op.create_table(
"roles",
sa.Column("id", sa.String(length=36), nullable=False),
sa.Column("account_id", sa.String(length=36), nullable=False),
sa.Column("name", sa.String(length=100), nullable=False),
sa.Column("description", sa.String(length=500), nullable=True),
sa.Column("permissions", sa.JSON(), nullable=False),
sa.ForeignKeyConstraint(["account_id"], ["accounts.id"], ondelete="CASCADE"),
sa.PrimaryKeyConstraint("id"),
)
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.create_foreign_key('fk_users_role_id_roles', 'roles', ['role_id'], ['id'], ondelete='SET NULL')
with op.batch_alter_table("users", schema=None) as batch_op:
batch_op.create_foreign_key(
"fk_users_role_id_roles", "roles", ["role_id"], ["id"], ondelete="SET NULL"
)
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_constraint(None, type_='foreignkey')
with op.batch_alter_table("users", schema=None) as batch_op:
batch_op.drop_constraint(None, type_="foreignkey")
op.drop_table('roles')
op.drop_table("roles")
# ### end Alembic commands ###