feat: increase character limit for who_processed and capture_user fields in InvoiceHeader to 100

This commit is contained in:
2026-04-30 09:22:44 -05:00
parent 6349bef45d
commit f225731625
3 changed files with 57 additions and 4 deletions

View File

@@ -0,0 +1,53 @@
"""increase invoice_header who_processed and capture_user to 100 chars
Revision ID: g1b2c3d4e5f6
Revises: f7a8b9c0d1e2
Create Date: 2026-04-30 00:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'g1b2c3d4e5f6'
down_revision = 'f7a8b9c0d1e2'
branch_labels = None
depends_on = None
def upgrade() -> None:
op.alter_column(
'invoice_header',
'who_processed',
existing_type=sa.String(length=20),
type_=sa.String(length=100),
existing_nullable=True,
schema='a76',
)
op.alter_column(
'invoice_header',
'capture_user',
existing_type=sa.String(length=20),
type_=sa.String(length=100),
existing_nullable=True,
schema='a76',
)
def downgrade() -> None:
op.alter_column(
'invoice_header',
'capture_user',
existing_type=sa.String(length=100),
type_=sa.String(length=20),
existing_nullable=True,
schema='a76',
)
op.alter_column(
'invoice_header',
'who_processed',
existing_type=sa.String(length=100),
type_=sa.String(length=20),
existing_nullable=True,
schema='a76',
)

View File

@@ -124,10 +124,10 @@ class InvoiceHeader(Base, TenantScopedMixin, TimestampMixin):
TIMESTAMP(timezone=False)
) # FECHAACTUALIZACION / FECHAACTUAL
who_processed: Mapped[Optional[str]] = mapped_column(
String(20)
String(100)
) # USUARIOACT / Quien actualizó
capture_user: Mapped[Optional[str]] = mapped_column(
String(20)
String(100)
) # USUARIOCAP / Usuario que capturó
traffic_light_status: Mapped[Optional[str]] = mapped_column(

View File

@@ -73,8 +73,8 @@ class InvoiceHeaderBase(BaseModel):
return InvoiceStatus.PROCESSED.value
return v
processed_date: Optional[datetime] = Field(None, description="Update date")
who_processed: Optional[str] = Field(None, max_length=20, description="Who processed")
capture_user: Optional[str] = Field(None, max_length=20, description="Capture user")
who_processed: Optional[str] = Field(None, max_length=100, description="Who processed")
capture_user: Optional[str] = Field(None, max_length=100, description="Capture user")
traffic_light_status: Optional[str] = Field(
None, max_length=50, description="Traffic light status"
)