Add reports to database

This commit is contained in:
rubenwardy
2025-08-24 22:07:31 +01:00
parent 80d06d154a
commit a9f82b6e1b
7 changed files with 238 additions and 31 deletions

View File

@@ -0,0 +1,30 @@
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '3052712496e4'
down_revision = '663521dfe86d'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('report',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('thread_id', sa.Integer(), nullable=True),
sa.Column('url', sa.String(), nullable=True),
sa.Column('title', sa.Unicode(length=300), nullable=False),
sa.Column('message', sa.UnicodeText(), nullable=False),
sa.Column('is_resolved', sa.Boolean(), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
sa.ForeignKeyConstraint(['thread_id'], ['thread.id'], ),
sa.PrimaryKeyConstraint('id')
)
def downgrade():
op.drop_table('report')