0023_compliance_fields.py
python
sha256:a10adeeb7a0169cb9900f9806ed7a973047258abb6283724fe55e8eb68ff3f0a
init: musehub initial commit
Human
171 days ago
| 1 | """Add compliance fields: training_opt_out on repos, tos_accepted_at/tos_version on identities. |
| 2 | |
| 3 | Revision ID: 0023 |
| 4 | Revises: 0022 |
| 5 | """ |
| 6 | from __future__ import annotations |
| 7 | |
| 8 | import sqlalchemy as sa |
| 9 | from alembic import op |
| 10 | |
| 11 | revision = "0023" |
| 12 | down_revision = "0022" |
| 13 | branch_labels = None |
| 14 | depends_on = None |
| 15 | |
| 16 | |
| 17 | def upgrade() -> None: |
| 18 | # training opt-out flag on repos |
| 19 | op.add_column( |
| 20 | "musehub_repos", |
| 21 | sa.Column("training_opt_out", sa.Boolean(), nullable=False, server_default="false"), |
| 22 | ) |
| 23 | |
| 24 | # ToS acceptance record on identities |
| 25 | op.add_column( |
| 26 | "musehub_identities", |
| 27 | sa.Column("tos_accepted_at", sa.DateTime(timezone=True), nullable=True), |
| 28 | ) |
| 29 | op.add_column( |
| 30 | "musehub_identities", |
| 31 | sa.Column("tos_version", sa.String(16), nullable=True), |
| 32 | ) |
| 33 | |
| 34 | |
| 35 | def downgrade() -> None: |
| 36 | op.drop_column("musehub_repos", "training_opt_out") |
| 37 | op.drop_column("musehub_identities", "tos_version") |
| 38 | op.drop_column("musehub_identities", "tos_accepted_at") |
File History
1 commit
sha256:a10adeeb7a0169cb9900f9806ed7a973047258abb6283724fe55e8eb68ff3f0a
init: musehub initial commit
Human
171 days ago