colour settings start

This commit is contained in:
2025-05-25 21:15:28 +02:00
parent a8aeb2dbee
commit 3fe3037aed
14 changed files with 221 additions and 57 deletions

View File

@@ -0,0 +1,56 @@
"""Add ColorSettings table
Revision ID: ca9026520dad
Revises: 76da0573e84b
Create Date: 2025-05-25 21:08:37.158900
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'ca9026520dad'
down_revision = '76da0573e84b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('color_settings',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('primary_color', sa.String(length=7), nullable=True),
sa.Column('secondary_color', sa.String(length=7), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('room_file', schema=None) as batch_op:
batch_op.alter_column('deleted',
existing_type=sa.BOOLEAN(),
nullable=True,
existing_server_default=sa.text('false'))
with op.batch_alter_table('trashed_file', schema=None) as batch_op:
batch_op.alter_column('deleted_at',
existing_type=postgresql.TIMESTAMP(),
nullable=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('trashed_file', schema=None) as batch_op:
batch_op.alter_column('deleted_at',
existing_type=postgresql.TIMESTAMP(),
nullable=False)
with op.batch_alter_table('room_file', schema=None) as batch_op:
batch_op.alter_column('deleted',
existing_type=sa.BOOLEAN(),
nullable=False,
existing_server_default=sa.text('false'))
op.drop_table('color_settings')
# ### end Alembic commands ###