updated to video upload

This commit is contained in:
2025-01-23 16:31:57 +02:00
parent 4b8d075bfe
commit 70a0065b98
28 changed files with 619 additions and 420 deletions

View File

@@ -1,34 +0,0 @@
"""Initial migration
Revision ID: 0de18b4ddaa3
Revises:
Create Date: 2025-01-20 14:50:44.116314
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0de18b4ddaa3'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('player', schema=None) as batch_op:
batch_op.add_column(sa.Column('user_id', sa.Integer(), nullable=True))
batch_op.create_foreign_key('fk_user_id', 'user', ['user_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('player', schema=None) as batch_op:
batch_op.drop_constraint('fk_user_id', type_='foreignkey')
batch_op.drop_column('user_id')
# ### end Alembic commands ###

View File

@@ -0,0 +1,28 @@
"""Add theme column to user table
Revision ID: 173774695298
Revises: c07c6e720021
Create Date: 2025-01-23 15:16:46.761912
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '173774695298'
down_revision = 'c07c6e720021'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@@ -0,0 +1,28 @@
"""Add theme column to user table
Revision ID: c07c6e720021
Revises: e341b0e3043c
Create Date: 2025-01-23 15:13:01.413532
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c07c6e720021'
down_revision = 'e341b0e3043c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###

View File

@@ -0,0 +1,72 @@
"""Initial migration
Revision ID: e341b0e3043c
Revises:
Create Date: 2025-01-23 15:09:25.485823
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e341b0e3043c'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('group',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=80), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.create_table('player',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=80), nullable=False),
sa.Column('hostname', sa.String(length=120), nullable=False),
sa.Column('password', sa.String(length=120), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('hostname'),
sa.UniqueConstraint('username')
)
op.create_table('user',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('username', sa.String(length=80), nullable=False),
sa.Column('password', sa.String(length=120), nullable=False),
sa.Column('role', sa.String(length=20), nullable=False),
sa.Column('theme', sa.String(length=10), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('username')
)
op.create_table('content',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('file_name', sa.String(length=120), nullable=False),
sa.Column('duration', sa.Integer(), nullable=False),
sa.Column('player_id', sa.Integer(), nullable=True),
sa.Column('group_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['group_id'], ['group.id'], ),
sa.ForeignKeyConstraint(['player_id'], ['player.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.create_table('group_players',
sa.Column('group_id', sa.Integer(), nullable=False),
sa.Column('player_id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['group_id'], ['group.id'], ),
sa.ForeignKeyConstraint(['player_id'], ['player.id'], ),
sa.PrimaryKeyConstraint('group_id', 'player_id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('group_players')
op.drop_table('content')
op.drop_table('user')
op.drop_table('player')
op.drop_table('group')
# ### end Alembic commands ###