Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
categories
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
project-open
categories
Commits
d81d2ae6
Commit
d81d2ae6
authored
Nov 22, 2012
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed creation script
parent
c899fdb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
3 deletions
+38
-3
categories-create.sql
sql/postgresql/categories-create.sql
+38
-3
No files found.
sql/postgresql/categories-create.sql
View file @
d81d2ae6
...
...
@@ -267,7 +267,18 @@ create table category_links (
create
unique
index
category_links_rev_ix
on
category_links
(
to_category_id
,
from_category_id
);
create
sequence
category_links_id_seq
;
create
or
replace
function
inline_0
()
returns
integer
as
$
body
$
declare
v_count
integer
;
begin
select
count
(
*
)
into
v_count
from
pg_class
where
lower
(
relname
)
=
'category_links_id_seq'
;
IF
v_count
=
0
THEN
create
sequence
category_links_id_seq
;
END
IF
;
return
1
;
end
;
$
body
$
language
'plpgsql'
;
select
inline_0
();
drop
function
inline_0
();
comment
on
table
category_links
is
'
Stores directed graph of linked categories. If category A
...
...
@@ -310,7 +321,20 @@ create index category_synonyms_locale_ix on category_synonyms(category_id, local
-- to sort synonyms by name
create
index
category_synonyms_name_ix
on
category_synonyms
(
category_id
,
name
);
create
sequence
category_synonyms_id_seq
;
create
or
replace
function
inline_0
()
returns
integer
as
$
body
$
declare
v_count
integer
;
begin
select
count
(
*
)
into
v_count
from
pg_class
where
lower
(
relname
)
=
'category_synonyms_id_seq'
;
IF
v_count
=
0
THEN
create
sequence
category_synonyms_id_seq
;
END
IF
;
return
1
;
end
;
$
body
$
language
'plpgsql'
;
select
inline_0
();
drop
function
inline_0
();
comment
on
table
category_synonyms
is
'
Stores multilingual synonyms of the categories.
...
...
@@ -372,7 +396,18 @@ create table category_search (
-- to delete old queries
create
index
category_search_date_ix
on
category_search
(
last_queried
);
create
sequence
category_search_id_seq
;
create
or
replace
function
inline_0
()
returns
integer
as
$
body
$
declare
v_count
integer
;
begin
select
count
(
*
)
into
v_count
from
pg_class
where
lower
(
relname
)
=
'category_search_id_seq'
;
IF
v_count
=
0
THEN
create
sequence
category_search_id_seq
;
END
IF
;
return
1
;
end
;
$
body
$
language
'plpgsql'
;
select
inline_0
();
drop
function
inline_0
();
comment
on
table
category_search
is
'
Stores users multilingual search texts for category synonyms.
...
...
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