Replace Paste.Content field by P.URL and FU.PasteID #75

Open
electricdusk wants to merge 1 commits from sql into master
Owner

This PR removes the polymorphic Content field (that contained a binary blob describing the paste content) with two dedicated fields for the paste URL or FileUpload. In the FileUpload case, the actual foreign key field is added on FileUpload.PasteID.

While writing the migration code, it turned out that there seems to be a bug in GORM, where a nil pointer deference happens every time you try to drop a column. The unfortunate workaround is to not drop any columns.

This PR removes the polymorphic `Content` field (that contained a binary blob describing the paste content) with two dedicated fields for the paste `URL` or `FileUpload`. In the `FileUpload` case, the actual foreign key field is added on `FileUpload.PasteID`. While writing the migration code, it turned out that there seems to be a bug in GORM, where a nil pointer deference happens every time you try to drop a column. The unfortunate workaround is to not drop any columns.
mrngm was assigned by electricdusk 2021-07-23 17:28:00 +02:00
electricdusk added 1 commit 2021-07-23 17:28:02 +02:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin sql:sql
git checkout sql
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: electricdusk/rushlink#75
No description provided.