Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
DB: migration b047 adds start_date (DateTime nullable) + index to campaigns. Backend: - Campaign model: start_date field - CampaignCreate/Update schemas: accept start_date (ISO string) - CRUD service: persist + serialize start_date in both serializers - Activation endpoint: blocks manual activation if start_date is in the future (campaign will auto-activate via scheduler) - Scheduler: new hourly job _run_scheduled_campaign_activation — finds draft campaigns with start_date <= now, activates them, creates Jira tickets, notifies red_tech team - Jira: campaign + test tickets now include JIRA_START_DATE_FIELD (configurable, default customfield_10015). Campaign uses start_date if set, else created_at. Tests inherit campaign start_date. - config.py: JIRA_START_DATE_FIELD setting Frontend: - Campaign type: start_date field on Campaign + CampaignSummary - CampaignCreatePayload: start_date optional field - Create form: date picker with min=today, warning message explaining behavior - Campaign detail header: start_date badge showing days remaining or started date Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
574 B
Python
28 lines
574 B
Python
"""Add start_date to campaigns.
|
|
|
|
Revision ID: b047
|
|
Revises: b046
|
|
Create Date: 2026-06-03
|
|
"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision = "b047"
|
|
down_revision = "b046"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"campaigns",
|
|
sa.Column("start_date", sa.DateTime(), nullable=True),
|
|
)
|
|
op.create_index("ix_campaigns_start_date", "campaigns", ["start_date"])
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index("ix_campaigns_start_date", table_name="campaigns")
|
|
op.drop_column("campaigns", "start_date")
|