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
63a1c034
Verified
Commit
63a1c034
authored
5 years ago
by
Giovannoni Laurent
Browse files
Options
Downloads
Patches
Plain Diff
add contacts samples for m2m
parent
5c2ac89f
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/m2m_contacts_samples.sql
+56
-0
56 additions, 0 deletions
sql/m2m_contacts_samples.sql
with
56 additions
and
0 deletions
sql/m2m_contacts_samples.sql
0 → 100644
+
56
−
0
View file @
63a1c034
DELETE
FROM
usergroups
WHERE
group_id
=
'MAARCHTOGEC'
;
INSERT
INTO
usergroups
(
group_id
,
group_desc
,
enabled
)
VALUES
(
'MAARCHTOGEC'
,
'Envoi dématérialisé'
,
'Y'
);
DELETE
FROM
usergroups_services
WHERE
group_id
=
'MAARCHTOGEC'
;
INSERT
INTO
usergroups_services
(
group_id
,
service_id
)
VALUES
(
'MAARCHTOGEC'
,
'save_numeric_package'
);
DELETE
FROM
security
WHERE
group_id
=
'MAARCHTOGEC'
;
INSERT
INTO
security
(
group_id
,
coll_id
,
where_clause
,
maarch_comment
)
VALUES
(
'MAARCHTOGEC'
,
'letterbox_coll'
,
'1=0'
,
'Aucun courrier'
);
DELETE
FROM
users
WHERE
user_id
=
'cchaplin'
;
INSERT
INTO
users
(
user_id
,
password
,
firstname
,
lastname
,
mail
,
enabled
,
change_password
,
status
,
loginmode
)
VALUES
(
'cchaplin'
,
'$2y$10$C.QSslBKD3yNMfRPuZfcaubFwPKiCkqqOUyAdOr5FSGKPaePwuEjG'
,
'Jean'
,
'WEBSERVICE'
,
'info@maarch.org'
,
'Y'
,
'N'
,
'OK'
,
'restMode'
);
DELETE
FROM
usergroup_content
WHERE
user_id
=
'cchaplin'
;
INSERT
INTO
usergroup_content
(
user_id
,
group_id
,
primary_group
,
role
)
VALUES
(
'cchaplin'
,
'MAARCHTOGEC'
,
'Y'
,
''
);
DELETE
FROM
contacts_v2
where
contact_id
>=
1000000
;
DELETE
FROM
contact_addresses
where
id
>=
1000000
;
DELETE
FROM
contact_communication
where
contact_id
>=
1000000
;
-- INSTANCE A
INSERT
INTO
contacts_v2
(
contact_id
,
contact_type
,
is_corporate_person
,
is_external_contact
,
society
,
user_id
,
entity_id
,
creation_date
)
VALUES
(
1000000
,
102
,
'Y'
,
'Y'
,
'Custom 1'
,
'cchaplin'
,
'COU'
,
'2019-03-28 21:43:54.97424'
);
INSERT
INTO
contact_addresses
(
id
,
contact_id
,
contact_purpose_id
,
user_id
,
entity_id
,
external_id
)
VALUES
(
1000000
,
1000000
,
1
,
'cchaplin'
,
'COU'
,
'{"m2m": "org_custom_1"}'
);
INSERT
INTO
contact_communication
(
contact_id
,
type
,
value
)
VALUES
(
1000000
,
'url'
,
'http://cchaplin:maarch@127.0.0.1/MaarchCourrier/cs_custom_1/'
);
-- INSTANCE B
INSERT
INTO
contacts_v2
(
contact_id
,
contact_type
,
is_corporate_person
,
is_external_contact
,
society
,
user_id
,
entity_id
,
creation_date
)
VALUES
(
1000001
,
102
,
'Y'
,
'Y'
,
'Custom 2'
,
'cchaplin'
,
'COU'
,
'2019-03-28 21:43:54.97424'
);
INSERT
INTO
contact_addresses
(
id
,
contact_id
,
contact_purpose_id
,
user_id
,
entity_id
,
external_id
)
VALUES
(
1000001
,
1000001
,
1
,
'cchaplin'
,
'COU'
,
'{"m2m": "org_custom_2"}'
);
INSERT
INTO
contact_communication
(
contact_id
,
type
,
value
)
VALUES
(
1000001
,
'url'
,
'http://cchaplin:maarch@127.0.0.1/MaarchCourrier/cs_custom_2/'
);
-- INSTANCE C
INSERT
INTO
contacts_v2
(
contact_id
,
contact_type
,
is_corporate_person
,
is_external_contact
,
society
,
user_id
,
entity_id
,
creation_date
)
VALUES
(
1000002
,
102
,
'Y'
,
'Y'
,
'Custom 3'
,
'cchaplin'
,
'COU'
,
'2019-03-28 21:43:54.97424'
);
INSERT
INTO
contact_addresses
(
id
,
contact_id
,
contact_purpose_id
,
user_id
,
entity_id
,
external_id
)
VALUES
(
1000002
,
1000002
,
1
,
'cchaplin'
,
'COU'
,
'{"m2m": "org_custom_2"}'
);
INSERT
INTO
contact_communication
(
contact_id
,
type
,
value
)
VALUES
(
1000002
,
'url'
,
'http://cchaplin:maarch@127.0.0.1/MaarchCourrier/cs_custom_3/'
);
DO
$$
BEGIN
IF
(
SELECT
current_database
()
=
'custom_1'
)
THEN
UPDATE
entities
set
business_id
=
'org_custom_1'
;
END
IF
;
END
$$
;
DO
$$
BEGIN
IF
(
SELECT
current_database
()
=
'custom_2'
)
THEN
UPDATE
entities
set
business_id
=
'org_custom_2'
;
END
IF
;
END
$$
;
DO
$$
BEGIN
IF
(
SELECT
current_database
()
=
'custom_3'
)
THEN
UPDATE
entities
set
business_id
=
'org_custom_3'
;
END
IF
;
END
$$
;
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