Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
cb1563e2
Commit
cb1563e2
authored
4 years ago
by
Marcin
Browse files
Options
Downloads
Patches
Plain Diff
fix for drop hive_post_dags without assign tags to post during upgrades
parent
d90efed9
No related branches found
No related tags found
2 merge requests
!456
Release candidate v1 24
,
!405
fix for drop hive_post_tags without assign tags to post during upgrades
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/db/sql_scripts/upgrade/upgrade_table_schema.sql
+14
-0
14 additions, 0 deletions
hive/db/sql_scripts/upgrade/upgrade_table_schema.sql
with
14 additions
and
0 deletions
hive/db/sql_scripts/upgrade/upgrade_table_schema.sql
+
14
−
0
View file @
cb1563e2
...
...
@@ -225,6 +225,20 @@ IF NOT EXISTS(SELECT data_type FROM information_schema.columns
WHERE
table_name
=
'hive_posts'
AND
column_name
=
'tags_ids'
)
THEN
ALTER
TABLE
ONLY
hive_posts
ADD
COLUMN
tags_ids
INTEGER
[];
UPDATE
hive_posts
hp
SET
tags_ids
=
tags
.
tags
FROM
(
SELECT
post_id
as
post_id
,
array_agg
(
hpt
.
tag_id
)
as
tags
FROM
hive_post_tags
hpt
GROUP
BY
post_id
)
as
tags
WHERE
hp
.
id
=
tags
.
post_id
;
ELSE
RAISE
NOTICE
'SKIPPING hive_posts upgrade - adding a tags_ids column'
;
END
IF
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment