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
Merge requests
!121
Something went wrong on our end
Prerequisuites to Reputation api support
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Prerequisuites to Reputation api support
reputation_api_support
into
develop
Overview
0
Commits
14
Pipelines
0
Changes
2
Merged
Bartek Wrona
requested to merge
reputation_api_support
into
develop
4 years ago
Overview
0
Commits
14
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Viewing commit
dbf23919
Prev
Next
Show latest version
2 files
+
18
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
dbf23919
Prerequisites for setting LOGGED/UNLOGGED attribute on selected tables.
· dbf23919
Bartek Wrona
authored
4 years ago
hive/db/schema.py
+
17
−
1
Options
@@ -229,7 +229,6 @@ def build_metadata():
sa
.
PrimaryKeyConstraint
(
'
post_id
'
,
'
tag_id
'
,
name
=
'
hive_post_tags_pk1
'
),
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
]),
sa
.
ForeignKeyConstraint
([
'
tag_id
'
],
[
'
hive_tag_data.id
'
]),
sa
.
Index
(
'
hive_post_tags_post_id_idx
'
,
'
post_id
'
),
sa
.
Index
(
'
hive_post_tags_tag_id_idx
'
,
'
tag_id
'
)
)
@@ -1406,3 +1405,20 @@ def set_fillfactor(db):
for
table
,
fillfactor
in
fillfactor_config
.
items
():
sql
=
"""
ALTER TABLE {} SET (FILLFACTOR = {})
"""
db
.
query
(
sql
.
format
(
table
,
fillfactor
))
def
set_logged
(
db
,
logged
):
"""
Initializes/resets LOGGED/UNLOGGED attribute for tables which are intesively updated
"""
logged_config
=
[
'
hive_author
'
,
'
hive_permlink_data
'
,
'
hive_post_tags
'
,
'
hive_posts
'
,
'
hive_post_data
'
,
'
hive_votes
'
,
'
hive_reputation_data
'
]
for
table
in
logged_config
:
sql
=
"""
ALTER TABLE {} SET {}
"""
db
.
query_no_return
(
sql
.
format
(
table
,
'
LOGGED
'
if
logged
else
'
UNLOGGED
'
))
Loading