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

Rewrite the migrations to match legacy tables #77

Merged
merged 5 commits into from
Jan 9, 2023

Conversation

Cruikshanks
Copy link
Member

DEFRA/water-abstraction-team#69

WARNING - This will break your test environment. Run npm run rollback:db:test before pulling down to prevent this.

Note - Whilst the repo is new, not yet in production and we only have a few migrations purely for test purposes we have opted for a rewrite rather than a 'fix-forward' approach.

This change rewrites the existing migrations. We'll be

  • renaming the files to include which schemas they will be added to
  • adding timestamp fields that match the original tables
  • consolidating any changes we've made up to this point

This is to ensure our test tables match what we see in the legacy code so we know we're handling the issues we find there and make it clearer what schema a table belongs to.

@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Jan 4, 2023
@Cruikshanks Cruikshanks self-assigned this Jan 4, 2023
@Cruikshanks Cruikshanks marked this pull request as ready for review January 5, 2023 08:46
DEFRA/water-abstraction-team#69

> **WARNING** - This will break your test environment. Run `npm run rollback:db:test` before pulling down to prevent this.

> Note - Whilst the repo is new, not yet in `production` and we only have a few migrations purely for test purposes we have opted to rewrite rather than 'fix-forward' approach.

This change rewrites the existing migrations. We'll be

- renaming the files to include which schemas they will be added to
- adding timestamp fields that match the original tables
- consolidating any changes we've made up to this point

This is to ensure our test tables match what we see in the legacy code so we know we're handling the issues we find there and make it clearer what schema a table belongs to.
Match the field names and their properties to what we find in the legacy DB.
Include schema in name (where relevant). Also, be consistent with kebab-case usage (the `20221108143943_*` comes from Knex and is out of our control).
@Cruikshanks Cruikshanks merged commit 88cb9dc into main Jan 9, 2023
@Cruikshanks Cruikshanks deleted the rewrite-migrations branch January 9, 2023 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant