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
0a7cf22a
Verified
Commit
0a7cf22a
authored
5 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #11266 TIME 0:15 Remove disable groups
parent
da6f8acf
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
sql/develop.sql
+36
-25
36 additions, 25 deletions
sql/develop.sql
with
36 additions
and
25 deletions
sql/develop.sql
+
36
−
25
View file @
0a7cf22a
...
@@ -7,14 +7,6 @@
...
@@ -7,14 +7,6 @@
-- *************************************************************************--
-- *************************************************************************--
UPDATE
parameters
SET
param_value_string
=
'19.12'
WHERE
id
=
'database_version'
;
UPDATE
parameters
SET
param_value_string
=
'19.12'
WHERE
id
=
'database_version'
;
ALTER
TABLE
notif_email_stack
ALTER
COLUMN
attachments
TYPE
text
;
DO
$$
BEGIN
IF
(
SELECT
count
(
attname
)
FROM
pg_attribute
WHERE
attrelid
=
(
SELECT
oid
FROM
pg_class
WHERE
relname
=
'users'
)
AND
attname
=
'enabled'
)
THEN
UPDATE
users
SET
status
=
'SPD'
WHERE
enabled
=
'N'
and
(
status
=
'OK'
or
status
=
'ABS'
);
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
enabled
;
END
IF
;
END
$$
;
/* FULL TEXT */
/* FULL TEXT */
DELETE
FROM
docservers
where
docserver_type_id
=
'FULLTEXT'
;
DELETE
FROM
docservers
where
docserver_type_id
=
'FULLTEXT'
;
...
@@ -39,10 +31,39 @@ ALTER TABLE usergroups ADD COLUMN can_index boolean NOT NULL DEFAULT FALSE;
...
@@ -39,10 +31,39 @@ ALTER TABLE usergroups ADD COLUMN can_index boolean NOT NULL DEFAULT FALSE;
ALTER
TABLE
usergroups
DROP
COLUMN
IF
EXISTS
indexation_parameters
;
ALTER
TABLE
usergroups
DROP
COLUMN
IF
EXISTS
indexation_parameters
;
ALTER
TABLE
usergroups
ADD
COLUMN
indexation_parameters
jsonb
NOT
NULL
DEFAULT
'{"actions" : [], "entities" : [], "keywords" : []}'
;
ALTER
TABLE
usergroups
ADD
COLUMN
indexation_parameters
jsonb
NOT
NULL
DEFAULT
'{"actions" : [], "entities" : [], "keywords" : []}'
;
/* BASKETS LIST EVENT */
ALTER
TABLE
groupbasket
DROP
COLUMN
IF
EXISTS
list_event
;
ALTER
TABLE
groupbasket
DROP
COLUMN
IF
EXISTS
list_event
;
ALTER
TABLE
groupbasket
ADD
COLUMN
list_event
character
varying
(
255
);
ALTER
TABLE
groupbasket
ADD
COLUMN
list_event
character
varying
(
255
);
/* REFACTORING */
/* FOLDERS */
ALTER
TABLE
folders
RENAME
TO
folder_tmp
;
CREATE
TABLE
folders
(
id
serial
NOT
NULL
,
label
character
varying
(
255
)
NOT
NULL
,
public
boolean
NOT
NULL
,
sharing
jsonb
DEFAULT
'{"entities" : []}'
,
user_id
INTEGER
NOT
NULL
,
parent_id
INTEGER
,
CONSTRAINT
folders_pkey
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
/* REFACTORING DATA */
DELETE
FROM
usergroup_content
WHERE
group_id
in
(
SELECT
group_id
FROM
usergroups
WHERE
enabled
=
'N'
);
DELETE
FROM
usergroups_reports
WHERE
group_id
in
(
SELECT
group_id
FROM
usergroups
WHERE
enabled
=
'N'
);
DELETE
FROM
usergroups_services
WHERE
group_id
in
(
SELECT
group_id
FROM
usergroups
WHERE
enabled
=
'N'
);
DELETE
FROM
security
WHERE
group_id
in
(
SELECT
group_id
FROM
usergroups
WHERE
enabled
=
'N'
);
DELETE
FROM
groupbasket
WHERE
group_id
in
(
SELECT
group_id
FROM
usergroups
WHERE
enabled
=
'N'
);
DELETE
FROM
groupbasket_redirect
WHERE
group_id
in
(
SELECT
group_id
FROM
usergroups
WHERE
enabled
=
'N'
);
DELETE
FROM
groupbasket_status
WHERE
group_id
in
(
SELECT
group_id
FROM
usergroups
WHERE
enabled
=
'N'
);
DELETE
FROM
users_baskets_preferences
WHERE
group_serial_id
in
(
SELECT
id
FROM
usergroups
WHERE
enabled
=
'N'
);
DELETE
FROM
usergroups
WHERE
enabled
=
'N'
;
/* REFACTORING MODIFICATION */
ALTER
TABLE
notif_email_stack
ALTER
COLUMN
attachments
TYPE
text
;
/* REFACTORING SUPPRESSION */
ALTER
TABLE
res_letterbox
DROP
COLUMN
IF
EXISTS
converter_result
;
ALTER
TABLE
res_letterbox
DROP
COLUMN
IF
EXISTS
converter_result
;
ALTER
TABLE
res_version_attachments
DROP
COLUMN
IF
EXISTS
converter_result
;
ALTER
TABLE
res_version_attachments
DROP
COLUMN
IF
EXISTS
converter_result
;
ALTER
TABLE
res_letterbox
DROP
COLUMN
IF
EXISTS
convert_result
;
ALTER
TABLE
res_letterbox
DROP
COLUMN
IF
EXISTS
convert_result
;
...
@@ -61,19 +82,9 @@ ALTER TABLE res_letterbox DROP COLUMN IF EXISTS tnl_result;
...
@@ -61,19 +82,9 @@ ALTER TABLE res_letterbox DROP COLUMN IF EXISTS tnl_result;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
tnl_result
;
ALTER
TABLE
res_attachments
DROP
COLUMN
IF
EXISTS
tnl_result
;
ALTER
TABLE
res_version_attachments
DROP
COLUMN
IF
EXISTS
tnl_result
;
ALTER
TABLE
res_version_attachments
DROP
COLUMN
IF
EXISTS
tnl_result
;
ALTER
TABLE
usergroups
DROP
COLUMN
IF
EXISTS
enabled
;
ALTER
TABLE
usergroups
DROP
COLUMN
IF
EXISTS
enabled
;
DO
$$
BEGIN
/* FOLDERS */
IF
(
SELECT
count
(
attname
)
FROM
pg_attribute
WHERE
attrelid
=
(
SELECT
oid
FROM
pg_class
WHERE
relname
=
'users'
)
AND
attname
=
'enabled'
)
THEN
UPDATE
users
SET
status
=
'SPD'
WHERE
enabled
=
'N'
and
(
status
=
'OK'
or
status
=
'ABS'
);
ALTER
TABLE
folders
RENAME
TO
folder_tmp
;
ALTER
TABLE
users
DROP
COLUMN
IF
EXISTS
enabled
;
END
IF
;
CREATE
TABLE
folders
END
$$
;
(
id
serial
NOT
NULL
,
label
character
varying
(
255
)
NOT
NULL
,
public
boolean
NOT
NULL
,
sharing
jsonb
DEFAULT
'{"entities" : []}'
,
user_id
INTEGER
NOT
NULL
,
parent_id
INTEGER
,
CONSTRAINT
folders_pkey
PRIMARY
KEY
(
id
)
)
WITH
(
OIDS
=
FALSE
);
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