Combines shared, blog, market, cart, events, federation, and account into a single repository. Eliminates submodule sync, sibling model copying at build time, and per-app CI orchestration. Changes: - Remove per-app .git, .gitmodules, .gitea, submodule shared/ dirs - Remove stale sibling model copies from each app - Update all 6 Dockerfiles for monorepo build context (root = .) - Add build directives to docker-compose.yml - Add single .gitea/workflows/ci.yml with change detection - Add .dockerignore for monorepo build context - Create __init__.py for federation and account (cross-app imports)
36 lines
1.3 KiB
Python
36 lines
1.3 KiB
Python
"""add snippets table
|
|
|
|
Revision ID: c3a1f7b9d4e5
|
|
Revises: 47fc53fc0d2b
|
|
Create Date: 2026-02-07
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
revision = 'c3a1f7b9d4e5'
|
|
down_revision = '47fc53fc0d2b'
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
'snippets',
|
|
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
|
|
sa.Column('user_id', sa.Integer(), nullable=False),
|
|
sa.Column('name', sa.String(length=255), nullable=False),
|
|
sa.Column('value', sa.Text(), nullable=False),
|
|
sa.Column('visibility', sa.String(length=20), server_default='private', nullable=False),
|
|
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
|
|
sa.Column('updated_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
|
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
|
|
sa.PrimaryKeyConstraint('id'),
|
|
sa.UniqueConstraint('user_id', 'name', name='uq_snippets_user_name'),
|
|
)
|
|
op.create_index('ix_snippets_visibility', 'snippets', ['visibility'])
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_index('ix_snippets_visibility', table_name='snippets')
|
|
op.drop_table('snippets')
|