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

EES-4490: Add theme to all publications #5269

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

EES-4490: Add theme to all publications #5269

wants to merge 2 commits into from

Conversation

tomjonesdev
Copy link
Collaborator

This PR adds a Theme property directly to a Publication, in preparation for the removal of Topic.

The work includes:

  1. a migration script to create the new Publication column and populate existing records with the correct theme ID, and
  2. front- and back-end work to ensure new/updated publications populate/retain a link to the appropriate theme.

It was fairly awkward deciding which aspects could/should be changed in advance of the removal of topics, and which should remain, as the affected entities are inherently linked, and removing or changing them could break existing functionality until the next piece of work to remove topics is completed.

name: "FK_Publications_Topics_TopicId",
table: "Publications");

migrationBuilder.Sql(@"
Copy link
Collaborator

Choose a reason for hiding this comment

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

After this point, could we then add a foreign key constraint to this column, once all of the correct values are populated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

A foreign key was added automatically through changes to the class (see the snapshot file to see if that's what you meant).

Copy link
Collaborator

Choose a reason for hiding this comment

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

But I still think that you need to add the SQL to enforce a foreign key. The snapshot update doesn't create SQL commands itself - it's just a mechanism to let the next migration know what has changed since the last migration was created, as far as I know. Would you mind checking in your DB to see if a foreign key constraint is created?

@tomjonesdev tomjonesdev force-pushed the EES-4490-1 branch 4 times, most recently from 826d2f7 to 95b809f Compare September 23, 2024 13:48
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