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

Set the name Mapper in migrations #14526

Merged
merged 2 commits into from
Jan 30, 2021
Merged

Commits on Jan 30, 2021

  1. Set the name Mapper in migrations

    Migrations currently uses the default Xorm mapper which is
    not the same as the mapper Gitea actually uses.
    
    This means that there is a difference between the struct
    parsing and mapping to database tables in migrations as
    compared to normal Sync2.
    
    This was the cause for the catastrophic problem in v168 -
    untagged fields are not mapped in the same way in migrations
    as compared to outside of migrations.
    
    This is also likely the cause of some weird subtle failures
    in other migrations as any untagged field may not be being
    mapped exactly the same way.
    
    This PR suggests that we ensure that the mapper is set at
    the start of the migrations code - but also enforces a strict
    clean mapper between each migration.
    
    Signed-off-by: Andrew Thornton <art27@cantab.net>
    zeripath committed Jan 30, 2021
    Configuration menu
    Copy the full SHA
    738fd89 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a1d708 View commit details
    Browse the repository at this point in the history