Skip to content

Conversation

@linkdotnet
Copy link
Owner

@linkdotnet linkdotnet commented Aug 1, 2023

This PR fixes #101

Open points:

  • Does that work with MySQL?
  • Migration?

Possible Migration for SqlServer:

ALTER TABLE [dbo].[BlogPosts]
ADD [Tags] [nvarchar](2048) NULL;
GO

UPDATE [dbo].[BlogPosts]
SET [Tags] = (
  SELECT '[' + STRING_AGG('"' + t.Content + '"', ',') + ']'
  FROM [dbo].[Tags] t
  WHERE t.BlogPostId = [dbo].[BlogPosts].[Id]
)

ALTER TABLE [dbo].[Tags]
DROP CONSTRAINT [FK_Tag_BlogPosts_BlogPostId]
GO

-- Drop the Tags table
DROP TABLE [dbo].[Tags]
GO

@linkdotnet linkdotnet merged commit a4a8fe4 into master Aug 1, 2023
@linkdotnet linkdotnet deleted the fix/#101 branch August 1, 2023 19:58
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.

Updating Tags in a blog post doesn't update

2 participants