refactor(db): increase account_keyring_table.key_value size
This commit is contained in:
parent
9c9201f130
commit
3d8ee4835d
38
api/api/db/alembic/versions/93106fbe7d83_.py
Normal file
38
api/api/db/alembic/versions/93106fbe7d83_.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: 93106fbe7d83
|
||||||
|
Revises: f1b06efacec0
|
||||||
|
Create Date: 2025-06-26 16:36:02.270706
|
||||||
|
|
||||||
|
"""
|
||||||
|
from typing import Sequence, Union
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
from sqlalchemy.dialects import mysql
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision: str = '93106fbe7d83'
|
||||||
|
down_revision: Union[str, None] = 'f1b06efacec0'
|
||||||
|
branch_labels: Union[str, Sequence[str], None] = None
|
||||||
|
depends_on: Union[str, Sequence[str], None] = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade() -> None:
|
||||||
|
"""Upgrade schema."""
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.alter_column('account_keyring', 'key_value',
|
||||||
|
existing_type=mysql.VARCHAR(length=255),
|
||||||
|
type_=sa.String(length=512),
|
||||||
|
existing_nullable=False)
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade() -> None:
|
||||||
|
"""Downgrade schema."""
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.alter_column('account_keyring', 'key_value',
|
||||||
|
existing_type=sa.String(length=512),
|
||||||
|
type_=mysql.VARCHAR(length=255),
|
||||||
|
existing_nullable=False)
|
||||||
|
# ### end Alembic commands ###
|
@ -60,7 +60,7 @@ account_keyring_table = Table(
|
|||||||
Column("owner_id", UnsignedInt, ForeignKey("account.id"), primary_key=True, nullable=False),
|
Column("owner_id", UnsignedInt, ForeignKey("account.id"), primary_key=True, nullable=False),
|
||||||
Column("key_type", SQLAEnum(KeyType), primary_key=True, nullable=False),
|
Column("key_type", SQLAEnum(KeyType), primary_key=True, nullable=False),
|
||||||
Column("key_id", String(40), primary_key=True, default=None),
|
Column("key_id", String(40), primary_key=True, default=None),
|
||||||
Column("key_value", String(255), nullable=False),
|
Column("key_value", String(512), nullable=False),
|
||||||
Column("created_at", DateTime(timezone=True), server_default=func.now()),
|
Column("created_at", DateTime(timezone=True), server_default=func.now()),
|
||||||
Column("expiry", DateTime(timezone=True), nullable=True),
|
Column("expiry", DateTime(timezone=True), nullable=True),
|
||||||
Column("status", SQLAEnum(KeyStatus), nullable=False),
|
Column("status", SQLAEnum(KeyStatus), nullable=False),
|
||||||
|
Loading…
Reference in New Issue
Block a user