Feat(Project Hub): Apply for Founding Partner Program page created with database structure and methods.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
|
||||
USE parts;
|
||||
USE fetchmetrics;
|
||||
|
||||
DROP PROCEDURE IF EXISTS parts.p_dog_save_location;
|
||||
DROP PROCEDURE IF EXISTS fetchmetrics.p_dog_save_location;
|
||||
|
||||
DELIMITER //
|
||||
CREATE PROCEDURE parts.p_dog_save_location (
|
||||
CREATE PROCEDURE fetchmetrics.p_dog_save_location (
|
||||
IN a_comment VARCHAR(500),
|
||||
IN a_guid BINARY(36),
|
||||
IN a_id_user INT,
|
||||
@@ -46,7 +46,7 @@ BEGIN
|
||||
MET.id_type
|
||||
, @errno
|
||||
, @text
|
||||
FROM parts.CORE_Msg_Error_Type MET
|
||||
FROM fetchmetrics.CORE_Msg_Error_Type MET
|
||||
WHERE MET.code = 'MYSQL_ERROR'
|
||||
;
|
||||
|
||||
@@ -61,7 +61,7 @@ BEGIN
|
||||
, ERROR_TYPE.text_colour
|
||||
, t_ERROR.msg
|
||||
FROM tmp_Msg_Error t_ERROR
|
||||
INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
INNER JOIN fetchmetrics.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
;
|
||||
|
||||
DROP TABLE IF EXISTS tmp_Msg_Error;
|
||||
@@ -71,11 +71,11 @@ BEGIN
|
||||
|
||||
SET v_time_start := CURRENT_TIMESTAMP(6);
|
||||
SET v_code_type_error_bad_data := 'BAD_DATA';
|
||||
SET v_id_type_error_bad_data := (SELECT ERROR_TYPE.id_type FROM parts.CORE_Msg_Error_Type ERROR_TYPE WHERE ERROR_TYPE.code = v_code_type_error_bad_data LIMIT 1);
|
||||
SET v_id_permission_dog_new := (SELECT PERMISSION.id_permission FROM parts.DOG_Permission PERMISSION WHERE PERMISSION.code = 'DOG_CREATE' LIMIT 1);
|
||||
SET v_id_access_level_edit := (SELECT ACCESS_LEVEL.id_access_level FROM parts.DOG_Access_Level ACCESS_LEVEL WHERE ACCESS_LEVEL.code = 'EDIT' LIMIT 1);
|
||||
SET v_id_type_error_bad_data := (SELECT ERROR_TYPE.id_type FROM fetchmetrics.CORE_Msg_Error_Type ERROR_TYPE WHERE ERROR_TYPE.code = v_code_type_error_bad_data LIMIT 1);
|
||||
SET v_id_permission_dog_new := (SELECT PERMISSION.id_permission FROM fetchmetrics.DOG_Permission PERMISSION WHERE PERMISSION.code = 'DOG_CREATE' LIMIT 1);
|
||||
SET v_id_access_level_edit := (SELECT ACCESS_LEVEL.id_access_level FROM fetchmetrics.DOG_Access_Level ACCESS_LEVEL WHERE ACCESS_LEVEL.code = 'EDIT' LIMIT 1);
|
||||
|
||||
CALL parts.p_core_validate_guid ( a_guid );
|
||||
CALL fetchmetrics.p_core_validate_guid ( a_guid );
|
||||
|
||||
DROP TABLE IF EXISTS tmp_Location_Copy;
|
||||
DROP TABLE IF EXISTS tmp_Location;
|
||||
@@ -137,8 +137,8 @@ BEGIN
|
||||
) AS name
|
||||
, COALESCE(LOCATIONS_T.active, 1) AS active
|
||||
, CASE WHEN COALESCE(LOCATIONS.id_location, LOCATIONS_T.id_location, 0) < 1 THEN 1 ELSE 0 END AS is_new
|
||||
FROM parts.DOG_Location_Temp LOCATIONS_T
|
||||
LEFT JOIN parts.DOG_Location LOCATIONS
|
||||
FROM fetchmetrics.DOG_Location_Temp LOCATIONS_T
|
||||
LEFT JOIN fetchmetrics.DOG_Location LOCATIONS
|
||||
ON LOCATIONS_T.id_location = LOCATIONS.id_location
|
||||
OR (
|
||||
LOCATIONS_T.id_location_parent = LOCATIONS.id_location_parent
|
||||
@@ -155,7 +155,7 @@ BEGIN
|
||||
|
||||
-- Error names
|
||||
UPDATE tmp_Location t_LOCATIONS
|
||||
LEFT JOIN parts.DOG_Location LOCATIONS_PARENT ON t_LOCATIONS.id_location_parent = LOCATIONS_PARENT.id_location
|
||||
LEFT JOIN fetchmetrics.DOG_Location LOCATIONS_PARENT ON t_LOCATIONS.id_location_parent = LOCATIONS_PARENT.id_location
|
||||
SET t_LOCATIONS.name_error = CONCAT(
|
||||
COALESCE(LOCATIONS_PARENT.name, t_LOCATIONS.id_location_parent, '(No Parent Location)')
|
||||
, ' - '
|
||||
@@ -242,9 +242,9 @@ BEGIN
|
||||
, ' - '
|
||||
, COALESCE(t_LOCATIONS_COPY.name, t_LOCATIONS_COPY.code, t_LOCATIONS_COPY.id_location, '(No Location)')
|
||||
) AS name_error
|
||||
FROM parts.DOG_Location LOCATIONS
|
||||
FROM fetchmetrics.DOG_Location LOCATIONS
|
||||
LEFT JOIN tmp_Location_Copy t_LOCATIONS_COPY ON LOCATIONS.name = t_LOCATIONS_COPY.name
|
||||
LEFT JOIN parts.DOG_Location LOCATIONS_PARENT ON LOCATIONS.id_location = LOCATIONS_PARENT.id_location_parent
|
||||
LEFT JOIN fetchmetrics.DOG_Location LOCATIONS_PARENT ON LOCATIONS.id_location = LOCATIONS_PARENT.id_location_parent
|
||||
WHERE t_LOCATIONS_COPY.is_new = 1
|
||||
UNION
|
||||
SELECT
|
||||
@@ -283,9 +283,9 @@ BEGIN
|
||||
, ' - '
|
||||
, COALESCE(t_LOCATIONS_COPY.name, t_LOCATIONS_COPY.code, t_LOCATIONS_COPY.id_location, '(No Location)')
|
||||
) AS name_error
|
||||
FROM parts.DOG_Location LOCATIONS
|
||||
FROM fetchmetrics.DOG_Location LOCATIONS
|
||||
LEFT JOIN tmp_Location_Copy t_LOCATIONS_COPY ON LOCATIONS.name = t_LOCATIONS_COPY.name
|
||||
LEFT JOIN parts.DOG_Location LOCATIONS_PARENT ON LOCATIONS.id_location = LOCATIONS_PARENT.id_location_parent
|
||||
LEFT JOIN fetchmetrics.DOG_Location LOCATIONS_PARENT ON LOCATIONS.id_location = LOCATIONS_PARENT.id_location_parent
|
||||
WHERE t_LOCATIONS_COPY.is_new = 1
|
||||
UNION
|
||||
SELECT
|
||||
@@ -328,9 +328,9 @@ BEGIN
|
||||
, ' - '
|
||||
, COALESCE(t_LOCATIONS_COPY.name, t_LOCATIONS_COPY.code, t_LOCATIONS_COPY.id_location, '(No Location)')
|
||||
) AS name_error
|
||||
FROM parts.DOG_Location LOCATIONS
|
||||
FROM fetchmetrics.DOG_Location LOCATIONS
|
||||
LEFT JOIN tmp_Location_Copy t_LOCATIONS_COPY ON LOCATIONS.name = t_LOCATIONS_COPY.name
|
||||
LEFT JOIN parts.DOG_Location LOCATIONS_PARENT ON LOCATIONS.id_location = LOCATIONS_PARENT.id_location_parent
|
||||
LEFT JOIN fetchmetrics.DOG_Location LOCATIONS_PARENT ON LOCATIONS.id_location = LOCATIONS_PARENT.id_location_parent
|
||||
WHERE t_LOCATIONS_COPY.is_new = 1
|
||||
UNION
|
||||
SELECT
|
||||
@@ -363,7 +363,7 @@ BEGIN
|
||||
|
||||
-- Permissions
|
||||
-- Can Create
|
||||
CALL parts.p_dog_calc_user(
|
||||
CALL fetchmetrics.p_dog_calc_user(
|
||||
a_guid
|
||||
, 0 -- get_all_user
|
||||
, 0 -- get_inactive_user
|
||||
@@ -385,12 +385,12 @@ BEGIN
|
||||
IFNULL(CU_T.has_access, 0)
|
||||
INTO
|
||||
v_can_create
|
||||
FROM parts.DOG_Calc_User_Temp CU_T
|
||||
FROM fetchmetrics.DOG_Calc_User_Temp CU_T
|
||||
WHERE CU_T.GUID = a_guid
|
||||
LIMIT 1
|
||||
;
|
||||
|
||||
CALL parts.p_dog_clear_calc_user(
|
||||
CALL fetchmetrics.p_dog_clear_calc_user(
|
||||
a_guid
|
||||
, 0 -- a_debug
|
||||
);
|
||||
@@ -413,7 +413,7 @@ BEGIN
|
||||
;
|
||||
END IF;
|
||||
|
||||
IF EXISTS (SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF EXISTS (SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN fetchmetrics.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF a_debug = 1 THEN
|
||||
SELECT * from tmp_Location;
|
||||
END IF;
|
||||
@@ -421,10 +421,10 @@ BEGIN
|
||||
DELETE FROM tmp_Location;
|
||||
END IF;
|
||||
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
IF NOT EXISTS (SELECT * FROM tmp_Msg_Error t_ERROR INNER JOIN fetchmetrics.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type WHERE ERROR_TYPE.is_breaking_error = 1 LIMIT 1) THEN
|
||||
START TRANSACTION;
|
||||
|
||||
INSERT INTO parts.DOG_Dog_Change_Set (
|
||||
INSERT INTO fetchmetrics.DOG_Dog_Change_Set (
|
||||
comment
|
||||
, id_user_updated_last_by
|
||||
, updated_last_on
|
||||
@@ -438,7 +438,7 @@ BEGIN
|
||||
|
||||
SET v_id_change_set := LAST_INSERT_ID();
|
||||
|
||||
UPDATE parts.DOG_Location LOCATIONS
|
||||
UPDATE fetchmetrics.DOG_Location LOCATIONS
|
||||
INNER JOIN tmp_Location t_LOCATIONS
|
||||
ON LOCATIONS.id_location = t_LOCATIONS.id_location
|
||||
AND t_LOCATIONS.is_new = 0
|
||||
@@ -450,7 +450,7 @@ BEGIN
|
||||
, LOCATIONS.id_change_set = v_id_change_set
|
||||
;
|
||||
|
||||
INSERT INTO parts.DOG_Location (
|
||||
INSERT INTO fetchmetrics.DOG_Location (
|
||||
id_location_parent
|
||||
, code
|
||||
, name
|
||||
@@ -476,7 +476,7 @@ BEGIN
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
DELETE FROM parts.DOG_Location_Temp
|
||||
DELETE FROM fetchmetrics.DOG_Location_Temp
|
||||
WHERE GUID = a_guid
|
||||
;
|
||||
|
||||
@@ -494,7 +494,7 @@ BEGIN
|
||||
, ERROR_TYPE.text_colour
|
||||
, t_ERROR.msg
|
||||
FROM tmp_Msg_Error t_ERROR
|
||||
INNER JOIN parts.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
INNER JOIN fetchmetrics.CORE_Msg_Error_Type ERROR_TYPE ON t_ERROR.id_type = ERROR_TYPE.id_type
|
||||
;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
@@ -505,7 +505,7 @@ BEGIN
|
||||
DROP TEMPORARY TABLE tmp_Msg_Error;
|
||||
|
||||
IF a_debug = 1 THEN
|
||||
CALL parts.p_core_debug_timing_reporting ( v_time_start );
|
||||
CALL fetchmetrics.p_core_debug_timing_reporting ( v_time_start );
|
||||
END IF;
|
||||
END //
|
||||
DELIMITER ;
|
||||
@@ -515,39 +515,39 @@ DELIMITER ;
|
||||
/*
|
||||
|
||||
'ripplesipplenippletippledipplekippsy'
|
||||
DELETE FROM parts.DOG_Location WHERE id_location > 740;
|
||||
DELETE FROM fetchmetrics.DOG_Location WHERE id_location > 740;
|
||||
* /
|
||||
delete
|
||||
from parts.DOG_Location_Audit
|
||||
from fetchmetrics.DOG_Location_Audit
|
||||
where id_location > 768
|
||||
;
|
||||
delete
|
||||
from parts.DOG_Location
|
||||
from fetchmetrics.DOG_Location
|
||||
where id_location > 768
|
||||
;
|
||||
delete
|
||||
from parts.DOG_Location_Temp
|
||||
from fetchmetrics.DOG_Location_Temp
|
||||
;
|
||||
select
|
||||
*
|
||||
-- COUNT(*)
|
||||
-- delete
|
||||
from parts.DOG_Location_Temp
|
||||
from fetchmetrics.DOG_Location_Temp
|
||||
;
|
||||
select COUNT(*)
|
||||
from parts.DOG_Location_Temp
|
||||
from fetchmetrics.DOG_Location_Temp
|
||||
;
|
||||
select
|
||||
*
|
||||
-- COUNT(*)
|
||||
-- delete
|
||||
from parts.DOG_Location
|
||||
from fetchmetrics.DOG_Location
|
||||
;
|
||||
select COUNT(*)
|
||||
from parts.DOG_Location
|
||||
from fetchmetrics.DOG_Location
|
||||
;
|
||||
|
||||
INSERT INTO parts.DOG_Location_Temp (
|
||||
INSERT INTO fetchmetrics.DOG_Location_Temp (
|
||||
id_location
|
||||
, id_location_parent
|
||||
, code
|
||||
@@ -564,7 +564,7 @@ VALUES (
|
||||
, 'ripplesipplenippletippledipplekippsy'
|
||||
);
|
||||
|
||||
CALL parts.p_dog_save_location (
|
||||
CALL fetchmetrics.p_dog_save_location (
|
||||
'nipples'
|
||||
, 'ripplesipplenippletippledipplekippsy'
|
||||
, 1
|
||||
@@ -576,19 +576,19 @@ select
|
||||
*
|
||||
-- COUNT(*)
|
||||
-- delete
|
||||
from parts.DOG_Location_Temp
|
||||
from fetchmetrics.DOG_Location_Temp
|
||||
;
|
||||
select COUNT(*)
|
||||
from parts.DOG_Location_Temp
|
||||
from fetchmetrics.DOG_Location_Temp
|
||||
;
|
||||
select
|
||||
*
|
||||
-- COUNT(*)
|
||||
-- delete
|
||||
from parts.DOG_Location
|
||||
from fetchmetrics.DOG_Location
|
||||
;
|
||||
select COUNT(*)
|
||||
from parts.DOG_Location
|
||||
from fetchmetrics.DOG_Location
|
||||
;
|
||||
|
||||
*/
|
||||
Reference in New Issue
Block a user