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
adffc12a
Commit
adffc12a
authored
6 months ago
by
Marcin
Committed by
Bartek Wrona
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
correctly check if rep_tracker is installed
parent
78c2aeff
Branches
bw_mi/hivemind_wit_sa_btracker_rebase
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!827
Merge develop changes to master
,
!728
desynchronize hivemind and reptracker
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/install_app.sh
+2
-2
2 additions, 2 deletions
scripts/install_app.sh
scripts/install_app.sql
+14
-4
14 additions, 4 deletions
scripts/install_app.sql
with
16 additions
and
6 deletions
scripts/install_app.sh
+
2
−
2
View file @
adffc12a
...
...
@@ -71,8 +71,8 @@ else
POSTGRES_ACCESS
=
$POSTGRES_URL
fi
psql
"
$POSTGRES_ACCESS
"
-v
ON_ERROR_STOP
=
on
-v
REPTRACKER_SCHEMA
=
${
REPTRACKER_SCHEMA
}
-f
"
${
SCRIPTPATH
}
/install_app.sql"
psql
"
$POSTGRES_ACCESS
"
-v
ON_ERROR_STOP
=
on
-v
REPTRACKER_SCHEMA
=
"
${
REPTRACKER_SCHEMA
}
"
-f
"
${
SCRIPTPATH
}
/install_app.sql"
echo
"Grant permissions to reptracker schema."
psql
"
$POSTGRES_ACCESS
"
-v
ON_ERROR_STOP
=
on
-v
REPTRACKER_SCHEMA
=
${
REPTRACKER_SCHEMA
}
-c
"GRANT reptracker_owner TO hivemind;"
psql
"
$POSTGRES_ACCESS
"
-v
ON_ERROR_STOP
=
on
-c
"GRANT reptracker_owner TO hivemind;"
psql
"
$POSTGRES_ACCESS
"
-v
ON_ERROR_STOP
=
on
-c
"GRANT reptracker_user TO hivemind;"
This diff is collapsed.
Click to expand it.
scripts/install_app.sql
+
14
−
4
View file @
adffc12a
-- Script contains all ADMINISTRATIVE steps required to setup a target database for Hivemind App
CREATE
OR
REPLACE
FUNCTION
hivemind_check_reptracker
(
_reptracker_schema
TEXT
)
RETURNS
VOID
LANGUAGE
plpgsql
STABLE
AS
$$
BEGIN
ASSERT
EXISTS
(
SELECT
1
FROM
information_schema
.
schemata
WHERE
schema_name
=
_reptracker_schema
)
,
'Reputation tracker is not installed'
;
END
;
$$
;
SELECT
hivemind_check_reptracker
(
:
'REPTRACKER_SCHEMA'
);
DROP
FUNCTION
hivemind_check_reptracker
;
DO
$$
DECLARE
__version
INT
;
BEGIN
--ASSERT EXISTS( SELECT 1 FROM information_schema.schemata WHERE schema_name = ':REPTRACKER_SCHEMA' )
-- , 'Reputation tracker is not installed'
--;
SELECT
CURRENT_SETTING
(
'server_version_num'
)::
INT
INTO
__version
;
EXECUTE
'ALTER DATABASE '
||
current_database
()
||
' SET join_collapse_limit TO 16'
;
...
...
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