"""Add server_default now() to musehub_commits.created_at. The ORM model declared server_default=sa.func.now() but it was never applied to the DB, causing NOT NULL violations when the push handler inserts a commit without supplying created_at explicitly. Revision ID: 0029 Revises: 0028 """ from __future__ import annotations from alembic import op import sqlalchemy as sa revision = "0029" down_revision = "0028" branch_labels = None depends_on = None def upgrade() -> None: op.get_bind().execute(sa.text( "ALTER TABLE musehub_commits ALTER COLUMN created_at SET DEFAULT now()" )) def downgrade() -> None: op.get_bind().execute(sa.text( "ALTER TABLE musehub_commits ALTER COLUMN created_at DROP DEFAULT" ))