Browse Source

forgot the linter

pull/378/head
squeaky otter 7 months ago
parent
commit
50aac7a39c
Signed by: dashie GPG Key ID: C2D57B325840B755
  1. 1
      .gitignore
  2. 122
      api/migrations/versions/67_7df5c87e5fef_.py

1
.gitignore

@ -34,3 +34,4 @@ front/locales/en_US/LC_MESSAGES/app.po
.env
/data
/api/celerybeat-schedule
/venv

122
api/migrations/versions/67_7df5c87e5fef_.py

@ -7,79 +7,87 @@ Create Date: 2021-02-23 19:07:51.420492
"""
# revision identifiers, used by Alembic.
revision = '7df5c87e5fef'
down_revision = 'f537ac7a67d6'
revision = "7df5c87e5fef"
down_revision = "f537ac7a67d6"
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
import uuid # noqa: E402
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('oauth2_client', sa.Column('client_id_issued_at', sa.Integer(), nullable=False))
op.add_column('oauth2_client', sa.Column('client_metadata', sa.Text(), nullable=True))
op.add_column('oauth2_client', sa.Column('client_secret_expires_at', sa.Integer(), nullable=False))
op.drop_column('oauth2_client', 'policy_uri')
op.drop_column('oauth2_client', 'tos_uri')
op.drop_column('oauth2_client', 'client_name')
op.drop_column('oauth2_client', 'response_type')
op.drop_column('oauth2_client', 'expires_at')
op.drop_column('oauth2_client', 'software_id')
op.drop_column('oauth2_client', 'redirect_uri')
op.drop_column('oauth2_client', 'software_version')
op.drop_column('oauth2_client', 'client_uri')
op.drop_column('oauth2_client', 'contact')
op.drop_column('oauth2_client', 'i18n_metadata')
op.drop_column('oauth2_client', 'logo_uri')
op.drop_column('oauth2_client', 'grant_type')
op.drop_column('oauth2_client', 'jwks_uri')
op.drop_column('oauth2_client', 'issued_at')
op.drop_column('oauth2_client', 'scope')
op.drop_column('oauth2_client', 'jwks_text')
op.drop_column('oauth2_client', 'token_endpoint_auth_method')
op.add_column('oauth2_code', sa.Column('code_challenge', sa.Text(), nullable=True))
op.add_column('oauth2_code', sa.Column('code_challenge_method', sa.String(length=48), nullable=True))
op.add_column('oauth2_code', sa.Column('nonce', sa.Text(), nullable=True))
op.add_column("oauth2_client", sa.Column("client_id_issued_at", sa.Integer(), nullable=False))
op.add_column("oauth2_client", sa.Column("client_metadata", sa.Text(), nullable=True))
op.add_column("oauth2_client", sa.Column("client_secret_expires_at", sa.Integer(), nullable=False))
op.drop_column("oauth2_client", "policy_uri")
op.drop_column("oauth2_client", "tos_uri")
op.drop_column("oauth2_client", "client_name")
op.drop_column("oauth2_client", "response_type")
op.drop_column("oauth2_client", "expires_at")
op.drop_column("oauth2_client", "software_id")
op.drop_column("oauth2_client", "redirect_uri")
op.drop_column("oauth2_client", "software_version")
op.drop_column("oauth2_client", "client_uri")
op.drop_column("oauth2_client", "contact")
op.drop_column("oauth2_client", "i18n_metadata")
op.drop_column("oauth2_client", "logo_uri")
op.drop_column("oauth2_client", "grant_type")
op.drop_column("oauth2_client", "jwks_uri")
op.drop_column("oauth2_client", "issued_at")
op.drop_column("oauth2_client", "scope")
op.drop_column("oauth2_client", "jwks_text")
op.drop_column("oauth2_client", "token_endpoint_auth_method")
op.add_column("oauth2_code", sa.Column("code_challenge", sa.Text(), nullable=True))
op.add_column("oauth2_code", sa.Column("code_challenge_method", sa.String(length=48), nullable=True))
op.add_column("oauth2_code", sa.Column("nonce", sa.Text(), nullable=True))
# fs_uniquifier
op.add_column('user', sa.Column('fs_uniquifier', sa.String(length=255), nullable=True))
user_table = sa.Table('user', sa.MetaData(), sa.Column('id', sa.Integer, primary_key=True), sa.Column('fs_uniquifier', sa.String))
op.add_column("user", sa.Column("fs_uniquifier", sa.String(length=255), nullable=True))
user_table = sa.Table(
"user", sa.MetaData(), sa.Column("id", sa.Integer, primary_key=True), sa.Column("fs_uniquifier", sa.String)
)
conn = op.get_bind()
for row in conn.execute(sa.select([user_table.c.id])):
conn.execute(user_table.update().values(fs_uniquifier=uuid.uuid4().hex).where(user_table.c.id == row['id']))
op.alter_column('user', 'fs_uniquifier', nullable=False)
conn.execute(user_table.update().values(fs_uniquifier=uuid.uuid4().hex).where(user_table.c.id == row["id"]))
op.alter_column("user", "fs_uniquifier", nullable=False)
op.create_unique_constraint(None, 'user', ['fs_uniquifier'])
op.create_unique_constraint(None, "user", ["fs_uniquifier"])
# end fs_uniquifier
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'user', type_='unique')
op.drop_column('user', 'fs_uniquifier')
op.drop_column('oauth2_code', 'nonce')
op.drop_column('oauth2_code', 'code_challenge_method')
op.drop_column('oauth2_code', 'code_challenge')
op.add_column('oauth2_client', sa.Column('token_endpoint_auth_method', sa.VARCHAR(length=48), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('jwks_text', sa.TEXT(), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('scope', sa.TEXT(), autoincrement=False, nullable=False))
op.add_column('oauth2_client', sa.Column('issued_at', sa.INTEGER(), autoincrement=False, nullable=False))
op.add_column('oauth2_client', sa.Column('jwks_uri', sa.TEXT(), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('grant_type', sa.TEXT(), autoincrement=False, nullable=False))
op.add_column('oauth2_client', sa.Column('logo_uri', sa.TEXT(), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('i18n_metadata', sa.TEXT(), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('contact', sa.TEXT(), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('client_uri', sa.TEXT(), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('software_version', sa.VARCHAR(length=48), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('redirect_uri', sa.TEXT(), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('software_id', sa.VARCHAR(length=36), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('expires_at', sa.INTEGER(), autoincrement=False, nullable=False))
op.add_column('oauth2_client', sa.Column('response_type', sa.TEXT(), autoincrement=False, nullable=False))
op.add_column('oauth2_client', sa.Column('client_name', sa.VARCHAR(length=100), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('tos_uri', sa.TEXT(), autoincrement=False, nullable=True))
op.add_column('oauth2_client', sa.Column('policy_uri', sa.TEXT(), autoincrement=False, nullable=True))
op.drop_column('oauth2_client', 'client_secret_expires_at')
op.drop_column('oauth2_client', 'client_metadata')
op.drop_column('oauth2_client', 'client_id_issued_at')
op.drop_constraint(None, "user", type_="unique")
op.drop_column("user", "fs_uniquifier")
op.drop_column("oauth2_code", "nonce")
op.drop_column("oauth2_code", "code_challenge_method")
op.drop_column("oauth2_code", "code_challenge")
op.add_column(
"oauth2_client",
sa.Column("token_endpoint_auth_method", sa.VARCHAR(length=48), autoincrement=False, nullable=True),
)
op.add_column("oauth2_client", sa.Column("jwks_text", sa.TEXT(), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("scope", sa.TEXT(), autoincrement=False, nullable=False))
op.add_column("oauth2_client", sa.Column("issued_at", sa.INTEGER(), autoincrement=False, nullable=False))
op.add_column("oauth2_client", sa.Column("jwks_uri", sa.TEXT(), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("grant_type", sa.TEXT(), autoincrement=False, nullable=False))
op.add_column("oauth2_client", sa.Column("logo_uri", sa.TEXT(), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("i18n_metadata", sa.TEXT(), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("contact", sa.TEXT(), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("client_uri", sa.TEXT(), autoincrement=False, nullable=True))
op.add_column(
"oauth2_client", sa.Column("software_version", sa.VARCHAR(length=48), autoincrement=False, nullable=True)
)
op.add_column("oauth2_client", sa.Column("redirect_uri", sa.TEXT(), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("software_id", sa.VARCHAR(length=36), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("expires_at", sa.INTEGER(), autoincrement=False, nullable=False))
op.add_column("oauth2_client", sa.Column("response_type", sa.TEXT(), autoincrement=False, nullable=False))
op.add_column("oauth2_client", sa.Column("client_name", sa.VARCHAR(length=100), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("tos_uri", sa.TEXT(), autoincrement=False, nullable=True))
op.add_column("oauth2_client", sa.Column("policy_uri", sa.TEXT(), autoincrement=False, nullable=True))
op.drop_column("oauth2_client", "client_secret_expires_at")
op.drop_column("oauth2_client", "client_metadata")
op.drop_column("oauth2_client", "client_id_issued_at")
# ### end Alembic commands ###
Loading…
Cancel
Save