Skip to content

[Bug] - Alembic auto generate revision #127

Open

Description

@janssensjelle

Describe the bug

When I want to make alembic generate a new migration script it starts to change column widths. Is this related to PR #124 and #118 ?

def upgrade() -> None:
   op.alter_column('ban', 'unban_time',
               existing_type=mysql.BIGINT(display_width=18),
               type_=mysql.BIGINT(display_width=11, unsigned=True),
               existing_nullable=False)
    op.drop_index('ix_ctf_id', table_name='ctf')
    op.alter_column('htb_discord_link', 'account_identifier',
               existing_type=mysql.VARCHAR(length=255),
               nullable=False)
    op.alter_column('htb_discord_link', 'discord_user_id',
               existing_type=mysql.VARCHAR(length=42),
               type_=mysql.BIGINT(display_width=18),
               nullable=False)
    op.alter_column('htb_discord_link', 'htb_user_id',
               existing_type=mysql.VARCHAR(length=255),
               type_=mysql.BIGINT(),
               nullable=False)
    op.alter_column('mute', 'unmute_time',
               existing_type=mysql.BIGINT(display_width=18),
               type_=mysql.BIGINT(display_width=11, unsigned=True),
               existing_nullable=False)

To reproduce

I am working on a new table so I executed command
alembic revision --autogenerate -m "Added macro table"

Expected behavior

I will only see my new table + colums

Relevant log output

No response

Additional context

No response

Activity

  1. dimoschi commented on Feb 17, 2025

    @dimoschi
    Contributor

    Dear @janssensjelle sorry for not responding earlier. It seems that the DB is not in parity with the models indeed. Please give us some time to align it. I will follow up, once we are done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions