sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1146, “Table ‘short_urls.settings’ doesn't exist”)
[SQL: SELECT settings.id AS settings_id, settings.origin_url_min_len AS settings_origin_url_min_len, settings.origin_url_max_len AS settings_origin_url_max_len, settings.short_url_min_len AS settings_short_url_min_len, settings.short_url_max_len AS settings_short_url_max_len, settings.short_url_generate_url AS settings_short_url_generate_url, settings.first_name_min_len AS settings_first_name_min_len, settings.first_name_max_len AS settings_first_name_max_len, settings.last_name_min_len AS settings_last_name_min_len, settings.last_name_max_len AS settings_last_name_max_len, settings.nick_name_min_len AS settings_nick_name_min_len, settings.nick_name_max_len AS settings_nick_name_max_len, settings.password_min_len AS settings_password_min_len
FROM settings
LIMIT %(param_1)s]
(Background on this error at: https://sqlalche.me/e/20/f405)
Вот файл миграции модели settings:
“”"Create settings
Revision ID: bdbc71c02d5b
Revises: 5609b3afde7b
Create Date: 2023-12-14 20:34:34.779207
""" from alembic import op import sqlalchemy as sa revision = 'bdbc71c02d5b' down_revision = '5609b3afde7b' branch_labels = None depends_on = None def upgrade(): op.create_table('settings', sa.Column('id', sa.Integer(), nullable=False), sa.Column('origin_url_min_len', sa.Integer, nullable=False), sa.Column('origin_url_max_len', sa.Integer, nullable=False), sa.Column('short_url_min_len', sa.Integer, nullable=False), sa.Column('short_url_max_len', sa.Integer, nullable=False), sa.Column('short_url_generate_url', sa.Integer, nullable=False), sa.Column('first_name_min_len', sa.Integer, nullable=False), sa.Column('first_name_max_len', sa.Integer, nullable=False), sa.Column('last_name_min_len', sa.Integer, nullable=False), sa.Column('last_name_max_len', sa.Integer, nullable=False), sa.Column('nick_name_min_len', sa.Integer, nullable=False), sa.Column('nick_name_max_len', sa.Integer, nullable=False), sa.Column('password_min_len', sa.Integer(), nullable=False), sa.PrimaryKeyConstraint('id') ) op.execute(""" INSERT INTO settings (origin_url_min_len, origin_url_max_len, short_url_min_len, short_url_max_len, short_url_generate_url, first_name_min_len, first_name_max_len, last_name_min_len, last_name_max_len, nick_name_min_len, nick_name_max_len, password_min_len) VALUES (10, 512, 2, 15, 7, 2, 50, 2, 50, 2, 20, 8) """) def downgrade(): op.drop_table('settings')
Буду благодарен если кто нибудь сможет помочь.