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

NEW Add migration task from gorriecoe/silverstripe-link #253

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Mar 14, 2024

Description

Adds a migration task and guide for migrating from gorriecoe/silverstripe-link and gorriecoe/silverstripe-linkfield

Requires silverstripe/silverstripe-framework#11182 for CI to go green.

Manual testing steps

  • Set up some links with gorriecoe/silverstripe-link
    • be as creative as you want with it, hopefully the guide tells you how to deal with your scenario.
    • Ideally have a range of relations
      • has_one
      • has_many (with custom sort column)
      • many_many (with many_many_extraFields)
      • many_many through (with extra $db fields)
      • many_many through, with polymorphic has_one on the "from" end of the join model
  • Use the upgrade guide. Where it says to composer require silverstripe/linkfield:^4 obviously you'll need to pull in this PR instead.

Issues

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

@GuySartorelli GuySartorelli marked this pull request as draft March 14, 2024 01:43
@GuySartorelli GuySartorelli force-pushed the pulls/4.0/gorriecoe-migration branch 3 times, most recently from b992618 to 3dff66f Compare March 14, 2024 03:28
@GuySartorelli GuySartorelli force-pushed the pulls/4.0/gorriecoe-migration branch from 3dff66f to 6346428 Compare March 14, 2024 23:32
@GuySartorelli GuySartorelli changed the base branch from 4.0 to 4 March 17, 2024 20:58
@GuySartorelli GuySartorelli force-pushed the pulls/4.0/gorriecoe-migration branch 9 times, most recently from ed5fd39 to 29e52b7 Compare March 20, 2024 21:57
@GuySartorelli GuySartorelli force-pushed the pulls/4.0/gorriecoe-migration branch 11 times, most recently from 6759999 to 6466b5b Compare March 25, 2024 03:53
@GuySartorelli GuySartorelli force-pushed the pulls/4.0/gorriecoe-migration branch 2 times, most recently from 07293fe to 9d51b6a Compare March 26, 2024 03:39
@GuySartorelli GuySartorelli marked this pull request as ready for review March 26, 2024 03:52
Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, seems really good, only some minor things

docs/en/09_migrating/02_gorriecoe-migration.md Outdated Show resolved Hide resolved
docs/en/09_migrating/02_gorriecoe-migration.md Outdated Show resolved Hide resolved
is_enabled: true
```

- Declare any columns that you added to the gorriecoe link model which need to be migrated to the new base link table, for example if you added a custom sort column for your `has_many` relations:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to move the yml config up much higher and be above where the diff examples are, because when you run through this you've removed all of the old config by this point, yet with the yml you're asked to define it, though you have nothing to refer to

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep all of the migration task configuration in one chunk - are you suggesting moving all of the migration task configuration up above the rest of the setup?

I'm alright with doing that (and I'll update the v2/v3 to v4 migration docs while I'm at it) if that's what you want, but just want to clarify before doing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah move the migration task config above the bit where it tells you to delete old stuff. Because you need to refer to that old stuff when adding your migration task config

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

I've also moved the "Take a backup of your database" into its own callout block to highlight that a bit better - it's easier to miss when its a step buried in a section like that, especially for experienced devs who may want to just skimread the docs and then figure it out themselves.

@GuySartorelli GuySartorelli force-pushed the pulls/4.0/gorriecoe-migration branch from 9d51b6a to 2d0e3c8 Compare April 1, 2024 21:02
@GuySartorelli GuySartorelli force-pushed the pulls/4.0/gorriecoe-migration branch from 2d0e3c8 to 7117247 Compare April 1, 2024 21:50
@emteknetnz emteknetnz merged commit 495dc35 into silverstripe:4 Apr 1, 2024
9 of 12 checks passed
@emteknetnz emteknetnz deleted the pulls/4.0/gorriecoe-migration branch April 1, 2024 22: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.

2 participants