Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
fa3ec64f
Commit
fa3ec64f
authored
11 years ago
by
Giovannoni Laurent
Browse files
Options
Downloads
Patches
Plain Diff
evo: filplan structure
parent
d9249469
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/trunk/structure.sql
+58
-0
58 additions, 0 deletions
core/trunk/structure.sql
with
58 additions
and
0 deletions
core/trunk/structure.sql
+
58
−
0
View file @
fa3ec64f
...
@@ -3299,6 +3299,48 @@ CREATE TABLE photo_capture
...
@@ -3299,6 +3299,48 @@ CREATE TABLE photo_capture
CONSTRAINT
photo_capture_pkey
PRIMARY
KEY
(
res_id
)
CONSTRAINT
photo_capture_pkey
PRIMARY
KEY
(
res_id
)
);
);
-- fileplan module
DROP
SEQUENCE
IF
EXISTS
fp_fileplan_positions_position_id_seq
;
CREATE
SEQUENCE
fp_fileplan_positions_position_id_seq
INCREMENT
1
MINVALUE
1
MAXVALUE
9223372036854775807
START
10
CACHE
1
;
DROP
TABLE
IF
EXISTS
fp_fileplan
;
CREATE
TABLE
fp_fileplan
(
fileplan_id
serial
NOT
NULL
,
fileplan_label
character
varying
(
255
),
user_id
character
varying
(
128
)
DEFAULT
NULL
,
entity_id
character
varying
(
32
)
DEFAULT
NULL
,
is_serial_id
character
varying
(
1
)
NOT
NULL
DEFAULT
'Y'
,
enabled
character
varying
(
1
)
NOT
NULL
DEFAULT
'Y'
,
CONSTRAINT
fp_fileplan_pkey
PRIMARY
KEY
(
fileplan_id
)
);
DROP
TABLE
IF
EXISTS
fp_fileplan_positions
;
CREATE
TABLE
fp_fileplan_positions
(
position_id
character
varying
(
32
)
NOT
NULL
,
position_label
character
varying
(
255
),
parent_id
character
varying
(
32
)
DEFAULT
NULL
,
fileplan_id
bigint
NOT
NULL
,
enabled
character
varying
(
1
)
NOT
NULL
DEFAULT
'Y'
,
CONSTRAINT
fp_fileplan_positions_pkey
PRIMARY
KEY
(
fileplan_id
,
position_id
)
);
DROP
TABLE
IF
EXISTS
fp_res_fileplan_positions
;
CREATE
TABLE
fp_res_fileplan_positions
(
res_id
bigint
NOT
NULL
,
coll_id
character
varying
(
32
)
NOT
NULL
,
fileplan_id
bigint
NOT
NULL
,
position_id
character
varying
(
32
)
NOT
NULL
,
CONSTRAINT
fp_res_fileplan_positions_pkey
PRIMARY
KEY
(
res_id
,
coll_id
,
fileplan_id
,
position_id
)
);
--VIEWS
--VIEWS
--view for demo
--view for demo
DROP
VIEW
IF
EXISTS
res_view
;
DROP
VIEW
IF
EXISTS
res_view
;
...
@@ -3545,3 +3587,19 @@ LEFT JOIN (SELECT res_letterbox.folders_system_id, count(res_letterbox.folders_s
...
@@ -3545,3 +3587,19 @@ LEFT JOIN (SELECT res_letterbox.folders_system_id, count(res_letterbox.folders_s
FROM
res_letterbox
FROM
res_letterbox
GROUP
BY
res_letterbox
.
folders_system_id
)
r
ON
r
.
folders_system_id
=
folders
.
folders_system_id
GROUP
BY
res_letterbox
.
folders_system_id
)
r
ON
r
.
folders_system_id
=
folders
.
folders_system_id
WHERE
folders
.
foldertype_id
=
foldertypes
.
foldertype_id
;
WHERE
folders
.
foldertype_id
=
foldertypes
.
foldertype_id
;
-- View fileplan
CREATE
OR
REPLACE
VIEW
fp_view_fileplan
AS
SELECT
fp_fileplan
.
fileplan_id
,
fp_fileplan
.
fileplan_label
,
fp_fileplan
.
user_id
,
fp_fileplan
.
entity_id
,
fp_fileplan
.
enabled
,
fp_fileplan_positions
.
position_id
,
fp_fileplan_positions
.
position_label
,
fp_fileplan_positions
.
parent_id
,
fp_fileplan_positions
.
enabled
AS
position_enabled
,
COALESCE
(
r
.
count_document
,
0
::
bigint
)
AS
count_document
FROM
fp_fileplan
,
fp_fileplan_positions
LEFT
JOIN
(
SELECT
fp_res_fileplan_positions
.
position_id
,
count
(
fp_res_fileplan_positions
.
res_id
)
AS
count_document
FROM
fp_res_fileplan_positions
GROUP
BY
fp_res_fileplan_positions
.
position_id
)
r
ON
r
.
position_id
::
text
=
fp_fileplan_positions
.
position_id
::
text
WHERE
fp_fileplan
.
fileplan_id
=
fp_fileplan_positions
.
fileplan_id
;
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