Settings column and now-playing state table (phase 4, step 1)
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 13s
CI / federation-interop (push) Successful in 1m9s
CI / test (push) Successful in 3m5s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
CI / validate-monitoring (push) Successful in 7s
CI / lint (push) Successful in 13s
CI / federation-interop (push) Successful in 1m9s
CI / test (push) Successful in 3m5s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 6s
federation_settings gains now_playing_mode (off/profile/posts, default off), validated in sharing.update() the same way visibility is. New federation_now_playing table: one row per user, tracking what we've last told the fediverse (profile_key/profile_updated_at, post_key/post_posted_at) - separate from core's now_playing table, which is what's actually playing right now. Verified the migration both ways against the local dev database: full downgrade to base and back up to heads on both branches, not just a single-step round trip. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
1 parent
7d86bad929
commit
cb8f9c997e
4 files changed
+80
-6
No files matched your search
@@ -0,0 +1,42 @@
|
||||
"""now playing
|
||||
|
||||
Revision ID: 2533b727da79
|
||||
Revises: 0b81b61c932a
|
||||
Create Date: 2026-09-26 16:54:40.320486
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2533b727da79'
|
||||
down_revision = '0b81b61c932a'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('federation_now_playing',
|
||||
sa.Column('user_id', sa.Integer(), nullable=False),
|
||||
sa.Column('profile_key', sa.String(length=512), nullable=True),
|
||||
sa.Column('profile_updated_at', sa.DateTime(timezone=True), nullable=True),
|
||||
sa.Column('post_key', sa.String(length=512), nullable=True),
|
||||
sa.Column('post_posted_at', sa.DateTime(timezone=True), nullable=True),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('user_id')
|
||||
)
|
||||
with op.batch_alter_table('federation_settings', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('now_playing_mode', sa.String(length=16), nullable=False, server_default='off'))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('federation_settings', schema=None) as batch_op:
|
||||
batch_op.drop_column('now_playing_mode')
|
||||
|
||||
op.drop_table('federation_now_playing')
|
||||
# ### end Alembic commands ###
|
||||
Reference in new issue
Block a user