Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
157
Issues
157
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
e3ee761d
Commit
e3ee761d
authored
Oct 02, 2024
by
Alexandre Delanoë
1
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/fix/removes_check_json' into dev
parents
5e28eafa
139b5372
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
32 deletions
+0
-32
schema.sql
devops/postgres/schema.sql
+0
-32
No files found.
devops/postgres/schema.sql
View file @
e3ee761d
...
...
@@ -404,35 +404,3 @@ FOR EACH ROW
EXECUTE
PROCEDURE
check_node_stories_json
();
CREATE
OR
REPLACE
FUNCTION
check_ngrams_json
()
RETURNS
TRIGGER
AS
$$
DECLARE
missing_ngrams_exist
boolean
;
BEGIN
WITH
child_ngrams
as
(
SELECT
jsonb_array_elements_text
(
ngrams_repo_element
->
'children'
)
AS
term
FROM
node_stories
WHERE
term
=
OLD
.
terms
),
parent_ngrams
AS
(
SELECT
ngrams_repo_element
->>
'root'
AS
term
FROM
node_stories
WHERE
term
=
OLD
.
terms
),
child_parent_ngrams
AS
(
SELECT
*
FROM
child_ngrams
UNION
SELECT
*
FROM
parent_ngrams
)
SELECT
EXISTS
(
SELECT
*
FROM
child_parent_ngrams
)
INTO
missing_ngrams_exist
;
IF
missing_ngrams_exist
THEN
RAISE
EXCEPTION
'ngrams are missing: %'
,
row_to_json
(
OLD
);
END
IF
;
RETURN
OLD
;
END
;
$$
LANGUAGE
plpgsql
;
CREATE
OR
REPLACE
TRIGGER
check_ngrams_json_trg
AFTER
DELETE
ON
ngrams
FOR
EACH
ROW
EXECUTE
PROCEDURE
check_ngrams_json
();
Przemyslaw Kaminski
@cgenie
mentioned in commit
5660aec0
·
Oct 08, 2024
mentioned in commit
5660aec0
mentioned in commit 5660aec07ec5a0a0a5468f440092c1a8f57a864e
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment