Skip to content

Conversation

@ChrisJollyAU
Copy link
Member

@ChrisJollyAU ChrisJollyAU commented Aug 24, 2024

  • Database model did not set the sort order for the columns in an index
  • Try and use base class function for variaous in the JetMigrationsSqlGenerator
    • Our current code for generating the index to did add the sort order for the columns whereas the base class was 99% similar and did add that info
    • Some other functions were exactly the same as base
  • Override some functions so that we can add an EndCommand. This finishes the current command sql and starts a new command with a blank string builder. In effect probably does nothing as JetCommand already would split it if all the statements were in one string
  • Update the Generate function for the AlterColumnOperation
    • If the computed sql has changed the operation to re-add it (we drop then re-add) now recreates precision,scale,fixedlength etc. Note: as Jet doesn't work on computed sql this is just here for completeness
    • Check against OldColumn to not generate unnecessary ALTER TABLE
    • If the column is being made non-nullable (when originally null), create an UPDATE statement to set the value of that column to the default value for those where the current value is NULL
    • Above changes come from similar improvement on the SQL Server AlterColumnOperation

- Missing index sort order in model and sql
- When altering a column to non-nullable, have an UPDATE to make any NULL values the default value
@ChrisJollyAU ChrisJollyAU added this to the 9.0.0 milestone Aug 24, 2024
@ChrisJollyAU ChrisJollyAU merged commit 4b3dcf5 into CirrusRedOrg:master Aug 25, 2024
@ChrisJollyAU ChrisJollyAU deleted the migrationimprove branch August 25, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant