Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alembic autogeneration and rename mismatching constraints #39032

Merged
merged 14 commits into from
May 4, 2024

Commits on May 3, 2024

  1. Fix alembic autogeneration and rename mismatching constraints

    The alembic autogeneration is not working as expected and the tests
    were detecting it because we use DBs created from the ORM to run tests.
    When a change is made in the ORM and the ORM is used to initialize the
    database for tests, the changes in the ORM will appear the same with what
    is in the migration file. To be sure that both match, we have to compare
    the database generated using the migration file to the database that could be
    created from the ORM.
    To fix this, I added 'use_migration_file' arg to resetdb function and updated
    the db reset in conftest to use migration file during test db reset.
    
    As part of this fix, I also updated mismatching constraint names. The update was
    done in the migration file instead of the ORM as I take the ORM as the source
    of truth. New airflow users create their DB from the ORM with the correct naming
    because we have a naming convention. Old airflow users would have to upgrade
    to use these names from ORM instead of the reverse.
    
    I also removed the `sqlite_sequence` table which is specific to sqlite and not
    needed for anything. An alternative would be to add `sqlite_autoincrement` to
    table args in the ORM and migration but this table is not that useful.
    ephraimbuddy committed May 3, 2024
    Configuration menu
    Copy the full SHA
    d9e3371 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    271d34e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6a11962 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a71a5e3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6629fff View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e3742af View commit details
    Browse the repository at this point in the history
  7. Fix migration for mysql

    ephraimbuddy committed May 3, 2024
    Configuration menu
    Copy the full SHA
    a25203c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f59d9c5 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    13f2156 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a6a6de1 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0b6ae3d View commit details
    Browse the repository at this point in the history
  12. Fix processor_subdir in the migration file for mysql and make use-mig…

    …ration-files an option in db commands
    ephraimbuddy committed May 3, 2024
    Configuration menu
    Copy the full SHA
    5bdffbc View commit details
    Browse the repository at this point in the history
  13. fixup! Fix processor_subdir in the migration file for mysql and make …

    …use-migration-files an option in db commands
    ephraimbuddy committed May 3, 2024
    Configuration menu
    Copy the full SHA
    4c1b163 View commit details
    Browse the repository at this point in the history
  14. Apply suggestions from code review

    Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
    ephraimbuddy and jedcunningham committed May 3, 2024
    Configuration menu
    Copy the full SHA
    93357c3 View commit details
    Browse the repository at this point in the history