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
449f6fdb
Verified
Commit
449f6fdb
authored
5 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #11691 TIME 0:45 Remove useless attachments columns
parent
088c842a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
migration/19.12/1912.sql
+15
-0
15 additions, 0 deletions
migration/19.12/1912.sql
sql/structure.sql
+0
-13
0 additions, 13 deletions
sql/structure.sql
src/app/attachment/controllers/AttachmentController.php
+3
-1
3 additions, 1 deletion
src/app/attachment/controllers/AttachmentController.php
with
18 additions
and
14 deletions
migration/19.12/1912.sql
+
15
−
0
View file @
449f6fdb
...
@@ -529,6 +529,21 @@ ALTER TABLE listinstance DROP COLUMN IF EXISTS visible;
...
@@ -529,6 +529,21 @@ ALTER TABLE listinstance DROP COLUMN IF EXISTS visible;
ALTER
TABLE
listinstance_history_details
DROP
COLUMN
IF
EXISTS
added_by_entity
;
ALTER
TABLE
listinstance_history_details
DROP
COLUMN
IF
EXISTS
added_by_entity
;
ALTER
TABLE
usergroup_content
DROP
COLUMN
IF
EXISTS
primary_group
;
ALTER
TABLE
usergroup_content
DROP
COLUMN
IF
EXISTS
primary_group
;
ALTER
TABLE
emails
ALTER
COLUMN
document
type
jsonb
;
ALTER
TABLE
emails
ALTER
COLUMN
document
type
jsonb
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
subject
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
description
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
type_id
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
author
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
source
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
folders_system_id
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
offset_doc
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
destination
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
priotity
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
initiator
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
is_multicontacts
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
is_multi_docservers
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
tnl_path
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
tnl_filename
;
/* M2M */
/* M2M */
DO
$$
BEGIN
DO
$$
BEGIN
...
...
This diff is collapsed.
Click to expand it.
sql/structure.sql
+
0
−
13
View file @
449f6fdb
...
@@ -247,31 +247,22 @@ CREATE TABLE res_attachments
...
@@ -247,31 +247,22 @@ CREATE TABLE res_attachments
(
(
res_id
bigint
NOT
NULL
DEFAULT
nextval
(
'res_attachment_res_id_seq'
::
regclass
),
res_id
bigint
NOT
NULL
DEFAULT
nextval
(
'res_attachment_res_id_seq'
::
regclass
),
title
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
title
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
subject
text
,
description
text
,
type_id
bigint
,
format
character
varying
(
50
)
NOT
NULL
,
format
character
varying
(
50
)
NOT
NULL
,
typist
character
varying
(
128
)
NOT
NULL
,
typist
character
varying
(
128
)
NOT
NULL
,
creation_date
timestamp
without
time
zone
NOT
NULL
,
creation_date
timestamp
without
time
zone
NOT
NULL
,
modification_date
timestamp
without
time
zone
DEFAULT
NOW
(),
modification_date
timestamp
without
time
zone
DEFAULT
NOW
(),
author
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
identifier
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
identifier
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
source
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
relation
bigint
,
relation
bigint
,
docserver_id
character
varying
(
32
)
NOT
NULL
,
docserver_id
character
varying
(
32
)
NOT
NULL
,
path
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
path
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
filename
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
filename
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
offset_doc
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
fingerprint
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
fingerprint
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
filesize
bigint
,
filesize
bigint
,
status
character
varying
(
10
)
DEFAULT
NULL
::
character
varying
,
status
character
varying
(
10
)
DEFAULT
NULL
::
character
varying
,
destination
character
varying
(
50
)
DEFAULT
NULL
::
character
varying
,
validation_date
timestamp
without
time
zone
,
validation_date
timestamp
without
time
zone
,
effective_date
timestamp
without
time
zone
,
effective_date
timestamp
without
time
zone
,
work_batch
bigint
,
work_batch
bigint
,
origin
character
varying
(
50
)
DEFAULT
NULL
::
character
varying
,
origin
character
varying
(
50
)
DEFAULT
NULL
::
character
varying
,
priority
character
varying
(
16
),
initiator
character
varying
(
50
)
DEFAULT
NULL
::
character
varying
,
dest_user
character
varying
(
128
)
DEFAULT
NULL
::
character
varying
,
dest_user
character
varying
(
128
)
DEFAULT
NULL
::
character
varying
,
res_id_master
bigint
,
res_id_master
bigint
,
origin_id
INTEGER
,
origin_id
INTEGER
,
...
@@ -279,10 +270,6 @@ CREATE TABLE res_attachments
...
@@ -279,10 +270,6 @@ CREATE TABLE res_attachments
dest_contact_id
bigint
,
dest_contact_id
bigint
,
dest_address_id
bigint
,
dest_address_id
bigint
,
updated_by
character
varying
(
128
)
DEFAULT
NULL
::
character
varying
,
updated_by
character
varying
(
128
)
DEFAULT
NULL
::
character
varying
,
is_multicontacts
character
(
1
),
is_multi_docservers
character
(
1
)
NOT
NULL
DEFAULT
'N'
::
bpchar
,
tnl_path
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
tnl_filename
character
varying
(
255
)
DEFAULT
NULL
::
character
varying
,
in_signature_book
boolean
DEFAULT
FALSE
,
in_signature_book
boolean
DEFAULT
FALSE
,
in_send_attach
boolean
DEFAULT
FALSE
,
in_send_attach
boolean
DEFAULT
FALSE
,
signatory_user_serial_id
int
,
signatory_user_serial_id
int
,
...
...
This diff is collapsed.
Click to expand it.
src/app/attachment/controllers/AttachmentController.php
+
3
−
1
View file @
449f6fdb
...
@@ -830,11 +830,13 @@ class AttachmentController
...
@@ -830,11 +830,13 @@ class AttachmentController
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$body
[
'originId'
]))
{
if
(
!
Validator
::
intVal
()
->
notEmpty
()
->
validate
(
$body
[
'originId'
]))
{
return
[
'errors'
=>
'Body originId is not an integer'
];
return
[
'errors'
=>
'Body originId is not an integer'
];
}
}
$origin
=
AttachmentModel
::
getById
([
'id'
=>
$body
[
'originId'
],
'select'
=>
[
'res_id_master'
]]);
$origin
=
AttachmentModel
::
getById
([
'id'
=>
$body
[
'originId'
],
'select'
=>
[
'res_id_master'
,
'origin_id'
]]);
if
(
empty
(
$origin
))
{
if
(
empty
(
$origin
))
{
return
[
'errors'
=>
'Body originId does not exist'
];
return
[
'errors'
=>
'Body originId does not exist'
];
}
elseif
(
$origin
[
'res_id_master'
]
!=
$body
[
'resIdMaster'
])
{
}
elseif
(
$origin
[
'res_id_master'
]
!=
$body
[
'resIdMaster'
])
{
return
[
'errors'
=>
'Body resIdMaster is different from origin'
];
return
[
'errors'
=>
'Body resIdMaster is different from origin'
];
}
elseif
(
!
empty
(
$origin
[
'origin_id'
]))
{
return
[
'errors'
=>
'Body originId can not be a version, it must be the original version'
];
}
}
}
}
...
...
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