Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchParapheur
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
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
Maarch
MaarchParapheur
Commits
64681adf
Commit
64681adf
authored
4 years ago
by
Florian Azizian
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #16480 TIME 0:45 Improve Migration
parent
4ecf2276
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sql/1909.sql
+0
-9
0 additions, 9 deletions
sql/1909.sql
sql/2003.sql
+0
-16
0 additions, 16 deletions
sql/2003.sql
sql/2103.sql
+0
-83
0 additions, 83 deletions
sql/2103.sql
with
0 additions
and
108 deletions
sql/1909.sql
deleted
100755 → 0
+
0
−
9
View file @
4ecf2276
-- *************************************************************************--
-- --
-- --
-- Model migration script - 19.07 to 19.09 --
-- --
-- --
-- *************************************************************************--
ALTER
TABLE
signatures
DROP
COLUMN
IF
EXISTS
substituted
;
This diff is collapsed.
Click to expand it.
sql/2003.sql
deleted
100755 → 0
+
0
−
16
View file @
4ecf2276
-- *************************************************************************--
-- --
-- --
-- Model migration script - 19.09 to 20.03 --
-- --
-- --
-- *************************************************************************--
ALTER
TABLE
main_documents
DROP
COLUMN
IF
EXISTS
notes
;
ALTER
TABLE
main_documents
ADD
COLUMN
notes
jsonb
;
ALTER
TABLE
main_documents
DROP
COLUMN
IF
EXISTS
link_id
;
ALTER
TABLE
main_documents
ADD
COLUMN
link_id
text
;
ALTER
TABLE
signatures
DROP
COLUMN
IF
EXISTS
substituted
;
ALTER
TABLE
signatures
ADD
COLUMN
substituted
boolean
DEFAULT
FALSE
NOT
NULL
;
This diff is collapsed.
Click to expand it.
sql/2103.sql
deleted
100755 → 0
+
0
−
83
View file @
4ecf2276
-- *************************************************************************--
-- --
-- --
-- Model migration script - 20.03 to 21.03 --
-- --
-- --
-- *************************************************************************--
CREATE
EXTENSION
IF
NOT
EXISTS
unaccent
;
ALTER
TABLE
main_documents
DROP
COLUMN
IF
EXISTS
status
;
ALTER
TABLE
main_documents
ADD
COLUMN
status
varchar
(
10
);
ALTER
TABLE
main_documents
DROP
COLUMN
IF
EXISTS
typist
;
ALTER
TABLE
main_documents
ADD
COLUMN
typist
INTEGER
;
DELETE
FROM
groups_privileges
WHERE
privilege
=
'indexation'
;
INSERT
INTO
groups_privileges
(
group_id
,
privilege
)
SELECT
group_id
,
'indexation'
FROM
groups_privileges
WHERE
privilege
=
'manage_documents'
;
UPDATE
main_documents
SET
status
=
'READY'
;
DROP
TABLE
IF
EXISTS
workflow_templates
;
CREATE
TABLE
workflow_templates
(
id
SERIAL
NOT
NULL
,
title
text
NOT
NULL
,
owner
INTEGER
NOT
NULL
,
CONSTRAINT
workflow_templates_pkey
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
DROP
TABLE
IF
EXISTS
workflow_templates_items
;
CREATE
TABLE
workflow_templates_items
(
id
SERIAL
NOT
NULL
,
workflow_template_id
INTEGER
NOT
NULL
,
user_id
INTEGER
NOT
NULL
,
mode
CHARACTER
VARYING
(
64
)
NOT
NULL
,
signature_mode
CHARACTER
VARYING
(
64
)
NOT
NULL
,
"order"
INTEGER
NOT
NULL
,
CONSTRAINT
workflow_templates_items_pkey
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
DO
$$
BEGIN
IF
(
SELECT
count
(
column_name
)
from
information_schema
.
columns
where
table_name
=
'workflows'
and
column_name
=
'signature_mode'
)
=
0
THEN
ALTER
TABLE
workflows
ADD
COLUMN
signature_mode
CHARACTER
VARYING
(
64
);
UPDATE
workflows
SET
signature_mode
=
'stamp'
;
ALTER
TABLE
workflows
ALTER
COLUMN
signature_mode
set
not
null
;
END
IF
;
END
$$
;
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
signature_modes
;
ALTER
TABLE
users
ADD
COLUMN
signature_modes
jsonb
DEFAULT
'["stamp"]'
;
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
x509_fingerprint
;
ALTER
TABLE
users
ADD
COLUMN
x509_fingerprint
text
;
ALTER
TABLE
workflows
DROP
COLUMN
IF
EXISTS
signature_positions
;
ALTER
TABLE
workflows
ADD
COLUMN
signature_positions
jsonb
DEFAULT
'[]'
;
ALTER
TABLE
workflows
DROP
COLUMN
IF
EXISTS
date_positions
;
ALTER
TABLE
workflows
ADD
COLUMN
date_positions
jsonb
DEFAULT
'[]'
;
ALTER
TABLE
workflows
DROP
COLUMN
IF
EXISTS
digital_signature_id
;
ALTER
TABLE
workflows
ADD
COLUMN
digital_signature_id
text
;
ALTER
TABLE
main_documents
DROP
COLUMN
IF
EXISTS
digital_signature_transaction_id
;
ALTER
TABLE
main_documents
ADD
COLUMN
digital_signature_transaction_id
text
;
DO
$$
BEGIN
IF
(
SELECT
count
(
1
)
from
docservers
where
type
=
'ESIGN'
)
=
0
THEN
INSERT
INTO
docservers
(
type
,
label
,
is_readonly
,
size_limit_number
,
actual_size_number
,
path
)
VALUES
(
'ESIGN'
,
'Document avec signatures électronique'
,
'N'
,
50000000000
,
0
,
'/opt/maarchparapheur/docservers/esigned_documents/'
);
END
IF
;
IF
(
SELECT
count
(
1
)
from
docservers
where
type
=
'ORIGINAL'
)
=
0
THEN
INSERT
INTO
docservers
(
type
,
label
,
is_readonly
,
size_limit_number
,
actual_size_number
,
path
)
VALUES
(
'ORIGINAL'
,
'Documents originaux'
,
'N'
,
50000000000
,
0
,
'/opt/maarchparapheur/docservers/original_documents/'
);
END
IF
;
END
$$
;
ALTER
TABLE
main_documents
DROP
COLUMN
IF
EXISTS
mailing_id
;
ALTER
TABLE
main_documents
ADD
COLUMN
mailing_id
text
;
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