Revize 6b50e2ca
Přidáno uživatelem Dominik Poch před téměř 6 roky(ů)
server/init.sql | ||
---|---|---|
65 | 65 |
OUT out_no_sick_days INT, |
66 | 66 |
OUT out_taken_sick_days INT, |
67 | 67 |
OUT out_alert DATETIME, |
68 |
OUT out_token TEXT, |
|
68 | 69 |
OUT out_email VARCHAR(100), |
69 | 70 |
OUT out_photo TEXT, |
70 | 71 |
OUT out_creation_date DATETIME, |
... | ... | |
75 | 76 |
DECLARE notification DATETIME; |
76 | 77 |
|
77 | 78 |
SELECT no_sick_days, alert INTO sickDaysCount, notification FROM default_settings ORDER BY id DESC LIMIT 1; |
78 |
SELECT id, first_name, last_name, no_vacations, IFNULL(no_sick_days, sickDaysCount), taken_sick_days, IFNULL(alert, notification), email, photo, creation_date, user_role, status |
|
79 |
INTO out_id, out_first_name, out_last_name, out_no_vacations, out_no_sick_days, out_taken_sick_days, out_alert, out_email, out_photo, out_creation_date, out_role, out_status |
|
79 |
SELECT id, first_name, last_name, no_vacations, IFNULL(no_sick_days, sickDaysCount), taken_sick_days, IFNULL(alert, notification), token, email, photo, creation_date, user_role, status
|
|
80 |
INTO out_id, out_first_name, out_last_name, out_no_vacations, out_no_sick_days, out_taken_sick_days, out_alert, out_token, out_email, out_photo, out_creation_date, out_role, out_status
|
|
80 | 81 |
FROM end_user |
81 | 82 |
WHERE id=in_id; |
82 | 83 |
END $$ |
... | ... | |
91 | 92 |
OUT out_no_sick_days INT, |
92 | 93 |
OUT out_taken_sick_days INT, |
93 | 94 |
OUT out_alert DATETIME, |
95 |
OUT out_token TEXT, |
|
94 | 96 |
OUT out_email VARCHAR(100), |
95 | 97 |
OUT out_photo TEXT, |
96 | 98 |
OUT out_creation_date DATETIME, |
... | ... | |
101 | 103 |
DECLARE notification DATETIME; |
102 | 104 |
|
103 | 105 |
SELECT no_sick_days, alert INTO sickDaysCount, notification FROM default_settings ORDER BY id DESC LIMIT 1; |
104 |
SELECT id, first_name, last_name, no_vacations, IFNULL(no_sick_days, sickDaysCount), taken_sick_days, IFNULL(alert, notification), email, photo, creation_date, user_role, status |
|
105 |
INTO out_id, out_first_name, out_last_name, out_no_vacations, out_no_sick_days, out_taken_sick_days, out_alert, out_email, out_photo, out_creation_date, out_role, out_status |
|
106 |
SELECT id, first_name, last_name, no_vacations, IFNULL(no_sick_days, sickDaysCount), taken_sick_days, IFNULL(alert, notification), token, email, photo, creation_date, user_role, status
|
|
107 |
INTO out_id, out_first_name, out_last_name, out_no_vacations, out_no_sick_days, out_taken_sick_days, out_alert, out_token, out_email, out_photo, out_creation_date, out_role, out_status
|
|
106 | 108 |
FROM end_user |
107 | 109 |
WHERE token=in_token; |
108 | 110 |
END $$ |
... | ... | |
112 | 114 |
-- ----------------------------------------------------- |
113 | 115 |
-- Insert table end_user |
114 | 116 |
-- ----------------------------------------------------- |
115 |
INSERT INTO end_user (first_name, last_name, no_vacations, no_sick_days, taken_sick_days, alert, token, email, photo, user_role, status) VALUES ('admin', 'admin', 0, NULL, 0, NULL, '', '', '', 'employer', 'accepted');
|
|
116 |
INSERT INTO end_user (first_name, last_name, no_vacations, no_sick_days, taken_sick_days, alert, token, email, photo, user_role, status) VALUES ('Jan', 'Novák', 0, 10, 0, '2019-12-6 16:30:00.000', '', '', '', 'employee', 'pending');
|
|
117 |
INSERT INTO end_user (first_name, last_name, no_vacations, no_sick_days, taken_sick_days, alert, token, email, photo, user_role, status) VALUES ('Josef', 'Svoboda', 2, NULL, 3, NULL, '', '', '', 'employee', 'rejected');
|
|
117 |
INSERT INTO end_user (first_name, last_name, no_vacations, no_sick_days, taken_sick_days, alert, token, email, photo, user_role, status) VALUES ('admin', 'admin', 0, NULL, 0, NULL, '', '', '', 'EMPLOYER', 'ACCEPTED');
|
|
118 |
INSERT INTO end_user (first_name, last_name, no_vacations, no_sick_days, taken_sick_days, alert, token, email, photo, user_role, status) VALUES ('Jan', 'Novák', 0, 10, 0, '2019-12-6 16:30:00.000', '', '', '', 'EMPLOYEE', 'PENDING');
|
|
119 |
INSERT INTO end_user (first_name, last_name, no_vacations, no_sick_days, taken_sick_days, alert, token, email, photo, user_role, status) VALUES ('Josef', 'Svoboda', 2, NULL, 3, NULL, '', '', '', 'EMPLOYEE', 'REJECTED');
|
|
118 | 120 |
|
119 | 121 |
-- ----------------------------------------------------- |
120 | 122 |
-- Insert table vacation_day |
Také k dispozici: Unified diff
Handle different or non inputs, unit tests, error messages