diff --git a/docker/test.db.Dockerfile b/docker/test.db.Dockerfile index 209cd15b3..16fec024e 100644 --- a/docker/test.db.Dockerfile +++ b/docker/test.db.Dockerfile @@ -9,5 +9,5 @@ ENV POSTGRES_DB phpreport COPY sql/schema.sql /docker-entrypoint-initdb.d/1.sql COPY sql/uniqueConstraints.sql /docker-entrypoint-initdb.d/2.sql COPY sql/otherConstraints.sql /docker-entrypoint-initdb.d/3.sql -COPY sql/initialData.sql /docker-entrypoint-initdb.d/4.sql -COPY sql/update/all.sql /docker-entrypoint-initdb.d/5.sql +COPY sql/update/all.sql /docker-entrypoint-initdb.d/4.sql +COPY sql/initialData.sql /docker-entrypoint-initdb.d/5.sql diff --git a/sql/initialData.sql b/sql/initialData.sql index aba43274b..214765338 100644 --- a/sql/initialData.sql +++ b/sql/initialData.sql @@ -12,21 +12,27 @@ INSERT INTO user_group VALUES (1, 'staff'); INSERT INTO user_group VALUES (2, 'admin'); +INSERT INTO user_group VALUES (3,'manager'); -- advance two steps the sequence which generates group ids SELECT nextval(pg_get_serial_sequence('user_group', 'id')); SELECT nextval(pg_get_serial_sequence('user_group', 'id')); - +SELECT nextval(pg_get_serial_sequence('user_group', 'id')); -- -- Data for Name: usr; Type: TABLE DATA; Schema: public; Owner: phpreport -- INSERT INTO usr VALUES (1, md5('user'), 'user'); INSERT INTO usr VALUES (2, md5('admin'), 'admin'); +INSERT INTO usr VALUES (3, md5('manager'), 'manager'); +INSERT INTO usr VALUES (4, md5('phpreport'), 'phpreport-test'); + -- advance two steps the sequence which generates user ids SELECT nextval(pg_get_serial_sequence('usr', 'id')); SELECT nextval(pg_get_serial_sequence('usr', 'id')); +SELECT nextval(pg_get_serial_sequence('usr', 'id')); +SELECT nextval(pg_get_serial_sequence('usr', 'id')); -- -- Data for Name: belongs; Type: TABLE DATA; Schema: public; Owner: phpreport @@ -35,7 +41,10 @@ SELECT nextval(pg_get_serial_sequence('usr', 'id')); INSERT INTO belongs VALUES (1, 1); INSERT INTO belongs VALUES (1, 2); INSERT INTO belongs VALUES (2, 2); - +INSERT INTO belongs VALUES (1, 3); +INSERT INTO belongs VALUES (3, 3); +INSERT INTO belongs VALUES (1, 4); +INSERT INTO belongs VALUES (2, 4); -- -- Data for Name: area; Type: TABLE DATA; Schema: public; Owner: phpreport -- @@ -45,8 +54,8 @@ INSERT INTO area VALUES (1, 'internal'); -- advance one step the sequence which generates area ids SELECT nextval(pg_get_serial_sequence('area', 'id')); --- --- Data for Name: project; Type: TABLE DATA; Schema: public; Owner: phpreport --- +INSERT INTO sector VALUES (1, 'tech'); +SELECT nextval(pg_get_serial_sequence('sector', 'id')); -INSERT INTO project (description, areaid) VALUES ('Holidays', 1); +INSERT INTO customer (name, type, sectorid) VALUES ('Internal', 'Small', 1); +INSERT INTO project (description, areaid, customerid) VALUES ('Holidays', 1, 1); diff --git a/sql/update/all.sql b/sql/update/all.sql index a43dfa10a..756cacbc8 100644 --- a/sql/update/all.sql +++ b/sql/update/all.sql @@ -100,28 +100,6 @@ alter table template add constraint includes foreign key (task_storyId) references task_story (id) ; --- --- Add new manager user group to the user_group table --- Restricts access to default staff profile --- - -INSERT INTO user_group VALUES (3,'manager'); -SELECT nextval(pg_get_serial_sequence('user_group', 'id')); --- --- Add admin user to the manager group --- - -INSERT INTO belongs VALUES (3, 2); - --- --- Create manager user and give proper permissions (staff and manager) --- - -INSERT INTO usr VALUES (3, md5('manager'), 'manager'); -SELECT nextval(pg_get_serial_sequence('usr', 'id')); -INSERT INTO belongs VALUES (1, 3); -INSERT INTO belongs VALUES (3, 3); - -- -- New table for user goals templates. --