gabriel / musehub public
0029_musehub_commits_created_at_server_default.py python
31 lines 749 B
Raw
sha256:42bc547653458bb15e283222247af0237872d9cb5c2a72ad2ca1c111ed2c0ca4 feat(9A-4 F7): overseer-run provenance enrichment API for S… Human minor ⚠ breaking 13 days ago
1 """Add server_default now() to musehub_commits.created_at.
2
3 The ORM model declared server_default=sa.func.now() but it was never applied
4 to the DB, causing NOT NULL violations when the push handler inserts a commit
5 without supplying created_at explicitly.
6
7 Revision ID: 0029
8 Revises: 0028
9 """
10 from __future__ import annotations
11
12 from alembic import op
13 import sqlalchemy as sa
14
15
16 revision = "0029"
17 down_revision = "0028"
18 branch_labels = None
19 depends_on = None
20
21
22 def upgrade() -> None:
23 op.get_bind().execute(sa.text(
24 "ALTER TABLE musehub_commits ALTER COLUMN created_at SET DEFAULT now()"
25 ))
26
27
28 def downgrade() -> None:
29 op.get_bind().execute(sa.text(
30 "ALTER TABLE musehub_commits ALTER COLUMN created_at DROP DEFAULT"
31 ))
File History 1 commit
sha256:e5530c6b8996b96fc4030d6d30fe4f688926bdda2875fb01d303092b11513bd2 fix(9A-4 F7): env alias + staging secrets for overseer prov… Human minor 10 days ago