1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

фикс авторизации112

This commit is contained in:
MoonTestUse1
2025-01-03 23:11:47 +06:00
parent f68e46581b
commit 9ed1b6fd55
2 changed files with 13 additions and 8 deletions

View File

@@ -1,23 +1,23 @@
"""create tokens table """create tokens table
Revision ID: create_tokens_table_new Revision ID: create_tokens_table_new
Revises: merge_heads Revises: initial_migration
Create Date: 2024-01-03 17:30:00.000000 Create Date: 2024-01-03 17:45:00.000000
""" """
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = 'create_tokens_table_new' revision = 'create_tokens_table_new'
down_revision = 'merge_heads' down_revision = 'initial_migration'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
def upgrade() -> None: def upgrade() -> None:
op.create_table('tokens', # Создаем таблицу tokens
op.create_table(
'tokens',
sa.Column('id', sa.Integer(), nullable=False), sa.Column('id', sa.Integer(), nullable=False),
sa.Column('access_token', sa.String(), nullable=False), sa.Column('access_token', sa.String(), nullable=False),
sa.Column('employee_id', sa.Integer(), nullable=False), sa.Column('employee_id', sa.Integer(), nullable=False),
@@ -29,7 +29,6 @@ def upgrade() -> None:
op.create_index(op.f('ix_tokens_access_token'), 'tokens', ['access_token'], unique=True) op.create_index(op.f('ix_tokens_access_token'), 'tokens', ['access_token'], unique=True)
op.create_index(op.f('ix_tokens_id'), 'tokens', ['id'], unique=False) op.create_index(op.f('ix_tokens_id'), 'tokens', ['id'], unique=False)
def downgrade() -> None: def downgrade() -> None:
op.drop_index(op.f('ix_tokens_id'), table_name='tokens') op.drop_index(op.f('ix_tokens_id'), table_name='tokens')
op.drop_index(op.f('ix_tokens_access_token'), table_name='tokens') op.drop_index(op.f('ix_tokens_access_token'), table_name='tokens')

View File

@@ -17,7 +17,13 @@ echo "Applying database migrations..."
cd /app cd /app
alembic upgrade head alembic upgrade head
echo "Migrations completed!" # Проверяем, что миграции применились успешно
if [ $? -eq 0 ]; then
echo "Migrations completed successfully!"
else
echo "Error applying migrations!"
exit 1
fi
# Запускаем приложение # Запускаем приложение
echo "Starting application..." echo "Starting application..."