text
stringlengths 1
1.05M
|
|---|
library CTForHeadDecision version '1.0.0'
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0' called FHIRHelpers
include CTForHead version '1.0.0' called CTHead
codesystem "ICD-10-CM": 'http://hl7.org/fhir/sid/icd-10-cm'
codesystem "LOINC": 'http://loinc.org'
codesystem "HCPCS": 'https://hcpcs.codes/'
codesystem "SNOMED-CT": 'http://snomed.info/sct'
codesystem "CPT": 'https://www.aapc.com/resources/medical-coding/cpt.aspx'
parameter "ServiceRequest" ServiceRequest
context Patient
define BlurredVision:
CTHead."BlurredVision"
define Nausea:
CTHead."Nausea"
define Vomiting:
CTHead."Vomiting"
define SignsOfWeakness:
CTHead."SignsOfWeakness"
define SymptomsOfParalysis:
CTHead."SymptomsOfParalysis"
define ExtremeObesity:
CTHead."ExtremeObesity"
define InabilityToLieStill:
CTHead."InabilityToLieStill"
define HeadachesOrDizziness:
CTHead."HeadachesOrDizziness"
define HeadachesOnset:
CTHead."HeadachesOnset"
define HeadachesSeverity:
CTHead."HeadachesSeverity"
define Trauma:
CTHead."Trauma"
define AcuteHemorrhage:
CTHead."AcuteHemorrhage"
define StrokesEncephalomalacia:
CTHead."StrokesEncephalomalacia"
define Seizures:
CTHead."Seizures"
define IntracranialLesions:
CTHead."IntracranialLesions"
define UsageOfMetallicEquipments:
CTHead."UsageOfMetallicEquipments"
define RequirementOfContrastCT:
CTHead."RequirementOfContrastCT"
define DiagnosisForContrastCT:
CTHead."DiagnosisForContrastCT"
define Symptoms:
if(("BlurredVision" = true)
or ("Nausea" = true)
or ("Vomiting" = true)
or ("SignsOfWeakness" = true)
or ("SymptomsOfParalysis" = true))
then true
else false
define QualifyingHeadaches:
if("HeadachesOrDizziness" = true)
then true
else false
define QualifyingDiagnosis:
if(("ExtremeObesity" = true)
or ("InabilityToLieStill" = true)
or ("Trauma" = true)
or ("AcuteHemorrhage" = true)
or ("StrokesEncephalomalacia" = true)
or ("Seizures" = true)
or ("IntracranialLesions" = true))
then true
else false
define Limitations:
if(("RequirementOfContrastCT" = true)
or ("UsageOfMetallicEquipments" = true))
then true
else false
define FinalDecision:
'YES'
|
alter table stream_push
add serverId varchar(50) not null;
alter table device
add geoCoordSys varchar(50) not null;
update device set device.geoCoordSys='WGS84';
alter table device_channel
add longitudeGcj02 double default null;
alter table device_channel
add latitudeGcj02 double default null;
alter table device_channel
add longitudeWgs84 double default null;
alter table device_channel
add latitudeWgs84 double default null;
|
-- This SQL code was generated by sklearn2sql (development version).
-- Copyright 2018
-- Model : CaretClassifier_cforest_pca
-- Dataset : iris_date_tgt
-- Database : db2
-- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
-- Model deployment code
WITH "ADS_sca_1_OUT" AS
(SELECT "ADS"."KEY" AS "KEY", (CAST("ADS"."Feature_0" AS DOUBLE) - 5.8475) / 0.8305068311812104 AS "Feature_0", (CAST("ADS"."Feature_1" AS DOUBLE) - 3.040833333333333) / 0.4410636176856331 AS "Feature_1", (CAST("ADS"."Feature_2" AS DOUBLE) - 3.8441666666666667) / 1.7181578875675667 AS "Feature_2", (CAST("ADS"."Feature_3" AS DOUBLE) - 1.245833333333333) / 0.7517929083403303 AS "Feature_3"
FROM "IRIS_DATE_TGT" AS "ADS"),
"ADS_pre_1_OUT" AS
(SELECT "ADS_sca_1_OUT"."KEY" AS "KEY", "ADS_sca_1_OUT"."Feature_0" * -0.5263014514387969 + "ADS_sca_1_OUT"."Feature_1" * 0.2495430740050257 + "ADS_sca_1_OUT"."Feature_2" * -0.5822562654142306 + "ADS_sca_1_OUT"."Feature_3" * -0.5671972124538438 AS "PC1", "ADS_sca_1_OUT"."Feature_0" * 0.35797855187209515 + "ADS_sca_1_OUT"."Feature_1" * 0.9312088394674648 + "ADS_sca_1_OUT"."Feature_2" * 0.009350349831007576 + "ADS_sca_1_OUT"."Feature_3" * 0.06792661227568664 AS "PC2", "ADS_sca_1_OUT"."Feature_0" * 0.7268387018817979 + "ADS_sca_1_OUT"."Feature_1" * -0.2319858665682916 + "ADS_sca_1_OUT"."Feature_2" * -0.142090941958786 + "ADS_sca_1_OUT"."Feature_3" * -0.6306331924126783 AS "PC3", "ADS_sca_1_OUT"."Feature_0" * -0.2579993024404442 + "ADS_sca_1_OUT"."Feature_1" * 0.1294639302135427 + "ADS_sca_1_OUT"."Feature_2" * 0.8004376156560707 + "ADS_sca_1_OUT"."Feature_3" * -0.5253332981610163 AS "PC4"
FROM "ADS_sca_1_OUT"),
"DT_node_lookup" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.4878053759714748) THEN CASE WHEN ("ADS_pre_1_OUT"."PC2" <= -0.07877348070249307) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.9062073022076612) THEN 4 ELSE 5 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.95901586978046) THEN 7 ELSE 8 END END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.285714285714286 AS "P_1", 0.714285714285714 AS "P_2", 2 AS "D", 0.714285714285714 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.9285714285714286 AS "P_1", 0.07142857142857137 AS "P_2", 1 AS "D", 0.9285714285714286 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 0.025 AS "P_1", 0.975 AS "P_2", 2 AS "D", 0.975 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 0.625 AS "P_1", 0.375 AS "P_2", 1 AS "D", 0.625 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output" AS
(SELECT "DT_node_lookup"."KEY" AS "KEY", "DT_node_lookup".node_id_2 AS node_id_2, "DT_node_data".nid AS nid, "DT_node_data"."P_0" AS "P_0", "DT_node_data"."P_1" AS "P_1", "DT_node_data"."P_2" AS "P_2", "DT_node_data"."D" AS "D", "DT_node_data"."DP" AS "DP"
FROM "DT_node_lookup" LEFT OUTER JOIN "DT_node_data" ON "DT_node_lookup".node_id_2 = "DT_node_data".nid),
"RF_Model_0" AS
(SELECT "DT_Output"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output"."P_0" IS NULL OR "DT_Output"."P_0" > 0.0) THEN ln("DT_Output"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output"."P_1" IS NULL OR "DT_Output"."P_1" > 0.0) THEN ln("DT_Output"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output"."P_2" IS NULL OR "DT_Output"."P_2" > 0.0) THEN ln("DT_Output"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output"),
"DT_node_lookup_1" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.5638086683346546) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.8617563505066399) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.465057420340947) THEN 4 ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.2669247386386567) THEN 6 ELSE 7 END END ELSE 8 END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_1" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_1" AS
(SELECT "DT_node_lookup_1"."KEY" AS "KEY", "DT_node_lookup_1".node_id_2 AS node_id_2, "DT_node_data_1".nid AS nid, "DT_node_data_1"."P_0" AS "P_0", "DT_node_data_1"."P_1" AS "P_1", "DT_node_data_1"."P_2" AS "P_2", "DT_node_data_1"."D" AS "D", "DT_node_data_1"."DP" AS "DP"
FROM "DT_node_lookup_1" LEFT OUTER JOIN "DT_node_data_1" ON "DT_node_lookup_1".node_id_2 = "DT_node_data_1".nid),
"RF_Model_1" AS
(SELECT "DT_Output_1"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_1"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_1"."P_0" IS NULL OR "DT_Output_1"."P_0" > 0.0) THEN ln("DT_Output_1"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_1"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_1"."P_1" IS NULL OR "DT_Output_1"."P_1" > 0.0) THEN ln("DT_Output_1"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_1"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_1"."P_2" IS NULL OR "DT_Output_1"."P_2" > 0.0) THEN ln("DT_Output_1"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_1"),
"DT_node_lookup_2" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC2" <= -0.07877348070249307) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.9062073022076612) THEN 3 ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.09197375169872644) THEN 5 ELSE 6 END END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.6740826551115219) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.318013878932838) THEN 9 ELSE 10 END ELSE 11 END END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_2" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 3 AS nid, 0.0 AS "P_0", 0.272727272727273 AS "P_1", 0.727272727272727 AS "P_2", 2 AS "D", 0.727272727272727 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS nid, 0.625 AS "P_0", 0.375 AS "P_1", 0.0 AS "P_2", 0 AS "D", 0.625 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 10 AS nid, 0.0 AS "P_0", 0.666666666666667 AS "P_1", 0.333333333333333 AS "P_2", 1 AS "D", 0.666666666666667 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 11 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_2" AS
(SELECT "DT_node_lookup_2"."KEY" AS "KEY", "DT_node_lookup_2".node_id_2 AS node_id_2, "DT_node_data_2".nid AS nid, "DT_node_data_2"."P_0" AS "P_0", "DT_node_data_2"."P_1" AS "P_1", "DT_node_data_2"."P_2" AS "P_2", "DT_node_data_2"."D" AS "D", "DT_node_data_2"."DP" AS "DP"
FROM "DT_node_lookup_2" LEFT OUTER JOIN "DT_node_data_2" ON "DT_node_lookup_2".node_id_2 = "DT_node_data_2".nid),
"RF_Model_2" AS
(SELECT "DT_Output_2"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_2"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_2"."P_0" IS NULL OR "DT_Output_2"."P_0" > 0.0) THEN ln("DT_Output_2"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_2"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_2"."P_1" IS NULL OR "DT_Output_2"."P_1" > 0.0) THEN ln("DT_Output_2"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_2"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_2"."P_2" IS NULL OR "DT_Output_2"."P_2" > 0.0) THEN ln("DT_Output_2"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_2"),
"DT_node_lookup_3" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.1731995294167479) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.023110876503666) THEN 4 ELSE 5 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.5149003690055787) THEN 7 ELSE 8 END END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_3" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.142857142857143 AS "P_1", 0.857142857142857 AS "P_2", 2 AS "D", 0.857142857142857 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 0.25 AS "P_1", 0.75 AS "P_2", 2 AS "D", 0.75 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 0.9767441860465116 AS "P_1", 0.02325581395348839 AS "P_2", 1 AS "D", 0.9767441860465116 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_3" AS
(SELECT "DT_node_lookup_3"."KEY" AS "KEY", "DT_node_lookup_3".node_id_2 AS node_id_2, "DT_node_data_3".nid AS nid, "DT_node_data_3"."P_0" AS "P_0", "DT_node_data_3"."P_1" AS "P_1", "DT_node_data_3"."P_2" AS "P_2", "DT_node_data_3"."D" AS "D", "DT_node_data_3"."DP" AS "DP"
FROM "DT_node_lookup_3" LEFT OUTER JOIN "DT_node_data_3" ON "DT_node_lookup_3".node_id_2 = "DT_node_data_3".nid),
"RF_Model_3" AS
(SELECT "DT_Output_3"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_3"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_3"."P_0" IS NULL OR "DT_Output_3"."P_0" > 0.0) THEN ln("DT_Output_3"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_3"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_3"."P_1" IS NULL OR "DT_Output_3"."P_1" > 0.0) THEN ln("DT_Output_3"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_3"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_3"."P_2" IS NULL OR "DT_Output_3"."P_2" > 0.0) THEN ln("DT_Output_3"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_3"),
"DT_node_lookup_4" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.5638086683346546) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.040352232576907) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.4568141239582277) THEN 4 ELSE 5 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.1775886326533845) THEN 7 ELSE 8 END END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_4" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.625 AS "P_1", 0.375 AS "P_2", 1 AS "D", 0.625 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 0.625 AS "P_1", 0.375 AS "P_2", 1 AS "D", 0.625 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_4" AS
(SELECT "DT_node_lookup_4"."KEY" AS "KEY", "DT_node_lookup_4".node_id_2 AS node_id_2, "DT_node_data_4".nid AS nid, "DT_node_data_4"."P_0" AS "P_0", "DT_node_data_4"."P_1" AS "P_1", "DT_node_data_4"."P_2" AS "P_2", "DT_node_data_4"."D" AS "D", "DT_node_data_4"."DP" AS "DP"
FROM "DT_node_lookup_4" LEFT OUTER JOIN "DT_node_data_4" ON "DT_node_lookup_4".node_id_2 = "DT_node_data_4".nid),
"RF_Model_4" AS
(SELECT "DT_Output_4"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_4"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_4"."P_0" IS NULL OR "DT_Output_4"."P_0" > 0.0) THEN ln("DT_Output_4"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_4"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_4"."P_1" IS NULL OR "DT_Output_4"."P_1" > 0.0) THEN ln("DT_Output_4"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_4"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_4"."P_2" IS NULL OR "DT_Output_4"."P_2" > 0.0) THEN ln("DT_Output_4"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_4"),
"DT_node_lookup_5" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.5638086683346546) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.9000504423712101) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.2669247386386567) THEN 4 ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.8102018999734852) THEN 6 ELSE 7 END END ELSE 8 END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_5" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_5" AS
(SELECT "DT_node_lookup_5"."KEY" AS "KEY", "DT_node_lookup_5".node_id_2 AS node_id_2, "DT_node_data_5".nid AS nid, "DT_node_data_5"."P_0" AS "P_0", "DT_node_data_5"."P_1" AS "P_1", "DT_node_data_5"."P_2" AS "P_2", "DT_node_data_5"."D" AS "D", "DT_node_data_5"."DP" AS "DP"
FROM "DT_node_lookup_5" LEFT OUTER JOIN "DT_node_data_5" ON "DT_node_lookup_5".node_id_2 = "DT_node_data_5".nid),
"RF_Model_5" AS
(SELECT "DT_Output_5"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_5"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_5"."P_0" IS NULL OR "DT_Output_5"."P_0" > 0.0) THEN ln("DT_Output_5"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_5"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_5"."P_1" IS NULL OR "DT_Output_5"."P_1" > 0.0) THEN ln("DT_Output_5"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_5"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_5"."P_2" IS NULL OR "DT_Output_5"."P_2" > 0.0) THEN ln("DT_Output_5"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_5"),
"DT_node_lookup_6" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC2" <= 1.067182940673082) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.081857971942155) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.2669247386386567) THEN 5 ELSE 6 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.3097148481468427) THEN 8 ELSE 9 END END ELSE 10 END ELSE 11 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_6" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 5 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS nid, 0.0 AS "P_0", 0.4 AS "P_1", 0.6 AS "P_2", 2 AS "D", 0.6 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 0.444444444444444 AS "P_1", 0.555555555555556 AS "P_2", 2 AS "D", 0.555555555555556 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 0.0 AS "P_0", 0.9743589743589745 AS "P_1", 0.02564102564102561 AS "P_2", 1 AS "D", 0.9743589743589745 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 10 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 11 AS nid, 0.769230769230769 AS "P_0", 0.0 AS "P_1", 0.230769230769231 AS "P_2", 0 AS "D", 0.769230769230769 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_6" AS
(SELECT "DT_node_lookup_6"."KEY" AS "KEY", "DT_node_lookup_6".node_id_2 AS node_id_2, "DT_node_data_6".nid AS nid, "DT_node_data_6"."P_0" AS "P_0", "DT_node_data_6"."P_1" AS "P_1", "DT_node_data_6"."P_2" AS "P_2", "DT_node_data_6"."D" AS "D", "DT_node_data_6"."DP" AS "DP"
FROM "DT_node_lookup_6" LEFT OUTER JOIN "DT_node_data_6" ON "DT_node_lookup_6".node_id_2 = "DT_node_data_6".nid),
"RF_Model_6" AS
(SELECT "DT_Output_6"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_6"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_6"."P_0" IS NULL OR "DT_Output_6"."P_0" > 0.0) THEN ln("DT_Output_6"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_6"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_6"."P_1" IS NULL OR "DT_Output_6"."P_1" > 0.0) THEN ln("DT_Output_6"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_6"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_6"."P_2" IS NULL OR "DT_Output_6"."P_2" > 0.0) THEN ln("DT_Output_6"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_6"),
"DT_node_lookup_7" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.2669247386386567) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.8617563505066399) THEN 4 ELSE 5 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.1423081349429791) THEN 7 ELSE 8 END END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_7" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 0.666666666666667 AS "P_1", 0.333333333333333 AS "P_2", 1 AS "D", 0.666666666666667 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_7" AS
(SELECT "DT_node_lookup_7"."KEY" AS "KEY", "DT_node_lookup_7".node_id_2 AS node_id_2, "DT_node_data_7".nid AS nid, "DT_node_data_7"."P_0" AS "P_0", "DT_node_data_7"."P_1" AS "P_1", "DT_node_data_7"."P_2" AS "P_2", "DT_node_data_7"."D" AS "D", "DT_node_data_7"."DP" AS "DP"
FROM "DT_node_lookup_7" LEFT OUTER JOIN "DT_node_data_7" ON "DT_node_lookup_7".node_id_2 = "DT_node_data_7".nid),
"RF_Model_7" AS
(SELECT "DT_Output_7"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_7"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_7"."P_0" IS NULL OR "DT_Output_7"."P_0" > 0.0) THEN ln("DT_Output_7"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_7"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_7"."P_1" IS NULL OR "DT_Output_7"."P_1" > 0.0) THEN ln("DT_Output_7"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_7"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_7"."P_2" IS NULL OR "DT_Output_7"."P_2" > 0.0) THEN ln("DT_Output_7"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_7"),
"DT_node_lookup_8" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.8617563505066399) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.318013878932838) THEN 4 ELSE 5 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.1081629160806747) THEN 7 ELSE 8 END END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_8" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.411764705882353 AS "P_1", 0.588235294117647 AS "P_2", 2 AS "D", 0.588235294117647 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 0.857142857142857 AS "P_1", 0.142857142857143 AS "P_2", 1 AS "D", 0.857142857142857 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_8" AS
(SELECT "DT_node_lookup_8"."KEY" AS "KEY", "DT_node_lookup_8".node_id_2 AS node_id_2, "DT_node_data_8".nid AS nid, "DT_node_data_8"."P_0" AS "P_0", "DT_node_data_8"."P_1" AS "P_1", "DT_node_data_8"."P_2" AS "P_2", "DT_node_data_8"."D" AS "D", "DT_node_data_8"."DP" AS "DP"
FROM "DT_node_lookup_8" LEFT OUTER JOIN "DT_node_data_8" ON "DT_node_lookup_8".node_id_2 = "DT_node_data_8".nid),
"RF_Model_8" AS
(SELECT "DT_Output_8"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_8"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_8"."P_0" IS NULL OR "DT_Output_8"."P_0" > 0.0) THEN ln("DT_Output_8"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_8"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_8"."P_1" IS NULL OR "DT_Output_8"."P_1" > 0.0) THEN ln("DT_Output_8"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_8"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_8"."P_2" IS NULL OR "DT_Output_8"."P_2" > 0.0) THEN ln("DT_Output_8"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_8"),
"DT_node_lookup_9" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.9062073022076612) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.2311087384060417) THEN 4 ELSE 5 END ELSE 6 END ELSE 7 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_9" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.444444444444444 AS "P_1", 0.555555555555556 AS "P_2", 2 AS "D", 0.555555555555556 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_9" AS
(SELECT "DT_node_lookup_9"."KEY" AS "KEY", "DT_node_lookup_9".node_id_2 AS node_id_2, "DT_node_data_9".nid AS nid, "DT_node_data_9"."P_0" AS "P_0", "DT_node_data_9"."P_1" AS "P_1", "DT_node_data_9"."P_2" AS "P_2", "DT_node_data_9"."D" AS "D", "DT_node_data_9"."DP" AS "DP"
FROM "DT_node_lookup_9" LEFT OUTER JOIN "DT_node_data_9" ON "DT_node_lookup_9".node_id_2 = "DT_node_data_9".nid),
"RF_Model_9" AS
(SELECT "DT_Output_9"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_9"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_9"."P_0" IS NULL OR "DT_Output_9"."P_0" > 0.0) THEN ln("DT_Output_9"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_9"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_9"."P_1" IS NULL OR "DT_Output_9"."P_1" > 0.0) THEN ln("DT_Output_9"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_9"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_9"."P_2" IS NULL OR "DT_Output_9"."P_2" > 0.0) THEN ln("DT_Output_9"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_9"),
"RF_0" AS
(SELECT "RF_esu_0"."KEY" AS "KEY", "RF_esu_0"."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", "RF_esu_0"."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", "RF_esu_0"."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", "RF_esu_0"."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", "RF_esu_0"."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", "RF_esu_0"."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", "RF_esu_0"."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", "RF_esu_0"."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", "RF_esu_0"."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000"
FROM (SELECT "RF_Model_0"."KEY" AS "KEY", CAST("RF_Model_0"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_0"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_0"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_0"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_0"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_0"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_0"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_0"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_0"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_0" UNION ALL SELECT "RF_Model_1"."KEY" AS "KEY", CAST("RF_Model_1"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_1"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_1"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_1"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_1"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_1"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_1"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_1"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_1"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_1" UNION ALL SELECT "RF_Model_2"."KEY" AS "KEY", CAST("RF_Model_2"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_2"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_2"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_2"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_2"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_2"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_2"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_2"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_2"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_2" UNION ALL SELECT "RF_Model_3"."KEY" AS "KEY", CAST("RF_Model_3"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_3"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_3"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_3"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_3"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_3"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_3"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_3"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_3"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_3" UNION ALL SELECT "RF_Model_4"."KEY" AS "KEY", CAST("RF_Model_4"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_4"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_4"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_4"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_4"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_4"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_4"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_4"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_4"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_4" UNION ALL SELECT "RF_Model_5"."KEY" AS "KEY", CAST("RF_Model_5"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_5"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_5"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_5"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_5"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_5"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_5"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_5"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_5"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_5" UNION ALL SELECT "RF_Model_6"."KEY" AS "KEY", CAST("RF_Model_6"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_6"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_6"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_6"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_6"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_6"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_6"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_6"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_6"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_6" UNION ALL SELECT "RF_Model_7"."KEY" AS "KEY", CAST("RF_Model_7"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_7"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_7"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_7"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_7"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_7"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_7"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_7"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_7"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_7" UNION ALL SELECT "RF_Model_8"."KEY" AS "KEY", CAST("RF_Model_8"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_8"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_8"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_8"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_8"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_8"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_8"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_8"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_8"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_8" UNION ALL SELECT "RF_Model_9"."KEY" AS "KEY", CAST("RF_Model_9"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_9"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_9"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_9"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_9"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_9"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_9"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_9"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_9"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_9") AS "RF_esu_0"),
"DT_node_lookup_10" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.9000504423712101) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.2669247386386567) THEN 4 ELSE 5 END ELSE 6 END ELSE 7 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_10" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.363636363636364 AS "P_1", 0.636363636363636 AS "P_2", 2 AS "D", 0.636363636363636 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_10" AS
(SELECT "DT_node_lookup_10"."KEY" AS "KEY", "DT_node_lookup_10".node_id_2 AS node_id_2, "DT_node_data_10".nid AS nid, "DT_node_data_10"."P_0" AS "P_0", "DT_node_data_10"."P_1" AS "P_1", "DT_node_data_10"."P_2" AS "P_2", "DT_node_data_10"."D" AS "D", "DT_node_data_10"."DP" AS "DP"
FROM "DT_node_lookup_10" LEFT OUTER JOIN "DT_node_data_10" ON "DT_node_lookup_10".node_id_2 = "DT_node_data_10".nid),
"RF_Model_10" AS
(SELECT "DT_Output_10"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_10"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_10"."P_0" IS NULL OR "DT_Output_10"."P_0" > 0.0) THEN ln("DT_Output_10"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_10"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_10"."P_1" IS NULL OR "DT_Output_10"."P_1" > 0.0) THEN ln("DT_Output_10"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_10"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_10"."P_2" IS NULL OR "DT_Output_10"."P_2" > 0.0) THEN ln("DT_Output_10"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_10"),
"DT_node_lookup_11" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.2003479470757281) THEN CASE WHEN ("ADS_pre_1_OUT"."PC4" <= 0.04265235298720832) THEN 4 ELSE 5 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.379554491562844) THEN 7 ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.040352232576907) THEN 9 ELSE 10 END END END ELSE 11 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_11" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.052631578947368376 AS "P_1", 0.9473684210526315 AS "P_2", 2 AS "D", 0.9473684210526315 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.571428571428571 AS "P_1", 0.428571428571429 AS "P_2", 1 AS "D", 0.571428571428571 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 0.0 AS "P_0", 0.6 AS "P_1", 0.4 AS "P_2", 1 AS "D", 0.6 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 10 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 11 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_11" AS
(SELECT "DT_node_lookup_11"."KEY" AS "KEY", "DT_node_lookup_11".node_id_2 AS node_id_2, "DT_node_data_11".nid AS nid, "DT_node_data_11"."P_0" AS "P_0", "DT_node_data_11"."P_1" AS "P_1", "DT_node_data_11"."P_2" AS "P_2", "DT_node_data_11"."D" AS "D", "DT_node_data_11"."DP" AS "DP"
FROM "DT_node_lookup_11" LEFT OUTER JOIN "DT_node_data_11" ON "DT_node_lookup_11".node_id_2 = "DT_node_data_11".nid),
"RF_Model_11" AS
(SELECT "DT_Output_11"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_11"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_11"."P_0" IS NULL OR "DT_Output_11"."P_0" > 0.0) THEN ln("DT_Output_11"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_11"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_11"."P_1" IS NULL OR "DT_Output_11"."P_1" > 0.0) THEN ln("DT_Output_11"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_11"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_11"."P_2" IS NULL OR "DT_Output_11"."P_2" > 0.0) THEN ln("DT_Output_11"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_11"),
"DT_node_lookup_12" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.8617563505066399) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.4039450310106915) THEN 4 ELSE 5 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.2409526654291027) THEN 7 ELSE 8 END END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_12" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.625 AS "P_1", 0.375 AS "P_2", 1 AS "D", 0.625 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 0.714285714285714 AS "P_1", 0.285714285714286 AS "P_2", 1 AS "D", 0.714285714285714 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_12" AS
(SELECT "DT_node_lookup_12"."KEY" AS "KEY", "DT_node_lookup_12".node_id_2 AS node_id_2, "DT_node_data_12".nid AS nid, "DT_node_data_12"."P_0" AS "P_0", "DT_node_data_12"."P_1" AS "P_1", "DT_node_data_12"."P_2" AS "P_2", "DT_node_data_12"."D" AS "D", "DT_node_data_12"."DP" AS "DP"
FROM "DT_node_lookup_12" LEFT OUTER JOIN "DT_node_data_12" ON "DT_node_lookup_12".node_id_2 = "DT_node_data_12".nid),
"RF_Model_12" AS
(SELECT "DT_Output_12"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_12"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_12"."P_0" IS NULL OR "DT_Output_12"."P_0" > 0.0) THEN ln("DT_Output_12"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_12"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_12"."P_1" IS NULL OR "DT_Output_12"."P_1" > 0.0) THEN ln("DT_Output_12"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_12"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_12"."P_2" IS NULL OR "DT_Output_12"."P_2" > 0.0) THEN ln("DT_Output_12"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_12"),
"DT_node_lookup_13" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC2" <= -0.7439061782557091) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.2926068403415267) THEN 3 ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.017360589210772742) THEN 5 ELSE 6 END END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.22883929301935602) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.9000504423712101) THEN 9 ELSE 10 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= 0.2280435636734822) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.01563695558197669) THEN 13 ELSE 14 END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.9157154431689718) THEN 16 ELSE 17 END END END END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_13" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 3 AS nid, 0.0 AS "P_0", 0.666666666666667 AS "P_1", 0.333333333333333 AS "P_2", 1 AS "D", 0.666666666666667 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS nid, 0.25 AS "P_0", 0.75 AS "P_1", 0.0 AS "P_2", 1 AS "D", 0.75 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 10 AS nid, 0.285714285714286 AS "P_0", 0.571428571428571 AS "P_1", 0.142857142857143 AS "P_2", 1 AS "D", 0.571428571428571 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 13 AS nid, 0.0 AS "P_0", 0.466666666666667 AS "P_1", 0.533333333333333 AS "P_2", 2 AS "D", 0.533333333333333 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 14 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 16 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 17 AS nid, 0.222222222222222 AS "P_0", 0.777777777777778 AS "P_1", 0.0 AS "P_2", 1 AS "D", 0.777777777777778 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_13" AS
(SELECT "DT_node_lookup_13"."KEY" AS "KEY", "DT_node_lookup_13".node_id_2 AS node_id_2, "DT_node_data_13".nid AS nid, "DT_node_data_13"."P_0" AS "P_0", "DT_node_data_13"."P_1" AS "P_1", "DT_node_data_13"."P_2" AS "P_2", "DT_node_data_13"."D" AS "D", "DT_node_data_13"."DP" AS "DP"
FROM "DT_node_lookup_13" LEFT OUTER JOIN "DT_node_data_13" ON "DT_node_lookup_13".node_id_2 = "DT_node_data_13".nid),
"RF_Model_13" AS
(SELECT "DT_Output_13"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_13"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_13"."P_0" IS NULL OR "DT_Output_13"."P_0" > 0.0) THEN ln("DT_Output_13"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_13"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_13"."P_1" IS NULL OR "DT_Output_13"."P_1" > 0.0) THEN ln("DT_Output_13"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_13"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_13"."P_2" IS NULL OR "DT_Output_13"."P_2" > 0.0) THEN ln("DT_Output_13"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_13"),
"DT_node_lookup_14" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.318013878932838) THEN 3 ELSE CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.5012897374017098) THEN 5 ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -0.95901586978046) THEN 7 ELSE 8 END END END ELSE 9 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_14" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 3 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS nid, 0.0 AS "P_0", 0.25 AS "P_1", 0.75 AS "P_2", 2 AS "D", 0.75 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 0.7 AS "P_1", 0.3 AS "P_2", 1 AS "D", 0.7 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_14" AS
(SELECT "DT_node_lookup_14"."KEY" AS "KEY", "DT_node_lookup_14".node_id_2 AS node_id_2, "DT_node_data_14".nid AS nid, "DT_node_data_14"."P_0" AS "P_0", "DT_node_data_14"."P_1" AS "P_1", "DT_node_data_14"."P_2" AS "P_2", "DT_node_data_14"."D" AS "D", "DT_node_data_14"."DP" AS "DP"
FROM "DT_node_lookup_14" LEFT OUTER JOIN "DT_node_data_14" ON "DT_node_lookup_14".node_id_2 = "DT_node_data_14".nid),
"RF_Model_14" AS
(SELECT "DT_Output_14"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_14"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_14"."P_0" IS NULL OR "DT_Output_14"."P_0" > 0.0) THEN ln("DT_Output_14"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_14"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_14"."P_1" IS NULL OR "DT_Output_14"."P_1" > 0.0) THEN ln("DT_Output_14"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_14"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_14"."P_2" IS NULL OR "DT_Output_14"."P_2" > 0.0) THEN ln("DT_Output_14"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_14"),
"DT_node_lookup_15" AS
(SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", CASE WHEN ("ADS_pre_1_OUT"."PC1" <= 0.6077540617724528) THEN CASE WHEN ("ADS_pre_1_OUT"."PC2" <= -0.0386800519455172) THEN CASE WHEN ("ADS_pre_1_OUT"."PC3" <= -0.251509955577662) THEN 4 ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.040352232576907) THEN 6 ELSE 7 END END ELSE CASE WHEN ("ADS_pre_1_OUT"."PC1" <= -1.342748413570157) THEN 9 ELSE 10 END END ELSE 11 END AS node_id_2
FROM "ADS_pre_1_OUT"),
"DT_node_data_15" AS
(SELECT "Values".nid AS nid, "Values"."P_0" AS "P_0", "Values"."P_1" AS "P_1", "Values"."P_2" AS "P_2", "Values"."D" AS "D", "Values"."DP" AS "DP"
FROM (SELECT 4 AS nid, 0.0 AS "P_0", 0.2 AS "P_1", 0.8 AS "P_2", 2 AS "D", 0.8 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS nid, 0.0 AS "P_0", 0.2 AS "P_1", 0.8 AS "P_2", 2 AS "D", 0.8 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS nid, 0.0 AS "P_0", 0.0 AS "P_1", 1.0 AS "P_2", 2 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 10 AS nid, 0.0 AS "P_0", 1.0 AS "P_1", 0.0 AS "P_2", 1 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 11 AS nid, 1.0 AS "P_0", 0.0 AS "P_1", 0.0 AS "P_2", 0 AS "D", 1.0 AS "DP" FROM SYSIBM.SYSDUMMY1) AS "Values"),
"DT_Output_15" AS
(SELECT "DT_node_lookup_15"."KEY" AS "KEY", "DT_node_lookup_15".node_id_2 AS node_id_2, "DT_node_data_15".nid AS nid, "DT_node_data_15"."P_0" AS "P_0", "DT_node_data_15"."P_1" AS "P_1", "DT_node_data_15"."P_2" AS "P_2", "DT_node_data_15"."D" AS "D", "DT_node_data_15"."DP" AS "DP"
FROM "DT_node_lookup_15" LEFT OUTER JOIN "DT_node_data_15" ON "DT_node_lookup_15".node_id_2 = "DT_node_data_15".nid),
"RF_Model_15" AS
(SELECT "DT_Output_15"."KEY" AS "KEY", CAST(NULL AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", "DT_Output_15"."P_0" AS "Proba_1789-07-14T00:00:00.000000000", CASE WHEN ("DT_Output_15"."P_0" IS NULL OR "DT_Output_15"."P_0" > 0.0) THEN ln("DT_Output_15"."P_0") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", "DT_Output_15"."P_1" AS "Proba_1789-08-14T00:00:00.000000000", CASE WHEN ("DT_Output_15"."P_1" IS NULL OR "DT_Output_15"."P_1" > 0.0) THEN ln("DT_Output_15"."P_1") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", "DT_Output_15"."P_2" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN ("DT_Output_15"."P_2" IS NULL OR "DT_Output_15"."P_2" > 0.0) THEN ln("DT_Output_15"."P_2") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "DT_Output_15"),
"RF_1" AS
(SELECT "RF_esu_1"."KEY" AS "KEY", "RF_esu_1"."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", "RF_esu_1"."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", "RF_esu_1"."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", "RF_esu_1"."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", "RF_esu_1"."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", "RF_esu_1"."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", "RF_esu_1"."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", "RF_esu_1"."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", "RF_esu_1"."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000"
FROM (SELECT "RF_Model_10"."KEY" AS "KEY", CAST("RF_Model_10"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_10"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_10"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_10"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_10"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_10"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_10"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_10"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_10"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_10" UNION ALL SELECT "RF_Model_11"."KEY" AS "KEY", CAST("RF_Model_11"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_11"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_11"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_11"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_11"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_11"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_11"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_11"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_11"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_11" UNION ALL SELECT "RF_Model_12"."KEY" AS "KEY", CAST("RF_Model_12"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_12"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_12"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_12"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_12"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_12"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_12"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_12"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_12"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_12" UNION ALL SELECT "RF_Model_13"."KEY" AS "KEY", CAST("RF_Model_13"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_13"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_13"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_13"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_13"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_13"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_13"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_13"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_13"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_13" UNION ALL SELECT "RF_Model_14"."KEY" AS "KEY", CAST("RF_Model_14"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_14"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_14"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_14"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_14"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_14"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_14"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_14"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_14"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_14" UNION ALL SELECT "RF_Model_15"."KEY" AS "KEY", CAST("RF_Model_15"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_Model_15"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_Model_15"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_Model_15"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_Model_15"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_Model_15"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_Model_15"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_Model_15"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_Model_15"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_Model_15") AS "RF_esu_1"),
"RF" AS
(SELECT "RFbig_esu"."KEY" AS "KEY", "RFbig_esu"."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", "RFbig_esu"."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", "RFbig_esu"."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", "RFbig_esu"."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", "RFbig_esu"."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", "RFbig_esu"."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", "RFbig_esu"."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", "RFbig_esu"."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", "RFbig_esu"."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000"
FROM (SELECT "RF_0"."KEY" AS "KEY", CAST("RF_0"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_0"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_0"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_0"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_0"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_0"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_0"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_0"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_0"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_0" UNION ALL SELECT "RF_1"."KEY" AS "KEY", CAST("RF_1"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("RF_1"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("RF_1"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("RF_1"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("RF_1"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("RF_1"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("RF_1"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("RF_1"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("RF_1"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF_1") AS "RFbig_esu"),
"RF_avg" AS
(SELECT "T"."KEY" AS "KEY", CAST("T"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-07-14T00:00:00.000000000", CAST("T"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", CAST("T"."LogProba_1789-07-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST("T"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-08-14T00:00:00.000000000", CAST("T"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", CAST("T"."LogProba_1789-08-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST("T"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Score_1789-09-14T00:00:00.000000000", CAST("T"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", CAST("T"."LogProba_1789-09-14T00:00:00.000000000" AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM (SELECT "RF"."KEY" AS "KEY", AVG(DOUBLE((CAST("RF"."Score_1789-07-14T00:00:00.000000000" AS DOUBLE)))) AS "Score_1789-07-14T00:00:00.000000000", AVG(DOUBLE((CAST("RF"."Proba_1789-07-14T00:00:00.000000000" AS DOUBLE)))) AS "Proba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", AVG(DOUBLE((CAST("RF"."Score_1789-08-14T00:00:00.000000000" AS DOUBLE)))) AS "Score_1789-08-14T00:00:00.000000000", AVG(DOUBLE((CAST("RF"."Proba_1789-08-14T00:00:00.000000000" AS DOUBLE)))) AS "Proba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", AVG(DOUBLE((CAST("RF"."Score_1789-09-14T00:00:00.000000000" AS DOUBLE)))) AS "Score_1789-09-14T00:00:00.000000000", AVG(DOUBLE((CAST("RF"."Proba_1789-09-14T00:00:00.000000000" AS DOUBLE)))) AS "Proba_1789-09-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000"
FROM "RF" GROUP BY "RF"."KEY") AS "T"),
orig_cte AS
(SELECT "RF_avg"."KEY" AS "KEY", "RF_avg"."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", "RF_avg"."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", "RF_avg"."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", "RF_avg"."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", "RF_avg"."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", "RF_avg"."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", "RF_avg"."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", "RF_avg"."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", "RF_avg"."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000", NULL AS "Decision", CAST(NULL AS DOUBLE) AS "DecisionProba"
FROM "RF_avg"),
score_class_union AS
(SELECT scu."KEY_u" AS "KEY_u", scu.class AS class, scu."LogProba" AS "LogProba", scu."Proba" AS "Proba", scu."Score" AS "Score"
FROM (SELECT orig_cte."KEY" AS "KEY_u", '1789-07-14T00:00:00.000000000' AS class, orig_cte."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba", orig_cte."Proba_1789-07-14T00:00:00.000000000" AS "Proba", orig_cte."Score_1789-07-14T00:00:00.000000000" AS "Score"
FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", '1789-08-14T00:00:00.000000000' AS class, orig_cte."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba", orig_cte."Proba_1789-08-14T00:00:00.000000000" AS "Proba", orig_cte."Score_1789-08-14T00:00:00.000000000" AS "Score"
FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", '1789-09-14T00:00:00.000000000' AS class, orig_cte."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba", orig_cte."Proba_1789-09-14T00:00:00.000000000" AS "Proba", orig_cte."Score_1789-09-14T00:00:00.000000000" AS "Score"
FROM orig_cte) AS scu),
score_max AS
(SELECT orig_cte."KEY" AS "KEY", orig_cte."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", orig_cte."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", orig_cte."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", orig_cte."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", orig_cte."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", orig_cte."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", orig_cte."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", orig_cte."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", orig_cte."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000", orig_cte."Decision" AS "Decision", orig_cte."DecisionProba" AS "DecisionProba", max_select."KEY_m" AS "KEY_m", max_select."max_Proba" AS "max_Proba"
FROM orig_cte LEFT OUTER JOIN (SELECT score_class_union."KEY_u" AS "KEY_m", max(score_class_union."Proba") AS "max_Proba"
FROM score_class_union GROUP BY score_class_union."KEY_u") AS max_select ON orig_cte."KEY" = max_select."KEY_m"),
union_with_max AS
(SELECT score_class_union."KEY_u" AS "KEY_u", score_class_union.class AS class, score_class_union."LogProba" AS "LogProba", score_class_union."Proba" AS "Proba", score_class_union."Score" AS "Score", score_max."KEY" AS "KEY", score_max."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", score_max."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", score_max."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", score_max."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", score_max."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", score_max."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", score_max."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", score_max."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", score_max."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Proba" AS "max_Proba"
FROM score_class_union LEFT OUTER JOIN score_max ON score_class_union."KEY_u" = score_max."KEY"),
arg_max_cte AS
(SELECT score_max."KEY" AS "KEY", score_max."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", score_max."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", score_max."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", score_max."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", score_max."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", score_max."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", score_max."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", score_max."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", score_max."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Proba" AS "max_Proba", "arg_max_t_Proba"."KEY_Proba" AS "KEY_Proba", "arg_max_t_Proba"."arg_max_Proba" AS "arg_max_Proba"
FROM score_max LEFT OUTER JOIN (SELECT union_with_max."KEY" AS "KEY_Proba", max(union_with_max.class) AS "arg_max_Proba"
FROM union_with_max
WHERE union_with_max."max_Proba" <= union_with_max."Proba" GROUP BY union_with_max."KEY") AS "arg_max_t_Proba" ON score_max."KEY" = "arg_max_t_Proba"."KEY_Proba")
SELECT arg_max_cte."KEY" AS "KEY", arg_max_cte."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", arg_max_cte."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", arg_max_cte."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", arg_max_cte."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", arg_max_cte."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", arg_max_cte."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN (arg_max_cte."Proba_1789-07-14T00:00:00.000000000" IS NULL OR arg_max_cte."Proba_1789-07-14T00:00:00.000000000" > 0.0) THEN ln(arg_max_cte."Proba_1789-07-14T00:00:00.000000000") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CASE WHEN (arg_max_cte."Proba_1789-08-14T00:00:00.000000000" IS NULL OR arg_max_cte."Proba_1789-08-14T00:00:00.000000000" > 0.0) THEN ln(arg_max_cte."Proba_1789-08-14T00:00:00.000000000") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CASE WHEN (arg_max_cte."Proba_1789-09-14T00:00:00.000000000" IS NULL OR arg_max_cte."Proba_1789-09-14T00:00:00.000000000" > 0.0) THEN ln(arg_max_cte."Proba_1789-09-14T00:00:00.000000000") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000", arg_max_cte."arg_max_Proba" AS "Decision", arg_max_cte."max_Proba" AS "DecisionProba"
FROM arg_max_cte
|
CREATE TABLE clients (
id INT NOT NULL UNIQUE,
active BOOLEAN DEFAULT TRUE,
created INT NOT NULL,
secret VARCHAR(60) NOT NULL DEFAULT '',
email VARCHAR(255),
notes VARCHAR(100) DEFAULT '',
otp VARCHAR(100) DEFAULT '',
PRIMARY KEY (id)
);
CREATE TABLE yubikeys (
active BOOLEAN DEFAULT TRUE,
created INT NOT NULL,
modified INT NOT NULL,
yk_publicname VARCHAR(16) UNIQUE NOT NULL,
yk_counter INT NOT NULL,
yk_use INT NOT NULL,
yk_low INT NOT NULL,
yk_high INT NOT NULL,
nonce VARCHAR(40) DEFAULT '',
notes VARCHAR(100) DEFAULT '',
PRIMARY KEY (yk_publicname)
);
CREATE TABLE queue (
queued INT DEFAULT NULL,
modified INT DEFAULT NULL,
server_nonce VARCHAR(32) NOT NULL,
otp VARCHAR(100) NOT NULL,
server VARCHAR(100) NOT NULL,
info VARCHAR(256) NOT NULL
);
|
--
-- Table: testmeasurement
--
CREATE TABLE "testmeasurement" (
"testid" bigint NOT NULL,
"name" character varying(70) NOT NULL,
"type" character varying(70) NOT NULL,
"value" text NOT NULL
);
CREATE INDEX "testmeasurement_testid_idx" on "testmeasurement" ("testid");
--
-- Table: dailyupdate
--
CREATE TABLE "dailyupdate" (
"id" serial NOT NULL,
"projectid" bigint NOT NULL,
"date" date NOT NULL,
"command" text NOT NULL,
"type" character varying(4) DEFAULT '' NOT NULL,
"status" smallint DEFAULT '0' NOT NULL
);
CREATE INDEX "dailyupdate_buildid_idx" on "dailyupdate" ("id");
--
-- Table: dailyupdatefile
--
CREATE TABLE "dailyupdatefile" (
"dailyupdateid" bigint DEFAULT '0' NOT NULL,
"filename" character varying(255) DEFAULT '' NOT NULL,
"checkindate" timestamp(0) DEFAULT CURRENT_TIMESTAMP NOT NULL,
"author" character varying(255) DEFAULT '' NOT NULL,
"log" text NOT NULL,
"revision" character varying(10) DEFAULT '0' NOT NULL,
"priorrevision" character varying(10) DEFAULT '0' NOT NULL
);
CREATE INDEX "dailyupdatefile_buildid_idx" on "dailyupdatefile" ("dailyupdateid");
|
CREATE TABLE "table_versions" (
"id" serial NOT NULL,
"table_name" varchar NOT NULL UNIQUE,
"version" integer NOT NULL DEFAULT '0',
"last_update" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT table_versions_pk PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
INSERT INTO table_versions VALUES(1,'db_version',9,'2018-10-22 22:56:43');
INSERT INTO table_versions VALUES(2,'table_versions',0,'2017-11-11 08:57:42');
INSERT INTO table_versions VALUES(3,'accounts',1,'2018-05-03 14:06:03');
INSERT INTO table_versions VALUES(4,'characters',9,'2018-10-22 22:56:43');
INSERT INTO table_versions VALUES(7,'supergroups',1,'2018-10-22 22:56:43');
INSERT INTO table_versions VALUES(8,'emails',0,'2018-09-23 08:00:00');
CREATE TABLE "accounts" (
"id" integer NOT NULL,
"max_slots" integer NOT NULL DEFAULT '8',
CONSTRAINT accounts_pk PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "characters" (
"id" serial NOT NULL,
"char_level" integer NOT NULL DEFAULT '1',
"slot_index" integer NOT NULL DEFAULT '0',
"account_id" integer NOT NULL DEFAULT '0',
"char_name" varchar(20) NOT NULL,
"costume_data" bytea NOT NULL,
"chardata" bytea NOT NULL,
"entitydata" bytea NOT NULL,
"player_data" bytea NOT NULL,
"supergroup_id" integer NOT NULL DEFAULT '0',
CONSTRAINT characters_pk PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE "supergroups" (
"id" serial NOT NULL,
"sg_name" varchar(30) NOT NULL,
"sg_data" bytea NOT NULL,
"sg_members" bytea NOT NULL,
CONSTRAINT supergroups_pk PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
CREATE TABLE 'emails'(
`id` serial NOT NULL,
`sender_id` integer NOT NULL,
`recipient_id` integer NOT NULL,
`email_data` bytea NOT NULL,
CONSTRAINT emails_pk PRIMARY KEY ("id")
);
ALTER TABLE "emails" ADD CONSTRAINT "emails_fk0" FOREIGN KEY ("sender_id") REFERENCES "characters"("id");
ALTER TABLE "emails" ADD CONSTRAINT "emails_fk1" FOREIGN KEY ("recipient_id") REFERENCES "characters"("id");
ALTER TABLE "characters" ADD CONSTRAINT "characters_fk0" FOREIGN KEY ("account_id") REFERENCES "accounts"("id");
|
CREATE TABLE IF NOT EXISTS users(
id integer auto_increment primary key,
username varchar(20) not null ,
password varchar(20) not null,
created_at DATETIME,
updated_at DATETIME
);
|
\c doj;
INSERT INTO registrations (contest_id, username) VALUES (
'test0001',
'ucpr'
);
INSERT INTO registrations (contest_id, username) VALUES (
'test0002',
'ucpr'
);
INSERT INTO registrations (contest_id, username) VALUES (
'test0003',
'ucpr'
);
|
--Main permissions for schema
GRANT ALL ON SCHEMA eco_bundle_organicpizza to public; GRANT ALL ON SCHEMA eco_bundle_organicpizza to anon;
CREATE TABLE pizzas (
id text NOT NULL PRIMARY KEY,
name text,
description text,
image text,
slug text,
keywords text[]
);
CREATE TABLE toppings (
id text NOT NULL PRIMARY KEY,
name text,
description text,
supplierref text,
suppliername text,
supplierlocation text,
packsizekg numeric(35,2),
servingsizeg integer,
packprice numeric(35,2),
image text,
fatper100 numeric(35,2),
carbsper100 numeric(35,2),
protienper100 numeric(35,2),
slug text
);
CREATE VIEW toppings_info AS
SELECT toppings.*,
packprice / ((toppings.packsizekg * 1000) / toppings.servingsizeg) as costperserving,
(100 / toppings.servingsizeg) * toppings.fatper100 as fatperserving,
(100 / toppings.servingsizeg) * toppings.carbsper100 as carbsperserving,
(100 / toppings.servingsizeg) * toppings.protienper100 as protienperserving
FROM toppings;
-- Public web pages and anon(for functions)
GRANT SELECT on TABLE toppings_info TO anon;
CREATE TABLE toppingsperpizza (
id serial PRIMARY KEY,
pizza text NOT NULL references pizzas(id),
topping text NOT NULL references toppings(id),
servings integer
);
CREATE VIEW toppingsperpizza_info AS
SELECT toppingsperpizza.*,
toppings_info.name,
toppings_info.costperserving,
toppings_info.slug
FROM toppingsperpizza
LEFT JOIN toppings_info
ON toppingsperpizza.topping = toppings_info.id;
-- Public web pages and anon(for functions)
GRANT SELECT on TABLE toppingsperpizza_info TO anon;
CREATE VIEW pizzas_info AS
SELECT pizzas.*,
-- toppingsperpizza.topping,
-- toppingsperpizza.servings,
SUM(toppings_info.fatperserving * toppingsperpizza.servings) AS totalfat,
SUM(toppings_info.carbsperserving * toppingsperpizza.servings) AS totalcarbs,
SUM(toppings_info.protienperserving * toppingsperpizza.servings) AS totalprotien,
SUM(toppings_info.costperserving * toppingsperpizza.servings) AS totalcost,
SUM(toppings_info.costperserving * toppingsperpizza.servings) * 3 AS price
FROM pizzas
LEFT JOIN toppingsperpizza
ON pizzas.id = toppingsperpizza.pizza
LEFT JOIN toppings_info
ON toppingsperpizza.topping = toppings_info.id
GROUP BY pizzas.id;
-- Public web pages and anon(for functions)
GRANT SELECT on TABLE pizzas_info TO anon;
CREATE TABLE cartlines (
id serial PRIMARY KEY,
pizza_id text NOT NULL references pizzas(id),
user_id uuid NOT NULL,
created timestamp without time zone NOT NULL default (now() at time zone 'utc'),
qty_ordered integer default 1,
price numeric(35,2) NOT NULL,
image text,
title text
);
-- Hard restrict access to view/update/insert cartlines (remember doesnt affect views)
ALTER TABLE cartlines ENABLE ROW LEVEL SECURITY;
-- Allow anon to use the cartline sequencer
GRANT USAGE ON SEQUENCE cartlines_id_seq TO anon;
-- Allow anon access to cartlines...
GRANT SELECT, INSERT, UPDATE, DELETE on cartlines TO anon;
-- ...but restrict anon's ability to manipulate only his own cartlines
CREATE POLICY restrict_cartlines ON cartlines
USING (current_setting('my.user_id')::uuid IN (user_id));
--cart line insert logic
CREATE FUNCTION cartline_init() RETURNS trigger AS $$
DECLARE
-- Must specify the schema name within the function, otherwise it won't find the table when it runs
product eco_bundle_organicpizza.pizzas_info%ROWTYPE;
BEGIN
-- Run the user id restriction
IF current_user = 'anon' THEN
NEW.user_id = current_setting('my.user_id')::uuid;
END IF;
-- Reference the item id and bring in item information to be hard coded into the line
-- The logic of this is to make sure item info (e.g. description, price) is locked down at the time of adding
-- the line and not cross referenced at all points in the future
-- Must specify the schema name within the function, otherwise it won't find the table when it runs
SELECT * INTO product FROM eco_bundle_organicpizza.pizzas_info WHERE pizzas_info.id = NEW.pizza_id;
NEW.price := product.price;
NEW.title := product.name;
NEW.image := product.image;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER cartline_init
BEFORE INSERT ON cartlines FOR EACH ROW EXECUTE PROCEDURE cartline_init();
-- View of all cartlines
CREATE VIEW cartlines_full AS
SELECT
o.*,
o.price * o.qty_ordered AS total_price
FROM cartlines o;
-- View of cartlines restricted to customer
CREATE VIEW cartlines_customer AS
SELECT
o.*,
o.price * o.qty_ordered AS total_price
FROM cartlines o
WHERE o.user_id = current_setting('my.user_id')::uuid;
-- Grant anon the right to view their own cartlines
GRANT SELECT on cartlines_customer to anon;
-- Simple cart view talies customer cartlines
CREATE VIEW my_cart AS
SELECT
SUM(cl.total_price) AS order_total
FROM cartlines_customer cl
GROUP BY cl.user_id;
GRANT SELECT ON my_cart TO anon;
CREATE TABLE orders (
id serial PRIMARY KEY,
user_id uuid NOT NULL,
created timestamp without time zone NOT NULL default (now() at time zone 'utc'),
total numeric(35,2) NOT NULL,
contents text,
address text,
phone varchar(18)
);
-- Hard restrict access to view/update/insert cartlines (remember doesnt affect views)
ALTER TABLE orders ENABLE ROW LEVEL SECURITY;
-- Allow anon to use the sequencer
GRANT USAGE ON SEQUENCE orders_id_seq TO anon;
-- Allow anon access to orders (and select for return value)...
GRANT INSERT, SELECT on orders TO anon;
-- ...but restrict anon's ability to manipulate only his own orders
CREATE POLICY restrict_orders ON orders
USING (current_setting('my.user_id')::uuid IN (user_id));
--order insert logic
CREATE FUNCTION order_init() RETURNS trigger AS $$
DECLARE
my_cart eco_bundle_organicpizza.my_cart%ROWTYPE;
tempContents text;
cl eco_bundle_organicpizza.cartlines_customer%ROWTYPE;
BEGIN
-- Run the user id restriction
IF current_user = 'anon' THEN
NEW.user_id = current_setting('my.user_id')::uuid;
END IF;
tempContents := '';
SELECT * INTO my_cart FROM eco_bundle_organicpizza.my_cart;
NEW.total := my_cart.order_total;
-- Delete cartlines and compile order text
FOR cl IN
SELECT * FROM eco_bundle_organicpizza.cartlines_customer
LOOP
tempContents := tempContents || cl.qty_ordered || ' x ' || cl.title || ' @ ' || cl.price || ' = ' || cl.total_price || '
';
DELETE FROM eco_bundle_organicpizza.cartlines WHERE id = cl.id;
END LOOP;
NEW.contents := tempContents;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER order_init
BEFORE INSERT ON orders FOR EACH ROW EXECUTE PROCEDURE order_init();
|
drop table if exists common_code cascade;
-- 共通コード
create table common_code (
code_key varchar(50),
code_type varchar(50) not null,
code_name varchar(60) not null,
code_name_en varchar(60),
code_value varchar(256) not null,
use_yn char(1) default 'Y',
view_order int default 1,
css_class varchar(30),
image varchar(256),
description varchar(256),
insert_date timestamp with time zone default now(),
constraint common_code_pk primary key (code_key)
);
comment on table common_code is '共通コード';
comment on column common_code.code_key is '固有のキー';
comment on column common_code.code_type is 'コード分類';
comment on column common_code.code_name is 'コード名';
comment on column common_code.code_name_en is '英語コード名';
comment on column common_code.code_value is 'コード値';
comment on column common_code.use_yn is 'を使用の有無、Y:使用(基本)、N:を無効にする';
comment on column common_code.view_order is 'の表示順。デフォルト1';
comment on column common_code.css_class is 'css class';
comment on column common_code.image is '画像パス';
comment on column common_code.description is 'の説明';
comment on column common_code.insert_date is '登録';
|
drop materialized view if exists mv_flood_event_world_pop_village_summary;
create materialized view mv_flood_event_world_pop_village_summary as
with flooded_count as (
select
flood_event_id,
a.dc_code,
a.sub_dc_code,
a.village_code,
b.name,
round(sum(pop_sum)) as flooded_population_count
from (
select
flood_event_id,
dc_code,
sub_dc_code,
village_code,
sum(pop_sum) as pop_sum
from mv_flood_event_world_pop
where depth_class > 2
group by flood_event_id, dc_code, sub_dc_code, village_code, depth_class) a
join village b on a.village_code = b.village_code
group by flood_event_id, a.dc_code, a.sub_dc_code, a.village_code, b.name)
select
a.flood_event_id,
a.dc_code as district_id,
a.sub_dc_code as sub_district_id,
a.village_code as village_id,
a.name,
round(b.pop_sum) as population_count,
a.flooded_population_count,
c.trigger_status
from flooded_count a
join world_pop_village_stats b on a.village_code = b.village_code
left join village_trigger_status c on a.flood_event_id = c.flood_event_id and a.village_code = c.village_id
WITH NO DATA;
|
-- Prepare upgrade of model
IF EXISTS (SELECT 1 FROM sys.schemas WHERE name = 'metadata')
BEGIN
-- is job name not knotted?
IF EXISTS (
select *
from sys.tables t
join sys.columns c
on c.object_id = t.object_id
join sys.schemas s
on s.schema_id = t.schema_id
where t.[name] = 'JB_NAM_Job_Name'
and c.[name] = 'JB_NAM_Job_Name'
and s.[name] = 'metadata'
)
BEGIN
SELECT *
INTO metadata.old_JB_NAM_Job_Name
FROM metadata.JB_NAM_Job_Name;
IF OBJECT_ID('metadata.lJB_Job') is not null
DROP VIEW metadata.lJB_Job;
IF OBJECT_ID('metadata.pJB_Job') is not null
DROP FUNCTION metadata.pJB_Job;
DROP TABLE metadata.JB_NAM_Job_Name;
END
IF EXISTS (
select *
from sys.tables t
join sys.columns c
on c.object_id = t.object_id
join sys.schemas s
on s.schema_id = t.schema_id
where t.[name] = 'JB_AID_Job_AgentJobId'
and c.[name] = 'JB_AID_Job_AgentJobId'
and s.[name] = 'metadata'
)
BEGIN
SELECT *
INTO metadata.old_JB_AID_Job_AgentJobId
FROM metadata.JB_AID_Job_AgentJobId;
IF OBJECT_ID('metadata.lJB_Job') is not null
DROP VIEW metadata.lJB_Job;
IF OBJECT_ID('metadata.pJB_Job') is not null
DROP FUNCTION metadata.pJB_Job;
DROP TABLE metadata.JB_AID_Job_AgentJobId;
END
IF EXISTS (
select *
from sys.tables t
join sys.columns c
on c.object_id = t.object_id
join sys.schemas s
on s.schema_id = t.schema_id
where t.[name] = 'WO_NAM_Work_Name'
and c.[name] = 'WO_NAM_Work_Name'
and s.[name] = 'metadata'
)
BEGIN
SELECT *
INTO metadata.old_WO_NAM_Work_Name
FROM metadata.WO_NAM_Work_Name;
IF OBJECT_ID('metadata.lWO_Work') is not null
DROP VIEW metadata.lWO_Work;
IF OBJECT_ID('metadata.pWO_Work') is not null
DROP FUNCTION metadata.pWO_Work;
DROP TABLE metadata.WO_NAM_Work_Name;
END
IF EXISTS (
select *
from sys.tables t
join sys.columns c
on c.object_id = t.object_id
join sys.schemas s
on s.schema_id = t.schema_id
where t.[name] = 'WO_USR_Work_InvocationUser'
and c.[name] = 'WO_USR_Work_InvocationUser'
and s.[name] = 'metadata'
)
BEGIN
SELECT *
INTO metadata.old_WO_USR_Work_InvocationUser
FROM metadata.WO_USR_Work_InvocationUser;
IF OBJECT_ID('metadata.lWO_Work') is not null
DROP VIEW metadata.lWO_Work;
IF OBJECT_ID('metadata.pWO_Work') is not null
DROP FUNCTION metadata.pWO_Work;
DROP TABLE metadata.WO_USR_Work_InvocationUser;
END
IF EXISTS (
select *
from sys.tables t
join sys.columns c
on c.object_id = t.object_id
join sys.schemas s
on s.schema_id = t.schema_id
where t.[name] = 'WO_ROL_Work_InvocationRole'
and c.[name] = 'WO_ROL_Work_InvocationRole'
and s.[name] = 'metadata'
)
BEGIN
SELECT *
INTO metadata.old_WO_ROL_Work_InvocationRole
FROM metadata.WO_ROL_Work_InvocationRole;
IF OBJECT_ID('metadata.lWO_Work') is not null
DROP VIEW metadata.lWO_Work;
IF OBJECT_ID('metadata.pWO_Work') is not null
DROP FUNCTION metadata.pWO_Work;
DROP TABLE metadata.WO_ROL_Work_InvocationRole;
END
END
|
# exploration
SELECT * FROM nodes LIMIT 500;
SELECT * FROM labels LIMIT 500;
SELECT * FROM layouts LIMIT 300;
SELECT DISTINCT namespace FROM layouts LIMIT 300;
SELECT * FROM nodes_attributes LIMIT 300;
SELECT * FROM attributes LIMIT 300;
# query sample edge list file
SELECT node1_id, node2_id FROM edges
INNER JOIN (SELECT id FROM nodes LIMIT 500) AS n
ON n.id = edges.node1_id
INNER JOIN (SELECT id FROM nodes LIMIT 500) AS m
ON m.id = edges.node2_id
LIMIT 1000;
# query sample attributes file
SELECT node_id, attribute_id, namespace, name, description FROM nodes_attributes
INNER JOIN (SELECT id FROM nodes LIMIT 500) AS n
ON n.id = nodes_attributes.node_id
INNER JOIN attributes as att
ON att.id = nodes_attributes.attribute_id
LIMIT 20000;
# query sample layout file
SELECT node_id, x_loc, y_loc, z_loc, r_val, g_val, b_val, a_val, namespace FROM layouts
INNER JOIN (SELECT id FROM nodes LIMIT 500) AS n
ON n.id = layouts.node_id LIMIT 1000;
# query sample labels file
SELECT x_loc, y_loc, z_loc, text, namespace FROM labels LIMIT 500;
|
-- categories
INSERT INTO `ec-schema`.`categories` (`category_id`, `category_name`, `category_description`, `category_path`) VALUES ('1', 'category_1', 'category_1_desc', 'category_path_1');
INSERT INTO `ec-schema`.`categories` (`category_id`, `category_name`, `category_description`, `category_path`) VALUES ('2', 'category_2', 'category_2_desc', 'category_path_2');
INSERT INTO `ec-schema`.`categories` (`category_id`, `category_name`, `category_description`, `category_path`) VALUES ('3', 'category_3', 'category_3_desc', 'category_path_3');
INSERT INTO `ec-schema`.`categories` (`category_id`, `category_name`, `category_description`, `category_path`) VALUES ('4', 'category_4', 'category_4_desc', 'category_path_4');
-- test users
-- additional member user
INSERT INTO `users` (`user_id`, `first_name`, `last_name`, `email`, `password`, `user_type_id`)
VALUES ( 'a2901f19-715a-44fe-9701-fae6713fd764', 'Member', 'Test', 'test_member2@test.com', '$2y$10$bqu9h3ffWjQKjp5p3cB9iudPB75agR2smLd0dme7edCwti7mAznNy', '2');
--- products: endDate
INSERT INTO `ec-schema`.`products` (`product_id`, `product_name`, `product_description`, `product_path`, `product_base_unit_price`, `average_review_point`, `category_id`, `is_public`, `cheapest_price`, `highest_price`, `release_date`)
VALUES ('9e3e67ca-d058-41f0-aad5-4f09c956a81f', 'test_name_1', 'test_desc_1', 'test-path-1', '12.21', '4.21', '1', '1', '7.00', '123.00', '2021-01-07 00:00:00');
-- product variant 1-1 (unit price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `variant_unit_price`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('1', '1', 'white', '123.00', '12', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', '1.00', '1.00', '1.00', '1.00');
-- product variant 1-2 (unit price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `variant_unit_price`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('2', '2', 'black', '13.00', '20', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', '1.00', '1.00', '1.00', '1.00');
-- product variant 1-3 (discount & unit price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `variant_unit_price`, `is_discount`, `variant_discount_price`, `variant_discount_start_date`, `variant_discount_end_date`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('3', '3', 'aqua', '13.00', '1', '7.00', '2020-01-01 00:00:01', '2030-01-07 00:00:00', '6', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', '1.00', '1.00', '1.00', '1.00');
-- product variant 1-4 (no price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('4', '4', 'aqua', '6', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', '1.00', '1.00', '1.00', '1.00');
-- product variant 1-5 (discount price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `is_discount`, `variant_discount_price`, `variant_discount_start_date`, `variant_discount_end_date`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('5', '5', 'aqua', '1', '7.00', '2020-01-01 00:00:01', '2023-01-07 00:00:00', '6', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', '1.00', '1.00', '1.00', '1.00');
-- product images
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('10', '/images/product-image-0.png', 'product-image-0', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', 0);
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('11', '/images/product-image-1.png', 'product-image-1', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', 0);
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('12', '', 'product-image-2', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', 0);
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('13', '/images/product-image-3.png', 'product-image-3', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', 0);
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('14', '', 'product-image-4', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', 0);
-- review
INSERT INTO `reviews` (`user_id`, `product_id`, `review_point`, `review_title`, `review_description`, `is_verified`)
VALUES ('c7081519-16e5-4f92-ac50-1834001f12b9', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', '3.9', 'sample title 1', 'sample description', 1); -- this user is main member test user. check inital script
INSERT INTO `reviews` (`user_id`, `product_id`, `review_point`, `review_title`, `review_description`, `is_verified`)
VALUES ('a2901f19-715a-44fe-9701-fae6713fd764', '9e3e67ca-d058-41f0-aad5-4f09c956a81f', '3.9', 'sample title 3', 'sample description', 0); -- to make sure only retrieve verified review.
-- product: endDate (should be included)
INSERT INTO `ec-schema`.`products` (`product_id`, `product_name`, `product_description`, `product_path`, `product_base_unit_price`, `average_review_point`, `category_id`, `is_public`, `cheapest_price`, `highest_price`, `release_date`)
VALUES ('6267c525-396f-4ea0-8dfe-706c95036e5c', 'game_name_2', 'game_desc_2', 'test-path-2', '61.00', '4.21', '3', '1', '60.00', '90.00', '2019-01-07 00:00:00');
-- product variant 2-1 (unit price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `variant_unit_price`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('6', '1', 'white', '80.00', '12', '6267c525-396f-4ea0-8dfe-706c95036e5c', '1.00', '1.00', '1.00', '1.00');
-- product variant 2-2 (unit price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `variant_unit_price`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('7', '2', 'black', '90.00', '5', '6267c525-396f-4ea0-8dfe-706c95036e5c', '1.00', '1.00', '1.00', '1.00');
-- product variant 2-3 (discount & unit price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `variant_unit_price`, `is_discount`, `variant_discount_price`, `variant_discount_start_date`, `variant_discount_end_date`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('8', '3', 'aqua', NULL, '0', '60.00', '2020-01-01 00:00:01', '2020-01-07 00:00:00', '6', '6267c525-396f-4ea0-8dfe-706c95036e5c', '1.00', '1.00', '1.00', '1.00');
-- product variant 2-4 (no price)
INSERT INTO `product_variants` (`variant_id`, `product_size_id`, `variant_color`, `variant_stock`, `product_id`, `variant_weight`, `variant_width`, `variant_height`, `variant_length`)
VALUES ('9', '4', 'aqua', '6', '6267c525-396f-4ea0-8dfe-706c95036e5c', '1.00', '1.00', '1.00', '1.00');
-- product images
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('15', '/images/product-image-0.png', 'product-image-0', '6267c525-396f-4ea0-8dfe-706c95036e5c', 0);
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('16', '/images/product-image-1.png', 'product-image-1', '6267c525-396f-4ea0-8dfe-706c95036e5c', 0);
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('17', '', 'product-image-2', '6267c525-396f-4ea0-8dfe-706c95036e5c', 0);
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('18', '/images/product-image-3.png', 'product-image-3', '6267c525-396f-4ea0-8dfe-706c95036e5c', 0);
INSERT INTO `ec-schema`.`product_images` (`product_image_id`, `product_image_path`, `product_image_name`, `product_id`, `is_change`)
VALUES ('19', '', 'product-image-4', '6267c525-396f-4ea0-8dfe-706c95036e5c', 0);
-- review
INSERT INTO `reviews` (`user_id`, `product_id`, `review_point`, `review_title`, `review_description`, `is_verified`)
VALUES ('c7081519-16e5-4f92-ac50-1834001f12b9', '6267c525-396f-4ea0-8dfe-706c95036e5c', '4.1', 'sample title 2', 'sample description', 1); -- this user is main member test user. check inital script
INSERT INTO `reviews` (`user_id`, `product_id`, `review_point`, `review_title`, `review_description`, `is_verified`)
VALUES ('a2901f19-715a-44fe-9701-fae6713fd764', '6267c525-396f-4ea0-8dfe-706c95036e5c', '4.7', 'sample title 4', 'sample description', 0); -- to make sure only retrieve verified review.
|
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_user_profile_jurisdiction_user_profile_id ON public.user_profile_jurisdiction USING btree (user_profile_id);
|
create table ACT_ID_PROPERTY (
NAME_ varchar(64),
VALUE_ varchar(300),
REV_ integer,
primary key (NAME_)
);
insert into ACT_ID_PROPERTY
values ('schema.version', '6.4.1.1', 1);
create table ACT_ID_BYTEARRAY (
ID_ varchar(64),
REV_ integer,
NAME_ varchar(255),
BYTES_ bytea,
primary key (ID_)
);
create table ACT_ID_GROUP (
ID_ varchar(64),
REV_ integer,
NAME_ varchar(255),
TYPE_ varchar(255),
primary key (ID_)
);
create table ACT_ID_MEMBERSHIP (
USER_ID_ varchar(64),
GROUP_ID_ varchar(64),
primary key (USER_ID_, GROUP_ID_)
);
create table ACT_ID_USER (
ID_ varchar(64),
REV_ integer,
FIRST_ varchar(255),
LAST_ varchar(255),
DISPLAY_NAME_ varchar(255),
EMAIL_ varchar(255),
PWD_ varchar(255),
PICTURE_ID_ varchar(64),
TENANT_ID_ varchar(255) default '',
primary key (ID_)
);
create table ACT_ID_INFO (
ID_ varchar(64),
REV_ integer,
USER_ID_ varchar(64),
TYPE_ varchar(64),
KEY_ varchar(255),
VALUE_ varchar(255),
PASSWORD_ bytea,
PARENT_ID_ varchar(255),
primary key (ID_)
);
create table ACT_ID_TOKEN (
ID_ varchar(64) not null,
REV_ integer,
TOKEN_VALUE_ varchar(255),
TOKEN_DATE_ timestamp,
IP_ADDRESS_ varchar(255),
USER_AGENT_ varchar(255),
USER_ID_ varchar(255),
TOKEN_DATA_ varchar(2000),
primary key (ID_)
);
create table ACT_ID_PRIV (
ID_ varchar(64) not null,
NAME_ varchar(255) not null,
primary key (ID_)
);
create table ACT_ID_PRIV_MAPPING (
ID_ varchar(64) not null,
PRIV_ID_ varchar(64) not null,
USER_ID_ varchar(255),
GROUP_ID_ varchar(255),
primary key (ID_)
);
create index ACT_IDX_MEMB_GROUP on ACT_ID_MEMBERSHIP(GROUP_ID_);
alter table ACT_ID_MEMBERSHIP
add constraint ACT_FK_MEMB_GROUP
foreign key (GROUP_ID_)
references ACT_ID_GROUP (ID_);
create index ACT_IDX_MEMB_USER on ACT_ID_MEMBERSHIP(USER_ID_);
alter table ACT_ID_MEMBERSHIP
add constraint ACT_FK_MEMB_USER
foreign key (USER_ID_)
references ACT_ID_USER (ID_);
create index ACT_IDX_PRIV_MAPPING on ACT_ID_PRIV_MAPPING(PRIV_ID_);
alter table ACT_ID_PRIV_MAPPING
add constraint ACT_FK_PRIV_MAPPING
foreign key (PRIV_ID_)
references ACT_ID_PRIV (ID_);
create index ACT_IDX_PRIV_USER on ACT_ID_PRIV_MAPPING(USER_ID_);
create index ACT_IDX_PRIV_GROUP on ACT_ID_PRIV_MAPPING(GROUP_ID_);
alter table ACT_ID_PRIV
add constraint ACT_UNIQ_PRIV_NAME
unique (NAME_);
|
-- phpMyAdmin SQL Dump
-- version 2.11.8.1deb5+lenny3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generatie Tijd: 17 Nov 2011 om 17:28
-- Server versie: 5.0.51
-- PHP Versie: 5.2.6-1+lenny8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `z0rbot4`
--
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `channel`
--
CREATE TABLE IF NOT EXISTS `channel` (
`id` int(5) NOT NULL auto_increment,
`network_id` int(2) NOT NULL,
`name` varchar(25) NOT NULL default '',
`clanname` varchar(30) NOT NULL,
`password` varchar(20) NOT NULL,
`game` varchar(20) NOT NULL default 'none',
`submitmsg` varchar(3) NOT NULL default 'off',
`displaymsg` varchar(3) NOT NULL default 'on',
`submitpcw` varchar(3) NOT NULL default 'on',
`displaypcw` varchar(3) NOT NULL default 'on',
`submitcw` varchar(3) NOT NULL default 'on',
`displaycw` varchar(3) NOT NULL default 'on',
`submitringer` varchar(3) NOT NULL default 'on',
`displayringer` varchar(3) NOT NULL default 'on',
`submitrecruit` varchar(3) NOT NULL default 'on',
`displayrecruit` varchar(3) NOT NULL default 'on',
`quakenet` varchar(3) NOT NULL default 'on',
`freenode` varchar(3) NOT NULL default 'on',
`gamesurge` varchar(3) NOT NULL default 'on',
`enterthegame` varchar(3) NOT NULL default 'on',
`skill` int(11) NOT NULL default '1000',
`active` varchar(3) NOT NULL default 'on',
PRIMARY KEY (`id`),
UNIQUE KEY `network_id` (`network_id`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1436 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `cwresult`
--
CREATE TABLE IF NOT EXISTS `cwresult` (
`id` int(20) NOT NULL auto_increment,
`date` date NOT NULL,
`team1_channel_id` int(11) NOT NULL,
`team1_score` int(11) NOT NULL,
`team2_channel_id` int(11) NOT NULL,
`team2_score` int(11) NOT NULL,
`status` varchar(3) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `date` (`date`,`team1_channel_id`,`team2_channel_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=93 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `gameplayer`
--
CREATE TABLE IF NOT EXISTS `gameplayer` (
`id` int(20) NOT NULL auto_increment,
`gameserver_id` int(9) NOT NULL,
`name` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=755735 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `gameserver`
--
CREATE TABLE IF NOT EXISTS `gameserver` (
`id` int(20) NOT NULL auto_increment,
`protocol_name` varchar(20) NOT NULL,
`protocol_version` varchar(20) NOT NULL,
`address` varchar(15) NOT NULL,
`port` int(10) NOT NULL,
`name` varchar(200) NOT NULL,
`game` varchar(30) NOT NULL,
`manual` int(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `address` (`address`,`port`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=355674 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `log`
--
CREATE TABLE IF NOT EXISTS `log` (
`id` int(12) NOT NULL auto_increment,
`timestamp` varchar(20) NOT NULL,
`type` varchar(20) NOT NULL,
`channel_id` int(5) NOT NULL,
`user_id` int(10) NOT NULL,
`nick` varchar(30) NOT NULL,
`content` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=221057 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `network`
--
CREATE TABLE IF NOT EXISTS `network` (
`id` int(2) NOT NULL auto_increment,
`name` varchar(30) NOT NULL,
`perform` varchar(250) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `protocolmasterserver`
--
CREATE TABLE IF NOT EXISTS `protocolmasterserver` (
`id` int(20) NOT NULL auto_increment,
`protocol_name` varchar(20) NOT NULL,
`protocol_version` varchar(20) NOT NULL,
`address` varchar(100) NOT NULL,
`port` int(10) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `address` (`address`,`port`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `protocol_game`
--
CREATE TABLE IF NOT EXISTS `protocol_game` (
`id` int(5) NOT NULL auto_increment,
`protocol_name` varchar(30) NOT NULL,
`protocol_version` varchar(30) NOT NULL,
`gamedir` varchar(30) NOT NULL,
`game` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `server`
--
CREATE TABLE IF NOT EXISTS `server` (
`id` int(2) NOT NULL auto_increment,
`network_id` int(2) NOT NULL,
`host` varchar(30) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `network` (`network_id`,`host`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=43 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(10) NOT NULL auto_increment,
`network_id` int(3) NOT NULL,
`name` varchar(20) NOT NULL,
`active` varchar(3) NOT NULL default 'on',
`country` varchar(3) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `network_id` (`network_id`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=36285 ;
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `user_channel`
--
CREATE TABLE IF NOT EXISTS `user_channel` (
`user_id` int(10) NOT NULL,
`channel_id` int(11) NOT NULL,
`operator` tinyint(1) NOT NULL,
`friend` tinyint(1) NOT NULL default '0',
`function` int(11) NOT NULL default '0',
`gamename` varchar(20) default NULL,
PRIMARY KEY (`user_id`,`channel_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
ALTER TABLE `members`
ADD COLUMN enable_point BOOLEAN NOT NULL DEFAULT FALSE AFTER mobile,
ADD COLUMN enable_pay BOOLEAN NOT NULL DEFAULT TRUE AFTER mobile,
ADD COLUMN name VARCHAR(20) NOT NULL DEFAULT '' AFTER mobile;
|
-- BETWEEN operador se utiliza en una WHERE cláusula para filtrar el conjunto de resultados dentro de un cierto rango
-- Acepta dos valores que son números, texto o fechas.
SELECT *
FROM movies
WHERE year BETWEEN 1990 AND 1999;
-- películas con names que comienzan con la letra 'A' hasta, pero sin incluir las que comienzan con 'J'
SELECT *
FROM movies
WHERE name BETWEEN 'A' AND 'J';
-- filtrar el conjunto de resultados para incluir solo películas con años en 1970-1979:
SELECT *
FROM movies
WHERE year BETWEEN 1970 AND 1979;
|
--
-- PostgreSQL database dump
--
--
-- Data for Name: batch_job_instance; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.batch_job_instance (job_instance_id, version, job_name, job_key) VALUES (1, 0, 'restore', '97411dfcb23d12da43dfa78b6da678a1');
--
-- Data for Name: batch_job_execution; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.batch_job_execution (job_execution_id, version, job_instance_id, create_time, start_time, end_time, status, exit_code, exit_message, last_updated, job_configuration_location) VALUES (1, 2, 1, '2018-12-03 13:03:59.737', '2018-12-03 13:03:59.756', '2018-12-03 13:04:00.628', 'COMPLETED', 'COMPLETED', '', '2018-12-03 13:04:00.628', NULL);
--
-- Data for Name: batch_job_execution_context; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.batch_job_execution_context (job_execution_id, short_context, serialized_context) VALUES (1, '{"resources":["[Ljava.io.File;",["/home/jod/Desktop/apache-tomcat-8.5.34/temp/decompress1743764190167320258/employee/e98db949-f3e3-4d30-9894-7dd2e291fbef.json"]],"resourceType":["eu.openminted.registry.core.domain.ResourceType",{"name":"employee","schema":"\r\n\r\n<xs:schema attributeFormDefault=\"unqualified\" elementFormDefault=\"qualified\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\">\r\n <xs:element name=\"employee\">\r\n <xs:complexType>\r\n <xs:sequence>\r\n <xs:element type=\"xs:string\" name=\"author\"/>\r\n <xs:element type=\"xs:byte\" name=\"age\"/>\r\n <xs:element type=\"xs:string\" name=\"single\"/>\r\n <xs:element type=\"xs:string\" name=\"birthday\"/>\r\n <xs:element type=\"xs:float\" name=\"salary\"/>\r\n <xs:element type=\"xs:long\" name=\"amka\"/>\r\n </xs:sequence>\r\n </xs:complexType>\r\n </xs:element>\r\n</xs:schema>","schemaUrl":"not_set","payloadType":"xml","creationDate":1543835039871,"modificationDate":1543835039871,"indexMapperClass":"eu.openminted.registry.core.index.DefaultIndexMapper","indexFields":["org.hibernate.collection.internal.PersistentBag",[["eu.openminted.registry.core.domain.index.IndexField",{"name":"first_name","path":"//*[local-name()=''author'']/text()","type":"java.lang.String","label":"first_name","defaultValue":null,"multivalued":false,"primaryKey":true}],["eu.openminted.registry.core.domain.index.IndexField",{"name":"age","path":"//*[local-name()=''age'']/text()","type":"java.lang.Integer","label":"age","defaultValue":null,"multivalued":false,"primaryKey":false}],["eu.openminted.registry.core.domain.index.IndexField",{"name":"single","path":"//*[local-name()=''single'']/text()","type":"java.lang.Boolean","label":"single","defaultValue":null,"multivalued":false,"primaryKey":false}],["eu.openminted.registry.core.domain.index.IndexField",{"name":"birthday","path":"//*[local-name()=''birthday'']/text()","type":"java.util.Date","label":"birthday","defaultValue":null,"multivalued":false,"primaryKey":false}],["eu.openminted.registry.core.domain.index.IndexField",{"name":"salary","path":"//*[local-name()=''salary'']/text()","type":"java.lang.Float","label":"salary","defaultValue":null,"multivalued":false,"primaryKey":false}],["eu.openminted.registry.core.domain.index.IndexField",{"name":"amka","path":"//*[local-name()=''amka'']/text()","type":"java.lang.Long","label":"amka","defaultValue":null,"multivalued":false,"primaryKey":false}]]],"aliasGroup":"resourceTypes"}]}', NULL);
--
-- Data for Name: batch_job_execution_params; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.batch_job_execution_params (job_execution_id, type_cd, key_name, string_val, date_val, long_val, double_val, identifying) VALUES (1, 'STRING', 'resourceType', 'employee', '1970-01-01 02:00:00', 0, 0, 'Y');
INSERT INTO public.batch_job_execution_params (job_execution_id, type_cd, key_name, string_val, date_val, long_val, double_val, identifying) VALUES (1, 'STRING', 'resourceTypeDir', '/home/jod/Desktop/apache-tomcat-8.5.34/temp/decompress1743764190167320258/employee', '1970-01-01 02:00:00', 0, 0, 'Y');
INSERT INTO public.batch_job_execution_params (job_execution_id, type_cd, key_name, string_val, date_val, long_val, double_val, identifying) VALUES (1, 'DATE', 'date', '', '2018-12-03 13:03:59.648', 0, 0, 'Y');
--
-- Data for Name: batch_step_execution; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.batch_step_execution (step_execution_id, version, step_name, job_execution_id, start_time, end_time, status, commit_count, read_count, filter_count, write_count, read_skip_count, write_skip_count, process_skip_count, rollback_count, exit_code, exit_message, last_updated) VALUES (1, 3, 'resourceTypeStep', 1, '2018-12-03 13:03:59.783', '2018-12-03 13:03:59.988', 'COMPLETED', 1, 0, 0, 0, 0, 0, 0, 0, 'COMPLETED', '', '2018-12-03 13:03:59.988');
INSERT INTO public.batch_step_execution (step_execution_id, version, step_name, job_execution_id, start_time, end_time, status, commit_count, read_count, filter_count, write_count, read_skip_count, write_skip_count, process_skip_count, rollback_count, exit_code, exit_message, last_updated) VALUES (2, 7, 'resourcesChunkStep', 1, '2018-12-03 13:04:00.039', '2018-12-03 13:04:00.624', 'COMPLETED', 5, 1, 0, 1, 0, 0, 0, 0, 'COMPLETED', '', '2018-12-03 13:04:00.624');
--
-- Data for Name: batch_step_execution_context; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.batch_step_execution_context (step_execution_id, short_context, serialized_context) VALUES (1, '{"batch.taskletType":"eu.openminted.registry.core.backup.restore.RestoreResourceTypeStep$$EnhancerBySpringCGLIB$$24f07c0f","batch.stepType":"org.springframework.batch.core.step.tasklet.TaskletStep"}', NULL);
INSERT INTO public.batch_step_execution_context (step_execution_id, short_context, serialized_context) VALUES (2, '{"batch.taskletType":"org.springframework.batch.core.step.item.ChunkOrientedTasklet","batch.stepType":"org.springframework.batch.core.step.tasklet.TaskletStep"}', NULL);
--
-- Data for Name: resourcetype; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.resourcetype (name, aliasgroup, creation_date, indexmapperclass, modification_date, payloadtype, schema, schemaurl) VALUES ('employee', 'resourceTypes', '2018-12-03 13:03:59.871', 'eu.openminted.registry.core.index.DefaultIndexMapper', '2018-12-03 13:03:59.871', 'xml', '
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employee">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="author"/>
<xs:element type="xs:byte" name="age"/>
<xs:element type="xs:string" name="single"/>
<xs:element type="xs:string" name="birthday"/>
<xs:element type="xs:float" name="salary"/>
<xs:element type="xs:long" name="amka"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>', 'not_set');
--
-- Data for Name: resource; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.resource (id, creation_date, modification_date, payload, payloadformat, version, fk_name) VALUES ('e98db949-f3e3-4d30-9894-7dd2e291fbef', '2018-09-19 15:59:22.122', '2018-09-19 15:59:22.122', '<?xml version="1.0"?> <employee> <author>Jodeee</author> <age>28</age> <single>false</single> <birthday>645544821000</birthday> <salary>1292.123</salary> <amka>051417010293821</amka></employee>
', 'xml', '12032018130400', 'employee');
--
-- Data for Name: booleanindexedfield; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.booleanindexedfield (id, name, resource_id) VALUES (123123, 'single', 'e98db949-f3e3-4d30-9894-7dd2e291fbef');
--
-- Data for Name: booleanindexedfield_values; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.booleanindexedfield_values (booleanindexedfield_id, values) VALUES (123123, false);
--
-- Data for Name: dateindexedfield; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.dateindexedfield (id, name, resource_id) VALUES (123123, 'birthday', 'e98db949-f3e3-4d30-9894-7dd2e291fbef');
--
-- Data for Name: dateindexedfield_values; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.dateindexedfield_values (dateindexedfield_id, values) VALUES (123123, '1990-06-16 17:00:21');
--
-- Data for Name: floatindexedfield; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.floatindexedfield (id, name, resource_id) VALUES (123123, 'salary', 'e98db949-f3e3-4d30-9894-7dd2e291fbef');
--
-- Data for Name: floatindexedfield_values; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.floatindexedfield_values (floatindexedfield_id, values) VALUES (123123, 1292.12300000000005);
--
-- Data for Name: indexfield; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.indexfield (name, defaultvalue, label, multivalued, path, primarykey, type, resourcetype_name) VALUES ('first_name', NULL, 'first_name', false, '//*[local-name()=''author'']/text()', true, 'java.lang.String', 'employee');
INSERT INTO public.indexfield (name, defaultvalue, label, multivalued, path, primarykey, type, resourcetype_name) VALUES ('age', NULL, 'age', false, '//*[local-name()=''age'']/text()', false, 'java.lang.Integer', 'employee');
INSERT INTO public.indexfield (name, defaultvalue, label, multivalued, path, primarykey, type, resourcetype_name) VALUES ('single', NULL, 'single', false, '//*[local-name()=''single'']/text()', false, 'java.lang.Boolean', 'employee');
INSERT INTO public.indexfield (name, defaultvalue, label, multivalued, path, primarykey, type, resourcetype_name) VALUES ('birthday', NULL, 'birthday', false, '//*[local-name()=''birthday'']/text()', false, 'java.util.Date', 'employee');
INSERT INTO public.indexfield (name, defaultvalue, label, multivalued, path, primarykey, type, resourcetype_name) VALUES ('salary', NULL, 'salary', false, '//*[local-name()=''salary'']/text()', false, 'java.lang.Float', 'employee');
INSERT INTO public.indexfield (name, defaultvalue, label, multivalued, path, primarykey, type, resourcetype_name) VALUES ('amka', NULL, 'amka', false, '//*[local-name()=''amka'']/text()', false, 'java.lang.Long', 'employee');
--
-- Data for Name: integerindexedfield; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.integerindexedfield (id, name, resource_id) VALUES (123123, 'age', 'e98db949-f3e3-4d30-9894-7dd2e291fbef');
--
-- Data for Name: integerindexedfield_values; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.integerindexedfield_values (integerindexedfield_id, values) VALUES (123123, 28);
--
-- Data for Name: longindexedfield; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.longindexedfield (id, name, resource_id) VALUES (123123, 'amka', 'e98db949-f3e3-4d30-9894-7dd2e291fbef');
--
-- Data for Name: longindexedfield_values; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.longindexedfield_values (longindexedfield_id, values) VALUES (123123, 51417010293821);
--
-- Data for Name: resourcetype_indexfield; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.resourcetype_indexfield (resourcetype_name, indexfields_resourcetype_name, indexfields_name) VALUES ('employee', 'employee', 'first_name');
INSERT INTO public.resourcetype_indexfield (resourcetype_name, indexfields_resourcetype_name, indexfields_name) VALUES ('employee', 'employee', 'age');
INSERT INTO public.resourcetype_indexfield (resourcetype_name, indexfields_resourcetype_name, indexfields_name) VALUES ('employee', 'employee', 'single');
INSERT INTO public.resourcetype_indexfield (resourcetype_name, indexfields_resourcetype_name, indexfields_name) VALUES ('employee', 'employee', 'birthday');
INSERT INTO public.resourcetype_indexfield (resourcetype_name, indexfields_resourcetype_name, indexfields_name) VALUES ('employee', 'employee', 'salary');
INSERT INTO public.resourcetype_indexfield (resourcetype_name, indexfields_resourcetype_name, indexfields_name) VALUES ('employee', 'employee', 'amka');
--
-- Data for Name: resourceversion; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
--
-- Data for Name: schemadatabase; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.schemadatabase (id, originalurl, schema) VALUES ('cccbd2ae2abfd0bb0d1c6c2216116ed1', 'employee', '
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employee">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="author"/>
<xs:element type="xs:byte" name="age"/>
<xs:element type="xs:string" name="single"/>
<xs:element type="xs:string" name="birthday"/>
<xs:element type="xs:float" name="salary"/>
<xs:element type="xs:long" name="amka"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>');
--
-- Data for Name: stringindexedfield; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.stringindexedfield (id, name, resource_id) VALUES (123123,'first_name', 'e98db949-f3e3-4d30-9894-7dd2e291fbef');
--
-- Data for Name: stringindexedfield_values; Type: TABLE DATA; Schema: public; Owner: vrasidas
--
INSERT INTO public.stringindexedfield_values (stringindexedfield_id, values) VALUES (123123, 'Jodeee');
--
-- PostgreSQL database dump complete
--
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 08 Jul 2019 pada 00.34
-- Versi server: 10.3.16-MariaDB
-- Versi PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_training`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data untuk tabel `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(7, '2014_10_12_000000_create_users_table', 1),
(8, '2014_10_12_100000_create_password_resets_table', 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tcertificate`
--
CREATE TABLE `tcertificate` (
`fcertificateid` int(11) NOT NULL,
`fcertificatenumber` varchar(255) NOT NULL,
`ftrainplanid` int(11) NOT NULL,
`fusercertif` bigint(20) NOT NULL,
`fmediaid` int(11) NOT NULL,
`fcertificatestatus` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tcertificate`
--
INSERT INTO `tcertificate` (`fcertificateid`, `fcertificatenumber`, `ftrainplanid`, `fusercertif`, `fmediaid`, `fcertificatestatus`, `created_at`, `updated_at`) VALUES
(2, 'CERT-001', 1, 8, 0, 1, '2019-07-07 02:30:40', NULL),
(3, 'Cert-0012', 1, 8, 0, 1, '2019-07-07 09:05:02', '2019-07-07 09:23:11'),
(4, 'CERT-003', 1, 8, 2, 1, '2019-07-07 09:33:00', NULL),
(5, '123456', 1, 8, 3, 1, '2019-07-07 09:34:58', NULL),
(8, 'qwerty', 1, 8, 5, 1, '2019-07-07 09:43:05', NULL),
(9, 'qwerty144', 1, 8, 8, 0, '2019-07-07 09:44:34', '2019-07-07 10:15:37');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tmedia`
--
CREATE TABLE `tmedia` (
`fmediaid` int(11) UNSIGNED NOT NULL,
`fmediaoriginalname` varchar(200) DEFAULT NULL,
`fmediatype` varchar(10) DEFAULT NULL,
`fmediapath` varchar(300) DEFAULT NULL,
`fuserid` int(11) DEFAULT NULL,
`fmediatimestamp` timestamp NULL DEFAULT NULL,
`fmediastatus` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tmedia`
--
INSERT INTO `tmedia` (`fmediaid`, `fmediaoriginalname`, `fmediatype`, `fmediapath`, `fuserid`, `fmediatimestamp`, `fmediastatus`) VALUES
(1, 'module_5874583f789d58b7718dcf32f812daab.JPG', 'image/jpeg', '/assets/backend/media/uploads/module_5874583f789d58b7718dcf32f812daab.JPG', 1, '0000-00-00 00:00:00', 1),
(2, 'module_67ea46486d387976e8ae614024c9cc98.JPG', 'image/jpeg', '/assets/backend/media/uploads/module_67ea46486d387976e8ae614024c9cc98.JPG', 1, '0000-00-00 00:00:00', 1),
(3, 'module_6774b4e2c08b592d76c2ba5b4cbacd5d.JPG', 'image/jpeg', '/assets/backend/media/uploads/module_6774b4e2c08b592d76c2ba5b4cbacd5d.JPG', 1, '0000-00-00 00:00:00', 1),
(4, 'module_64dcb4385cd6e9a3880a77ea0d465a5d.JPG', 'image/jpeg', '/assets/backend/media/uploads/module_64dcb4385cd6e9a3880a77ea0d465a5d.JPG', 1, '0000-00-00 00:00:00', 1),
(5, 'module_39711027dd95d6a5dfda24d14af71c4f.JPG', 'image/jpeg', '/assets/backend/media/uploads/module_39711027dd95d6a5dfda24d14af71c4f.JPG', 1, '0000-00-00 00:00:00', 1),
(6, 'module_05530d032def5c26549c04ef1fcfaa22.JPG', 'image/jpeg', '/assets/backend/media/uploads/module_05530d032def5c26549c04ef1fcfaa22.JPG', 1, '0000-00-00 00:00:00', 1),
(7, 'module_ca63f5bbe511c317fa0ab37a4c173669.JPG', 'image/jpeg', '/assets/backend/media/uploads/module_ca63f5bbe511c317fa0ab37a4c173669.JPG', 1, '0000-00-00 00:00:00', 1),
(8, 'module_82e705462e010c472729f5b8382f31f3.jpg', 'image/jpeg', '/assets/backend/media/uploads/module_82e705462e010c472729f5b8382f31f3.jpg', 1, '0000-00-00 00:00:00', 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tmodule`
--
CREATE TABLE `tmodule` (
`fmoduleid` int(11) NOT NULL,
`fmodulename` varchar(255) NOT NULL,
`fmediaid` int(11) NOT NULL,
`fmodulestatus` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tmodule`
--
INSERT INTO `tmodule` (`fmoduleid`, `fmodulename`, `fmediaid`, `fmodulestatus`, `created_at`, `updated_at`) VALUES
(2, 'module', 7, 1, '2019-07-06 02:11:39', '2019-07-07 10:11:01');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tposition`
--
CREATE TABLE `tposition` (
`fpositionid` int(11) NOT NULL,
`fpositionname` varchar(100) NOT NULL,
`fpositionstatus` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `tposition`
--
INSERT INTO `tposition` (`fpositionid`, `fpositionname`, `fpositionstatus`, `created_at`, `updated_at`) VALUES
(1, 'Manager', 1, NULL, NULL),
(3, 'IT Staff', 1, '2019-07-05 20:51:14', '2019-07-05 20:56:57'),
(4, 'Member biasa', 1, '2019-07-06 23:00:38', NULL);
-- --------------------------------------------------------
--
-- Struktur dari tabel `trole`
--
CREATE TABLE `trole` (
`froleid` int(11) NOT NULL,
`frolename` varchar(100) NOT NULL,
`frolestatus` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `trole`
--
INSERT INTO `trole` (`froleid`, `frolename`, `frolestatus`) VALUES
(1, 'Super Admin', 1),
(2, 'Member', 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `ttrainingmeta`
--
CREATE TABLE `ttrainingmeta` (
`ftrainingmetaid` int(11) NOT NULL,
`ftrainplanid` int(11) NOT NULL,
`fmetakey` varchar(255) NOT NULL,
`fmetavalue` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `ttrainingplan`
--
CREATE TABLE `ttrainingplan` (
`ftrainplanid` bigint(20) NOT NULL,
`ftrainplanname` varchar(100) NOT NULL,
`ftraintypeid` bigint(20) NOT NULL,
`ftrainmember` text NOT NULL,
`ftrainstartdate` date NOT NULL,
`ftrainenddate` date NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`ftrainingstatus` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `ttrainingplan`
--
INSERT INTO `ttrainingplan` (`ftrainplanid`, `ftrainplanname`, `ftraintypeid`, `ftrainmember`, `ftrainstartdate`, `ftrainenddate`, `created_at`, `updated_at`, `ftrainingstatus`) VALUES
(1, 'Trainplane', 1, 'a:1:{i:0;a:4:{s:7:\"fuserid\";s:1:\"8\";s:9:\"fusername\";s:7:\"Aldiyan\";s:11:\"fpositionid\";s:1:\"3\";s:13:\"fpositionname\";s:8:\"IT Staff\";}}', '2019-06-18', '2019-07-05', '2019-07-06 20:26:23', '2019-07-06 17:00:00', 1),
(2, 'eee network', 1, 'a:2:{i:0;a:4:{s:7:\"fuserid\";s:1:\"8\";s:9:\"fusername\";s:7:\"Aldiyan\";s:11:\"fpositionid\";s:1:\"3\";s:13:\"fpositionname\";s:8:\"IT Staff\";}i:1;a:4:{s:7:\"fuserid\";s:1:\"9\";s:9:\"fusername\";s:5:\"roman\";s:11:\"fpositionid\";s:1:\"1\";s:13:\"fpositionname\";s:7:\"Manager\";}}', '2019-07-14', '2019-07-31', '2019-07-06 21:46:52', '2019-07-06 22:57:16', 1),
(3, 'Train to Bus2', 1, 'a:1:{i:0;a:4:{s:7:\"fuserid\";s:1:\"8\";s:9:\"fusername\";s:7:\"Aldiyan\";s:11:\"fpositionid\";s:1:\"3\";s:13:\"fpositionname\";s:8:\"IT Staff\";}}', '2019-06-01', '2019-08-23', '2019-07-07 09:24:08', '2019-07-06 17:00:00', 1),
(4, '1234', 1, 'a:1:{i:0;a:4:{s:7:\"fuserid\";s:1:\"8\";s:9:\"fusername\";s:7:\"Aldiyan\";s:11:\"fpositionid\";s:1:\"1\";s:13:\"fpositionname\";s:7:\"Manager\";}}', '2019-07-01', '2019-07-15', '2019-07-07 09:34:41', NULL, 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `ttrainingtype`
--
CREATE TABLE `ttrainingtype` (
`ftraintypeid` int(11) NOT NULL,
`ftraintypename` varchar(100) NOT NULL,
`ftraintypestatus` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `ttrainingtype`
--
INSERT INTO `ttrainingtype` (`ftraintypeid`, `ftraintypename`, `ftraintypestatus`, `created_at`, `updated_at`) VALUES
(1, 'IT Industry', 1, '2019-07-06 08:40:55', '2019-07-06 08:41:47');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tusers`
--
CREATE TABLE `tusers` (
`fuserid` int(10) UNSIGNED NOT NULL,
`froleid` int(11) NOT NULL,
`fusername` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`fuseremail` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`fuserpassword` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`fuseraddress` text COLLATE utf8mb4_unicode_ci NOT NULL,
`fnik` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`fnpwp` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`fusersoftskill` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`fuserhardskill` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`fuserbirthdate` date NOT NULL,
`fremembermetoken` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`fuserstatus` int(11) NOT NULL,
`fporgotcode` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data untuk tabel `tusers`
--
INSERT INTO `tusers` (`fuserid`, `froleid`, `fusername`, `fuseremail`, `fuserpassword`, `fuseraddress`, `fnik`, `fnpwp`, `fusersoftskill`, `fuserhardskill`, `fuserbirthdate`, `fremembermetoken`, `fuserstatus`, `fporgotcode`, `created_at`, `updated_at`) VALUES
(1, 1, 'admin', 'admin@123.com', 'e10adc3949ba59abbe56e057f20f883e', 'Jl.Widuri no.94 Banyuwangi', '9000000009', '9000000009', 'menulis', 'hardskill', '1999-01-05', NULL, 1, NULL, '2019-07-04 17:00:00', NULL),
(8, 2, 'Aldiyan', 'aldian@train.com', 'e10adc3949ba59abbe56e057f20f883e', 'jl. widuri', '9929299', '99999999', '', '', '2019-07-23', NULL, 1, NULL, '2019-07-06 18:15:45', NULL),
(9, 2, 'roman', 'wildan00x@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', 'jl.endah', '999999', '999999', '', '', '2019-07-09', NULL, 1, '', '2019-07-06 18:22:00', NULL),
(11, 1, 'Hanum', 'hanum@yahoo.co.id', 'e10adc3949ba59abbe56e057f20f883e', 'Banyuwangi', '', '', '', '', '2019-06-30', NULL, 1, NULL, '2019-07-07 17:23:15', NULL);
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indeks untuk tabel `tcertificate`
--
ALTER TABLE `tcertificate`
ADD PRIMARY KEY (`fcertificateid`);
--
-- Indeks untuk tabel `tmedia`
--
ALTER TABLE `tmedia`
ADD PRIMARY KEY (`fmediaid`);
--
-- Indeks untuk tabel `tmodule`
--
ALTER TABLE `tmodule`
ADD PRIMARY KEY (`fmoduleid`);
--
-- Indeks untuk tabel `tposition`
--
ALTER TABLE `tposition`
ADD PRIMARY KEY (`fpositionid`);
--
-- Indeks untuk tabel `trole`
--
ALTER TABLE `trole`
ADD PRIMARY KEY (`froleid`);
--
-- Indeks untuk tabel `ttrainingplan`
--
ALTER TABLE `ttrainingplan`
ADD PRIMARY KEY (`ftrainplanid`);
--
-- Indeks untuk tabel `ttrainingtype`
--
ALTER TABLE `ttrainingtype`
ADD PRIMARY KEY (`ftraintypeid`);
--
-- Indeks untuk tabel `tusers`
--
ALTER TABLE `tusers`
ADD PRIMARY KEY (`fuserid`),
ADD UNIQUE KEY `users_email_unique` (`fuseremail`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT untuk tabel `tcertificate`
--
ALTER TABLE `tcertificate`
MODIFY `fcertificateid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT untuk tabel `tmedia`
--
ALTER TABLE `tmedia`
MODIFY `fmediaid` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT untuk tabel `tmodule`
--
ALTER TABLE `tmodule`
MODIFY `fmoduleid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT untuk tabel `tposition`
--
ALTER TABLE `tposition`
MODIFY `fpositionid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `trole`
--
ALTER TABLE `trole`
MODIFY `froleid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `ttrainingplan`
--
ALTER TABLE `ttrainingplan`
MODIFY `ftrainplanid` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT untuk tabel `ttrainingtype`
--
ALTER TABLE `ttrainingtype`
MODIFY `ftraintypeid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `tusers`
--
ALTER TABLE `tusers`
MODIFY `fuserid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 11, 2017 at 09:09 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `db_diving_portal`
--
-- --------------------------------------------------------
--
-- Table structure for table `tbl_dcleisure_other_details`
--
CREATE TABLE IF NOT EXISTS `tbl_dcleisure_other_details` (
`id` int(15) NOT NULL AUTO_INCREMENT,
`diver_certification` varchar(255) NOT NULL,
`diver_experience` varchar(255) NOT NULL,
`diver_specialties` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE TABLE [HumanResources].[EmployeePayHistory] (
[BusinessEntityID] INT NOT NULL,
[RateChangeDate] DATETIME NOT NULL,
[Rate] MONEY NOT NULL,
[PayFrequency] TINYINT NOT NULL,
[ModifiedDate] DATETIME CONSTRAINT [DF_EmployeePayHistory_ModifiedDate] DEFAULT (getdate()) NOT NULL,
CONSTRAINT [PK_EmployeePayHistory_BusinessEntityID_RateChangeDate] PRIMARY KEY CLUSTERED ([BusinessEntityID] ASC, [RateChangeDate] ASC),
CONSTRAINT [CK_EmployeePayHistory_PayFrequency] CHECK ([PayFrequency]=(2) OR [PayFrequency]=(1)),
CONSTRAINT [CK_EmployeePayHistory_Rate] CHECK ([Rate]>=(6.50) AND [Rate]<=(200.00)),
CONSTRAINT [FK_EmployeePayHistory_Employee_BusinessEntityID] FOREIGN KEY ([BusinessEntityID]) REFERENCES [HumanResources].[Employee] ([BusinessEntityID])
);
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Check constraint [Rate] >= (6.50) AND [Rate] <= (200.00)', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'CONSTRAINT', @level2name = N'CK_EmployeePayHistory_Rate';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Check constraint [PayFrequency]=(3) OR [PayFrequency]=(2) OR [PayFrequency]=(1)', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'CONSTRAINT', @level2name = N'CK_EmployeePayHistory_PayFrequency';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Default constraint value of GETDATE()', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'CONSTRAINT', @level2name = N'DF_EmployeePayHistory_ModifiedDate';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Foreign key constraint referencing Employee.EmployeeID.', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'CONSTRAINT', @level2name = N'FK_EmployeePayHistory_Employee_BusinessEntityID';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Primary key (clustered) constraint', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'CONSTRAINT', @level2name = N'PK_EmployeePayHistory_BusinessEntityID_RateChangeDate';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Date and time the record was last updated.', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'COLUMN', @level2name = N'ModifiedDate';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'1 = Salary received monthly, 2 = Salary received biweekly', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'COLUMN', @level2name = N'PayFrequency';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Salary hourly rate.', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'COLUMN', @level2name = N'Rate';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Date the change in pay is effective', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'COLUMN', @level2name = N'RateChangeDate';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Employee identification number. Foreign key to Employee.BusinessEntityID.', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory', @level2type = N'COLUMN', @level2name = N'BusinessEntityID';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Employee pay history.', @level0type = N'SCHEMA', @level0name = N'HumanResources', @level1type = N'TABLE', @level1name = N'EmployeePayHistory';
|
#Runtime average, median, min, max and number of runs for all experiments
select e.name, e.suite, CAST(ROUND(AVG(r.time)/1000.0,2) as NUMERIC(18,2)) as average, MEDIAN(r.time)/1000.0 as median, MAX(r.time)/1000.0 as max, MIN(r.time)/1000.0 as min, COUNT(*) as numberOfRuns from experiment e, experiment_run r where e.id = r.experiment_id group by e.suite, e.name order by e.name, e.suite;
select e.name, e.suite, r.time as runtime, run from experiment e, experiment_run r where e.id = r.experiment_id;
|
-- -----------------------------------------------------
-- Schema jikji
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `jikji` DEFAULT CHARACTER SET utf8 ;
USE `jikji` ;
-- -----------------------------------------------------
-- Table `jikji`.`book_metadata`
-- 책 정보 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_metadata` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`type` VARCHAR(5) NULL,
`issued` DATETIME NULL,
`title` VARCHAR(255) NOT NULL,
`language` VARCHAR(5) NOT NULL,
`authors` VARCHAR(255) NOT NULL,
`cover` VARCHAR(255) NULL,
PRIMARY KEY (`id`));
-- -----------------------------------------------------
-- Table `jikji`.`book_original`
-- 책 원본 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_original` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`book_metadata_id` INT(10) NOT NULL,
`content` TEXT NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`book_metadata_id`) REFERENCES `jikji`.`book_metadata` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`book_translation`
-- 책 번역본 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_translation` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`book_metadata_id` INT(10) NOT NULL,
`book_original_id` BIGINT(20) NOT NULL,
`page` INT(10) NOT NULL,
`content` TEXT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`book_metadata_id`) REFERENCES `jikji`.`book_metadata` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`book_original_id`) REFERENCES `jikji`.`book_original` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`book_translation_history`
-- 책 번역본 이력 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_translation_history` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`book_metadata_id` INT(10) NOT NULL,
`book_translation_id` BIGINT(20) NOT NULL,
`content` TEXT NOT NULL,
`date_request` DATETIME NOT NULL DEFAULT current_timestamp,
`date_response` DATETIME NULL,
`state` INT(2) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
FOREIGN KEY (`book_metadata_id`) REFERENCES `jikji`.`book_metadata` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`book_translation_id`) REFERENCES `jikji`.`book_translation` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`user`
-- 회원 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`user` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(15) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`profile` VARCHAR(255) NOT NULL,
`access_token` VARCHAR(255) NOT NULL,
`provider` INT(2) NOT NULL,
`points` INT(10) NOT NULL DEFAULT 0,
`state` INT(2) NOT NULL DEFAULT 0,
`date_sign_up` DATETIME NOT NULL DEFAULT current_timestamp,
`date_withdraw` DATETIME NULL,
PRIMARY KEY (`id`));
-- -----------------------------------------------------
-- Table `jikji`.`book_translation_contributor`
-- 책 번역 기여자 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_translation_contributor` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`book_translation_history_id` BIGINT(20) NOT NULL,
`user_id` INT(10) NOT NULL,
`comment` TEXT NULL,
`point` INT(3) NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`book_translation_history_id`) REFERENCES `jikji`.`book_translation_history` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`user_id`) REFERENCES `jikji`.`user` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`book_translation_admin`
-- 책 번역 관리자 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_translation_admin` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`book_translation_history_id` BIGINT(20) NOT NULL,
`user_id` INT(10) NOT NULL,
`comment` TEXT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`book_translation_history_id`) REFERENCES `jikji`.`book_translation_history` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`user_id`) REFERENCES `jikji`.`user` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`authority`
-- 권한 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`authority` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`user_id` INT(10) NOT NULL,
`book_metadata_id` INT(19) NOT NULL,
`role` VARCHAR(100) NOT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `jikji`.`user` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`book_metadata_id`) REFERENCES `jikji`.`book_metadata` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`email_notification`
-- 이메일 알림 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`email_notification` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`user_id` INT(10) NOT NULL,
`translation_request` BOOLEAN NOT NULL DEFAULT TRUE,
`translation_response` BOOLEAN NOT NULL DEFAULT TRUE,
`translation_update` BOOLEAN NOT NULL DEFAULT TRUE,
`role_add` BOOLEAN NOT NULL DEFAULT TRUE,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `jikji`.`user` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`book_read`
-- 조회 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_read` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`user_id` INT(10) NOT NULL,
`book_metadata_id` INT(19) NOT NULL,
`book_translation_id` BIGINT(20) NOT NULL,
`date` DATETIME NOT NULL DEFAULT current_timestamp,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `jikji`.`user` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`book_metadata_id`) REFERENCES `jikji`.`book_metadata` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`book_translation_id`) REFERENCES `jikji`.`book_translation` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`book_review`
-- 리뷰 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_review` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`user_id` INT(10) NOT NULL,
`book_metadata_id` INT(19) NOT NULL,
`score` INT(2) NOT NULL,
`comment` VARCHAR(400) NOT NULL,
`date` DATETIME NOT NULL DEFAULT current_timestamp,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `jikji`.`user` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`book_metadata_id`) REFERENCES `jikji`.`book_metadata` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`book_like`
-- 찜 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_like` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`user_id` INT(10) NOT NULL,
`book_metadata_id` INT(19) NOT NULL,
`date` DATETIME NOT NULL DEFAULT current_timestamp,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `jikji`.`user` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`book_metadata_id`) REFERENCES `jikji`.`book_metadata` (`id`) ON DELETE CASCADE);
-- -----------------------------------------------------
-- Table `jikji`.`book_mark`
-- 책갈피 테이블
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `jikji`.`book_mark` (
`id` INT(10) NOT NULL AUTO_INCREMENT,
`user_id` INT(10) NOT NULL,
`book_translation_id` BIGINT(20) NOT NULL,
`date` DATETIME NOT NULL DEFAULT current_timestamp,
PRIMARY KEY (`id`),
FOREIGN KEY (`user_id`) REFERENCES `jikji`.`user` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`book_translation_id`) REFERENCES `jikji`.`book_translation` (`id`) ON DELETE CASCADE);
|
USE burgers_db;
INSERT INTO burgers (name) VALUES ('Avocado Beyond Burger');
INSERT INTO burgers (name) VALUES ('The Legendary');
INSERT INTO burgers (name) VALUES ('Bacon Cheddar Bigger Burger');
INSERT INTO burgers (name) VALUES ('Monty Mushroom Bigger Burger');
INSERT INTO burgers (name) VALUES ('Double Double');
INSERT INTO burgers (name) VALUES ('West Coast Salmon Burger');
INSERT INTO burgers (name) VALUES ('Mediterranean Chicken Burger');
INSERT INTO burgers (name) VALUES ('BC Chicken Burger');
INSERT INTO burgers (name) VALUES ('Brie & Mushroom Veggie Burger');
INSERT INTO burgers (name) VALUES ('Crispy Halibut Burger');
INSERT INTO burgers (name, eaten) VALUES ('Classic Canuck Burger');
INSERT INTO burgers (name, eaten) VALUES ('Cajun Chicken Cheddar Sandwich');
INSERT INTO burgers (name, eaten) VALUES ('Easy Grillable Veggie Burger');
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 17, 2020 at 11:19 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `quizapp`
--
-- --------------------------------------------------------
--
-- Table structure for table `answers`
--
CREATE TABLE `answers` (
`id` bigint(20) UNSIGNED NOT NULL,
`question_id` int(11) NOT NULL,
`answer` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`is_correct` tinyint(1) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `answers`
--
INSERT INTO `answers` (`id`, `question_id`, `answer`, `is_correct`, `created_at`, `updated_at`) VALUES
(49, 4, 'Preprocessed Hypertext Page', 0, '2019-12-15 20:31:25', '2019-12-15 20:31:25'),
(50, 4, 'Hypertext Markup Language', 0, '2019-12-15 20:31:25', '2019-12-15 20:31:25'),
(51, 4, '. PHP: Hypertext Preprocessor', 1, '2019-12-15 20:31:25', '2019-12-15 20:31:25'),
(52, 4, 'Hypertext Transfer Protocol', 0, '2019-12-15 20:31:25', '2019-12-15 20:31:25'),
(53, 5, '10', 0, '2019-12-15 21:32:09', '2019-12-15 21:32:09'),
(54, 5, '20', 0, '2019-12-15 21:32:09', '2019-12-15 21:32:09'),
(55, 5, '30', 1, '2019-12-15 21:32:09', '2019-12-15 21:32:09'),
(56, 5, '40', 0, '2019-12-15 21:32:09', '2019-12-15 21:32:09'),
(57, 6, 'Used to register a global variable', 0, '2019-12-15 21:33:58', '2019-12-15 21:33:58'),
(58, 6, 'Used to initialize a session', 0, '2019-12-15 21:33:58', '2019-12-15 21:33:58'),
(59, 6, 'Used to store variables of the current session', 1, '2019-12-15 21:33:58', '2019-12-15 21:33:58'),
(60, 6, 'none of the above', 0, '2019-12-15 21:33:58', '2019-12-15 21:33:58'),
(61, 7, '16', 1, '2019-12-15 21:35:02', '2019-12-15 21:35:02'),
(62, 7, '17', 0, '2019-12-15 21:35:02', '2019-12-15 21:35:02'),
(63, 7, '18', 0, '2019-12-15 21:35:02', '2019-12-15 21:35:02'),
(64, 7, '20', 0, '2019-12-15 21:35:02', '2019-12-15 21:35:02'),
(69, 8, 'CMS', 1, '2019-12-17 19:21:01', '2019-12-17 19:21:01'),
(70, 8, 'Set of library enriched with fucntions', 0, '2019-12-17 19:21:01', '2019-12-17 19:21:01'),
(71, 8, 'Framework for designing dynamic pages', 0, '2019-12-17 19:21:01', '2019-12-17 19:21:01'),
(72, 8, 'Framework and distribution system for reusable PHP components', 0, '2019-12-17 19:21:01', '2019-12-17 19:21:01'),
(73, 9, 'unset()', 1, '2019-12-17 22:38:53', '2019-12-17 22:38:53'),
(74, 9, 'delete()', 0, '2019-12-17 22:38:53', '2019-12-17 22:38:53'),
(75, 9, 'unlink()', 0, '2019-12-17 22:38:53', '2019-12-17 22:38:53'),
(76, 9, 'delete()', 0, '2019-12-17 22:38:53', '2019-12-17 22:38:53'),
(77, 10, '1MB', 0, '2019-12-17 22:41:15', '2019-12-17 22:41:15'),
(78, 10, '2MB', 1, '2019-12-17 22:41:15', '2019-12-17 22:41:15'),
(79, 10, '2.5MB', 0, '2019-12-17 22:41:15', '2019-12-17 22:41:15'),
(80, 10, '3MB', 0, '2019-12-17 22:41:15', '2019-12-17 22:41:15'),
(81, 11, 'Horizon', 0, '2020-04-14 15:33:55', '2020-04-14 15:33:55'),
(82, 11, 'Dusk', 0, '2020-04-14 15:33:55', '2020-04-14 15:33:55'),
(83, 11, 'Artisan', 1, '2020-04-14 15:33:55', '2020-04-14 15:33:55'),
(84, 11, 'Kernel', 0, '2020-04-14 15:33:55', '2020-04-14 15:33:55'),
(85, 12, 'average', 0, '2020-04-14 15:36:59', '2020-04-14 15:36:59'),
(86, 12, 'avg', 1, '2020-04-14 15:36:59', '2020-04-14 15:36:59'),
(87, 12, 'median', 0, '2020-04-14 15:36:59', '2020-04-14 15:36:59'),
(88, 12, 'avg_val', 0, '2020-04-14 15:36:59', '2020-04-14 15:36:59'),
(89, 13, 'split()', 0, '2020-04-14 15:38:00', '2020-04-14 15:38:00'),
(90, 13, 'chunk()', 1, '2020-04-14 15:38:00', '2020-04-14 15:38:00'),
(91, 13, 'explode()', 0, '2020-04-14 15:38:00', '2020-04-14 15:38:00'),
(92, 13, 'break()', 0, '2020-04-14 15:38:00', '2020-04-14 15:38:00'),
(93, 14, 'cache:flush', 0, '2020-04-14 15:40:57', '2020-04-14 15:40:57'),
(94, 14, 'cache:clear', 1, '2020-04-14 15:40:57', '2020-04-14 15:40:57'),
(95, 14, 'cache:forget', 0, '2020-04-14 15:40:57', '2020-04-14 15:40:57'),
(96, 14, 'cache:remove', 0, '2020-04-14 15:40:57', '2020-04-14 15:40:57'),
(97, 15, 'paragraph', 0, '2020-04-14 15:42:20', '2020-04-14 15:42:20'),
(98, 15, 'heading', 0, '2020-04-14 15:42:20', '2020-04-14 15:42:20'),
(99, 15, 'list', 0, '2020-04-14 15:42:20', '2020-04-14 15:42:20'),
(100, 15, 'All', 1, '2020-04-14 15:42:20', '2020-04-14 15:42:20'),
(101, 16, 'Hyper Text Markup Language', 1, '2020-04-14 15:43:13', '2020-04-14 15:43:13'),
(102, 16, 'High Text Markup Language', 0, '2020-04-14 15:43:13', '2020-04-14 15:43:13'),
(103, 16, 'Hyper Tabular Markup Language', 0, '2020-04-14 15:43:13', '2020-04-14 15:43:13'),
(104, 16, 'None', 0, '2020-04-14 15:43:13', '2020-04-14 15:43:13'),
(105, 17, '<TD>', 0, '2020-04-14 15:44:07', '2020-04-14 15:44:07'),
(106, 17, '<br>', 0, '2020-04-14 15:44:07', '2020-04-14 15:44:07'),
(107, 17, '<P>', 1, '2020-04-14 15:44:07', '2020-04-14 15:44:07'),
(108, 17, '<TR>', 0, '2020-04-14 15:44:07', '2020-04-14 15:44:07'),
(109, 18, '<LL>', 0, '2020-04-14 15:44:53', '2020-04-14 15:44:53'),
(110, 18, '<DD>', 0, '2020-04-14 15:44:53', '2020-04-14 15:44:53'),
(111, 18, '<DL>', 1, '2020-04-14 15:44:53', '2020-04-14 15:44:53'),
(112, 18, '<DS>', 0, '2020-04-14 15:44:53', '2020-04-14 15:44:53'),
(113, 19, '<head>', 0, '2020-04-14 15:45:33', '2020-04-14 15:45:33'),
(114, 19, '<h6>', 0, '2020-04-14 15:45:33', '2020-04-14 15:45:33'),
(115, 19, '<heading>', 0, '2020-04-14 15:45:33', '2020-04-14 15:45:33'),
(116, 19, '<h1>', 1, '2020-04-14 15:45:33', '2020-04-14 15:45:33'),
(117, 20, 'Method', 0, '2020-04-14 15:46:11', '2020-04-14 15:46:11'),
(118, 20, 'Action', 0, '2020-04-14 15:46:11', '2020-04-14 15:46:11'),
(119, 20, 'Both (a)&(b)', 1, '2020-04-14 15:46:11', '2020-04-14 15:46:11'),
(120, 20, 'None of these', 0, '2020-04-14 15:46:11', '2020-04-14 15:46:11'),
(129, 21, 'size', 0, '2020-04-14 16:10:00', '2020-04-14 16:10:00'),
(130, 21, 'len', 0, '2020-04-14 16:10:00', '2020-04-14 16:10:00'),
(131, 21, 'maxlength', 0, '2020-04-14 16:10:00', '2020-04-14 16:10:00'),
(132, 21, 'all of these', 1, '2020-04-14 16:10:00', '2020-04-14 16:10:00');
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_024239_create_quizzes_table', 1),
(5, '2019_12_14_024303_create_questions_table', 1),
(6, '2019_12_14_024322_create_answers_table', 1),
(7, '2019_12_14_024438_create_quiz_user_table', 1),
(8, '2019_12_14_025713_create_results_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `questions`
--
CREATE TABLE `questions` (
`id` bigint(20) UNSIGNED NOT NULL,
`question` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`quiz_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `questions`
--
INSERT INTO `questions` (`id`, `question`, `quiz_id`, `created_at`, `updated_at`) VALUES
(4, 'What does PHP stand for?', 1, '2019-12-13 22:55:26', '2019-12-14 22:52:21'),
(5, 'What is the default execution time set in set_time_limit()?', 1, '2019-12-15 21:32:09', '2019-12-15 21:32:09'),
(6, 'What is the purpose of $_SESSION[]?', 1, '2019-12-15 21:33:58', '2019-12-15 21:33:58'),
(7, 'How many error levels are available in PHP ?', 1, '2019-12-15 21:35:02', '2019-12-15 21:35:02'),
(8, 'What is Joomla in PHP?', 1, '2019-12-15 21:36:51', '2019-12-15 21:36:51'),
(9, '______ is used to unset a variable in PHP ?', 1, '2019-12-17 22:38:53', '2019-12-17 22:38:53'),
(10, 'What is the default size of a file set in upload_max_filesize ?', 1, '2019-12-17 22:41:15', '2019-12-17 22:41:15'),
(11, 'What is the name of the command-line interface provided by Laravel that provides a number of helpful commands?', 2, '2020-04-14 15:33:55', '2020-04-14 15:33:55'),
(12, 'Which method returns the average value of a given key ?', 2, '2020-04-14 15:36:59', '2020-04-14 15:36:59'),
(13, 'Which method breaks the collection into multiple, smaller collections of a given size', 2, '2020-04-14 15:38:00', '2020-04-14 15:38:00'),
(14, 'Artisan command to flush the application cache:', 2, '2020-04-14 15:40:57', '2020-04-14 15:40:57'),
(15, 'The common element which describe the web page, is ?', 3, '2020-04-14 15:42:20', '2020-04-14 15:42:20'),
(16, 'HTML stands for?', 3, '2020-04-14 15:43:13', '2020-04-14 15:43:13'),
(17, 'Which of the following tag is used to mark a beginning of paragraph ?', 3, '2020-04-14 15:44:07', '2020-04-14 15:44:07'),
(18, 'From which tag descriptive list starts ?', 3, '2020-04-14 15:44:53', '2020-04-14 15:44:53'),
(19, 'Correct HTML tag for the largest heading is', 3, '2020-04-14 15:45:33', '2020-04-14 15:45:33'),
(20, 'The attribute of <form> tag', 3, '2020-04-14 15:46:11', '2020-04-14 15:46:11'),
(21, 'Which of the following attributes of text box control allow to limit the maximum character?', 3, '2020-04-14 15:47:47', '2020-04-14 15:47:47');
-- --------------------------------------------------------
--
-- Table structure for table `quizzes`
--
CREATE TABLE `quizzes` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`minutes` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `quizzes`
--
INSERT INTO `quizzes` (`id`, `name`, `description`, `minutes`, `created_at`, `updated_at`) VALUES
(1, 'php quiz', 'This contains PHP questions', 10, NULL, '2020-03-27 16:45:42'),
(2, 'Laravel Quiz', 'This includes LARAVEL questions', 10, '2020-04-14 15:32:19', '2020-04-14 15:32:19'),
(3, 'HTML exam', 'Only html', 10, '2020-04-14 15:41:27', '2020-04-14 15:41:27'),
(4, 'JS Quiz', 'includes js questions', 10, '2020-04-14 15:49:02', '2020-04-14 15:49:02');
-- --------------------------------------------------------
--
-- Table structure for table `quiz_user`
--
CREATE TABLE `quiz_user` (
`id` bigint(20) UNSIGNED NOT NULL,
`quiz_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `quiz_user`
--
INSERT INTO `quiz_user` (`id`, `quiz_id`, `user_id`, `created_at`, `updated_at`) VALUES
(5, 1, 9, NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `results`
--
CREATE TABLE `results` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` int(11) NOT NULL,
`question_id` int(11) NOT NULL,
`quiz_id` int(11) NOT NULL,
`answer_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `results`
--
INSERT INTO `results` (`id`, `user_id`, `question_id`, `quiz_id`, `answer_id`, `created_at`, `updated_at`) VALUES
(39, 9, 4, 1, 51, '2020-04-14 16:15:09', '2020-04-14 16:15:26'),
(40, 9, 5, 1, 54, '2020-04-14 16:15:32', '2020-04-14 16:15:32'),
(41, 9, 6, 1, 57, '2020-04-14 16:15:38', '2020-04-14 16:15:38'),
(42, 9, 7, 1, 61, '2020-04-14 16:15:40', '2020-04-14 16:15:40'),
(43, 9, 8, 1, 69, '2020-04-14 16:15:42', '2020-04-14 16:15:42'),
(44, 9, 9, 1, 73, '2020-04-14 16:15:44', '2020-04-14 16:15:44'),
(45, 9, 10, 1, 78, '2020-04-14 16:15:46', '2020-04-14 16:15:46');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`visible_password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`occupation` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_admin` int(11) NOT NULL DEFAULT '0',
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `visible_password`, `occupation`, `address`, `phone`, `is_admin`, `remember_token`, `created_at`, `updated_at`) VALUES
(3, 'nick', 'nick@gmail.com', '2019-12-17 13:00:00', '$2y$10$2Fcg3ajV/EAYxbbUKYJOWOvWI.Pifr2CtiLg.6spy.ZLKnvrjcPma', ' apple123', 'php programmer', 'melbourne', '32423423', 0, NULL, '2019-12-15 23:40:32', '2019-12-15 23:40:32'),
(7, 'admin', 'admin123@gmail.com', '2019-12-17 01:01:22', '$2y$10$qN9L6ZbB1d0RQHNEI1ls/O9MU.M606AXtvypm5033Rajsse41lxGK', 'password', 'CEO', 'Australia', '03453494', 1, NULL, '2019-12-17 01:01:22', '2019-12-17 01:01:22'),
(9, 'louis', 'louis@gmail.com', '2019-12-17 13:00:00', '$2y$10$0FAPoOXyqatO8cnOHBOo8O9f5gdTHL.G6xeJaP8Q3eWIB4annOgAm', 'apple123', 'programmer', 'melbourne', '32423423', 0, 'PUI66OsH5BinqnXdrCPeNYkLf2JmDqZIj656Vzkq84GpELiOhvvmTiGdtzua', '2019-12-17 21:36:20', '2019-12-17 21:36:20'),
(10, 'RIchard', 'richard@gmail.com', '2019-12-17 13:00:00', '$2y$10$NUWGfzRHkoF53QJV.RCdLODII4sA5JLxVbPpUmzviLBupYTyIn4Au', 'apple123 ', 'programmer', 'Melbourne', '3423423', 0, NULL, '2019-12-17 21:39:32', '2020-03-27 12:24:54'),
(11, 'ranjeet', 'ranjeet@gmail.com', NULL, '$2y$10$2Ty.tkFM6kGhWsePqXHX3uAbmLh0/dHVkDxxk45bKzalhUdCNRxny', ' apple123 ', 'Apps Developer', 'Melbourne', '989892332', 0, NULL, '2020-03-27 12:23:03', '2020-03-27 17:08:26'),
(12, 'david doe', 'david@gmail.com', NULL, '$2y$10$JzyZuixpzlgxKX1OLrLxFOJ2wMPQBJ3KZglJofMsty9..3Qc7vz/2', 'apple123', 'intern', 'australia', '77965999', 0, NULL, '2020-03-27 12:26:02', '2020-03-27 12:26:02');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `answers`
--
ALTER TABLE `answers`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indexes for table `questions`
--
ALTER TABLE `questions`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `quizzes`
--
ALTER TABLE `quizzes`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `quiz_user`
--
ALTER TABLE `quiz_user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `results`
--
ALTER TABLE `results`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `answers`
--
ALTER TABLE `answers`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=133;
--
-- AUTO_INCREMENT for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `questions`
--
ALTER TABLE `questions`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `quizzes`
--
ALTER TABLE `quizzes`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `quiz_user`
--
ALTER TABLE `quiz_user`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `results`
--
ALTER TABLE `results`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
----------------------------------------------------------------
-- [providers] Table
--
Create or replace FUNCTION InsertProvider(
v_id UUID,
v_name VARCHAR(128),
v_description VARCHAR(4000),
v_url VARCHAR(512),
v_provider_type VARCHAR(32),
v_auth_required BOOLEAN,
v_auth_username VARCHAR(64),
v_auth_password TEXT,
v_custom_properties TEXT,
v_tenant_name VARCHAR DEFAULT NULL,
v_plugin_type VARCHAR DEFAULT NULL,
v_agent_configuration TEXT DEFAULT NULL)
RETURNS VOID
AS $procedure$
BEGIN
INSERT INTO providers(
id,
name,
description,
url,
provider_type,
auth_required,
auth_username,
auth_password,
custom_properties,
tenant_name,
plugin_type,
agent_configuration)
VALUES(
v_id,
v_name,
v_description,
v_url,
v_provider_type,
v_auth_required,
v_auth_username,
v_auth_password,
v_custom_properties,
v_tenant_name,
v_plugin_type,
v_agent_configuration);
END; $procedure$
LANGUAGE plpgsql;
Create or replace FUNCTION UpdateProvider(
v_id UUID,
v_name VARCHAR(128),
v_description VARCHAR(4000),
v_url VARCHAR(512),
v_provider_type VARCHAR(32),
v_auth_required BOOLEAN,
v_auth_username VARCHAR(64),
v_auth_password TEXT,
v_custom_properties TEXT,
v_tenant_name VARCHAR DEFAULT NULL,
v_plugin_type VARCHAR DEFAULT NULL,
v_agent_configuration TEXT DEFAULT NULL)
RETURNS VOID
AS $procedure$
BEGIN
UPDATE providers
SET name = v_name,
description = v_description,
url = v_url,
provider_type = v_provider_type,
auth_required = v_auth_required,
auth_username = v_auth_username,
auth_password = v_auth_password,
custom_properties = v_custom_properties,
tenant_name = v_tenant_name,
plugin_type = v_plugin_type,
_update_date = NOW(),
agent_configuration = v_agent_configuration
WHERE id = v_id;
END; $procedure$
LANGUAGE plpgsql;
Create or replace FUNCTION DeleteProvider(v_id UUID)
RETURNS VOID
AS $procedure$
BEGIN
DELETE
FROM providers
WHERE id = v_id;
END; $procedure$
LANGUAGE plpgsql;
Create or replace FUNCTION GetAllFromProviders() RETURNS SETOF providers STABLE
AS $procedure$
BEGIN
RETURN QUERY
SELECT *
FROM providers;
END; $procedure$
LANGUAGE plpgsql;
Create or replace FUNCTION GetAllFromProvidersByType(v_provider_type varchar(32)) RETURNS SETOF providers STABLE
AS $procedure$
BEGIN
RETURN QUERY
SELECT *
FROM providers
WHERE provider_type = v_provider_type;
END; $procedure$
LANGUAGE plpgsql;
Create or replace FUNCTION GetProviderByProviderId(v_id UUID)
RETURNS SETOF providers STABLE
AS $procedure$
BEGIN
RETURN QUERY
SELECT *
FROM providers
WHERE id = v_id;
END; $procedure$
LANGUAGE plpgsql;
Create or replace FUNCTION GetProviderByName(v_name VARCHAR)
RETURNS SETOF providers STABLE
AS $procedure$
BEGIN
RETURN QUERY
SELECT *
FROM providers
WHERE name = v_name;
END; $procedure$
LANGUAGE plpgsql;
|
--
-- NOTE:
--
-- File paths need to be edited. Search for $$PATH$$ and
-- replace it with the path to the directory containing
-- the extracted data files.
--
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
ALTER TABLE ONLY public.store DROP CONSTRAINT store_manager_staff_id_fkey;
ALTER TABLE ONLY public.store DROP CONSTRAINT store_address_id_fkey;
ALTER TABLE ONLY public.staff DROP CONSTRAINT staff_address_id_fkey;
ALTER TABLE ONLY public.rental DROP CONSTRAINT rental_staff_id_key;
ALTER TABLE ONLY public.rental DROP CONSTRAINT rental_inventory_id_fkey;
ALTER TABLE ONLY public.rental DROP CONSTRAINT rental_customer_id_fkey;
ALTER TABLE ONLY public.payment DROP CONSTRAINT payment_staff_id_fkey;
ALTER TABLE ONLY public.payment DROP CONSTRAINT payment_rental_id_fkey;
ALTER TABLE ONLY public.payment DROP CONSTRAINT payment_customer_id_fkey;
ALTER TABLE ONLY public.inventory DROP CONSTRAINT inventory_film_id_fkey;
ALTER TABLE ONLY public.city DROP CONSTRAINT fk_city;
ALTER TABLE ONLY public.address DROP CONSTRAINT fk_address_city;
ALTER TABLE ONLY public.film DROP CONSTRAINT film_language_id_fkey;
ALTER TABLE ONLY public.film_category DROP CONSTRAINT film_category_film_id_fkey;
ALTER TABLE ONLY public.film_category DROP CONSTRAINT film_category_category_id_fkey;
ALTER TABLE ONLY public.film_actor DROP CONSTRAINT film_actor_film_id_fkey;
ALTER TABLE ONLY public.film_actor DROP CONSTRAINT film_actor_actor_id_fkey;
ALTER TABLE ONLY public.customer DROP CONSTRAINT customer_address_id_fkey;
DROP TRIGGER last_updated ON public.store;
DROP TRIGGER last_updated ON public.staff;
DROP TRIGGER last_updated ON public.rental;
DROP TRIGGER last_updated ON public.language;
DROP TRIGGER last_updated ON public.inventory;
DROP TRIGGER last_updated ON public.film_category;
DROP TRIGGER last_updated ON public.film_actor;
DROP TRIGGER last_updated ON public.film;
DROP TRIGGER last_updated ON public.customer;
DROP TRIGGER last_updated ON public.country;
DROP TRIGGER last_updated ON public.city;
DROP TRIGGER last_updated ON public.category;
DROP TRIGGER last_updated ON public.address;
DROP TRIGGER last_updated ON public.actor;
DROP TRIGGER film_fulltext_trigger ON public.film;
DROP INDEX public.idx_unq_rental_rental_date_inventory_id_customer_id;
DROP INDEX public.idx_unq_manager_staff_id;
DROP INDEX public.idx_title;
DROP INDEX public.idx_store_id_film_id;
DROP INDEX public.idx_last_name;
DROP INDEX public.idx_fk_store_id;
DROP INDEX public.idx_fk_staff_id;
DROP INDEX public.idx_fk_rental_id;
DROP INDEX public.idx_fk_language_id;
DROP INDEX public.idx_fk_inventory_id;
DROP INDEX public.idx_fk_film_id;
DROP INDEX public.idx_fk_customer_id;
DROP INDEX public.idx_fk_country_id;
DROP INDEX public.idx_fk_city_id;
DROP INDEX public.idx_fk_address_id;
DROP INDEX public.idx_actor_last_name;
DROP INDEX public.film_fulltext_idx;
ALTER TABLE ONLY public.store DROP CONSTRAINT store_pkey;
ALTER TABLE ONLY public.staff DROP CONSTRAINT staff_pkey;
ALTER TABLE ONLY public.rental DROP CONSTRAINT rental_pkey;
ALTER TABLE ONLY public.payment DROP CONSTRAINT payment_pkey;
ALTER TABLE ONLY public.language DROP CONSTRAINT language_pkey;
ALTER TABLE ONLY public.inventory DROP CONSTRAINT inventory_pkey;
ALTER TABLE ONLY public.film DROP CONSTRAINT film_pkey;
ALTER TABLE ONLY public.film_category DROP CONSTRAINT film_category_pkey;
ALTER TABLE ONLY public.film_actor DROP CONSTRAINT film_actor_pkey;
ALTER TABLE ONLY public.customer DROP CONSTRAINT customer_pkey;
ALTER TABLE ONLY public.country DROP CONSTRAINT country_pkey;
ALTER TABLE ONLY public.city DROP CONSTRAINT city_pkey;
ALTER TABLE ONLY public.category DROP CONSTRAINT category_pkey;
ALTER TABLE ONLY public.address DROP CONSTRAINT address_pkey;
ALTER TABLE ONLY public.actor DROP CONSTRAINT actor_pkey;
DROP VIEW public.staff_list;
DROP VIEW public.sales_by_store;
DROP TABLE public.store;
DROP SEQUENCE public.store_store_id_seq;
DROP TABLE public.staff;
DROP SEQUENCE public.staff_staff_id_seq;
DROP VIEW public.sales_by_film_category;
DROP TABLE public.rental;
DROP SEQUENCE public.rental_rental_id_seq;
DROP TABLE public.payment;
DROP SEQUENCE public.payment_payment_id_seq;
DROP VIEW public.nicer_but_slower_film_list;
DROP TABLE public.language;
DROP SEQUENCE public.language_language_id_seq;
DROP TABLE public.inventory;
DROP SEQUENCE public.inventory_inventory_id_seq;
DROP VIEW public.film_list;
DROP VIEW public.customer_list;
DROP TABLE public.country;
DROP SEQUENCE public.country_country_id_seq;
DROP TABLE public.city;
DROP SEQUENCE public.city_city_id_seq;
DROP TABLE public.address;
DROP SEQUENCE public.address_address_id_seq;
DROP VIEW public.actor_info;
DROP TABLE public.film_category;
DROP TABLE public.film_actor;
DROP TABLE public.film;
DROP SEQUENCE public.film_film_id_seq;
DROP TABLE public.category;
DROP SEQUENCE public.category_category_id_seq;
DROP TABLE public.actor;
DROP SEQUENCE public.actor_actor_id_seq;
DROP AGGREGATE public.group_concat(text);
DROP FUNCTION public.rewards_report(min_monthly_purchases integer, min_dollar_amount_purchased numeric);
DROP TABLE public.customer;
DROP SEQUENCE public.customer_customer_id_seq;
DROP FUNCTION public.last_updated();
DROP FUNCTION public.last_day(timestamp without time zone);
DROP FUNCTION public.inventory_in_stock(p_inventory_id integer);
DROP FUNCTION public.inventory_held_by_customer(p_inventory_id integer);
DROP FUNCTION public.get_customer_balance(p_customer_id integer, p_effective_date timestamp without time zone);
DROP FUNCTION public.film_not_in_stock(p_film_id integer, p_store_id integer, OUT p_film_count integer);
DROP FUNCTION public.film_in_stock(p_film_id integer, p_store_id integer, OUT p_film_count integer);
DROP FUNCTION public._group_concat(text, text);
DROP DOMAIN public.year;
DROP TYPE public.mpaa_rating;
DROP EXTENSION plpgsql;
DROP SCHEMA public;
--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO postgres;
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'Standard public schema';
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
--
-- Name: mpaa_rating; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE mpaa_rating AS ENUM (
'G',
'PG',
'PG-13',
'R',
'NC-17'
);
ALTER TYPE public.mpaa_rating OWNER TO postgres;
--
-- Name: year; Type: DOMAIN; Schema: public; Owner: postgres
--
CREATE DOMAIN year AS integer
CONSTRAINT year_check CHECK (((VALUE >= 1901) AND (VALUE <= 2155)));
ALTER DOMAIN public.year OWNER TO postgres;
--
-- Name: _group_concat(text, text); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION _group_concat(text, text) RETURNS text
LANGUAGE sql IMMUTABLE
AS $_$
SELECT CASE
WHEN $2 IS NULL THEN $1
WHEN $1 IS NULL THEN $2
ELSE $1 || ', ' || $2
END
$_$;
ALTER FUNCTION public._group_concat(text, text) OWNER TO postgres;
--
-- Name: film_in_stock(integer, integer); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION film_in_stock(p_film_id integer, p_store_id integer, OUT p_film_count integer) RETURNS SETOF integer
LANGUAGE sql
AS $_$
SELECT inventory_id
FROM inventory
WHERE film_id = $1
AND store_id = $2
AND inventory_in_stock(inventory_id);
$_$;
ALTER FUNCTION public.film_in_stock(p_film_id integer, p_store_id integer, OUT p_film_count integer) OWNER TO postgres;
--
-- Name: film_not_in_stock(integer, integer); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION film_not_in_stock(p_film_id integer, p_store_id integer, OUT p_film_count integer) RETURNS SETOF integer
LANGUAGE sql
AS $_$
SELECT inventory_id
FROM inventory
WHERE film_id = $1
AND store_id = $2
AND NOT inventory_in_stock(inventory_id);
$_$;
ALTER FUNCTION public.film_not_in_stock(p_film_id integer, p_store_id integer, OUT p_film_count integer) OWNER TO postgres;
--
-- Name: get_customer_balance(integer, timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION get_customer_balance(p_customer_id integer, p_effective_date timestamp without time zone) RETURNS numeric
LANGUAGE plpgsql
AS $$
--#OK, WE NEED TO CALCULATE THE CURRENT BALANCE GIVEN A CUSTOMER_ID AND A DATE
--#THAT WE WANT THE BALANCE TO BE EFFECTIVE FOR. THE BALANCE IS:
--# 1) RENTAL FEES FOR ALL PREVIOUS RENTALS
--# 2) ONE DOLLAR FOR EVERY DAY THE PREVIOUS RENTALS ARE OVERDUE
--# 3) IF A FILM IS MORE THAN RENTAL_DURATION * 2 OVERDUE, CHARGE THE REPLACEMENT_COST
--# 4) SUBTRACT ALL PAYMENTS MADE BEFORE THE DATE SPECIFIED
DECLARE
v_rentfees DECIMAL(5,2); --#FEES PAID TO RENT THE VIDEOS INITIALLY
v_overfees INTEGER; --#LATE FEES FOR PRIOR RENTALS
v_payments DECIMAL(5,2); --#SUM OF PAYMENTS MADE PREVIOUSLY
BEGIN
SELECT COALESCE(SUM(film.rental_rate),0) INTO v_rentfees
FROM film, inventory, rental
WHERE film.film_id = inventory.film_id
AND inventory.inventory_id = rental.inventory_id
AND rental.rental_date <= p_effective_date
AND rental.customer_id = p_customer_id;
SELECT COALESCE(SUM(IF((rental.return_date - rental.rental_date) > (film.rental_duration * '1 day'::interval),
((rental.return_date - rental.rental_date) - (film.rental_duration * '1 day'::interval)),0)),0) INTO v_overfees
FROM rental, inventory, film
WHERE film.film_id = inventory.film_id
AND inventory.inventory_id = rental.inventory_id
AND rental.rental_date <= p_effective_date
AND rental.customer_id = p_customer_id;
SELECT COALESCE(SUM(payment.amount),0) INTO v_payments
FROM payment
WHERE payment.payment_date <= p_effective_date
AND payment.customer_id = p_customer_id;
RETURN v_rentfees + v_overfees - v_payments;
END
$$;
ALTER FUNCTION public.get_customer_balance(p_customer_id integer, p_effective_date timestamp without time zone) OWNER TO postgres;
--
-- Name: inventory_held_by_customer(integer); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION inventory_held_by_customer(p_inventory_id integer) RETURNS integer
LANGUAGE plpgsql
AS $$
DECLARE
v_customer_id INTEGER;
BEGIN
SELECT customer_id INTO v_customer_id
FROM rental
WHERE return_date IS NULL
AND inventory_id = p_inventory_id;
RETURN v_customer_id;
END $$;
ALTER FUNCTION public.inventory_held_by_customer(p_inventory_id integer) OWNER TO postgres;
--
-- Name: inventory_in_stock(integer); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION inventory_in_stock(p_inventory_id integer) RETURNS boolean
LANGUAGE plpgsql
AS $$
DECLARE
v_rentals INTEGER;
v_out INTEGER;
BEGIN
-- AN ITEM IS IN-STOCK IF THERE ARE EITHER NO ROWS IN THE rental TABLE
-- FOR THE ITEM OR ALL ROWS HAVE return_date POPULATED
SELECT count(*) INTO v_rentals
FROM rental
WHERE inventory_id = p_inventory_id;
IF v_rentals = 0 THEN
RETURN TRUE;
END IF;
SELECT COUNT(rental_id) INTO v_out
FROM inventory LEFT JOIN rental USING(inventory_id)
WHERE inventory.inventory_id = p_inventory_id
AND rental.return_date IS NULL;
IF v_out > 0 THEN
RETURN FALSE;
ELSE
RETURN TRUE;
END IF;
END $$;
ALTER FUNCTION public.inventory_in_stock(p_inventory_id integer) OWNER TO postgres;
--
-- Name: last_day(timestamp without time zone); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION last_day(timestamp without time zone) RETURNS date
LANGUAGE sql IMMUTABLE STRICT
AS $_$
SELECT CASE
WHEN EXTRACT(MONTH FROM $1) = 12 THEN
(((EXTRACT(YEAR FROM $1) + 1) operator(pg_catalog.||) '-01-01')::date - INTERVAL '1 day')::date
ELSE
((EXTRACT(YEAR FROM $1) operator(pg_catalog.||) '-' operator(pg_catalog.||) (EXTRACT(MONTH FROM $1) + 1) operator(pg_catalog.||) '-01')::date - INTERVAL '1 day')::date
END
$_$;
ALTER FUNCTION public.last_day(timestamp without time zone) OWNER TO postgres;
--
-- Name: last_updated(); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION last_updated() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW.last_update = CURRENT_TIMESTAMP;
RETURN NEW;
END $$;
ALTER FUNCTION public.last_updated() OWNER TO postgres;
--
-- Name: customer_customer_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE customer_customer_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.customer_customer_id_seq OWNER TO postgres;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: customer; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE customer (
customer_id integer DEFAULT nextval('customer_customer_id_seq'::regclass) NOT NULL,
store_id smallint NOT NULL,
first_name character varying(45) NOT NULL,
last_name character varying(45) NOT NULL,
email character varying(50),
address_id smallint NOT NULL,
activebool boolean DEFAULT true NOT NULL,
create_date date DEFAULT ('now'::text)::date NOT NULL,
last_update timestamp without time zone DEFAULT now(),
active integer
);
ALTER TABLE public.customer OWNER TO postgres;
--
-- Name: rewards_report(integer, numeric); Type: FUNCTION; Schema: public; Owner: postgres
--
CREATE FUNCTION rewards_report(min_monthly_purchases integer, min_dollar_amount_purchased numeric) RETURNS SETOF customer
LANGUAGE plpgsql SECURITY DEFINER
AS $_$
DECLARE
last_month_start DATE;
last_month_end DATE;
rr RECORD;
tmpSQL TEXT;
BEGIN
/* Some sanity checks... */
IF min_monthly_purchases = 0 THEN
RAISE EXCEPTION 'Minimum monthly purchases parameter must be > 0';
END IF;
IF min_dollar_amount_purchased = 0.00 THEN
RAISE EXCEPTION 'Minimum monthly dollar amount purchased parameter must be > $0.00';
END IF;
last_month_start := CURRENT_DATE - '3 month'::interval;
last_month_start := to_date((extract(YEAR FROM last_month_start) || '-' || extract(MONTH FROM last_month_start) || '-01'),'YYYY-MM-DD');
last_month_end := LAST_DAY(last_month_start);
/*
Create a temporary storage area for Customer IDs.
*/
CREATE TEMPORARY TABLE tmpCustomer (customer_id INTEGER NOT NULL PRIMARY KEY);
/*
Find all customers meeting the monthly purchase requirements
*/
tmpSQL := 'INSERT INTO tmpCustomer (customer_id)
SELECT p.customer_id
FROM payment AS p
WHERE DATE(p.payment_date) BETWEEN '||quote_literal(last_month_start) ||' AND '|| quote_literal(last_month_end) || '
GROUP BY customer_id
HAVING SUM(p.amount) > '|| min_dollar_amount_purchased || '
AND COUNT(customer_id) > ' ||min_monthly_purchases ;
EXECUTE tmpSQL;
/*
Output ALL customer information of matching rewardees.
Customize output as needed.
*/
FOR rr IN EXECUTE 'SELECT c.* FROM tmpCustomer AS t INNER JOIN customer AS c ON t.customer_id = c.customer_id' LOOP
RETURN NEXT rr;
END LOOP;
/* Clean up */
tmpSQL := 'DROP TABLE tmpCustomer';
EXECUTE tmpSQL;
RETURN;
END
$_$;
ALTER FUNCTION public.rewards_report(min_monthly_purchases integer, min_dollar_amount_purchased numeric) OWNER TO postgres;
--
-- Name: group_concat(text); Type: AGGREGATE; Schema: public; Owner: postgres
--
CREATE AGGREGATE group_concat(text) (
SFUNC = _group_concat,
STYPE = text
);
ALTER AGGREGATE public.group_concat(text) OWNER TO postgres;
--
-- Name: actor_actor_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE actor_actor_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.actor_actor_id_seq OWNER TO postgres;
--
-- Name: actor; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE actor (
actor_id integer DEFAULT nextval('actor_actor_id_seq'::regclass) NOT NULL,
first_name character varying(45) NOT NULL,
last_name character varying(45) NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.actor OWNER TO postgres;
--
-- Name: category_category_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE category_category_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.category_category_id_seq OWNER TO postgres;
--
-- Name: category; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE category (
category_id integer DEFAULT nextval('category_category_id_seq'::regclass) NOT NULL,
name character varying(25) NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.category OWNER TO postgres;
--
-- Name: film_film_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE film_film_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.film_film_id_seq OWNER TO postgres;
--
-- Name: film; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE film (
film_id integer DEFAULT nextval('film_film_id_seq'::regclass) NOT NULL,
title character varying(255) NOT NULL,
description text,
release_year year,
language_id smallint NOT NULL,
rental_duration smallint DEFAULT 3 NOT NULL,
rental_rate numeric(4,2) DEFAULT 4.99 NOT NULL,
length smallint,
replacement_cost numeric(5,2) DEFAULT 19.99 NOT NULL,
rating mpaa_rating DEFAULT 'G'::mpaa_rating,
last_update timestamp without time zone DEFAULT now() NOT NULL,
special_features text[],
fulltext tsvector NOT NULL
);
ALTER TABLE public.film OWNER TO postgres;
--
-- Name: film_actor; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE film_actor (
actor_id smallint NOT NULL,
film_id smallint NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.film_actor OWNER TO postgres;
--
-- Name: film_category; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE film_category (
film_id smallint NOT NULL,
category_id smallint NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.film_category OWNER TO postgres;
--
-- Name: actor_info; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW actor_info AS
SELECT a.actor_id, a.first_name, a.last_name, group_concat(DISTINCT (((c.name)::text || ': '::text) || (SELECT group_concat((f.title)::text) AS group_concat FROM ((film f JOIN film_category fc ON ((f.film_id = fc.film_id))) JOIN film_actor fa ON ((f.film_id = fa.film_id))) WHERE ((fc.category_id = c.category_id) AND (fa.actor_id = a.actor_id)) GROUP BY fa.actor_id))) AS film_info FROM (((actor a LEFT JOIN film_actor fa ON ((a.actor_id = fa.actor_id))) LEFT JOIN film_category fc ON ((fa.film_id = fc.film_id))) LEFT JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY a.actor_id, a.first_name, a.last_name;
ALTER TABLE public.actor_info OWNER TO postgres;
--
-- Name: address_address_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE address_address_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.address_address_id_seq OWNER TO postgres;
--
-- Name: address; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE address (
address_id integer DEFAULT nextval('address_address_id_seq'::regclass) NOT NULL,
address character varying(50) NOT NULL,
address2 character varying(50),
district character varying(20) NOT NULL,
city_id smallint NOT NULL,
postal_code character varying(10),
phone character varying(20) NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.address OWNER TO postgres;
--
-- Name: city_city_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE city_city_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.city_city_id_seq OWNER TO postgres;
--
-- Name: city; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE city (
city_id integer DEFAULT nextval('city_city_id_seq'::regclass) NOT NULL,
city character varying(50) NOT NULL,
country_id smallint NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.city OWNER TO postgres;
--
-- Name: country_country_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE country_country_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.country_country_id_seq OWNER TO postgres;
--
-- Name: country; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE country (
country_id integer DEFAULT nextval('country_country_id_seq'::regclass) NOT NULL,
country character varying(50) NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.country OWNER TO postgres;
--
-- Name: customer_list; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW customer_list AS
SELECT cu.customer_id AS id, (((cu.first_name)::text || ' '::text) || (cu.last_name)::text) AS name, a.address, a.postal_code AS "zip code", a.phone, city.city, country.country, CASE WHEN cu.activebool THEN 'active'::text ELSE ''::text END AS notes, cu.store_id AS sid FROM (((customer cu JOIN address a ON ((cu.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id)));
ALTER TABLE public.customer_list OWNER TO postgres;
--
-- Name: film_list; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW film_list AS
SELECT film.film_id AS fid, film.title, film.description, category.name AS category, film.rental_rate AS price, film.length, film.rating, group_concat((((actor.first_name)::text || ' '::text) || (actor.last_name)::text)) AS actors FROM ((((category LEFT JOIN film_category ON ((category.category_id = film_category.category_id))) LEFT JOIN film ON ((film_category.film_id = film.film_id))) JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating;
ALTER TABLE public.film_list OWNER TO postgres;
--
-- Name: inventory_inventory_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE inventory_inventory_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.inventory_inventory_id_seq OWNER TO postgres;
--
-- Name: inventory; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE inventory (
inventory_id integer DEFAULT nextval('inventory_inventory_id_seq'::regclass) NOT NULL,
film_id smallint NOT NULL,
store_id smallint NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.inventory OWNER TO postgres;
--
-- Name: language_language_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE language_language_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.language_language_id_seq OWNER TO postgres;
--
-- Name: language; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE language (
language_id integer DEFAULT nextval('language_language_id_seq'::regclass) NOT NULL,
name character(20) NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.language OWNER TO postgres;
--
-- Name: nicer_but_slower_film_list; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW nicer_but_slower_film_list AS
SELECT film.film_id AS fid, film.title, film.description, category.name AS category, film.rental_rate AS price, film.length, film.rating, group_concat((((upper("substring"((actor.first_name)::text, 1, 1)) || lower("substring"((actor.first_name)::text, 2))) || upper("substring"((actor.last_name)::text, 1, 1))) || lower("substring"((actor.last_name)::text, 2)))) AS actors FROM ((((category LEFT JOIN film_category ON ((category.category_id = film_category.category_id))) LEFT JOIN film ON ((film_category.film_id = film.film_id))) JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating;
ALTER TABLE public.nicer_but_slower_film_list OWNER TO postgres;
--
-- Name: payment_payment_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE payment_payment_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.payment_payment_id_seq OWNER TO postgres;
--
-- Name: payment; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE payment (
payment_id integer DEFAULT nextval('payment_payment_id_seq'::regclass) NOT NULL,
customer_id smallint NOT NULL,
staff_id smallint NOT NULL,
rental_id integer NOT NULL,
amount numeric(5,2) NOT NULL,
payment_date timestamp without time zone NOT NULL
);
ALTER TABLE public.payment OWNER TO postgres;
--
-- Name: rental_rental_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE rental_rental_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.rental_rental_id_seq OWNER TO postgres;
--
-- Name: rental; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE rental (
rental_id integer DEFAULT nextval('rental_rental_id_seq'::regclass) NOT NULL,
rental_date timestamp without time zone NOT NULL,
inventory_id integer NOT NULL,
customer_id smallint NOT NULL,
return_date timestamp without time zone,
staff_id smallint NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.rental OWNER TO postgres;
--
-- Name: sales_by_film_category; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW sales_by_film_category AS
SELECT c.name AS category, sum(p.amount) AS total_sales FROM (((((payment p JOIN rental r ON ((p.rental_id = r.rental_id))) JOIN inventory i ON ((r.inventory_id = i.inventory_id))) JOIN film f ON ((i.film_id = f.film_id))) JOIN film_category fc ON ((f.film_id = fc.film_id))) JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY c.name ORDER BY sum(p.amount) DESC;
ALTER TABLE public.sales_by_film_category OWNER TO postgres;
--
-- Name: staff_staff_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE staff_staff_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.staff_staff_id_seq OWNER TO postgres;
--
-- Name: staff; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE staff (
staff_id integer DEFAULT nextval('staff_staff_id_seq'::regclass) NOT NULL,
first_name character varying(45) NOT NULL,
last_name character varying(45) NOT NULL,
address_id smallint NOT NULL,
email character varying(50),
store_id smallint NOT NULL,
active boolean DEFAULT true NOT NULL,
username character varying(16) NOT NULL,
password character varying(40),
last_update timestamp without time zone DEFAULT now() NOT NULL,
picture bytea
);
ALTER TABLE public.staff OWNER TO postgres;
--
-- Name: store_store_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE store_store_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.store_store_id_seq OWNER TO postgres;
--
-- Name: store; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE store (
store_id integer DEFAULT nextval('store_store_id_seq'::regclass) NOT NULL,
manager_staff_id smallint NOT NULL,
address_id smallint NOT NULL,
last_update timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.store OWNER TO postgres;
--
-- Name: sales_by_store; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW sales_by_store AS
SELECT (((c.city)::text || ','::text) || (cy.country)::text) AS store, (((m.first_name)::text || ' '::text) || (m.last_name)::text) AS manager, sum(p.amount) AS total_sales FROM (((((((payment p JOIN rental r ON ((p.rental_id = r.rental_id))) JOIN inventory i ON ((r.inventory_id = i.inventory_id))) JOIN store s ON ((i.store_id = s.store_id))) JOIN address a ON ((s.address_id = a.address_id))) JOIN city c ON ((a.city_id = c.city_id))) JOIN country cy ON ((c.country_id = cy.country_id))) JOIN staff m ON ((s.manager_staff_id = m.staff_id))) GROUP BY cy.country, c.city, s.store_id, m.first_name, m.last_name ORDER BY cy.country, c.city;
ALTER TABLE public.sales_by_store OWNER TO postgres;
--
-- Name: staff_list; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW staff_list AS
SELECT s.staff_id AS id, (((s.first_name)::text || ' '::text) || (s.last_name)::text) AS name, a.address, a.postal_code AS "zip code", a.phone, city.city, country.country, s.store_id AS sid FROM (((staff s JOIN address a ON ((s.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id)));
ALTER TABLE public.staff_list OWNER TO postgres;
--
-- Data for Name: actor; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY actor (actor_id, first_name, last_name, last_update) FROM stdin;
\.
COPY actor (actor_id, first_name, last_name, last_update) FROM '$$PATH$$/2163.dat';
--
-- Name: actor_actor_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('actor_actor_id_seq', 200, true);
--
-- Data for Name: address; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY address (address_id, address, address2, district, city_id, postal_code, phone, last_update) FROM stdin;
\.
COPY address (address_id, address, address2, district, city_id, postal_code, phone, last_update) FROM '$$PATH$$/2171.dat';
--
-- Name: address_address_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('address_address_id_seq', 605, true);
--
-- Data for Name: category; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY category (category_id, name, last_update) FROM stdin;
\.
COPY category (category_id, name, last_update) FROM '$$PATH$$/2165.dat';
--
-- Name: category_category_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('category_category_id_seq', 16, true);
--
-- Data for Name: city; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY city (city_id, city, country_id, last_update) FROM stdin;
\.
COPY city (city_id, city, country_id, last_update) FROM '$$PATH$$/2173.dat';
--
-- Name: city_city_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('city_city_id_seq', 600, true);
--
-- Data for Name: country; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY country (country_id, country, last_update) FROM stdin;
\.
COPY country (country_id, country, last_update) FROM '$$PATH$$/2175.dat';
--
-- Name: country_country_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('country_country_id_seq', 109, true);
--
-- Data for Name: customer; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY customer (customer_id, store_id, first_name, last_name, email, address_id, activebool, create_date, last_update, active) FROM stdin;
\.
COPY customer (customer_id, store_id, first_name, last_name, email, address_id, activebool, create_date, last_update, active) FROM '$$PATH$$/2177.dat';
--
-- Name: customer_customer_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('customer_customer_id_seq', 599, true);
--
-- Data for Name: film; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY film (film_id, title, description, release_year, language_id, rental_duration, rental_rate, length, replacement_cost, rating, last_update, special_features, fulltext) FROM stdin;
\.
COPY film (film_id, title, description, release_year, language_id, rental_duration, rental_rate, length, replacement_cost, rating, last_update, special_features, fulltext) FROM '$$PATH$$/2167.dat';
--
-- Data for Name: film_actor; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY film_actor (actor_id, film_id, last_update) FROM stdin;
\.
COPY film_actor (actor_id, film_id, last_update) FROM '$$PATH$$/2168.dat';
--
-- Data for Name: film_category; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY film_category (film_id, category_id, last_update) FROM stdin;
\.
COPY film_category (film_id, category_id, last_update) FROM '$$PATH$$/2169.dat';
--
-- Name: film_film_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('film_film_id_seq', 1000, true);
--
-- Data for Name: inventory; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY inventory (inventory_id, film_id, store_id, last_update) FROM stdin;
\.
COPY inventory (inventory_id, film_id, store_id, last_update) FROM '$$PATH$$/2179.dat';
--
-- Name: inventory_inventory_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('inventory_inventory_id_seq', 4581, true);
--
-- Data for Name: language; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY language (language_id, name, last_update) FROM stdin;
\.
COPY language (language_id, name, last_update) FROM '$$PATH$$/2181.dat';
--
-- Name: language_language_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('language_language_id_seq', 6, true);
--
-- Data for Name: payment; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY payment (payment_id, customer_id, staff_id, rental_id, amount, payment_date) FROM stdin;
\.
COPY payment (payment_id, customer_id, staff_id, rental_id, amount, payment_date) FROM '$$PATH$$/2183.dat';
--
-- Name: payment_payment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('payment_payment_id_seq', 32098, true);
--
-- Data for Name: rental; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY rental (rental_id, rental_date, inventory_id, customer_id, return_date, staff_id, last_update) FROM stdin;
\.
COPY rental (rental_id, rental_date, inventory_id, customer_id, return_date, staff_id, last_update) FROM '$$PATH$$/2185.dat';
--
-- Name: rental_rental_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('rental_rental_id_seq', 16049, true);
--
-- Data for Name: staff; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY staff (staff_id, first_name, last_name, address_id, email, store_id, active, username, password, last_update, picture) FROM stdin;
\.
COPY staff (staff_id, first_name, last_name, address_id, email, store_id, active, username, password, last_update, picture) FROM '$$PATH$$/2187.dat';
--
-- Name: staff_staff_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('staff_staff_id_seq', 2, true);
--
-- Data for Name: store; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY store (store_id, manager_staff_id, address_id, last_update) FROM stdin;
\.
COPY store (store_id, manager_staff_id, address_id, last_update) FROM '$$PATH$$/2189.dat';
--
-- Name: store_store_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('store_store_id_seq', 2, true);
--
-- Name: actor_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY actor
ADD CONSTRAINT actor_pkey PRIMARY KEY (actor_id);
--
-- Name: address_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY address
ADD CONSTRAINT address_pkey PRIMARY KEY (address_id);
--
-- Name: category_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY category
ADD CONSTRAINT category_pkey PRIMARY KEY (category_id);
--
-- Name: city_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY city
ADD CONSTRAINT city_pkey PRIMARY KEY (city_id);
--
-- Name: country_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY country
ADD CONSTRAINT country_pkey PRIMARY KEY (country_id);
--
-- Name: customer_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY customer
ADD CONSTRAINT customer_pkey PRIMARY KEY (customer_id);
--
-- Name: film_actor_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY film_actor
ADD CONSTRAINT film_actor_pkey PRIMARY KEY (actor_id, film_id);
--
-- Name: film_category_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY film_category
ADD CONSTRAINT film_category_pkey PRIMARY KEY (film_id, category_id);
--
-- Name: film_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY film
ADD CONSTRAINT film_pkey PRIMARY KEY (film_id);
--
-- Name: inventory_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY inventory
ADD CONSTRAINT inventory_pkey PRIMARY KEY (inventory_id);
--
-- Name: language_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY language
ADD CONSTRAINT language_pkey PRIMARY KEY (language_id);
--
-- Name: payment_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY payment
ADD CONSTRAINT payment_pkey PRIMARY KEY (payment_id);
--
-- Name: rental_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY rental
ADD CONSTRAINT rental_pkey PRIMARY KEY (rental_id);
--
-- Name: staff_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY staff
ADD CONSTRAINT staff_pkey PRIMARY KEY (staff_id);
--
-- Name: store_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY store
ADD CONSTRAINT store_pkey PRIMARY KEY (store_id);
--
-- Name: film_fulltext_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX film_fulltext_idx ON film USING gist (fulltext);
--
-- Name: idx_actor_last_name; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_actor_last_name ON actor USING btree (last_name);
--
-- Name: idx_fk_address_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_address_id ON customer USING btree (address_id);
--
-- Name: idx_fk_city_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_city_id ON address USING btree (city_id);
--
-- Name: idx_fk_country_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_country_id ON city USING btree (country_id);
--
-- Name: idx_fk_customer_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_customer_id ON payment USING btree (customer_id);
--
-- Name: idx_fk_film_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_film_id ON film_actor USING btree (film_id);
--
-- Name: idx_fk_inventory_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_inventory_id ON rental USING btree (inventory_id);
--
-- Name: idx_fk_language_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_language_id ON film USING btree (language_id);
--
-- Name: idx_fk_rental_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_rental_id ON payment USING btree (rental_id);
--
-- Name: idx_fk_staff_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_staff_id ON payment USING btree (staff_id);
--
-- Name: idx_fk_store_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_fk_store_id ON customer USING btree (store_id);
--
-- Name: idx_last_name; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_last_name ON customer USING btree (last_name);
--
-- Name: idx_store_id_film_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_store_id_film_id ON inventory USING btree (store_id, film_id);
--
-- Name: idx_title; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX idx_title ON film USING btree (title);
--
-- Name: idx_unq_manager_staff_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE UNIQUE INDEX idx_unq_manager_staff_id ON store USING btree (manager_staff_id);
--
-- Name: idx_unq_rental_rental_date_inventory_id_customer_id; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE UNIQUE INDEX idx_unq_rental_rental_date_inventory_id_customer_id ON rental USING btree (rental_date, inventory_id, customer_id);
--
-- Name: film_fulltext_trigger; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER film_fulltext_trigger BEFORE INSERT OR UPDATE ON film FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('fulltext', 'pg_catalog.english', 'title', 'description');
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON actor FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON address FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON category FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON city FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON country FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON customer FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON film FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON film_actor FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON film_category FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON inventory FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON language FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON rental FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON staff FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: last_updated; Type: TRIGGER; Schema: public; Owner: postgres
--
CREATE TRIGGER last_updated BEFORE UPDATE ON store FOR EACH ROW EXECUTE PROCEDURE last_updated();
--
-- Name: customer_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY customer
ADD CONSTRAINT customer_address_id_fkey FOREIGN KEY (address_id) REFERENCES address(address_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: film_actor_actor_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY film_actor
ADD CONSTRAINT film_actor_actor_id_fkey FOREIGN KEY (actor_id) REFERENCES actor(actor_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: film_actor_film_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY film_actor
ADD CONSTRAINT film_actor_film_id_fkey FOREIGN KEY (film_id) REFERENCES film(film_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: film_category_category_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY film_category
ADD CONSTRAINT film_category_category_id_fkey FOREIGN KEY (category_id) REFERENCES category(category_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: film_category_film_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY film_category
ADD CONSTRAINT film_category_film_id_fkey FOREIGN KEY (film_id) REFERENCES film(film_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: film_language_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY film
ADD CONSTRAINT film_language_id_fkey FOREIGN KEY (language_id) REFERENCES language(language_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: fk_address_city; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY address
ADD CONSTRAINT fk_address_city FOREIGN KEY (city_id) REFERENCES city(city_id);
--
-- Name: fk_city; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY city
ADD CONSTRAINT fk_city FOREIGN KEY (country_id) REFERENCES country(country_id);
--
-- Name: inventory_film_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY inventory
ADD CONSTRAINT inventory_film_id_fkey FOREIGN KEY (film_id) REFERENCES film(film_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: payment_customer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY payment
ADD CONSTRAINT payment_customer_id_fkey FOREIGN KEY (customer_id) REFERENCES customer(customer_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: payment_rental_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY payment
ADD CONSTRAINT payment_rental_id_fkey FOREIGN KEY (rental_id) REFERENCES rental(rental_id) ON UPDATE CASCADE ON DELETE SET NULL;
--
-- Name: payment_staff_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY payment
ADD CONSTRAINT payment_staff_id_fkey FOREIGN KEY (staff_id) REFERENCES staff(staff_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: rental_customer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY rental
ADD CONSTRAINT rental_customer_id_fkey FOREIGN KEY (customer_id) REFERENCES customer(customer_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: rental_inventory_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY rental
ADD CONSTRAINT rental_inventory_id_fkey FOREIGN KEY (inventory_id) REFERENCES inventory(inventory_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: rental_staff_id_key; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY rental
ADD CONSTRAINT rental_staff_id_key FOREIGN KEY (staff_id) REFERENCES staff(staff_id);
--
-- Name: staff_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY staff
ADD CONSTRAINT staff_address_id_fkey FOREIGN KEY (address_id) REFERENCES address(address_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: store_address_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY store
ADD CONSTRAINT store_address_id_fkey FOREIGN KEY (address_id) REFERENCES address(address_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: store_manager_staff_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY store
ADD CONSTRAINT store_manager_staff_id_fkey FOREIGN KEY (manager_staff_id) REFERENCES staff(staff_id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
--
-- PostgreSQL database dump complete
--
|
Go
create table [ForFileExecution].dbo.WillExist1(id int null)
Go
create table [ForFileExecution].dbo.WillExist2(id int null)
Go
|
-- MySQL Script generated by MySQL Workbench
-- Пн. 14 дек. 2015 21:39:18
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema vetl
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema vetl
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `vetl` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;
USE `vetl` ;
-- -----------------------------------------------------
-- Table `vetl`.`tbl_type_locality`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vetl`.`tbl_type_locality` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
`type_locality` VARCHAR(45) NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
UNIQUE INDEX `id_UNIQUE` (`id` ASC) COMMENT '')
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `vetl`.`tbl_locality`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vetl`.`tbl_locality` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
`locality` VARCHAR(45) NOT NULL COMMENT '',
`type_locality_id` INT UNSIGNED NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
UNIQUE INDEX `id_UNIQUE` (`id` ASC) COMMENT '',
INDEX `fk_tbl_locality_tbl_type_locality_idx` (`type_locality_id` ASC) COMMENT '',
CONSTRAINT `fk_tbl_locality_tbl_type_locality`
FOREIGN KEY (`type_locality_id`)
REFERENCES `vetl`.`tbl_type_locality` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `vetl`.`tbl_hazard_category`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vetl`.`tbl_hazard_category` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
`hazard_category` VARCHAR(45) NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '')
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `vetl`.`tbl_brigada`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vetl`.`tbl_brigada` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
`room_brigade` VARCHAR(45) NOT NULL COMMENT '',
`last_name_SHNS` VARCHAR(45) NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '')
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `vetl`.`tbl_facility`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vetl`.`tbl_facility` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
`facility` VARCHAR(45) NOT NULL COMMENT '',
`hazard_category_id` INT NULL COMMENT '',
`locality_id` INT UNSIGNED NOT NULL COMMENT '',
`brigada_id` INT UNSIGNED NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
UNIQUE INDEX `facility_UNIQUE` (`facility` ASC) COMMENT '',
INDEX `fk_tbl_facility_tbl_hazard_category1_idx` (`hazard_category_id` ASC) COMMENT '',
INDEX `fk_tbl_facility_tbl_locality1_idx` (`locality_id` ASC) COMMENT '',
INDEX `fk_tbl_facility_tbl_brigada1_idx` (`brigada_id` ASC) COMMENT '',
CONSTRAINT `fk_tbl_facility_tbl_hazard_category1`
FOREIGN KEY (`hazard_category_id`)
REFERENCES `vetl`.`tbl_hazard_category` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_facility_tbl_locality1`
FOREIGN KEY (`locality_id`)
REFERENCES `vetl`.`tbl_locality` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_facility_tbl_brigada1`
FOREIGN KEY (`brigada_id`)
REFERENCES `vetl`.`tbl_brigada` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `vetl`.`tdl_measuring_instrument`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vetl`.`tdl_measuring_instrument` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
`type_measuring_instrument` VARCHAR(45) NOT NULL COMMENT '',
`serial_number` VARCHAR(45) NULL COMMENT '',
`inventory_number` VARCHAR(45) NULL COMMENT '',
`calibration_date` DATE NOT NULL COMMENT '',
`number_certificate` VARCHAR(45) NOT NULL COMMENT '',
`calibration_interval` VARCHAR(45) NOT NULL COMMENT '',
`next_calibration` DATE NOT NULL COMMENT '',
`notices` VARCHAR(1024) NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
UNIQUE INDEX `id_UNIQUE` (`id` ASC) COMMENT '')
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `vetl`.`tbl_type_object`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vetl`.`tbl_type_object` (
`id` INT NOT NULL COMMENT '',
`type_object` VARCHAR(45) NOT NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '')
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `vetl`.`tbl_object`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vetl`.`tbl_object` (
`id` INT NOT NULL COMMENT '',
`type_object_id` INT NOT NULL COMMENT '',
`inventory_number` VARCHAR(45) NULL COMMENT '',
`facility_id` INT UNSIGNED NOT NULL COMMENT '',
`inspection_date` DATE NOT NULL COMMENT '',
`inspection_interval` VARCHAR(45) NOT NULL COMMENT '',
`next_inspection` DATE NOT NULL COMMENT '',
`protocol_number` VARCHAR(45) NULL COMMENT '',
PRIMARY KEY (`id`) COMMENT '',
INDEX `fk_tbl_object_tbl_type_object1_idx` (`type_object_id` ASC) COMMENT '',
INDEX `fk_tbl_object_tbl_facility1_idx` (`facility_id` ASC) COMMENT '',
CONSTRAINT `fk_tbl_object_tbl_type_object1`
FOREIGN KEY (`type_object_id`)
REFERENCES `vetl`.`tbl_type_object` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_tbl_object_tbl_facility1`
FOREIGN KEY (`facility_id`)
REFERENCES `vetl`.`tbl_facility` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|
-- This SQL code was generated by sklearn2sql (development version).
-- Copyright 2018
-- Model : KerasClassifier_LSTM
-- Dataset : BinaryClass_100
-- Database : oracle
-- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
-- Model deployment code
WITH keras_input AS
(SELECT "ADS"."KEY" AS "KEY", "ADS"."Feature_0" AS "Feature_0", "ADS"."Feature_1" AS "Feature_1", "ADS"."Feature_2" AS "Feature_2", "ADS"."Feature_3" AS "Feature_3", "ADS"."Feature_4" AS "Feature_4", "ADS"."Feature_5" AS "Feature_5", "ADS"."Feature_6" AS "Feature_6", "ADS"."Feature_7" AS "Feature_7", "ADS"."Feature_8" AS "Feature_8", "ADS"."Feature_9" AS "Feature_9", "ADS"."Feature_10" AS "Feature_10", "ADS"."Feature_11" AS "Feature_11", "ADS"."Feature_12" AS "Feature_12", "ADS"."Feature_13" AS "Feature_13", "ADS"."Feature_14" AS "Feature_14", "ADS"."Feature_15" AS "Feature_15", "ADS"."Feature_16" AS "Feature_16", "ADS"."Feature_17" AS "Feature_17", "ADS"."Feature_18" AS "Feature_18", "ADS"."Feature_19" AS "Feature_19", "ADS"."Feature_20" AS "Feature_20", "ADS"."Feature_21" AS "Feature_21", "ADS"."Feature_22" AS "Feature_22", "ADS"."Feature_23" AS "Feature_23", "ADS"."Feature_24" AS "Feature_24", "ADS"."Feature_25" AS "Feature_25", "ADS"."Feature_26" AS "Feature_26", "ADS"."Feature_27" AS "Feature_27", "ADS"."Feature_28" AS "Feature_28", "ADS"."Feature_29" AS "Feature_29", "ADS"."Feature_30" AS "Feature_30", "ADS"."Feature_31" AS "Feature_31", "ADS"."Feature_32" AS "Feature_32", "ADS"."Feature_33" AS "Feature_33", "ADS"."Feature_34" AS "Feature_34", "ADS"."Feature_35" AS "Feature_35", "ADS"."Feature_36" AS "Feature_36", "ADS"."Feature_37" AS "Feature_37", "ADS"."Feature_38" AS "Feature_38", "ADS"."Feature_39" AS "Feature_39", "ADS"."Feature_40" AS "Feature_40", "ADS"."Feature_41" AS "Feature_41", "ADS"."Feature_42" AS "Feature_42", "ADS"."Feature_43" AS "Feature_43", "ADS"."Feature_44" AS "Feature_44", "ADS"."Feature_45" AS "Feature_45", "ADS"."Feature_46" AS "Feature_46", "ADS"."Feature_47" AS "Feature_47", "ADS"."Feature_48" AS "Feature_48", "ADS"."Feature_49" AS "Feature_49", "ADS"."Feature_50" AS "Feature_50", "ADS"."Feature_51" AS "Feature_51", "ADS"."Feature_52" AS "Feature_52", "ADS"."Feature_53" AS "Feature_53", "ADS"."Feature_54" AS "Feature_54", "ADS"."Feature_55" AS "Feature_55", "ADS"."Feature_56" AS "Feature_56", "ADS"."Feature_57" AS "Feature_57", "ADS"."Feature_58" AS "Feature_58", "ADS"."Feature_59" AS "Feature_59", "ADS"."Feature_60" AS "Feature_60", "ADS"."Feature_61" AS "Feature_61", "ADS"."Feature_62" AS "Feature_62", "ADS"."Feature_63" AS "Feature_63", "ADS"."Feature_64" AS "Feature_64", "ADS"."Feature_65" AS "Feature_65", "ADS"."Feature_66" AS "Feature_66", "ADS"."Feature_67" AS "Feature_67", "ADS"."Feature_68" AS "Feature_68", "ADS"."Feature_69" AS "Feature_69", "ADS"."Feature_70" AS "Feature_70", "ADS"."Feature_71" AS "Feature_71", "ADS"."Feature_72" AS "Feature_72", "ADS"."Feature_73" AS "Feature_73", "ADS"."Feature_74" AS "Feature_74", "ADS"."Feature_75" AS "Feature_75", "ADS"."Feature_76" AS "Feature_76", "ADS"."Feature_77" AS "Feature_77", "ADS"."Feature_78" AS "Feature_78", "ADS"."Feature_79" AS "Feature_79", "ADS"."Feature_80" AS "Feature_80", "ADS"."Feature_81" AS "Feature_81", "ADS"."Feature_82" AS "Feature_82", "ADS"."Feature_83" AS "Feature_83", "ADS"."Feature_84" AS "Feature_84", "ADS"."Feature_85" AS "Feature_85", "ADS"."Feature_86" AS "Feature_86", "ADS"."Feature_87" AS "Feature_87", "ADS"."Feature_88" AS "Feature_88", "ADS"."Feature_89" AS "Feature_89", "ADS"."Feature_90" AS "Feature_90", "ADS"."Feature_91" AS "Feature_91", "ADS"."Feature_92" AS "Feature_92", "ADS"."Feature_93" AS "Feature_93", "ADS"."Feature_94" AS "Feature_94", "ADS"."Feature_95" AS "Feature_95", "ADS"."Feature_96" AS "Feature_96", "ADS"."Feature_97" AS "Feature_97", "ADS"."Feature_98" AS "Feature_98", "ADS"."Feature_99" AS "Feature_99"
FROM "BINARYCLASS_100" "ADS"),
keras_input_1 AS
(SELECT keras_input."KEY" AS "KEY", keras_input."Feature_0" AS "Feature_0", keras_input."Feature_1" AS "Feature_1", keras_input."Feature_2" AS "Feature_2", keras_input."Feature_3" AS "Feature_3", keras_input."Feature_4" AS "Feature_4", keras_input."Feature_5" AS "Feature_5", keras_input."Feature_6" AS "Feature_6", keras_input."Feature_7" AS "Feature_7", keras_input."Feature_8" AS "Feature_8", keras_input."Feature_9" AS "Feature_9", keras_input."Feature_10" AS "Feature_10", keras_input."Feature_11" AS "Feature_11", keras_input."Feature_12" AS "Feature_12", keras_input."Feature_13" AS "Feature_13", keras_input."Feature_14" AS "Feature_14", keras_input."Feature_15" AS "Feature_15", keras_input."Feature_16" AS "Feature_16", keras_input."Feature_17" AS "Feature_17", keras_input."Feature_18" AS "Feature_18", keras_input."Feature_19" AS "Feature_19", keras_input."Feature_20" AS "Feature_20", keras_input."Feature_21" AS "Feature_21", keras_input."Feature_22" AS "Feature_22", keras_input."Feature_23" AS "Feature_23", keras_input."Feature_24" AS "Feature_24", keras_input."Feature_25" AS "Feature_25", keras_input."Feature_26" AS "Feature_26", keras_input."Feature_27" AS "Feature_27", keras_input."Feature_28" AS "Feature_28", keras_input."Feature_29" AS "Feature_29", keras_input."Feature_30" AS "Feature_30", keras_input."Feature_31" AS "Feature_31", keras_input."Feature_32" AS "Feature_32", keras_input."Feature_33" AS "Feature_33", keras_input."Feature_34" AS "Feature_34", keras_input."Feature_35" AS "Feature_35", keras_input."Feature_36" AS "Feature_36", keras_input."Feature_37" AS "Feature_37", keras_input."Feature_38" AS "Feature_38", keras_input."Feature_39" AS "Feature_39", keras_input."Feature_40" AS "Feature_40", keras_input."Feature_41" AS "Feature_41", keras_input."Feature_42" AS "Feature_42", keras_input."Feature_43" AS "Feature_43", keras_input."Feature_44" AS "Feature_44", keras_input."Feature_45" AS "Feature_45", keras_input."Feature_46" AS "Feature_46", keras_input."Feature_47" AS "Feature_47", keras_input."Feature_48" AS "Feature_48", keras_input."Feature_49" AS "Feature_49", keras_input."Feature_50" AS "Feature_50", keras_input."Feature_51" AS "Feature_51", keras_input."Feature_52" AS "Feature_52", keras_input."Feature_53" AS "Feature_53", keras_input."Feature_54" AS "Feature_54", keras_input."Feature_55" AS "Feature_55", keras_input."Feature_56" AS "Feature_56", keras_input."Feature_57" AS "Feature_57", keras_input."Feature_58" AS "Feature_58", keras_input."Feature_59" AS "Feature_59", keras_input."Feature_60" AS "Feature_60", keras_input."Feature_61" AS "Feature_61", keras_input."Feature_62" AS "Feature_62", keras_input."Feature_63" AS "Feature_63", keras_input."Feature_64" AS "Feature_64", keras_input."Feature_65" AS "Feature_65", keras_input."Feature_66" AS "Feature_66", keras_input."Feature_67" AS "Feature_67", keras_input."Feature_68" AS "Feature_68", keras_input."Feature_69" AS "Feature_69", keras_input."Feature_70" AS "Feature_70", keras_input."Feature_71" AS "Feature_71", keras_input."Feature_72" AS "Feature_72", keras_input."Feature_73" AS "Feature_73", keras_input."Feature_74" AS "Feature_74", keras_input."Feature_75" AS "Feature_75", keras_input."Feature_76" AS "Feature_76", keras_input."Feature_77" AS "Feature_77", keras_input."Feature_78" AS "Feature_78", keras_input."Feature_79" AS "Feature_79", keras_input."Feature_80" AS "Feature_80", keras_input."Feature_81" AS "Feature_81", keras_input."Feature_82" AS "Feature_82", keras_input."Feature_83" AS "Feature_83", keras_input."Feature_84" AS "Feature_84", keras_input."Feature_85" AS "Feature_85", keras_input."Feature_86" AS "Feature_86", keras_input."Feature_87" AS "Feature_87", keras_input."Feature_88" AS "Feature_88", keras_input."Feature_89" AS "Feature_89", keras_input."Feature_90" AS "Feature_90", keras_input."Feature_91" AS "Feature_91", keras_input."Feature_92" AS "Feature_92", keras_input."Feature_93" AS "Feature_93", keras_input."Feature_94" AS "Feature_94", keras_input."Feature_95" AS "Feature_95", keras_input."Feature_96" AS "Feature_96", keras_input."Feature_97" AS "Feature_97", keras_input."Feature_98" AS "Feature_98", keras_input."Feature_99" AS "Feature_99"
FROM keras_input),
keras_input_1_rn AS
(SELECT row_number() OVER (ORDER BY keras_input_1."KEY" ASC) AS rn, keras_input_1."KEY" AS "KEY", keras_input_1."Feature_0" AS "Feature_0", keras_input_1."Feature_1" AS "Feature_1", keras_input_1."Feature_2" AS "Feature_2", keras_input_1."Feature_3" AS "Feature_3", keras_input_1."Feature_4" AS "Feature_4", keras_input_1."Feature_5" AS "Feature_5", keras_input_1."Feature_6" AS "Feature_6", keras_input_1."Feature_7" AS "Feature_7", keras_input_1."Feature_8" AS "Feature_8", keras_input_1."Feature_9" AS "Feature_9", keras_input_1."Feature_10" AS "Feature_10", keras_input_1."Feature_11" AS "Feature_11", keras_input_1."Feature_12" AS "Feature_12", keras_input_1."Feature_13" AS "Feature_13", keras_input_1."Feature_14" AS "Feature_14", keras_input_1."Feature_15" AS "Feature_15", keras_input_1."Feature_16" AS "Feature_16", keras_input_1."Feature_17" AS "Feature_17", keras_input_1."Feature_18" AS "Feature_18", keras_input_1."Feature_19" AS "Feature_19", keras_input_1."Feature_20" AS "Feature_20", keras_input_1."Feature_21" AS "Feature_21", keras_input_1."Feature_22" AS "Feature_22", keras_input_1."Feature_23" AS "Feature_23", keras_input_1."Feature_24" AS "Feature_24", keras_input_1."Feature_25" AS "Feature_25", keras_input_1."Feature_26" AS "Feature_26", keras_input_1."Feature_27" AS "Feature_27", keras_input_1."Feature_28" AS "Feature_28", keras_input_1."Feature_29" AS "Feature_29", keras_input_1."Feature_30" AS "Feature_30", keras_input_1."Feature_31" AS "Feature_31", keras_input_1."Feature_32" AS "Feature_32", keras_input_1."Feature_33" AS "Feature_33", keras_input_1."Feature_34" AS "Feature_34", keras_input_1."Feature_35" AS "Feature_35", keras_input_1."Feature_36" AS "Feature_36", keras_input_1."Feature_37" AS "Feature_37", keras_input_1."Feature_38" AS "Feature_38", keras_input_1."Feature_39" AS "Feature_39", keras_input_1."Feature_40" AS "Feature_40", keras_input_1."Feature_41" AS "Feature_41", keras_input_1."Feature_42" AS "Feature_42", keras_input_1."Feature_43" AS "Feature_43", keras_input_1."Feature_44" AS "Feature_44", keras_input_1."Feature_45" AS "Feature_45", keras_input_1."Feature_46" AS "Feature_46", keras_input_1."Feature_47" AS "Feature_47", keras_input_1."Feature_48" AS "Feature_48", keras_input_1."Feature_49" AS "Feature_49", keras_input_1."Feature_50" AS "Feature_50", keras_input_1."Feature_51" AS "Feature_51", keras_input_1."Feature_52" AS "Feature_52", keras_input_1."Feature_53" AS "Feature_53", keras_input_1."Feature_54" AS "Feature_54", keras_input_1."Feature_55" AS "Feature_55", keras_input_1."Feature_56" AS "Feature_56", keras_input_1."Feature_57" AS "Feature_57", keras_input_1."Feature_58" AS "Feature_58", keras_input_1."Feature_59" AS "Feature_59", keras_input_1."Feature_60" AS "Feature_60", keras_input_1."Feature_61" AS "Feature_61", keras_input_1."Feature_62" AS "Feature_62", keras_input_1."Feature_63" AS "Feature_63", keras_input_1."Feature_64" AS "Feature_64", keras_input_1."Feature_65" AS "Feature_65", keras_input_1."Feature_66" AS "Feature_66", keras_input_1."Feature_67" AS "Feature_67", keras_input_1."Feature_68" AS "Feature_68", keras_input_1."Feature_69" AS "Feature_69", keras_input_1."Feature_70" AS "Feature_70", keras_input_1."Feature_71" AS "Feature_71", keras_input_1."Feature_72" AS "Feature_72", keras_input_1."Feature_73" AS "Feature_73", keras_input_1."Feature_74" AS "Feature_74", keras_input_1."Feature_75" AS "Feature_75", keras_input_1."Feature_76" AS "Feature_76", keras_input_1."Feature_77" AS "Feature_77", keras_input_1."Feature_78" AS "Feature_78", keras_input_1."Feature_79" AS "Feature_79", keras_input_1."Feature_80" AS "Feature_80", keras_input_1."Feature_81" AS "Feature_81", keras_input_1."Feature_82" AS "Feature_82", keras_input_1."Feature_83" AS "Feature_83", keras_input_1."Feature_84" AS "Feature_84", keras_input_1."Feature_85" AS "Feature_85", keras_input_1."Feature_86" AS "Feature_86", keras_input_1."Feature_87" AS "Feature_87", keras_input_1."Feature_88" AS "Feature_88", keras_input_1."Feature_89" AS "Feature_89", keras_input_1."Feature_90" AS "Feature_90", keras_input_1."Feature_91" AS "Feature_91", keras_input_1."Feature_92" AS "Feature_92", keras_input_1."Feature_93" AS "Feature_93", keras_input_1."Feature_94" AS "Feature_94", keras_input_1."Feature_95" AS "Feature_95", keras_input_1."Feature_96" AS "Feature_96", keras_input_1."Feature_97" AS "Feature_97", keras_input_1."Feature_98" AS "Feature_98", keras_input_1."Feature_99" AS "Feature_99"
FROM keras_input_1),
lstm_input_kernel_bias AS
(SELECT keras_input_1_rn.rn AS rn, keras_input_1_rn."KEY" AS "KEY", keras_input_1_rn."Feature_0" AS "Feature_0", keras_input_1_rn."Feature_1" AS "Feature_1", keras_input_1_rn."Feature_2" AS "Feature_2", keras_input_1_rn."Feature_3" AS "Feature_3", keras_input_1_rn."Feature_4" AS "Feature_4", keras_input_1_rn."Feature_5" AS "Feature_5", keras_input_1_rn."Feature_6" AS "Feature_6", keras_input_1_rn."Feature_7" AS "Feature_7", keras_input_1_rn."Feature_8" AS "Feature_8", keras_input_1_rn."Feature_9" AS "Feature_9", keras_input_1_rn."Feature_10" AS "Feature_10", keras_input_1_rn."Feature_11" AS "Feature_11", keras_input_1_rn."Feature_12" AS "Feature_12", keras_input_1_rn."Feature_13" AS "Feature_13", keras_input_1_rn."Feature_14" AS "Feature_14", keras_input_1_rn."Feature_15" AS "Feature_15", keras_input_1_rn."Feature_16" AS "Feature_16", keras_input_1_rn."Feature_17" AS "Feature_17", keras_input_1_rn."Feature_18" AS "Feature_18", keras_input_1_rn."Feature_19" AS "Feature_19", keras_input_1_rn."Feature_20" AS "Feature_20", keras_input_1_rn."Feature_21" AS "Feature_21", keras_input_1_rn."Feature_22" AS "Feature_22", keras_input_1_rn."Feature_23" AS "Feature_23", keras_input_1_rn."Feature_24" AS "Feature_24", keras_input_1_rn."Feature_25" AS "Feature_25", keras_input_1_rn."Feature_26" AS "Feature_26", keras_input_1_rn."Feature_27" AS "Feature_27", keras_input_1_rn."Feature_28" AS "Feature_28", keras_input_1_rn."Feature_29" AS "Feature_29", keras_input_1_rn."Feature_30" AS "Feature_30", keras_input_1_rn."Feature_31" AS "Feature_31", keras_input_1_rn."Feature_32" AS "Feature_32", keras_input_1_rn."Feature_33" AS "Feature_33", keras_input_1_rn."Feature_34" AS "Feature_34", keras_input_1_rn."Feature_35" AS "Feature_35", keras_input_1_rn."Feature_36" AS "Feature_36", keras_input_1_rn."Feature_37" AS "Feature_37", keras_input_1_rn."Feature_38" AS "Feature_38", keras_input_1_rn."Feature_39" AS "Feature_39", keras_input_1_rn."Feature_40" AS "Feature_40", keras_input_1_rn."Feature_41" AS "Feature_41", keras_input_1_rn."Feature_42" AS "Feature_42", keras_input_1_rn."Feature_43" AS "Feature_43", keras_input_1_rn."Feature_44" AS "Feature_44", keras_input_1_rn."Feature_45" AS "Feature_45", keras_input_1_rn."Feature_46" AS "Feature_46", keras_input_1_rn."Feature_47" AS "Feature_47", keras_input_1_rn."Feature_48" AS "Feature_48", keras_input_1_rn."Feature_49" AS "Feature_49", keras_input_1_rn."Feature_50" AS "Feature_50", keras_input_1_rn."Feature_51" AS "Feature_51", keras_input_1_rn."Feature_52" AS "Feature_52", keras_input_1_rn."Feature_53" AS "Feature_53", keras_input_1_rn."Feature_54" AS "Feature_54", keras_input_1_rn."Feature_55" AS "Feature_55", keras_input_1_rn."Feature_56" AS "Feature_56", keras_input_1_rn."Feature_57" AS "Feature_57", keras_input_1_rn."Feature_58" AS "Feature_58", keras_input_1_rn."Feature_59" AS "Feature_59", keras_input_1_rn."Feature_60" AS "Feature_60", keras_input_1_rn."Feature_61" AS "Feature_61", keras_input_1_rn."Feature_62" AS "Feature_62", keras_input_1_rn."Feature_63" AS "Feature_63", keras_input_1_rn."Feature_64" AS "Feature_64", keras_input_1_rn."Feature_65" AS "Feature_65", keras_input_1_rn."Feature_66" AS "Feature_66", keras_input_1_rn."Feature_67" AS "Feature_67", keras_input_1_rn."Feature_68" AS "Feature_68", keras_input_1_rn."Feature_69" AS "Feature_69", keras_input_1_rn."Feature_70" AS "Feature_70", keras_input_1_rn."Feature_71" AS "Feature_71", keras_input_1_rn."Feature_72" AS "Feature_72", keras_input_1_rn."Feature_73" AS "Feature_73", keras_input_1_rn."Feature_74" AS "Feature_74", keras_input_1_rn."Feature_75" AS "Feature_75", keras_input_1_rn."Feature_76" AS "Feature_76", keras_input_1_rn."Feature_77" AS "Feature_77", keras_input_1_rn."Feature_78" AS "Feature_78", keras_input_1_rn."Feature_79" AS "Feature_79", keras_input_1_rn."Feature_80" AS "Feature_80", keras_input_1_rn."Feature_81" AS "Feature_81", keras_input_1_rn."Feature_82" AS "Feature_82", keras_input_1_rn."Feature_83" AS "Feature_83", keras_input_1_rn."Feature_84" AS "Feature_84", keras_input_1_rn."Feature_85" AS "Feature_85", keras_input_1_rn."Feature_86" AS "Feature_86", keras_input_1_rn."Feature_87" AS "Feature_87", keras_input_1_rn."Feature_88" AS "Feature_88", keras_input_1_rn."Feature_89" AS "Feature_89", keras_input_1_rn."Feature_90" AS "Feature_90", keras_input_1_rn."Feature_91" AS "Feature_91", keras_input_1_rn."Feature_92" AS "Feature_92", keras_input_1_rn."Feature_93" AS "Feature_93", keras_input_1_rn."Feature_94" AS "Feature_94", keras_input_1_rn."Feature_95" AS "Feature_95", keras_input_1_rn."Feature_96" AS "Feature_96", keras_input_1_rn."Feature_97" AS "Feature_97", keras_input_1_rn."Feature_98" AS "Feature_98", keras_input_1_rn."Feature_99" AS "Feature_99", 0.04692705296312896 + -0.003111293175721276 * keras_input_1_rn."Feature_0" + 0.017621979481981315 * keras_input_1_rn."Feature_1" + -0.031071812401892426 * keras_input_1_rn."Feature_2" + 0.0038695023284273703 * keras_input_1_rn."Feature_3" + 0.23399293790163606 * keras_input_1_rn."Feature_4" + -0.13953891205326957 * keras_input_1_rn."Feature_5" + -0.07630642516451878 * keras_input_1_rn."Feature_6" + 0.1562017469846353 * keras_input_1_rn."Feature_7" + 0.12516236872735345 * keras_input_1_rn."Feature_8" + -0.009832250392341453 * keras_input_1_rn."Feature_9" + 0.0257431966179045 * keras_input_1_rn."Feature_10" + 0.05318663554008859 * keras_input_1_rn."Feature_11" + 0.07123469613898689 * keras_input_1_rn."Feature_12" + 0.018423908814328423 * keras_input_1_rn."Feature_13" + -0.18545476269727731 * keras_input_1_rn."Feature_14" + -0.021338137189254563 * keras_input_1_rn."Feature_15" + 0.10712794362316033 * keras_input_1_rn."Feature_16" + 0.26367538055448453 * keras_input_1_rn."Feature_17" + -0.17424343994328978 * keras_input_1_rn."Feature_18" + -0.07715393614020263 * keras_input_1_rn."Feature_19" + -0.03923843840572728 * keras_input_1_rn."Feature_20" + -0.06966921052962027 * keras_input_1_rn."Feature_21" + -0.2742113483548259 * keras_input_1_rn."Feature_22" + 0.16752910967273194 * keras_input_1_rn."Feature_23" + 0.1529343951696836 * keras_input_1_rn."Feature_24" + 0.14530438799868484 * keras_input_1_rn."Feature_25" + -0.017076279141318165 * keras_input_1_rn."Feature_26" + -0.12383730181155027 * keras_input_1_rn."Feature_27" + 0.1470338334420635 * keras_input_1_rn."Feature_28" + -0.001231737529635286 * keras_input_1_rn."Feature_29" + -0.2503089784266406 * keras_input_1_rn."Feature_30" + 0.12385023114018541 * keras_input_1_rn."Feature_31" + -0.060771017537696016 * keras_input_1_rn."Feature_32" + 0.2197031220856925 * keras_input_1_rn."Feature_33" + 0.17630150566458505 * keras_input_1_rn."Feature_34" + 0.15398265262933705 * keras_input_1_rn."Feature_35" + -0.12205631384238641 * keras_input_1_rn."Feature_36" + -0.11467992622018446 * keras_input_1_rn."Feature_37" + 0.08369680810398605 * keras_input_1_rn."Feature_38" + 0.24884857443094816 * keras_input_1_rn."Feature_39" + -0.13628713628555772 * keras_input_1_rn."Feature_40" + 0.08873597610529381 * keras_input_1_rn."Feature_41" + -0.08499925205979572 * keras_input_1_rn."Feature_42" + -0.014299472119316873 * keras_input_1_rn."Feature_43" + 0.02286887954846608 * keras_input_1_rn."Feature_44" + -0.1825983961329105 * keras_input_1_rn."Feature_45" + 0.21806732514074223 * keras_input_1_rn."Feature_46" + 0.01775668664388879 * keras_input_1_rn."Feature_47" + -0.15213250502050954 * keras_input_1_rn."Feature_48" + -0.0874669347595918 * keras_input_1_rn."Feature_49" + 0.09953575116677027 * keras_input_1_rn."Feature_50" + -0.011807613445452454 * keras_input_1_rn."Feature_51" + 0.03300531151791115 * keras_input_1_rn."Feature_52" + -0.22067236511989485 * keras_input_1_rn."Feature_53" + 0.08218124420800854 * keras_input_1_rn."Feature_54" + -0.29885696169500164 * keras_input_1_rn."Feature_55" + -0.07648610667784159 * keras_input_1_rn."Feature_56" + 0.1874141669148371 * keras_input_1_rn."Feature_57" + -0.20949837440403743 * keras_input_1_rn."Feature_58" + 0.02856480505549547 * keras_input_1_rn."Feature_59" + -0.12407040088945447 * keras_input_1_rn."Feature_60" + -0.05209321128397422 * keras_input_1_rn."Feature_61" + 0.1947523816194804 * keras_input_1_rn."Feature_62" + 0.10565984496296715 * keras_input_1_rn."Feature_63" + -0.060412760652432625 * keras_input_1_rn."Feature_64" + 0.21400186651133998 * keras_input_1_rn."Feature_65" + -0.22409928854936023 * keras_input_1_rn."Feature_66" + 0.05237216948239102 * keras_input_1_rn."Feature_67" + 0.07071224029417107 * keras_input_1_rn."Feature_68" + -0.25913939704372113 * keras_input_1_rn."Feature_69" + 0.06956075477740163 * keras_input_1_rn."Feature_70" + 0.11468602530351713 * keras_input_1_rn."Feature_71" + -0.2660918465188859 * keras_input_1_rn."Feature_72" + 0.03500496659997466 * keras_input_1_rn."Feature_73" + 0.06774214416431015 * keras_input_1_rn."Feature_74" + 0.011298954214733647 * keras_input_1_rn."Feature_75" + 0.05175690454065308 * keras_input_1_rn."Feature_76" + -0.130268812006925 * keras_input_1_rn."Feature_77" + 0.22269663019394065 * keras_input_1_rn."Feature_78" + 0.06516533846312549 * keras_input_1_rn."Feature_79" + -0.1450750773587508 * keras_input_1_rn."Feature_80" + -0.2296666653792587 * keras_input_1_rn."Feature_81" + 0.05448734061073473 * keras_input_1_rn."Feature_82" + -0.044434018991547655 * keras_input_1_rn."Feature_83" + -0.22843681702620922 * keras_input_1_rn."Feature_84" + -0.007133805093624862 * keras_input_1_rn."Feature_85" + -0.2549102991430653 * keras_input_1_rn."Feature_86" + -0.12696502724578215 * keras_input_1_rn."Feature_87" + -0.044675623260879406 * keras_input_1_rn."Feature_88" + 0.15443190166320447 * keras_input_1_rn."Feature_89" + 0.025525720060634804 * keras_input_1_rn."Feature_90" + 0.20926370267039252 * keras_input_1_rn."Feature_91" + -0.08289320590164181 * keras_input_1_rn."Feature_92" + 0.0777712879581469 * keras_input_1_rn."Feature_93" + 0.13947286197759587 * keras_input_1_rn."Feature_94" + 0.2699990304457427 * keras_input_1_rn."Feature_95" + -0.08591045360708843 * keras_input_1_rn."Feature_96" + -0.036871466271929325 * keras_input_1_rn."Feature_97" + -0.15824974136177988 * keras_input_1_rn."Feature_98" + 0.09651981932675593 * keras_input_1_rn."Feature_99" AS dot_prod_i_1, 0.05815918289309926 + 0.18557053187564118 * keras_input_1_rn."Feature_0" + 0.2550094747915779 * keras_input_1_rn."Feature_1" + 0.1713257492659739 * keras_input_1_rn."Feature_2" + -0.049477885418158264 * keras_input_1_rn."Feature_3" + -0.04107515960243689 * keras_input_1_rn."Feature_4" + 0.17532951215111944 * keras_input_1_rn."Feature_5" + 0.15698172362435991 * keras_input_1_rn."Feature_6" + -0.16954965373039355 * keras_input_1_rn."Feature_7" + 0.10990255239175108 * keras_input_1_rn."Feature_8" + 0.2519179714111925 * keras_input_1_rn."Feature_9" + -0.2434056927388019 * keras_input_1_rn."Feature_10" + 0.16978846735889863 * keras_input_1_rn."Feature_11" + -0.24202946320912147 * keras_input_1_rn."Feature_12" + 0.019710545010278496 * keras_input_1_rn."Feature_13" + 0.029158934334684698 * keras_input_1_rn."Feature_14" + 0.03610486591729598 * keras_input_1_rn."Feature_15" + 0.21435054883489182 * keras_input_1_rn."Feature_16" + -0.07653163228387211 * keras_input_1_rn."Feature_17" + -0.0010041252903368039 * keras_input_1_rn."Feature_18" + 0.08768639539600945 * keras_input_1_rn."Feature_19" + -0.08247023200424923 * keras_input_1_rn."Feature_20" + -0.21746162061835514 * keras_input_1_rn."Feature_21" + -0.03241933745636427 * keras_input_1_rn."Feature_22" + -0.06011341945735008 * keras_input_1_rn."Feature_23" + -0.2250333699849334 * keras_input_1_rn."Feature_24" + 0.08036134078406718 * keras_input_1_rn."Feature_25" + 0.12950292344132439 * keras_input_1_rn."Feature_26" + 0.14814857626331684 * keras_input_1_rn."Feature_27" + 0.12329344255769252 * keras_input_1_rn."Feature_28" + -0.13763316208535778 * keras_input_1_rn."Feature_29" + -0.019839987688610446 * keras_input_1_rn."Feature_30" + 0.12489465689635433 * keras_input_1_rn."Feature_31" + -0.14483054789028862 * keras_input_1_rn."Feature_32" + 0.041826464219903145 * keras_input_1_rn."Feature_33" + -0.21605895201896969 * keras_input_1_rn."Feature_34" + 0.04905054630410326 * keras_input_1_rn."Feature_35" + -0.04114973432822922 * keras_input_1_rn."Feature_36" + 0.11219396856484135 * keras_input_1_rn."Feature_37" + -0.26007568541969817 * keras_input_1_rn."Feature_38" + 0.048127230530997905 * keras_input_1_rn."Feature_39" + 0.160009023334213 * keras_input_1_rn."Feature_40" + 0.17129756725651968 * keras_input_1_rn."Feature_41" + -0.08170990154122733 * keras_input_1_rn."Feature_42" + -0.06871948654409919 * keras_input_1_rn."Feature_43" + 0.008139324491552736 * keras_input_1_rn."Feature_44" + -0.18240490198050774 * keras_input_1_rn."Feature_45" + -0.27449516098941734 * keras_input_1_rn."Feature_46" + -0.16521655994703965 * keras_input_1_rn."Feature_47" + -0.06685635477929641 * keras_input_1_rn."Feature_48" + -0.09864718667463347 * keras_input_1_rn."Feature_49" + 0.0945131385808344 * keras_input_1_rn."Feature_50" + 0.16845111824502126 * keras_input_1_rn."Feature_51" + 0.21987778453246282 * keras_input_1_rn."Feature_52" + 0.05281392398256871 * keras_input_1_rn."Feature_53" + 0.15802736293330155 * keras_input_1_rn."Feature_54" + -0.15216797371235863 * keras_input_1_rn."Feature_55" + 0.004642732004886698 * keras_input_1_rn."Feature_56" + -0.16905600065482845 * keras_input_1_rn."Feature_57" + -0.11292874181102584 * keras_input_1_rn."Feature_58" + 0.10170477388133255 * keras_input_1_rn."Feature_59" + -0.14238439958249394 * keras_input_1_rn."Feature_60" + -0.018370293698950126 * keras_input_1_rn."Feature_61" + 0.1460638012326751 * keras_input_1_rn."Feature_62" + -0.05073075020860907 * keras_input_1_rn."Feature_63" + 0.18996215232188304 * keras_input_1_rn."Feature_64" + 0.14851111436868125 * keras_input_1_rn."Feature_65" + 0.023556646564650497 * keras_input_1_rn."Feature_66" + 0.25350669105781265 * keras_input_1_rn."Feature_67" + 0.0939622842296661 * keras_input_1_rn."Feature_68" + -0.07176059718701361 * keras_input_1_rn."Feature_69" + -0.2191879257445863 * keras_input_1_rn."Feature_70" + 0.018529356939119983 * keras_input_1_rn."Feature_71" + 0.2328436968738406 * keras_input_1_rn."Feature_72" + 0.20461835917988833 * keras_input_1_rn."Feature_73" + 0.2123577509109666 * keras_input_1_rn."Feature_74" + 0.22311424638854102 * keras_input_1_rn."Feature_75" + -0.17543420636609802 * keras_input_1_rn."Feature_76" + 0.1243540344869936 * keras_input_1_rn."Feature_77" + -0.12374621740966683 * keras_input_1_rn."Feature_78" + -0.012758576493968521 * keras_input_1_rn."Feature_79" + -0.0257594596863625 * keras_input_1_rn."Feature_80" + 0.04663640329886694 * keras_input_1_rn."Feature_81" + 0.15039108217897237 * keras_input_1_rn."Feature_82" + -0.03203320403602339 * keras_input_1_rn."Feature_83" + 0.19492635950175663 * keras_input_1_rn."Feature_84" + -0.031009001940719386 * keras_input_1_rn."Feature_85" + -0.17424811076915342 * keras_input_1_rn."Feature_86" + 0.15615048596277545 * keras_input_1_rn."Feature_87" + 0.16360498947810628 * keras_input_1_rn."Feature_88" + 0.1992233831328376 * keras_input_1_rn."Feature_89" + 0.06747960727597425 * keras_input_1_rn."Feature_90" + 0.051483115799432044 * keras_input_1_rn."Feature_91" + 0.01963005266674765 * keras_input_1_rn."Feature_92" + -0.12014526552723832 * keras_input_1_rn."Feature_93" + 0.13259562221748025 * keras_input_1_rn."Feature_94" + 0.013462471293090344 * keras_input_1_rn."Feature_95" + 0.1375034433764529 * keras_input_1_rn."Feature_96" + -0.13174134660937045 * keras_input_1_rn."Feature_97" + 0.042127131325746185 * keras_input_1_rn."Feature_98" + -0.2927561727339331 * keras_input_1_rn."Feature_99" AS dot_prod_i_2, 0.05324200215333866 + -0.027493792616208948 * keras_input_1_rn."Feature_0" + -0.22421992523581538 * keras_input_1_rn."Feature_1" + -0.19486493916367273 * keras_input_1_rn."Feature_2" + 0.03507940278007413 * keras_input_1_rn."Feature_3" + 0.058630118628365875 * keras_input_1_rn."Feature_4" + 0.14809616043535898 * keras_input_1_rn."Feature_5" + 0.1053320472606958 * keras_input_1_rn."Feature_6" + -0.20352677068396097 * keras_input_1_rn."Feature_7" + -0.22919251325134907 * keras_input_1_rn."Feature_8" + 0.009749651686881793 * keras_input_1_rn."Feature_9" + -0.0029994705727941886 * keras_input_1_rn."Feature_10" + -0.09111677960764025 * keras_input_1_rn."Feature_11" + 0.12515796390377376 * keras_input_1_rn."Feature_12" + -0.10567329409273835 * keras_input_1_rn."Feature_13" + 0.07548741693863917 * keras_input_1_rn."Feature_14" + 0.1493817166543778 * keras_input_1_rn."Feature_15" + 0.23593042314141685 * keras_input_1_rn."Feature_16" + 0.01927870694372281 * keras_input_1_rn."Feature_17" + 0.02022286287955579 * keras_input_1_rn."Feature_18" + 0.12809497413243912 * keras_input_1_rn."Feature_19" + -0.0826830035138623 * keras_input_1_rn."Feature_20" + 0.16109815151744064 * keras_input_1_rn."Feature_21" + 0.24155725169667397 * keras_input_1_rn."Feature_22" + -0.08720671592719154 * keras_input_1_rn."Feature_23" + 0.15525796339126524 * keras_input_1_rn."Feature_24" + 0.18880029870306428 * keras_input_1_rn."Feature_25" + -0.006885459838437782 * keras_input_1_rn."Feature_26" + 0.05657625178660067 * keras_input_1_rn."Feature_27" + 0.06112140599735197 * keras_input_1_rn."Feature_28" + 0.10867585598820467 * keras_input_1_rn."Feature_29" + -0.021938947367098817 * keras_input_1_rn."Feature_30" + -0.22628601167894488 * keras_input_1_rn."Feature_31" + -0.05190229513274708 * keras_input_1_rn."Feature_32" + -0.006484093309484253 * keras_input_1_rn."Feature_33" + -0.015934772657743505 * keras_input_1_rn."Feature_34" + 0.02805266959148324 * keras_input_1_rn."Feature_35" + -0.026000651254253875 * keras_input_1_rn."Feature_36" + 0.09404787561792582 * keras_input_1_rn."Feature_37" + -0.07670481617127044 * keras_input_1_rn."Feature_38" + -0.02584734633316649 * keras_input_1_rn."Feature_39" + -0.020788263045358874 * keras_input_1_rn."Feature_40" + 0.007165066128518491 * keras_input_1_rn."Feature_41" + -0.342979969594121 * keras_input_1_rn."Feature_42" + 0.21807188871476849 * keras_input_1_rn."Feature_43" + -0.11187983045681331 * keras_input_1_rn."Feature_44" + 0.17950587805103704 * keras_input_1_rn."Feature_45" + -0.06899192060400575 * keras_input_1_rn."Feature_46" + 0.14114996428756318 * keras_input_1_rn."Feature_47" + 0.019822699653963275 * keras_input_1_rn."Feature_48" + 0.29102699850752894 * keras_input_1_rn."Feature_49" + 0.1627754694780801 * keras_input_1_rn."Feature_50" + -0.028181686906409698 * keras_input_1_rn."Feature_51" + 0.08617487990150267 * keras_input_1_rn."Feature_52" + -0.2053573204725743 * keras_input_1_rn."Feature_53" + 0.0034707519855327385 * keras_input_1_rn."Feature_54" + 0.04736125531436601 * keras_input_1_rn."Feature_55" + 0.2608525628683445 * keras_input_1_rn."Feature_56" + -0.14085226568439574 * keras_input_1_rn."Feature_57" + 0.10779539115871975 * keras_input_1_rn."Feature_58" + -0.06886421481574959 * keras_input_1_rn."Feature_59" + -0.058467498090865974 * keras_input_1_rn."Feature_60" + -0.06510962543653069 * keras_input_1_rn."Feature_61" + -0.0659636509702952 * keras_input_1_rn."Feature_62" + 0.0717681524006169 * keras_input_1_rn."Feature_63" + -0.21358949403649252 * keras_input_1_rn."Feature_64" + -0.1108812131531323 * keras_input_1_rn."Feature_65" + 0.019888521554308182 * keras_input_1_rn."Feature_66" + 0.14615373808303467 * keras_input_1_rn."Feature_67" + 0.03168022847497883 * keras_input_1_rn."Feature_68" + -0.007165718066765247 * keras_input_1_rn."Feature_69" + -0.08381621596276259 * keras_input_1_rn."Feature_70" + -0.05472752176492605 * keras_input_1_rn."Feature_71" + 0.11049982043551147 * keras_input_1_rn."Feature_72" + -0.017267646998017996 * keras_input_1_rn."Feature_73" + -0.08448863581087546 * keras_input_1_rn."Feature_74" + 0.18205275184864245 * keras_input_1_rn."Feature_75" + -0.1976147442205468 * keras_input_1_rn."Feature_76" + 0.0007078267132389187 * keras_input_1_rn."Feature_77" + -0.11413498245254082 * keras_input_1_rn."Feature_78" + 0.13570393769728317 * keras_input_1_rn."Feature_79" + -0.05500862423265612 * keras_input_1_rn."Feature_80" + 0.0284324092589923 * keras_input_1_rn."Feature_81" + 0.017542480298665293 * keras_input_1_rn."Feature_82" + 0.14631883927903025 * keras_input_1_rn."Feature_83" + 0.21773319148304568 * keras_input_1_rn."Feature_84" + -0.06004193204186833 * keras_input_1_rn."Feature_85" + 0.035772781983031944 * keras_input_1_rn."Feature_86" + 0.03443757435619655 * keras_input_1_rn."Feature_87" + 0.07454955541978102 * keras_input_1_rn."Feature_88" + -0.22814962869159944 * keras_input_1_rn."Feature_89" + -0.08954931742207854 * keras_input_1_rn."Feature_90" + 0.18714958520154157 * keras_input_1_rn."Feature_91" + -0.27372494545028864 * keras_input_1_rn."Feature_92" + -0.0338971362041714 * keras_input_1_rn."Feature_93" + 0.05971971697754889 * keras_input_1_rn."Feature_94" + -0.1419705822638298 * keras_input_1_rn."Feature_95" + -0.16591500726489725 * keras_input_1_rn."Feature_96" + -0.06908472697711342 * keras_input_1_rn."Feature_97" + -0.15111321551189957 * keras_input_1_rn."Feature_98" + -0.22929011623279605 * keras_input_1_rn."Feature_99" AS dot_prod_i_3, 0.9399664888630277 + -0.08859090466476797 * keras_input_1_rn."Feature_0" + -0.09616764062569308 * keras_input_1_rn."Feature_1" + 0.21633255981930835 * keras_input_1_rn."Feature_2" + -0.14662721198133224 * keras_input_1_rn."Feature_3" + 0.016693285358506463 * keras_input_1_rn."Feature_4" + 0.08473029239909534 * keras_input_1_rn."Feature_5" + 0.24657812416228964 * keras_input_1_rn."Feature_6" + 0.17488569500027118 * keras_input_1_rn."Feature_7" + -0.014022460628678356 * keras_input_1_rn."Feature_8" + 0.2240830975680015 * keras_input_1_rn."Feature_9" + -0.1971493739506765 * keras_input_1_rn."Feature_10" + -0.03490632139542104 * keras_input_1_rn."Feature_11" + -0.018792529464368768 * keras_input_1_rn."Feature_12" + 0.2021646801333358 * keras_input_1_rn."Feature_13" + 0.07824677952439212 * keras_input_1_rn."Feature_14" + 0.01861471950735494 * keras_input_1_rn."Feature_15" + 0.11878938490260431 * keras_input_1_rn."Feature_16" + 0.05316576611323274 * keras_input_1_rn."Feature_17" + 0.18579233666390096 * keras_input_1_rn."Feature_18" + -0.17659613034719635 * keras_input_1_rn."Feature_19" + -0.18867588230043497 * keras_input_1_rn."Feature_20" + -0.07096301938391668 * keras_input_1_rn."Feature_21" + 0.15751535838598824 * keras_input_1_rn."Feature_22" + 0.015690892728468745 * keras_input_1_rn."Feature_23" + 0.13771863068353468 * keras_input_1_rn."Feature_24" + 0.01913570342006707 * keras_input_1_rn."Feature_25" + -0.20718552452610545 * keras_input_1_rn."Feature_26" + -0.009770818973042187 * keras_input_1_rn."Feature_27" + 0.18082439884206195 * keras_input_1_rn."Feature_28" + -0.13109727635499036 * keras_input_1_rn."Feature_29" + 0.005667977937090489 * keras_input_1_rn."Feature_30" + -0.06311704782556359 * keras_input_1_rn."Feature_31" + -0.03302207867784887 * keras_input_1_rn."Feature_32" + -0.17581824434426557 * keras_input_1_rn."Feature_33" + 0.0318950578996302 * keras_input_1_rn."Feature_34" + 0.0956886879972591 * keras_input_1_rn."Feature_35" + -0.07168104168877411 * keras_input_1_rn."Feature_36" + -0.16927367191295525 * keras_input_1_rn."Feature_37" + 0.06401131778960288 * keras_input_1_rn."Feature_38" + -0.1492288166842248 * keras_input_1_rn."Feature_39" + 0.16867118552687527 * keras_input_1_rn."Feature_40" + -0.13565284589238816 * keras_input_1_rn."Feature_41" + 0.11050042527943157 * keras_input_1_rn."Feature_42" + 0.11235154252667129 * keras_input_1_rn."Feature_43" + 0.09659138749030724 * keras_input_1_rn."Feature_44" + 0.08114866207999864 * keras_input_1_rn."Feature_45" + -0.09871960151863912 * keras_input_1_rn."Feature_46" + 0.01005485077912569 * keras_input_1_rn."Feature_47" + -0.008460804496821286 * keras_input_1_rn."Feature_48" + -0.17530122586361463 * keras_input_1_rn."Feature_49" + -0.07411767749739134 * keras_input_1_rn."Feature_50" + 0.22941651529796478 * keras_input_1_rn."Feature_51" + -0.1921029919956078 * keras_input_1_rn."Feature_52" + 0.08741883670998121 * keras_input_1_rn."Feature_53" + -0.055262663067494784 * keras_input_1_rn."Feature_54" + 0.13129363027019222 * keras_input_1_rn."Feature_55" + 0.14019340343883285 * keras_input_1_rn."Feature_56" + 0.017084817261142 * keras_input_1_rn."Feature_57" + -0.19236661049041054 * keras_input_1_rn."Feature_58" + -0.14281239752796443 * keras_input_1_rn."Feature_59" + -0.22270324837708852 * keras_input_1_rn."Feature_60" + -0.23850655481032582 * keras_input_1_rn."Feature_61" + -0.1361576558511555 * keras_input_1_rn."Feature_62" + 0.1691451744013048 * keras_input_1_rn."Feature_63" + 0.25379750928509587 * keras_input_1_rn."Feature_64" + 0.05879939201094307 * keras_input_1_rn."Feature_65" + -0.09154027658643896 * keras_input_1_rn."Feature_66" + -0.05644836463845825 * keras_input_1_rn."Feature_67" + -0.14592442386181373 * keras_input_1_rn."Feature_68" + 0.22414540451648396 * keras_input_1_rn."Feature_69" + -0.14493935082287185 * keras_input_1_rn."Feature_70" + -0.10702250348246647 * keras_input_1_rn."Feature_71" + -0.14650309247486795 * keras_input_1_rn."Feature_72" + -0.11410698495896325 * keras_input_1_rn."Feature_73" + 0.05137269317272101 * keras_input_1_rn."Feature_74" + 0.16671402692731851 * keras_input_1_rn."Feature_75" + -0.05633398067793924 * keras_input_1_rn."Feature_76" + 0.11566426463860553 * keras_input_1_rn."Feature_77" + -0.06863987267816966 * keras_input_1_rn."Feature_78" + -0.19806182198473385 * keras_input_1_rn."Feature_79" + 0.1520909540080916 * keras_input_1_rn."Feature_80" + -0.19315978076548015 * keras_input_1_rn."Feature_81" + 0.20130661439838263 * keras_input_1_rn."Feature_82" + 0.11966134134975336 * keras_input_1_rn."Feature_83" + -0.04530191371107703 * keras_input_1_rn."Feature_84" + 0.22246321569336644 * keras_input_1_rn."Feature_85" + -0.09607105914608918 * keras_input_1_rn."Feature_86" + -0.17547488851448373 * keras_input_1_rn."Feature_87" + -0.02088683405595159 * keras_input_1_rn."Feature_88" + -0.24699197339730275 * keras_input_1_rn."Feature_89" + 0.1143675874851772 * keras_input_1_rn."Feature_90" + 0.1833453636449877 * keras_input_1_rn."Feature_91" + 0.09027556160961231 * keras_input_1_rn."Feature_92" + -0.08062493080309836 * keras_input_1_rn."Feature_93" + 0.20804495279589238 * keras_input_1_rn."Feature_94" + -0.13375261964020232 * keras_input_1_rn."Feature_95" + -0.10259412274853187 * keras_input_1_rn."Feature_96" + -0.172905982000541 * keras_input_1_rn."Feature_97" + 0.019555441809565706 * keras_input_1_rn."Feature_98" + 0.10584688754992433 * keras_input_1_rn."Feature_99" AS dot_prod_f_1, 1.0260294256559928 + -0.1283357343497072 * keras_input_1_rn."Feature_0" + -0.12293689660443628 * keras_input_1_rn."Feature_1" + -0.22847905872376328 * keras_input_1_rn."Feature_2" + -0.24487924379768655 * keras_input_1_rn."Feature_3" + -0.21517481483373638 * keras_input_1_rn."Feature_4" + 0.175140585020953 * keras_input_1_rn."Feature_5" + -0.0937935941527738 * keras_input_1_rn."Feature_6" + -0.13753960328804943 * keras_input_1_rn."Feature_7" + -0.0453722460968745 * keras_input_1_rn."Feature_8" + 0.048309900935712816 * keras_input_1_rn."Feature_9" + 0.127968546352926 * keras_input_1_rn."Feature_10" + 0.1301750849101902 * keras_input_1_rn."Feature_11" + 0.23367005398601928 * keras_input_1_rn."Feature_12" + 0.0865413637899961 * keras_input_1_rn."Feature_13" + 0.13956064079821792 * keras_input_1_rn."Feature_14" + 0.0811956868302681 * keras_input_1_rn."Feature_15" + 0.12452873472922732 * keras_input_1_rn."Feature_16" + -0.13215223024089787 * keras_input_1_rn."Feature_17" + 0.18777387016845634 * keras_input_1_rn."Feature_18" + -0.023643249958715327 * keras_input_1_rn."Feature_19" + 0.13973645007528573 * keras_input_1_rn."Feature_20" + 0.09895948135327773 * keras_input_1_rn."Feature_21" + 0.03858791859485856 * keras_input_1_rn."Feature_22" + -0.11190507684757026 * keras_input_1_rn."Feature_23" + 0.14473256505403945 * keras_input_1_rn."Feature_24" + 0.10591140462473524 * keras_input_1_rn."Feature_25" + -0.22358584936792952 * keras_input_1_rn."Feature_26" + 0.044257670492020534 * keras_input_1_rn."Feature_27" + -0.10967598129125837 * keras_input_1_rn."Feature_28" + 0.1392747604587318 * keras_input_1_rn."Feature_29" + -0.2811300537219852 * keras_input_1_rn."Feature_30" + 0.22407666441119733 * keras_input_1_rn."Feature_31" + -0.15304982293833647 * keras_input_1_rn."Feature_32" + -0.15795870234506576 * keras_input_1_rn."Feature_33" + 0.11625216258587014 * keras_input_1_rn."Feature_34" + 0.3506642009743174 * keras_input_1_rn."Feature_35" + 0.1585209439336054 * keras_input_1_rn."Feature_36" + 0.043520089431005195 * keras_input_1_rn."Feature_37" + 0.014118679398832457 * keras_input_1_rn."Feature_38" + 0.010052556109041277 * keras_input_1_rn."Feature_39" + 0.051904751513692914 * keras_input_1_rn."Feature_40" + -0.05792896551934081 * keras_input_1_rn."Feature_41" + 0.12500892277198905 * keras_input_1_rn."Feature_42" + 0.10294177693582465 * keras_input_1_rn."Feature_43" + 0.16761944863578654 * keras_input_1_rn."Feature_44" + -0.0605068630120791 * keras_input_1_rn."Feature_45" + 0.13876203492814537 * keras_input_1_rn."Feature_46" + -0.23835108432360363 * keras_input_1_rn."Feature_47" + 0.0755558352310318 * keras_input_1_rn."Feature_48" + 0.07048392861629814 * keras_input_1_rn."Feature_49" + -0.017997777658769504 * keras_input_1_rn."Feature_50" + 0.028385036819913157 * keras_input_1_rn."Feature_51" + 0.15854766731260658 * keras_input_1_rn."Feature_52" + -0.24064170258605677 * keras_input_1_rn."Feature_53" + -0.2891386413642863 * keras_input_1_rn."Feature_54" + -0.10321223075097045 * keras_input_1_rn."Feature_55" + 0.22698359651383512 * keras_input_1_rn."Feature_56" + 0.0739393611832352 * keras_input_1_rn."Feature_57" + -0.05170561937119213 * keras_input_1_rn."Feature_58" + -0.23385859026431377 * keras_input_1_rn."Feature_59" + -0.23177515704502946 * keras_input_1_rn."Feature_60" + 0.1302066237849394 * keras_input_1_rn."Feature_61" + 0.09587090431438143 * keras_input_1_rn."Feature_62" + -0.11960970261749335 * keras_input_1_rn."Feature_63" + 0.01100680845232596 * keras_input_1_rn."Feature_64" + 0.11353965961957793 * keras_input_1_rn."Feature_65" + 0.16716617051638497 * keras_input_1_rn."Feature_66" + -0.06445671311213662 * keras_input_1_rn."Feature_67" + -0.06965405383371429 * keras_input_1_rn."Feature_68" + -0.00808484812624547 * keras_input_1_rn."Feature_69" + 0.013913564398766662 * keras_input_1_rn."Feature_70" + 0.14592318378746535 * keras_input_1_rn."Feature_71" + 0.034739361776816524 * keras_input_1_rn."Feature_72" + 0.13859121790169346 * keras_input_1_rn."Feature_73" + -0.17713471617092671 * keras_input_1_rn."Feature_74" + 0.11823521843183421 * keras_input_1_rn."Feature_75" + -0.2542208376339519 * keras_input_1_rn."Feature_76" + 0.13842727649828152 * keras_input_1_rn."Feature_77" + -0.0345683868891385 * keras_input_1_rn."Feature_78" + 0.061520016966503846 * keras_input_1_rn."Feature_79" + 0.14277354960947583 * keras_input_1_rn."Feature_80" + -0.13200165491992136 * keras_input_1_rn."Feature_81" + -0.009660718610387023 * keras_input_1_rn."Feature_82" + 0.019534087762223856 * keras_input_1_rn."Feature_83" + 0.008727825454564317 * keras_input_1_rn."Feature_84" + 0.16124445877221627 * keras_input_1_rn."Feature_85" + 0.10359386452503073 * keras_input_1_rn."Feature_86" + -0.016647950889015464 * keras_input_1_rn."Feature_87" + -0.10132836093382293 * keras_input_1_rn."Feature_88" + 0.14156404540484704 * keras_input_1_rn."Feature_89" + -0.1956899468471767 * keras_input_1_rn."Feature_90" + 0.10993200085215979 * keras_input_1_rn."Feature_91" + -0.07414236311240102 * keras_input_1_rn."Feature_92" + 0.2227142534436054 * keras_input_1_rn."Feature_93" + 0.09892295260629988 * keras_input_1_rn."Feature_94" + 0.04698049670451353 * keras_input_1_rn."Feature_95" + -0.0199443391476259 * keras_input_1_rn."Feature_96" + -0.181418688180638 * keras_input_1_rn."Feature_97" + -0.02338674488098566 * keras_input_1_rn."Feature_98" + -0.11251789287201833 * keras_input_1_rn."Feature_99" AS dot_prod_f_2, 0.9757338902814822 + 0.13878703157611777 * keras_input_1_rn."Feature_0" + 0.03781457827785344 * keras_input_1_rn."Feature_1" + 0.1835286452639672 * keras_input_1_rn."Feature_2" + 0.13213868521924887 * keras_input_1_rn."Feature_3" + -0.04040664094592796 * keras_input_1_rn."Feature_4" + 0.13865036633391556 * keras_input_1_rn."Feature_5" + -0.19831146654601664 * keras_input_1_rn."Feature_6" + 0.07016477751506026 * keras_input_1_rn."Feature_7" + -0.07535173157200542 * keras_input_1_rn."Feature_8" + -0.0608560739467823 * keras_input_1_rn."Feature_9" + -0.019565881591476254 * keras_input_1_rn."Feature_10" + 0.14038824472314357 * keras_input_1_rn."Feature_11" + -0.17224980266104822 * keras_input_1_rn."Feature_12" + 0.007722698904050478 * keras_input_1_rn."Feature_13" + 0.042111674014140316 * keras_input_1_rn."Feature_14" + 0.07144333672832304 * keras_input_1_rn."Feature_15" + 0.14936519823854127 * keras_input_1_rn."Feature_16" + 0.046218411782602484 * keras_input_1_rn."Feature_17" + -0.17361173962575596 * keras_input_1_rn."Feature_18" + -0.19161348863678287 * keras_input_1_rn."Feature_19" + 0.13747564290616196 * keras_input_1_rn."Feature_20" + 0.1788379653588826 * keras_input_1_rn."Feature_21" + 0.035278711478846564 * keras_input_1_rn."Feature_22" + -0.2097762521193754 * keras_input_1_rn."Feature_23" + -0.15082374860791123 * keras_input_1_rn."Feature_24" + -0.009214329481168662 * keras_input_1_rn."Feature_25" + -0.03441819945272808 * keras_input_1_rn."Feature_26" + 0.072722531564859 * keras_input_1_rn."Feature_27" + 0.24141361244509513 * keras_input_1_rn."Feature_28" + 0.032120317340471174 * keras_input_1_rn."Feature_29" + -0.2317437244407785 * keras_input_1_rn."Feature_30" + -0.020949478001739023 * keras_input_1_rn."Feature_31" + 0.06748265962102822 * keras_input_1_rn."Feature_32" + 0.20452544818801935 * keras_input_1_rn."Feature_33" + -0.09251048388525512 * keras_input_1_rn."Feature_34" + -0.19923861458768077 * keras_input_1_rn."Feature_35" + 0.018529234128849714 * keras_input_1_rn."Feature_36" + -0.06853604612021644 * keras_input_1_rn."Feature_37" + 0.04695895392818334 * keras_input_1_rn."Feature_38" + 0.21216540307743456 * keras_input_1_rn."Feature_39" + -0.15546028397222716 * keras_input_1_rn."Feature_40" + 0.002326504339216194 * keras_input_1_rn."Feature_41" + 0.03721465700354489 * keras_input_1_rn."Feature_42" + -0.1963777896571132 * keras_input_1_rn."Feature_43" + 0.12913379858627375 * keras_input_1_rn."Feature_44" + -0.2046029781906565 * keras_input_1_rn."Feature_45" + 0.04238767122906669 * keras_input_1_rn."Feature_46" + -0.04188957156262659 * keras_input_1_rn."Feature_47" + -0.2344175759566046 * keras_input_1_rn."Feature_48" + -0.16280337455229596 * keras_input_1_rn."Feature_49" + -0.0068719946518009745 * keras_input_1_rn."Feature_50" + 0.214362116573704 * keras_input_1_rn."Feature_51" + 0.14091595160749168 * keras_input_1_rn."Feature_52" + 0.07311817776007248 * keras_input_1_rn."Feature_53" + 0.07336188836366372 * keras_input_1_rn."Feature_54" + 0.026746254721174083 * keras_input_1_rn."Feature_55" + 0.08046335171536999 * keras_input_1_rn."Feature_56" + 0.15153687508443445 * keras_input_1_rn."Feature_57" + 0.1563180056465912 * keras_input_1_rn."Feature_58" + 0.20225737146228423 * keras_input_1_rn."Feature_59" + -0.15960816101215938 * keras_input_1_rn."Feature_60" + 0.16846576571585142 * keras_input_1_rn."Feature_61" + 0.09619644671711852 * keras_input_1_rn."Feature_62" + -0.12649836237412546 * keras_input_1_rn."Feature_63" + -0.2374958716433928 * keras_input_1_rn."Feature_64" + 0.12191566245466509 * keras_input_1_rn."Feature_65" + -0.18838856383939892 * keras_input_1_rn."Feature_66" + 0.25718859187660786 * keras_input_1_rn."Feature_67" + 0.09859658594903106 * keras_input_1_rn."Feature_68" + -0.08354145400449003 * keras_input_1_rn."Feature_69" + -0.06853041432592731 * keras_input_1_rn."Feature_70" + 0.14416838019145228 * keras_input_1_rn."Feature_71" + -0.06296046147194508 * keras_input_1_rn."Feature_72" + -0.14207773927812872 * keras_input_1_rn."Feature_73" + 0.08491181168574223 * keras_input_1_rn."Feature_74" + -0.14720690106306605 * keras_input_1_rn."Feature_75" + -0.21409944724409302 * keras_input_1_rn."Feature_76" + -0.10013348862017876 * keras_input_1_rn."Feature_77" + 0.02786229093936371 * keras_input_1_rn."Feature_78" + 0.08209911584467557 * keras_input_1_rn."Feature_79" + 0.15624512514146194 * keras_input_1_rn."Feature_80" + 0.19162210990157078 * keras_input_1_rn."Feature_81" + -0.14441776109227827 * keras_input_1_rn."Feature_82" + -0.0801160032961261 * keras_input_1_rn."Feature_83" + -0.17674809088336083 * keras_input_1_rn."Feature_84" + -0.1686876781754033 * keras_input_1_rn."Feature_85" + -0.14225941333901063 * keras_input_1_rn."Feature_86" + -0.06560637393193385 * keras_input_1_rn."Feature_87" + -0.006489152407235783 * keras_input_1_rn."Feature_88" + 0.0616741410748235 * keras_input_1_rn."Feature_89" + 0.055126340160821706 * keras_input_1_rn."Feature_90" + 0.019732153774452303 * keras_input_1_rn."Feature_91" + 0.07521577236915461 * keras_input_1_rn."Feature_92" + 0.0019248846401526982 * keras_input_1_rn."Feature_93" + 0.028361228596442065 * keras_input_1_rn."Feature_94" + 0.1234138740017158 * keras_input_1_rn."Feature_95" + -0.06095949268981086 * keras_input_1_rn."Feature_96" + -0.22295689335566723 * keras_input_1_rn."Feature_97" + -0.06483972386321085 * keras_input_1_rn."Feature_98" + -0.16681264610423505 * keras_input_1_rn."Feature_99" AS dot_prod_f_3, -0.02351056645344602 + 0.13548488773147885 * keras_input_1_rn."Feature_0" + 0.04789318005739192 * keras_input_1_rn."Feature_1" + 0.02233669644376811 * keras_input_1_rn."Feature_2" + 0.21323040712531408 * keras_input_1_rn."Feature_3" + -0.0702122811832257 * keras_input_1_rn."Feature_4" + 0.00773375474918203 * keras_input_1_rn."Feature_5" + -0.07835881975992194 * keras_input_1_rn."Feature_6" + -0.05160476111708407 * keras_input_1_rn."Feature_7" + -0.05953718969352324 * keras_input_1_rn."Feature_8" + 0.23455724546783205 * keras_input_1_rn."Feature_9" + -0.20311240640287723 * keras_input_1_rn."Feature_10" + -0.12680441830525277 * keras_input_1_rn."Feature_11" + 0.056310969154489625 * keras_input_1_rn."Feature_12" + -0.06738676564327127 * keras_input_1_rn."Feature_13" + -0.1699718578165794 * keras_input_1_rn."Feature_14" + 0.09011720667699401 * keras_input_1_rn."Feature_15" + 0.19661824442547368 * keras_input_1_rn."Feature_16" + 0.17871935257412683 * keras_input_1_rn."Feature_17" + 0.12326976845676055 * keras_input_1_rn."Feature_18" + 0.21621311731047554 * keras_input_1_rn."Feature_19" + 0.03360903618474672 * keras_input_1_rn."Feature_20" + 0.08906188998529649 * keras_input_1_rn."Feature_21" + 0.13509153129643295 * keras_input_1_rn."Feature_22" + 0.22143842018505686 * keras_input_1_rn."Feature_23" + -0.13568485785735707 * keras_input_1_rn."Feature_24" + 0.11357403562852818 * keras_input_1_rn."Feature_25" + -0.003965769914053025 * keras_input_1_rn."Feature_26" + 0.18509307220088228 * keras_input_1_rn."Feature_27" + 0.16072716128110895 * keras_input_1_rn."Feature_28" + -0.011311334019138452 * keras_input_1_rn."Feature_29" + 0.20762215119846178 * keras_input_1_rn."Feature_30" + 0.1957133319485279 * keras_input_1_rn."Feature_31" + -0.23422866637848633 * keras_input_1_rn."Feature_32" + 0.11103023795945255 * keras_input_1_rn."Feature_33" + 0.02633622461675461 * keras_input_1_rn."Feature_34" + -0.18275038811293817 * keras_input_1_rn."Feature_35" + -0.10063946907824706 * keras_input_1_rn."Feature_36" + 0.2188748473198623 * keras_input_1_rn."Feature_37" + 0.02864619907537356 * keras_input_1_rn."Feature_38" + -0.07460535842429515 * keras_input_1_rn."Feature_39" + -0.2360493577280189 * keras_input_1_rn."Feature_40" + -0.03042637375528217 * keras_input_1_rn."Feature_41" + 0.10264317022340612 * keras_input_1_rn."Feature_42" + -0.03140370083477499 * keras_input_1_rn."Feature_43" + -0.06524114507129321 * keras_input_1_rn."Feature_44" + 0.06546236843095114 * keras_input_1_rn."Feature_45" + 0.08553197493136484 * keras_input_1_rn."Feature_46" + -0.1277651727007113 * keras_input_1_rn."Feature_47" + 0.01665344601110514 * keras_input_1_rn."Feature_48" + 0.12014614773465579 * keras_input_1_rn."Feature_49" + -0.04141634477013495 * keras_input_1_rn."Feature_50" + -0.1193463240448641 * keras_input_1_rn."Feature_51" + -0.09411746996356368 * keras_input_1_rn."Feature_52" + 0.05919368955297061 * keras_input_1_rn."Feature_53" + -0.08728099114643592 * keras_input_1_rn."Feature_54" + -0.04919524950167798 * keras_input_1_rn."Feature_55" + -0.012069457550735418 * keras_input_1_rn."Feature_56" + -0.025785529464628355 * keras_input_1_rn."Feature_57" + -0.1342571773744684 * keras_input_1_rn."Feature_58" + -0.17085971362817964 * keras_input_1_rn."Feature_59" + -0.21698908213944024 * keras_input_1_rn."Feature_60" + -0.10827341098939913 * keras_input_1_rn."Feature_61" + 0.10262061839274488 * keras_input_1_rn."Feature_62" + -0.017576351620588373 * keras_input_1_rn."Feature_63" + 0.19562998755286076 * keras_input_1_rn."Feature_64" + -0.025481568710442482 * keras_input_1_rn."Feature_65" + -0.08747220980363138 * keras_input_1_rn."Feature_66" + 0.21340903812470532 * keras_input_1_rn."Feature_67" + -0.07473212851987426 * keras_input_1_rn."Feature_68" + 0.09839078728083751 * keras_input_1_rn."Feature_69" + -0.010549868473328205 * keras_input_1_rn."Feature_70" + -0.06250278602811672 * keras_input_1_rn."Feature_71" + 0.034462595743602595 * keras_input_1_rn."Feature_72" + 0.16498299300740998 * keras_input_1_rn."Feature_73" + 0.056918662296547656 * keras_input_1_rn."Feature_74" + 0.09132037315756374 * keras_input_1_rn."Feature_75" + -0.011447514193718127 * keras_input_1_rn."Feature_76" + -0.10771748509302875 * keras_input_1_rn."Feature_77" + 0.17983480847207822 * keras_input_1_rn."Feature_78" + 0.014610635578370003 * keras_input_1_rn."Feature_79" + -0.15570231045851118 * keras_input_1_rn."Feature_80" + 0.07160660272400522 * keras_input_1_rn."Feature_81" + -0.021418471159980034 * keras_input_1_rn."Feature_82" + -0.2657577584561096 * keras_input_1_rn."Feature_83" + -0.2762288387980497 * keras_input_1_rn."Feature_84" + -0.10323425154206949 * keras_input_1_rn."Feature_85" + -0.19257456000257195 * keras_input_1_rn."Feature_86" + 0.05820571714347902 * keras_input_1_rn."Feature_87" + 0.1271904715815961 * keras_input_1_rn."Feature_88" + 0.1833576601166894 * keras_input_1_rn."Feature_89" + 0.14783301093787068 * keras_input_1_rn."Feature_90" + -0.18636566002084265 * keras_input_1_rn."Feature_91" + -0.15844658115389323 * keras_input_1_rn."Feature_92" + 0.03048596470314342 * keras_input_1_rn."Feature_93" + 0.16471830821529382 * keras_input_1_rn."Feature_94" + -0.24637023732702834 * keras_input_1_rn."Feature_95" + 0.08623068286856417 * keras_input_1_rn."Feature_96" + -0.1031238013233036 * keras_input_1_rn."Feature_97" + -0.24081493397155435 * keras_input_1_rn."Feature_98" + -0.10764000348839517 * keras_input_1_rn."Feature_99" AS dot_prod_c_1, -0.014137373289227085 + -0.0697936648193546 * keras_input_1_rn."Feature_0" + 0.25648758354175033 * keras_input_1_rn."Feature_1" + 0.23507062052266645 * keras_input_1_rn."Feature_2" + -0.012844189351897994 * keras_input_1_rn."Feature_3" + -0.018880882437533813 * keras_input_1_rn."Feature_4" + 0.24252282264109892 * keras_input_1_rn."Feature_5" + 0.22480782263231217 * keras_input_1_rn."Feature_6" + -0.20274658949729216 * keras_input_1_rn."Feature_7" + 0.08661000119683399 * keras_input_1_rn."Feature_8" + -0.10617899159110857 * keras_input_1_rn."Feature_9" + 0.06759878042200802 * keras_input_1_rn."Feature_10" + 0.02468015297097663 * keras_input_1_rn."Feature_11" + 0.10045099446521152 * keras_input_1_rn."Feature_12" + 0.07490835048869257 * keras_input_1_rn."Feature_13" + 0.10930402584295244 * keras_input_1_rn."Feature_14" + -0.01726905916489676 * keras_input_1_rn."Feature_15" + -0.10044391187340049 * keras_input_1_rn."Feature_16" + -0.06995688006248178 * keras_input_1_rn."Feature_17" + 0.14076219992452677 * keras_input_1_rn."Feature_18" + 0.12484172197164888 * keras_input_1_rn."Feature_19" + 0.019974810554647077 * keras_input_1_rn."Feature_20" + 0.23206169300507296 * keras_input_1_rn."Feature_21" + 0.22697788610893296 * keras_input_1_rn."Feature_22" + -0.09099015307278592 * keras_input_1_rn."Feature_23" + 0.018699317327501602 * keras_input_1_rn."Feature_24" + 0.06468370671072836 * keras_input_1_rn."Feature_25" + -0.1678649730380609 * keras_input_1_rn."Feature_26" + 0.16009404246122777 * keras_input_1_rn."Feature_27" + -0.025638969357364795 * keras_input_1_rn."Feature_28" + 0.2322070296762727 * keras_input_1_rn."Feature_29" + -0.09723705654838354 * keras_input_1_rn."Feature_30" + 0.1224040068214433 * keras_input_1_rn."Feature_31" + 0.09265230937103344 * keras_input_1_rn."Feature_32" + 0.03825557065368341 * keras_input_1_rn."Feature_33" + -0.09230180692188286 * keras_input_1_rn."Feature_34" + 0.15399362615743994 * keras_input_1_rn."Feature_35" + -0.23357981552940238 * keras_input_1_rn."Feature_36" + 0.04783810280065101 * keras_input_1_rn."Feature_37" + -0.04716147276507275 * keras_input_1_rn."Feature_38" + -0.23273339755182584 * keras_input_1_rn."Feature_39" + -0.07441186890378236 * keras_input_1_rn."Feature_40" + -0.005427169331722257 * keras_input_1_rn."Feature_41" + 0.047330791581246034 * keras_input_1_rn."Feature_42" + 0.08094714363462342 * keras_input_1_rn."Feature_43" + 0.14181754751168443 * keras_input_1_rn."Feature_44" + -0.02660493764193172 * keras_input_1_rn."Feature_45" + 0.15373484326691864 * keras_input_1_rn."Feature_46" + 0.09250089745617696 * keras_input_1_rn."Feature_47" + -0.05509406125938919 * keras_input_1_rn."Feature_48" + 0.06469505960762044 * keras_input_1_rn."Feature_49" + 0.11448071858835378 * keras_input_1_rn."Feature_50" + -0.1084376886628834 * keras_input_1_rn."Feature_51" + -0.03944406911401803 * keras_input_1_rn."Feature_52" + 0.18736888722422682 * keras_input_1_rn."Feature_53" + -0.06091054359064041 * keras_input_1_rn."Feature_54" + 0.1647188148458109 * keras_input_1_rn."Feature_55" + 0.04456320437868642 * keras_input_1_rn."Feature_56" + -0.004010052736751287 * keras_input_1_rn."Feature_57" + 0.008984952083523757 * keras_input_1_rn."Feature_58" + 0.06554901489356223 * keras_input_1_rn."Feature_59" + -0.2154714917898662 * keras_input_1_rn."Feature_60" + -0.1448209560319349 * keras_input_1_rn."Feature_61" + 0.17813357339850233 * keras_input_1_rn."Feature_62" + -0.09088694269926485 * keras_input_1_rn."Feature_63" + -0.12045543658115566 * keras_input_1_rn."Feature_64" + 0.166766151149436 * keras_input_1_rn."Feature_65" + 0.047432265912565545 * keras_input_1_rn."Feature_66" + 0.33122189425999066 * keras_input_1_rn."Feature_67" + -0.24179866424284188 * keras_input_1_rn."Feature_68" + -0.04077706134031147 * keras_input_1_rn."Feature_69" + -0.2536500638830468 * keras_input_1_rn."Feature_70" + 0.18133961881632044 * keras_input_1_rn."Feature_71" + 0.09098759986863832 * keras_input_1_rn."Feature_72" + -0.11571490173343135 * keras_input_1_rn."Feature_73" + -0.06537071387350941 * keras_input_1_rn."Feature_74" + 0.18976040149178994 * keras_input_1_rn."Feature_75" + 0.019699927471650048 * keras_input_1_rn."Feature_76" + 0.05200031276629339 * keras_input_1_rn."Feature_77" + 0.1538409702820004 * keras_input_1_rn."Feature_78" + -0.14693825429213758 * keras_input_1_rn."Feature_79" + -0.13000491321830718 * keras_input_1_rn."Feature_80" + 0.10991998763911247 * keras_input_1_rn."Feature_81" + 0.17545870536553804 * keras_input_1_rn."Feature_82" + -0.04599466108456963 * keras_input_1_rn."Feature_83" + 0.11227642071289201 * keras_input_1_rn."Feature_84" + 0.010810231248780408 * keras_input_1_rn."Feature_85" + 0.1430672362198406 * keras_input_1_rn."Feature_86" + -0.047009396393866476 * keras_input_1_rn."Feature_87" + -0.21463300297938664 * keras_input_1_rn."Feature_88" + -0.09489129190182465 * keras_input_1_rn."Feature_89" + 0.19606028066889872 * keras_input_1_rn."Feature_90" + -0.1883088255760263 * keras_input_1_rn."Feature_91" + -0.15861275712178463 * keras_input_1_rn."Feature_92" + -0.0880599386816326 * keras_input_1_rn."Feature_93" + -0.15593760445878008 * keras_input_1_rn."Feature_94" + 0.14073003888215407 * keras_input_1_rn."Feature_95" + 0.09640308480092605 * keras_input_1_rn."Feature_96" + 0.20477828930557962 * keras_input_1_rn."Feature_97" + -0.03429999264689887 * keras_input_1_rn."Feature_98" + 0.06980036755837815 * keras_input_1_rn."Feature_99" AS dot_prod_c_2, -0.010438967965257123 + -0.12646442626126528 * keras_input_1_rn."Feature_0" + -0.22691137867598848 * keras_input_1_rn."Feature_1" + 0.11016454787691576 * keras_input_1_rn."Feature_2" + -0.1984322880134803 * keras_input_1_rn."Feature_3" + -0.11202838457326542 * keras_input_1_rn."Feature_4" + 0.10001206011816832 * keras_input_1_rn."Feature_5" + -0.12516669387130608 * keras_input_1_rn."Feature_6" + -0.14291232025358294 * keras_input_1_rn."Feature_7" + 0.2324422673878144 * keras_input_1_rn."Feature_8" + 0.06263156942088187 * keras_input_1_rn."Feature_9" + 0.18570098377230793 * keras_input_1_rn."Feature_10" + 0.07426087051116678 * keras_input_1_rn."Feature_11" + 0.01551666887658305 * keras_input_1_rn."Feature_12" + -0.1838102642652007 * keras_input_1_rn."Feature_13" + -0.14169408243690082 * keras_input_1_rn."Feature_14" + -0.00922892144250568 * keras_input_1_rn."Feature_15" + -0.21162956747082248 * keras_input_1_rn."Feature_16" + -0.022691587575710367 * keras_input_1_rn."Feature_17" + 0.03575620919601694 * keras_input_1_rn."Feature_18" + -0.03530020467244563 * keras_input_1_rn."Feature_19" + 0.129457036125243 * keras_input_1_rn."Feature_20" + -0.22670039287978994 * keras_input_1_rn."Feature_21" + 0.08732398787090499 * keras_input_1_rn."Feature_22" + -0.04030328769441442 * keras_input_1_rn."Feature_23" + 0.20396508204204586 * keras_input_1_rn."Feature_24" + -0.09708534701703951 * keras_input_1_rn."Feature_25" + 0.14092291795325892 * keras_input_1_rn."Feature_26" + -0.15988859115435786 * keras_input_1_rn."Feature_27" + -0.053033367737558006 * keras_input_1_rn."Feature_28" + 0.12108906400407778 * keras_input_1_rn."Feature_29" + 0.07391199724495295 * keras_input_1_rn."Feature_30" + 0.1344641469329115 * keras_input_1_rn."Feature_31" + 0.13943612961080037 * keras_input_1_rn."Feature_32" + -0.1805890369029186 * keras_input_1_rn."Feature_33" + 0.08178896707724712 * keras_input_1_rn."Feature_34" + 0.006794566938643268 * keras_input_1_rn."Feature_35" + 0.12262709077044212 * keras_input_1_rn."Feature_36" + 0.08768716846577376 * keras_input_1_rn."Feature_37" + 0.14312591937003677 * keras_input_1_rn."Feature_38" + -0.2139845214115504 * keras_input_1_rn."Feature_39" + -0.260977908426655 * keras_input_1_rn."Feature_40" + -0.05480087937988641 * keras_input_1_rn."Feature_41" + 0.21457189859783177 * keras_input_1_rn."Feature_42" + -0.04992261578641656 * keras_input_1_rn."Feature_43" + -0.2078583032726391 * keras_input_1_rn."Feature_44" + -0.2796523944419525 * keras_input_1_rn."Feature_45" + -0.09314996611148897 * keras_input_1_rn."Feature_46" + -0.1258835959722042 * keras_input_1_rn."Feature_47" + -0.020372148964558454 * keras_input_1_rn."Feature_48" + -0.11020272920901712 * keras_input_1_rn."Feature_49" + -0.09003692278133041 * keras_input_1_rn."Feature_50" + -0.11871717473576242 * keras_input_1_rn."Feature_51" + 0.14835342773701668 * keras_input_1_rn."Feature_52" + 0.06835794037474507 * keras_input_1_rn."Feature_53" + -0.09602288791778324 * keras_input_1_rn."Feature_54" + 0.08674510342990994 * keras_input_1_rn."Feature_55" + 0.035639934901479216 * keras_input_1_rn."Feature_56" + -0.022769022969300688 * keras_input_1_rn."Feature_57" + -0.1803537890349027 * keras_input_1_rn."Feature_58" + 0.24692172768152934 * keras_input_1_rn."Feature_59" + 0.10234927007753337 * keras_input_1_rn."Feature_60" + -0.17585151165119417 * keras_input_1_rn."Feature_61" + 0.07925399845788428 * keras_input_1_rn."Feature_62" + -0.12674932046038007 * keras_input_1_rn."Feature_63" + 0.22621940813911628 * keras_input_1_rn."Feature_64" + -0.1626626745585671 * keras_input_1_rn."Feature_65" + 0.11741492031887395 * keras_input_1_rn."Feature_66" + -0.08294865905542755 * keras_input_1_rn."Feature_67" + 0.03491326423806915 * keras_input_1_rn."Feature_68" + 0.10760387922381855 * keras_input_1_rn."Feature_69" + 0.12373295123016513 * keras_input_1_rn."Feature_70" + -0.16141359474815423 * keras_input_1_rn."Feature_71" + -0.05386377309415914 * keras_input_1_rn."Feature_72" + -0.17773392377649486 * keras_input_1_rn."Feature_73" + 0.2543807358702775 * keras_input_1_rn."Feature_74" + 0.09577409943556162 * keras_input_1_rn."Feature_75" + 0.1334498619580169 * keras_input_1_rn."Feature_76" + 0.13328762469146774 * keras_input_1_rn."Feature_77" + 0.10439246093597461 * keras_input_1_rn."Feature_78" + 0.030081197683690726 * keras_input_1_rn."Feature_79" + -0.0840785769371978 * keras_input_1_rn."Feature_80" + -0.09453721897362971 * keras_input_1_rn."Feature_81" + -0.0781902137879447 * keras_input_1_rn."Feature_82" + 0.03446102020746993 * keras_input_1_rn."Feature_83" + 0.18243225301260863 * keras_input_1_rn."Feature_84" + -0.21719774570838976 * keras_input_1_rn."Feature_85" + -0.25549757330807277 * keras_input_1_rn."Feature_86" + -0.20976015648477245 * keras_input_1_rn."Feature_87" + 0.08415227990979532 * keras_input_1_rn."Feature_88" + -0.13755900210116764 * keras_input_1_rn."Feature_89" + -0.1484634244530382 * keras_input_1_rn."Feature_90" + 0.15468019481088768 * keras_input_1_rn."Feature_91" + 0.26205128280865336 * keras_input_1_rn."Feature_92" + 0.25878226882340616 * keras_input_1_rn."Feature_93" + 0.0022650136393302096 * keras_input_1_rn."Feature_94" + -0.1688193133638464 * keras_input_1_rn."Feature_95" + -0.18992340023603219 * keras_input_1_rn."Feature_96" + -0.001665189620194187 * keras_input_1_rn."Feature_97" + 0.10884551039807588 * keras_input_1_rn."Feature_98" + -0.2261796139661032 * keras_input_1_rn."Feature_99" AS dot_prod_c_3, -0.06675975171275937 + 0.04481413678202575 * keras_input_1_rn."Feature_0" + -0.10150424263543657 * keras_input_1_rn."Feature_1" + -0.16999052981759413 * keras_input_1_rn."Feature_2" + 0.09187508523295111 * keras_input_1_rn."Feature_3" + 0.11944972425770925 * keras_input_1_rn."Feature_4" + 0.15643631866711905 * keras_input_1_rn."Feature_5" + 0.07766213075347009 * keras_input_1_rn."Feature_6" + -0.15482472263481661 * keras_input_1_rn."Feature_7" + -0.0704272284476504 * keras_input_1_rn."Feature_8" + -0.021427908159717388 * keras_input_1_rn."Feature_9" + -0.08874937695190391 * keras_input_1_rn."Feature_10" + -0.16130656157556347 * keras_input_1_rn."Feature_11" + -0.20116175363734584 * keras_input_1_rn."Feature_12" + 0.01687677583976282 * keras_input_1_rn."Feature_13" + 0.11602964233945248 * keras_input_1_rn."Feature_14" + 0.11143686007039731 * keras_input_1_rn."Feature_15" + 0.09960936658232193 * keras_input_1_rn."Feature_16" + 0.1685357299873129 * keras_input_1_rn."Feature_17" + -0.005650217595639128 * keras_input_1_rn."Feature_18" + 0.05624050732436789 * keras_input_1_rn."Feature_19" + 0.154565744452863 * keras_input_1_rn."Feature_20" + -0.002098016381331114 * keras_input_1_rn."Feature_21" + -0.23717245941351647 * keras_input_1_rn."Feature_22" + -0.22424896336263872 * keras_input_1_rn."Feature_23" + -0.0188202112435162 * keras_input_1_rn."Feature_24" + 0.15744613129205937 * keras_input_1_rn."Feature_25" + 0.1269270706230535 * keras_input_1_rn."Feature_26" + -0.1889302906866408 * keras_input_1_rn."Feature_27" + -0.23642784243751477 * keras_input_1_rn."Feature_28" + -0.011421382245146732 * keras_input_1_rn."Feature_29" + 0.1373239841052186 * keras_input_1_rn."Feature_30" + 0.15104525497006172 * keras_input_1_rn."Feature_31" + 0.13767089878579492 * keras_input_1_rn."Feature_32" + 0.07258584141987404 * keras_input_1_rn."Feature_33" + 0.08467250465458734 * keras_input_1_rn."Feature_34" + -0.1950978627504091 * keras_input_1_rn."Feature_35" + -0.20956552960038877 * keras_input_1_rn."Feature_36" + -0.023721155446125682 * keras_input_1_rn."Feature_37" + -0.11840353253817416 * keras_input_1_rn."Feature_38" + 0.28291962646525565 * keras_input_1_rn."Feature_39" + -0.0999829691177183 * keras_input_1_rn."Feature_40" + 0.00995828661666402 * keras_input_1_rn."Feature_41" + 0.10386910310704656 * keras_input_1_rn."Feature_42" + -0.06590474905202304 * keras_input_1_rn."Feature_43" + 0.047002064687109726 * keras_input_1_rn."Feature_44" + 0.03359094136718241 * keras_input_1_rn."Feature_45" + -0.010345965018464133 * keras_input_1_rn."Feature_46" + 0.10491790997108069 * keras_input_1_rn."Feature_47" + -0.23734543317790793 * keras_input_1_rn."Feature_48" + 0.11557183042813036 * keras_input_1_rn."Feature_49" + 0.16431804423431473 * keras_input_1_rn."Feature_50" + 0.024030499479786964 * keras_input_1_rn."Feature_51" + -0.14465543873690614 * keras_input_1_rn."Feature_52" + -0.019693863902006566 * keras_input_1_rn."Feature_53" + -0.028581209482728326 * keras_input_1_rn."Feature_54" + -0.10765067965684973 * keras_input_1_rn."Feature_55" + 0.13389795099372256 * keras_input_1_rn."Feature_56" + 0.13298232941869428 * keras_input_1_rn."Feature_57" + 0.12929023437210732 * keras_input_1_rn."Feature_58" + -0.006741191802503683 * keras_input_1_rn."Feature_59" + 0.04170520468604215 * keras_input_1_rn."Feature_60" + -0.1620933586220245 * keras_input_1_rn."Feature_61" + -0.18718884086054757 * keras_input_1_rn."Feature_62" + -0.125003683093715 * keras_input_1_rn."Feature_63" + 0.0391475283128861 * keras_input_1_rn."Feature_64" + 0.03096129554781574 * keras_input_1_rn."Feature_65" + -0.014694130954505497 * keras_input_1_rn."Feature_66" + -0.058239804354605865 * keras_input_1_rn."Feature_67" + 0.021787747349299096 * keras_input_1_rn."Feature_68" + 0.0671774106175963 * keras_input_1_rn."Feature_69" + -0.15031223615694364 * keras_input_1_rn."Feature_70" + -0.11948062605573764 * keras_input_1_rn."Feature_71" + -0.1469737393079624 * keras_input_1_rn."Feature_72" + -0.04291455551153252 * keras_input_1_rn."Feature_73" + 0.08156836240218901 * keras_input_1_rn."Feature_74" + 0.1337707119976046 * keras_input_1_rn."Feature_75" + 0.028717629404910416 * keras_input_1_rn."Feature_76" + 0.23223030924012902 * keras_input_1_rn."Feature_77" + -0.09098781534488289 * keras_input_1_rn."Feature_78" + -0.09455082912817453 * keras_input_1_rn."Feature_79" + 0.11148272401976084 * keras_input_1_rn."Feature_80" + -0.1579469935449186 * keras_input_1_rn."Feature_81" + 0.07971915692182183 * keras_input_1_rn."Feature_82" + -0.027590494085689986 * keras_input_1_rn."Feature_83" + 0.18749278895847737 * keras_input_1_rn."Feature_84" + -0.11251382958641619 * keras_input_1_rn."Feature_85" + 0.011033929555319543 * keras_input_1_rn."Feature_86" + -0.16787035385053387 * keras_input_1_rn."Feature_87" + -0.08161165862435817 * keras_input_1_rn."Feature_88" + 0.14798384028150285 * keras_input_1_rn."Feature_89" + -0.15455484412535395 * keras_input_1_rn."Feature_90" + -0.04628113157174786 * keras_input_1_rn."Feature_91" + 0.02921979267380741 * keras_input_1_rn."Feature_92" + 0.12725738195957748 * keras_input_1_rn."Feature_93" + -0.042990418662264156 * keras_input_1_rn."Feature_94" + 0.12272803457772308 * keras_input_1_rn."Feature_95" + -0.2248479312102466 * keras_input_1_rn."Feature_96" + -0.0881613648185701 * keras_input_1_rn."Feature_97" + -0.04981754352998033 * keras_input_1_rn."Feature_98" + 0.022529150176978572 * keras_input_1_rn."Feature_99" AS dot_prod_o_1, 0.004623136503713668 + -0.17161467856239196 * keras_input_1_rn."Feature_0" + 0.12403813578837919 * keras_input_1_rn."Feature_1" + -0.001152860896622625 * keras_input_1_rn."Feature_2" + -0.25507368884384 * keras_input_1_rn."Feature_3" + -0.17477876899999625 * keras_input_1_rn."Feature_4" + -0.12744890095651853 * keras_input_1_rn."Feature_5" + 0.11848131219372098 * keras_input_1_rn."Feature_6" + -0.27220000456473015 * keras_input_1_rn."Feature_7" + 0.076953756583127 * keras_input_1_rn."Feature_8" + 0.13524826393215597 * keras_input_1_rn."Feature_9" + 0.1381836694912968 * keras_input_1_rn."Feature_10" + -0.23108351527481197 * keras_input_1_rn."Feature_11" + -0.017107312122498528 * keras_input_1_rn."Feature_12" + -0.05847286387193394 * keras_input_1_rn."Feature_13" + -0.24873730117154555 * keras_input_1_rn."Feature_14" + 0.19047372948778718 * keras_input_1_rn."Feature_15" + -0.026162637863732068 * keras_input_1_rn."Feature_16" + 0.0824289598012173 * keras_input_1_rn."Feature_17" + 0.08877914676499728 * keras_input_1_rn."Feature_18" + 0.19168261274800039 * keras_input_1_rn."Feature_19" + 0.060819612497097345 * keras_input_1_rn."Feature_20" + -0.2608688519881089 * keras_input_1_rn."Feature_21" + 0.13680570780331058 * keras_input_1_rn."Feature_22" + -0.2305538226808542 * keras_input_1_rn."Feature_23" + -0.01742817034586724 * keras_input_1_rn."Feature_24" + 0.09833462566689646 * keras_input_1_rn."Feature_25" + -0.1210413004053227 * keras_input_1_rn."Feature_26" + -0.13478274285102868 * keras_input_1_rn."Feature_27" + 0.004265711436307788 * keras_input_1_rn."Feature_28" + 0.15693125591849713 * keras_input_1_rn."Feature_29" + 0.08434532024032902 * keras_input_1_rn."Feature_30" + -0.0397633650458187 * keras_input_1_rn."Feature_31" + 0.187257939480025 * keras_input_1_rn."Feature_32" + 0.15743421920019218 * keras_input_1_rn."Feature_33" + -0.15969936216621053 * keras_input_1_rn."Feature_34" + 0.005668808026046486 * keras_input_1_rn."Feature_35" + -0.12341809957169192 * keras_input_1_rn."Feature_36" + 0.11954379813441988 * keras_input_1_rn."Feature_37" + 0.156649594546703 * keras_input_1_rn."Feature_38" + 0.10970460029294643 * keras_input_1_rn."Feature_39" + -0.10428931767951406 * keras_input_1_rn."Feature_40" + 0.02784539762438232 * keras_input_1_rn."Feature_41" + -0.03065986812463634 * keras_input_1_rn."Feature_42" + 0.012156801058155213 * keras_input_1_rn."Feature_43" + -0.006982544097277612 * keras_input_1_rn."Feature_44" + -0.04090189533461655 * keras_input_1_rn."Feature_45" + 0.09600019173770113 * keras_input_1_rn."Feature_46" + 0.16843700967324984 * keras_input_1_rn."Feature_47" + 0.06706663393091986 * keras_input_1_rn."Feature_48" + 0.022967917133439954 * keras_input_1_rn."Feature_49" + 0.0753450226414235 * keras_input_1_rn."Feature_50" + -0.02674741137751994 * keras_input_1_rn."Feature_51" + -0.05472764419987001 * keras_input_1_rn."Feature_52" + -0.13327749016480112 * keras_input_1_rn."Feature_53" + -0.002410892792366397 * keras_input_1_rn."Feature_54" + 0.14813898475193296 * keras_input_1_rn."Feature_55" + -0.08396134633827455 * keras_input_1_rn."Feature_56" + 0.16594775084211372 * keras_input_1_rn."Feature_57" + -0.05808412866143864 * keras_input_1_rn."Feature_58" + 0.0859783868865219 * keras_input_1_rn."Feature_59" + 0.09961959307693953 * keras_input_1_rn."Feature_60" + -0.015457824654709943 * keras_input_1_rn."Feature_61" + -0.09026744120074405 * keras_input_1_rn."Feature_62" + 0.22484192014537094 * keras_input_1_rn."Feature_63" + 0.13893457647119425 * keras_input_1_rn."Feature_64" + -0.1578975532424198 * keras_input_1_rn."Feature_65" + 0.11662657853412614 * keras_input_1_rn."Feature_66" + 0.17555808395787464 * keras_input_1_rn."Feature_67" + -0.08510149303832805 * keras_input_1_rn."Feature_68" + -0.2310747293821488 * keras_input_1_rn."Feature_69" + -0.018615899742067496 * keras_input_1_rn."Feature_70" + 0.1494620013717771 * keras_input_1_rn."Feature_71" + 0.2933108492257372 * keras_input_1_rn."Feature_72" + 0.05739956483275871 * keras_input_1_rn."Feature_73" + -0.13255480683689974 * keras_input_1_rn."Feature_74" + 0.26731430119303784 * keras_input_1_rn."Feature_75" + 0.11450569540595841 * keras_input_1_rn."Feature_76" + -0.22983291931824998 * keras_input_1_rn."Feature_77" + 0.2601723532016374 * keras_input_1_rn."Feature_78" + -0.18969626199078152 * keras_input_1_rn."Feature_79" + -0.0719500271003473 * keras_input_1_rn."Feature_80" + 0.2873980901695535 * keras_input_1_rn."Feature_81" + 0.10508796143555177 * keras_input_1_rn."Feature_82" + 0.11695856914249178 * keras_input_1_rn."Feature_83" + -0.00018280354122706804 * keras_input_1_rn."Feature_84" + 0.09508225349456613 * keras_input_1_rn."Feature_85" + -0.27005518752225144 * keras_input_1_rn."Feature_86" + 0.11374908483876196 * keras_input_1_rn."Feature_87" + 0.2320875091968078 * keras_input_1_rn."Feature_88" + 0.22432164381232325 * keras_input_1_rn."Feature_89" + 0.04413910933530747 * keras_input_1_rn."Feature_90" + -0.06111510182026692 * keras_input_1_rn."Feature_91" + -0.13003966645907553 * keras_input_1_rn."Feature_92" + 0.1837066131261153 * keras_input_1_rn."Feature_93" + -0.09257217188566245 * keras_input_1_rn."Feature_94" + -0.0029544494731760782 * keras_input_1_rn."Feature_95" + -0.21893326608606392 * keras_input_1_rn."Feature_96" + 0.18959924490256355 * keras_input_1_rn."Feature_97" + -0.13065839856744704 * keras_input_1_rn."Feature_98" + -0.21166911567389218 * keras_input_1_rn."Feature_99" AS dot_prod_o_2, -0.010698754700771649 + -0.060778321049891254 * keras_input_1_rn."Feature_0" + -0.06257148138147882 * keras_input_1_rn."Feature_1" + 0.04299959639351853 * keras_input_1_rn."Feature_2" + 0.24475157076597095 * keras_input_1_rn."Feature_3" + 0.14469393395445915 * keras_input_1_rn."Feature_4" + -0.2097959755618785 * keras_input_1_rn."Feature_5" + -0.1971651044059977 * keras_input_1_rn."Feature_6" + 0.07186568122369438 * keras_input_1_rn."Feature_7" + 0.0688569654484995 * keras_input_1_rn."Feature_8" + -0.17442890859697918 * keras_input_1_rn."Feature_9" + 0.21893869278031994 * keras_input_1_rn."Feature_10" + 0.03535886168941608 * keras_input_1_rn."Feature_11" + 0.24769664140714617 * keras_input_1_rn."Feature_12" + -0.038575168903448274 * keras_input_1_rn."Feature_13" + 0.12468076527005666 * keras_input_1_rn."Feature_14" + -0.08195926899026691 * keras_input_1_rn."Feature_15" + 0.12567899839087385 * keras_input_1_rn."Feature_16" + -0.2067875728656763 * keras_input_1_rn."Feature_17" + -0.11772958812587725 * keras_input_1_rn."Feature_18" + 0.004565083537647616 * keras_input_1_rn."Feature_19" + 0.12490138057345741 * keras_input_1_rn."Feature_20" + -0.19746291419976642 * keras_input_1_rn."Feature_21" + 0.13378497545194315 * keras_input_1_rn."Feature_22" + -0.022781176970659726 * keras_input_1_rn."Feature_23" + 0.16914319956201418 * keras_input_1_rn."Feature_24" + 0.08403944976429838 * keras_input_1_rn."Feature_25" + -0.08099951751117516 * keras_input_1_rn."Feature_26" + 0.0738988416246826 * keras_input_1_rn."Feature_27" + -0.1173677438739194 * keras_input_1_rn."Feature_28" + -0.08134447781282189 * keras_input_1_rn."Feature_29" + 0.18276901197418483 * keras_input_1_rn."Feature_30" + -0.06963138718046556 * keras_input_1_rn."Feature_31" + 0.05095511829169194 * keras_input_1_rn."Feature_32" + 0.13575442815504943 * keras_input_1_rn."Feature_33" + -0.10797748567389989 * keras_input_1_rn."Feature_34" + -0.13547748003504834 * keras_input_1_rn."Feature_35" + 0.039702248701462016 * keras_input_1_rn."Feature_36" + 0.04784934298612182 * keras_input_1_rn."Feature_37" + 0.1676334217399241 * keras_input_1_rn."Feature_38" + 0.2079462888572023 * keras_input_1_rn."Feature_39" + 0.05568025467992014 * keras_input_1_rn."Feature_40" + 0.07897058715848757 * keras_input_1_rn."Feature_41" + -0.22263264059425697 * keras_input_1_rn."Feature_42" + -0.06594878054586571 * keras_input_1_rn."Feature_43" + -0.0637913323171497 * keras_input_1_rn."Feature_44" + 0.11888394068630465 * keras_input_1_rn."Feature_45" + 0.20036242969556456 * keras_input_1_rn."Feature_46" + 0.03670620638013279 * keras_input_1_rn."Feature_47" + -0.13749969056411418 * keras_input_1_rn."Feature_48" + 0.2925908340859715 * keras_input_1_rn."Feature_49" + 0.19359912157810913 * keras_input_1_rn."Feature_50" + 0.11957637620333253 * keras_input_1_rn."Feature_51" + 0.09125071039459766 * keras_input_1_rn."Feature_52" + -0.16677537030293738 * keras_input_1_rn."Feature_53" + 0.23134413118051383 * keras_input_1_rn."Feature_54" + 0.13870431537848837 * keras_input_1_rn."Feature_55" + 0.14796220354335202 * keras_input_1_rn."Feature_56" + -0.22085859556156223 * keras_input_1_rn."Feature_57" + 0.14378716226175284 * keras_input_1_rn."Feature_58" + -0.15988485027018773 * keras_input_1_rn."Feature_59" + 0.18691013182791555 * keras_input_1_rn."Feature_60" + 0.11825586310348682 * keras_input_1_rn."Feature_61" + -0.010569813439188903 * keras_input_1_rn."Feature_62" + 0.1648107719098701 * keras_input_1_rn."Feature_63" + 0.06520547459710406 * keras_input_1_rn."Feature_64" + -0.14805932706479935 * keras_input_1_rn."Feature_65" + 0.1762018963325168 * keras_input_1_rn."Feature_66" + 0.07782616993851872 * keras_input_1_rn."Feature_67" + 0.08203007011752529 * keras_input_1_rn."Feature_68" + 0.23612817482849036 * keras_input_1_rn."Feature_69" + -0.2022486482519645 * keras_input_1_rn."Feature_70" + -0.18562905998425183 * keras_input_1_rn."Feature_71" + -0.12428230270099005 * keras_input_1_rn."Feature_72" + -0.16039867741705632 * keras_input_1_rn."Feature_73" + -0.14545755037060262 * keras_input_1_rn."Feature_74" + -0.12940281607732262 * keras_input_1_rn."Feature_75" + -0.07139615425175 * keras_input_1_rn."Feature_76" + -0.0931397852796838 * keras_input_1_rn."Feature_77" + 0.20966152625961276 * keras_input_1_rn."Feature_78" + -0.1194813093404895 * keras_input_1_rn."Feature_79" + -0.00586669629925359 * keras_input_1_rn."Feature_80" + -0.22645536398789773 * keras_input_1_rn."Feature_81" + -0.1518955746957503 * keras_input_1_rn."Feature_82" + -0.2062140283838129 * keras_input_1_rn."Feature_83" + 0.22297400779753 * keras_input_1_rn."Feature_84" + -0.016634157851125368 * keras_input_1_rn."Feature_85" + 0.26306966793444125 * keras_input_1_rn."Feature_86" + -0.10421461715210141 * keras_input_1_rn."Feature_87" + -0.13337917527481893 * keras_input_1_rn."Feature_88" + -0.19930579561972506 * keras_input_1_rn."Feature_89" + 0.015142277518066903 * keras_input_1_rn."Feature_90" + 0.06213563171712093 * keras_input_1_rn."Feature_91" + 0.0009403858560175511 * keras_input_1_rn."Feature_92" + 0.08609296187863648 * keras_input_1_rn."Feature_93" + 0.009958416939316444 * keras_input_1_rn."Feature_94" + -0.010684224078491804 * keras_input_1_rn."Feature_95" + -0.10661296075477876 * keras_input_1_rn."Feature_96" + 0.11466333358447399 * keras_input_1_rn."Feature_97" + 0.19624329846648308 * keras_input_1_rn."Feature_98" + -0.2093859326690845 * keras_input_1_rn."Feature_99" AS dot_prod_o_3
FROM keras_input_1_rn),
rnn_cte_lstm_1(rn_1, "KEY", "PreviousState_1", "PreviousState_2", "PreviousState_3", "PreviousState_4", "PreviousState_5", "PreviousState_6", "State_1", "State_2", "State_3", "State_4", "State_5", "State_6") AS
(SELECT lstm_input_kernel_bias.rn AS rn_1, lstm_input_kernel_bias."KEY" AS "KEY", CAST(0.0 AS BINARY_DOUBLE) AS "PreviousState_1", CAST(0.0 AS BINARY_DOUBLE) AS "PreviousState_2", CAST(0.0 AS BINARY_DOUBLE) AS "PreviousState_3", CAST(0.0 AS BINARY_DOUBLE) AS "PreviousState_4", CAST(0.0 AS BINARY_DOUBLE) AS "PreviousState_5", CAST(0.0 AS BINARY_DOUBLE) AS "PreviousState_6", greatest(lstm_input_kernel_bias.dot_prod_o_1 + 0.0, 0) * tanh(greatest(lstm_input_kernel_bias.dot_prod_i_1 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_1 + 0.0) + greatest(lstm_input_kernel_bias.dot_prod_f_1 + 0.0, 0) * 0.0) AS "State_1", greatest(lstm_input_kernel_bias.dot_prod_o_2 + 0.0, 0) * tanh(greatest(lstm_input_kernel_bias.dot_prod_i_2 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_2 + 0.0) + greatest(lstm_input_kernel_bias.dot_prod_f_2 + 0.0, 0) * 0.0) AS "State_2", greatest(lstm_input_kernel_bias.dot_prod_o_3 + 0.0, 0) * tanh(greatest(lstm_input_kernel_bias.dot_prod_i_3 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_3 + 0.0) + greatest(lstm_input_kernel_bias.dot_prod_f_3 + 0.0, 0) * 0.0) AS "State_3", greatest(lstm_input_kernel_bias.dot_prod_i_1 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_1 + 0.0) + greatest(lstm_input_kernel_bias.dot_prod_f_1 + 0.0, 0) * 0.0 AS "State_4", greatest(lstm_input_kernel_bias.dot_prod_i_2 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_2 + 0.0) + greatest(lstm_input_kernel_bias.dot_prod_f_2 + 0.0, 0) * 0.0 AS "State_5", greatest(lstm_input_kernel_bias.dot_prod_i_3 + 0.0, 0) * tanh(lstm_input_kernel_bias.dot_prod_c_3 + 0.0) + greatest(lstm_input_kernel_bias.dot_prod_f_3 + 0.0, 0) * 0.0 AS "State_6"
FROM lstm_input_kernel_bias
WHERE lstm_input_kernel_bias.rn = 1 UNION ALL SELECT lstm_input_kernel_bias.rn AS rn, lstm_input_kernel_bias."KEY" AS "KEY", rnn_cte_lstm_1."State_1" AS "PreviousState_1", rnn_cte_lstm_1."State_2" AS "PreviousState_2", rnn_cte_lstm_1."State_3" AS "PreviousState_3", rnn_cte_lstm_1."State_4" AS "PreviousState_4", rnn_cte_lstm_1."State_5" AS "PreviousState_5", rnn_cte_lstm_1."State_6" AS "PreviousState_6", greatest(lstm_input_kernel_bias.dot_prod_o_1 + -0.12705381127459214 * rnn_cte_lstm_1."State_1" + 0.014530883294396923 * rnn_cte_lstm_1."State_2" + -0.06910137156511605 * rnn_cte_lstm_1."State_3", 0) * tanh(greatest(lstm_input_kernel_bias.dot_prod_i_1 + 0.10217994587809522 * rnn_cte_lstm_1."State_1" + 0.22813685674691914 * rnn_cte_lstm_1."State_2" + -0.05214988526201731 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_1 + 0.03617484413426402 * rnn_cte_lstm_1."State_1" + -0.05437307769545803 * rnn_cte_lstm_1."State_2" + 0.49053219010297566 * rnn_cte_lstm_1."State_3") + greatest(lstm_input_kernel_bias.dot_prod_f_1 + -0.41452916684192603 * rnn_cte_lstm_1."State_1" + 0.08596430845664274 * rnn_cte_lstm_1."State_2" + -0.01008388679135442 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_4") AS "State_1", greatest(lstm_input_kernel_bias.dot_prod_o_2 + 0.048754909517330185 * rnn_cte_lstm_1."State_1" + 0.6561258292151261 * rnn_cte_lstm_1."State_2" + -0.1868870240819538 * rnn_cte_lstm_1."State_3", 0) * tanh(greatest(lstm_input_kernel_bias.dot_prod_i_2 + -0.2006070531212521 * rnn_cte_lstm_1."State_1" + -0.23452656950367468 * rnn_cte_lstm_1."State_2" + -0.10087251495182341 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_2 + 0.17788273423762863 * rnn_cte_lstm_1."State_1" + 0.4604442222086753 * rnn_cte_lstm_1."State_2" + 0.125635204594822 * rnn_cte_lstm_1."State_3") + greatest(lstm_input_kernel_bias.dot_prod_f_2 + 0.3176936282532448 * rnn_cte_lstm_1."State_1" + -0.134134823296872 * rnn_cte_lstm_1."State_2" + 0.5707998660266808 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_5") AS "State_2", greatest(lstm_input_kernel_bias.dot_prod_o_3 + 0.65093127305949 * rnn_cte_lstm_1."State_1" + -0.3032617462231505 * rnn_cte_lstm_1."State_2" + -0.47259093425657633 * rnn_cte_lstm_1."State_3", 0) * tanh(greatest(lstm_input_kernel_bias.dot_prod_i_3 + -0.0656782076719609 * rnn_cte_lstm_1."State_1" + 0.29131842769723704 * rnn_cte_lstm_1."State_2" + -0.22441221707406375 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_3 + -0.0993841177152909 * rnn_cte_lstm_1."State_1" + -0.1994274010969699 * rnn_cte_lstm_1."State_2" + -0.14813166799939595 * rnn_cte_lstm_1."State_3") + greatest(lstm_input_kernel_bias.dot_prod_f_3 + 0.4652714717988876 * rnn_cte_lstm_1."State_1" + 0.2530506910239013 * rnn_cte_lstm_1."State_2" + 0.030450876733346916 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_6") AS "State_3", greatest(lstm_input_kernel_bias.dot_prod_i_1 + 0.10217994587809522 * rnn_cte_lstm_1."State_1" + 0.22813685674691914 * rnn_cte_lstm_1."State_2" + -0.05214988526201731 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_1 + 0.03617484413426402 * rnn_cte_lstm_1."State_1" + -0.05437307769545803 * rnn_cte_lstm_1."State_2" + 0.49053219010297566 * rnn_cte_lstm_1."State_3") + greatest(lstm_input_kernel_bias.dot_prod_f_1 + -0.41452916684192603 * rnn_cte_lstm_1."State_1" + 0.08596430845664274 * rnn_cte_lstm_1."State_2" + -0.01008388679135442 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_4" AS "State_4", greatest(lstm_input_kernel_bias.dot_prod_i_2 + -0.2006070531212521 * rnn_cte_lstm_1."State_1" + -0.23452656950367468 * rnn_cte_lstm_1."State_2" + -0.10087251495182341 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_2 + 0.17788273423762863 * rnn_cte_lstm_1."State_1" + 0.4604442222086753 * rnn_cte_lstm_1."State_2" + 0.125635204594822 * rnn_cte_lstm_1."State_3") + greatest(lstm_input_kernel_bias.dot_prod_f_2 + 0.3176936282532448 * rnn_cte_lstm_1."State_1" + -0.134134823296872 * rnn_cte_lstm_1."State_2" + 0.5707998660266808 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_5" AS "State_5", greatest(lstm_input_kernel_bias.dot_prod_i_3 + -0.0656782076719609 * rnn_cte_lstm_1."State_1" + 0.29131842769723704 * rnn_cte_lstm_1."State_2" + -0.22441221707406375 * rnn_cte_lstm_1."State_3", 0) * tanh(lstm_input_kernel_bias.dot_prod_c_3 + -0.0993841177152909 * rnn_cte_lstm_1."State_1" + -0.1994274010969699 * rnn_cte_lstm_1."State_2" + -0.14813166799939595 * rnn_cte_lstm_1."State_3") + greatest(lstm_input_kernel_bias.dot_prod_f_3 + 0.4652714717988876 * rnn_cte_lstm_1."State_1" + 0.2530506910239013 * rnn_cte_lstm_1."State_2" + 0.030450876733346916 * rnn_cte_lstm_1."State_3", 0) * rnn_cte_lstm_1."State_6" AS "State_6"
FROM lstm_input_kernel_bias, rnn_cte_lstm_1
WHERE lstm_input_kernel_bias.rn = rnn_cte_lstm_1.rn_1 + 1),
lstm_1 AS
(SELECT rnn_cte_lstm_1."KEY" AS "KEY", CAST(rnn_cte_lstm_1."State_1" AS BINARY_DOUBLE) AS output_1, CAST(rnn_cte_lstm_1."State_2" AS BINARY_DOUBLE) AS output_2, CAST(rnn_cte_lstm_1."State_3" AS BINARY_DOUBLE) AS output_3
FROM rnn_cte_lstm_1),
lstm_1_1 AS
(SELECT lstm_1."KEY" AS "KEY", lstm_1.output_1 AS output_1, lstm_1.output_2 AS output_2, lstm_1.output_3 AS output_3
FROM lstm_1),
layer_dense_1 AS
(SELECT lstm_1_1."KEY" AS "KEY", 0.024233938939658587 + -0.5100473059343649 * lstm_1_1.output_1 + -0.5320527364838099 * lstm_1_1.output_2 + -0.47138146557963356 * lstm_1_1.output_3 AS output_1, -0.024233938939658577 + 0.9706227025144729 * lstm_1_1.output_1 + -0.18651383148174125 * lstm_1_1.output_2 + 0.3473824771209179 * lstm_1_1.output_3 AS output_2
FROM lstm_1_1),
layer_dense_1_1 AS
(SELECT layer_dense_1."KEY" AS "KEY", layer_dense_1.output_1 AS output_1, layer_dense_1.output_2 AS output_2
FROM layer_dense_1),
score_soft_max_step1 AS
(SELECT layer_dense_1_1."KEY" AS "KEY", layer_dense_1_1.output_1 AS "Score_0", exp(least(100.0, greatest(-100.0, layer_dense_1_1.output_1))) AS "exp_Score_0", layer_dense_1_1.output_2 AS "Score_1", exp(least(100.0, greatest(-100.0, layer_dense_1_1.output_2))) AS "exp_Score_1"
FROM layer_dense_1_1),
score_class_union_soft AS
(SELECT soft_scu."KEY" AS "KEY", soft_scu.class AS class, soft_scu."exp_Score" AS "exp_Score"
FROM (SELECT score_soft_max_step1."KEY" AS "KEY", 0 AS class, score_soft_max_step1."exp_Score_0" AS "exp_Score"
FROM score_soft_max_step1 UNION ALL SELECT score_soft_max_step1."KEY" AS "KEY", 1 AS class, score_soft_max_step1."exp_Score_1" AS "exp_Score"
FROM score_soft_max_step1) soft_scu),
score_soft_max AS
(SELECT score_soft_max_step1."KEY" AS "KEY", score_soft_max_step1."Score_0" AS "Score_0", score_soft_max_step1."exp_Score_0" AS "exp_Score_0", score_soft_max_step1."Score_1" AS "Score_1", score_soft_max_step1."exp_Score_1" AS "exp_Score_1", sum_exp_t."KEY_sum" AS "KEY_sum", sum_exp_t."sum_ExpScore" AS "sum_ExpScore"
FROM score_soft_max_step1 LEFT OUTER JOIN (SELECT score_class_union_soft."KEY" AS "KEY_sum", sum(score_class_union_soft."exp_Score") AS "sum_ExpScore"
FROM score_class_union_soft GROUP BY score_class_union_soft."KEY") sum_exp_t ON score_soft_max_step1."KEY" = sum_exp_t."KEY_sum"),
layer_softmax AS
(SELECT score_soft_max."KEY" AS "KEY", score_soft_max."exp_Score_0" / score_soft_max."sum_ExpScore" AS output_1, score_soft_max."exp_Score_1" / score_soft_max."sum_ExpScore" AS output_2
FROM score_soft_max),
orig_cte AS
(SELECT layer_softmax."KEY" AS "KEY", CAST(NULL AS BINARY_DOUBLE) AS "Score_0", CAST(NULL AS BINARY_DOUBLE) AS "Score_1", layer_softmax.output_1 AS "Proba_0", layer_softmax.output_2 AS "Proba_1", CAST(NULL AS BINARY_DOUBLE) AS "LogProba_0", CAST(NULL AS BINARY_DOUBLE) AS "LogProba_1", CAST(NULL AS NUMBER(19)) AS "Decision", CAST(NULL AS BINARY_DOUBLE) AS "DecisionProba"
FROM layer_softmax),
score_class_union AS
(SELECT scu."KEY_u" AS "KEY_u", scu.class AS class, scu."LogProba" AS "LogProba", scu."Proba" AS "Proba", scu."Score" AS "Score"
FROM (SELECT orig_cte."KEY" AS "KEY_u", 0 AS class, orig_cte."LogProba_0" AS "LogProba", orig_cte."Proba_0" AS "Proba", orig_cte."Score_0" AS "Score"
FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", 1 AS class, orig_cte."LogProba_1" AS "LogProba", orig_cte."Proba_1" AS "Proba", orig_cte."Score_1" AS "Score"
FROM orig_cte) scu),
score_max AS
(SELECT orig_cte."KEY" AS "KEY", orig_cte."Score_0" AS "Score_0", orig_cte."Score_1" AS "Score_1", orig_cte."Proba_0" AS "Proba_0", orig_cte."Proba_1" AS "Proba_1", orig_cte."LogProba_0" AS "LogProba_0", orig_cte."LogProba_1" AS "LogProba_1", orig_cte."Decision" AS "Decision", orig_cte."DecisionProba" AS "DecisionProba", max_select."KEY_m" AS "KEY_m", max_select."max_Proba" AS "max_Proba"
FROM orig_cte LEFT OUTER JOIN (SELECT score_class_union."KEY_u" AS "KEY_m", max(score_class_union."Proba") AS "max_Proba"
FROM score_class_union GROUP BY score_class_union."KEY_u") max_select ON orig_cte."KEY" = max_select."KEY_m"),
union_with_max AS
(SELECT score_class_union."KEY_u" AS "KEY_u", score_class_union.class AS class, score_class_union."LogProba" AS "LogProba", score_class_union."Proba" AS "Proba", score_class_union."Score" AS "Score", score_max."KEY" AS "KEY", score_max."Score_0" AS "Score_0", score_max."Score_1" AS "Score_1", score_max."Proba_0" AS "Proba_0", score_max."Proba_1" AS "Proba_1", score_max."LogProba_0" AS "LogProba_0", score_max."LogProba_1" AS "LogProba_1", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Proba" AS "max_Proba"
FROM score_class_union LEFT OUTER JOIN score_max ON score_class_union."KEY_u" = score_max."KEY"),
arg_max_cte AS
(SELECT score_max."KEY" AS "KEY", score_max."Score_0" AS "Score_0", score_max."Score_1" AS "Score_1", score_max."Proba_0" AS "Proba_0", score_max."Proba_1" AS "Proba_1", score_max."LogProba_0" AS "LogProba_0", score_max."LogProba_1" AS "LogProba_1", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Proba" AS "max_Proba", "arg_max_t_Proba"."KEY_Proba" AS "KEY_Proba", "arg_max_t_Proba"."arg_max_Proba" AS "arg_max_Proba"
FROM score_max LEFT OUTER JOIN (SELECT union_with_max."KEY" AS "KEY_Proba", max(union_with_max.class) AS "arg_max_Proba"
FROM union_with_max
WHERE union_with_max."max_Proba" <= union_with_max."Proba" GROUP BY union_with_max."KEY") "arg_max_t_Proba" ON score_max."KEY" = "arg_max_t_Proba"."KEY_Proba")
SELECT arg_max_cte."KEY" AS "KEY", arg_max_cte."Score_0" AS "Score_0", arg_max_cte."Score_1" AS "Score_1", arg_max_cte."Proba_0" AS "Proba_0", arg_max_cte."Proba_1" AS "Proba_1", CASE WHEN (arg_max_cte."Proba_0" IS NULL OR arg_max_cte."Proba_0" > 0.0) THEN ln(arg_max_cte."Proba_0") ELSE -BINARY_DOUBLE_INFINITY END AS "LogProba_0", CASE WHEN (arg_max_cte."Proba_1" IS NULL OR arg_max_cte."Proba_1" > 0.0) THEN ln(arg_max_cte."Proba_1") ELSE -BINARY_DOUBLE_INFINITY END AS "LogProba_1", arg_max_cte."arg_max_Proba" AS "Decision", arg_max_cte."max_Proba" AS "DecisionProba"
FROM arg_max_cte
|
insert into routines(
name
,unit_period
,target_quantity
,unit
)
values(
$1
,$2
,$3
,$4
)
returning
routine_id
,user_id
,name
,unit_period
,target_quantity
,unit
,to_char(insert_datetime, 'YYYY-MM-DD HH24:MI:SS') as insert_datetime
|
CREATE TABLE IF NOT EXISTS table2base (
page_id varchar(50) NULL DEFAULT NULL,
tag_text varchar(5000) NULL DEFAULT NULL,
time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
name varchar(100) NULL
)
|
CREATE TABLE if not exists messages (
id INT PRIMARY KEY AUTO_INCREMENT,
text VARCHAR(255)
);
|
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 02, 2015 at 10:55 AM
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `rims3`
--
-- --------------------------------------------------------
--
-- Table structure for table `rims_bank`
--
CREATE TABLE IF NOT EXISTS `rims_bank` (
`id` int(11) NOT NULL,
`name` varchar(100) DEFAULT NULL,
`code` int(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=136 ;
--
-- Dumping data for table `rims_bank`
--
INSERT INTO `rims_bank` (`id`, `name`, `code`) VALUES
(1, 'BANK BRI', 2),
(2, 'BANK EKSPOR INDONESIA', 3),
(3, 'BANK MANDIRI', 8),
(4, 'BANK BNI', 9),
(5, 'BANK DANAMON', 11),
(6, 'PERMATA BANK', 13),
(7, 'BANK BCA', 14),
(8, 'BANK BII', 16),
(9, 'BANK PANIN', 19),
(10, 'BANK ARTA NIAGA KENCANA', 20),
(11, 'BANK NIAGA', 22),
(12, 'BANK BUANA IND', 23),
(13, 'BANK LIPPO', 26),
(14, 'BANK NISP', 28),
(15, 'AMERICAN EXPRESS BANK LTD', 30),
(16, 'CITIBANK ', 31),
(17, 'JP. MORGAN CHASE BANK, N.A.', 32),
(18, 'BANK OF AMERICA, N.A', 33),
(19, 'ING INDONESIA BANK', 34),
(20, 'BANK MULTICOR TBK.', 36),
(21, 'BANK ARTHA GRAHA', 37),
(22, 'BANK CREDIT AGRICOLE INDOSUEZ', 39),
(23, 'THE BANGKOK BANK COMP. LTD', 40),
(24, 'BANK HSBC', 41),
(25, 'THE BANK OF TOKYO MITSUBISHI UFJ LTD', 42),
(26, 'BANK SUMITOMO MITSUI INDONESIA', 45),
(27, 'BANK DBS INDONESIA', 46),
(28, 'BANK RESONA PERDANIA', 47),
(29, 'BANK MIZUHO INDONESIA', 48),
(30, 'STANDARD CHARTERED BANK', 50),
(31, 'BANK ABN AMRO', 52),
(32, 'BANK KEPPEL TATLEE BUANA', 53),
(33, 'BANK CAPITAL INDONESIA, TBK.', 54),
(34, 'BANK BNP PARIBAS INDONESIA', 57),
(35, 'BANK UOB INDONESIA', 58),
(36, 'KOREA EXCHANGE BANK DANAMON', 59),
(37, 'RABOBANK INTERNASIONAL INDONESIA', 60),
(38, 'ANZ PANIN BANK', 61),
(39, 'DEUTSCHE BANK AG.', 67),
(40, 'BANK WOORI INDONESIA', 68),
(41, 'BANK OF CHINA LIMITED', 69),
(42, 'BANK BUMI ARTA', 76),
(43, 'BANK EKONOMI', 87),
(44, 'BANK ANTARDAERAH', 88),
(45, 'BANK HAGA', 89),
(46, 'BANK IFI', 93),
(47, 'BANK CENTURY, TBK.', 95),
(48, 'BANK MAYAPADA', 97),
(49, 'BANK JABAR', 110),
(50, 'BANK DKI', 111),
(51, 'BPD DIY', 112),
(52, 'BANK JATENG', 113),
(53, 'BANK JATIM', 114),
(54, 'BPD JAMBI', 115),
(55, 'BPD ACEH', 116),
(56, 'BANK SUMUT', 117),
(57, 'BANK NAGARI', 118),
(58, 'BANK RIAU', 119),
(59, 'BANK SUMSEL', 120),
(60, 'BANK LAMPUNG', 121),
(61, 'BPD KALSEL', 122),
(62, 'BPD KALIMANTAN BARAT', 123),
(63, 'BPD KALTIM', 124),
(64, 'BPD KALTENG', 125),
(65, 'BPD SULSEL', 126),
(66, 'BANK SULUT', 127),
(67, 'BPD NTB', 128),
(68, 'BPD BALI', 129),
(69, 'BANK NTT', 130),
(70, 'BANK MALUKU', 131),
(71, 'BPD PAPUA', 132),
(72, 'BANK BENGKULU', 133),
(73, 'BPD SULAWESI TENGAH', 134),
(74, 'BANK SULTRA', 135),
(75, 'BANK NUSANTARA PARAHYANGAN', 145),
(76, 'BANK SWADESI', 146),
(77, 'BANK MUAMALAT', 147),
(78, 'BANK MESTIKA', 151),
(79, 'BANK METRO EXPRESS', 152),
(80, 'BANK SHINTA INDONESIA', 153),
(81, 'BANK MASPION', 157),
(82, 'BANK HAGAKITA', 159),
(83, 'BANK GANESHA', 161),
(84, 'BANK WINDU KENTJANA', 162),
(85, 'HALIM INDONESIA BANK', 164),
(86, 'BANK HARMONI INTERNATIONAL', 166),
(87, 'BANK KESAWAN', 167),
(88, 'BANK TABUNGAN NEGARA (PERSERO)', 200),
(89, 'BANK HIMPUNAN SAUDARA 1906, TBK', 0),
(90, 'BANK TABUNGAN PENSIUNAN NASIONAL', 213),
(91, 'BANK SWAGUNA', 405),
(92, 'BANK JASA ARTA', 422),
(93, 'BANK MEGA', 426),
(94, 'BANK JASA JAKARTA', 427),
(95, 'BANK BUKOPIN', 441),
(96, 'BANK SYARIAH MANDIRI', 451),
(97, 'BANK BISNIS INTERNASIONAL', 459),
(98, 'BANK SRI PARTHA', 466),
(99, 'BANK JASA JAKARTA', 472),
(100, 'BANK BINTANG MANUNGGAL', 484),
(101, 'BANK BUMIPUTERA', 485),
(102, 'BANK YUDHA BHAKTI', 490),
(103, 'BANK MITRANIAGA', 491),
(104, 'BANK AGRO NIAGA', 494),
(105, 'BANK INDOMONEX', 498),
(106, 'BANK ROYAL INDONESIA', 501),
(107, 'BANK ALFINDO', 503),
(108, 'BANK SYARIAH MEGA', 506),
(109, 'BANK INA PERDANA', 513),
(110, 'BANK HARFA', 517),
(111, 'PRIMA MASTER BANK', 520),
(112, 'BANK PERSYARIKATAN INDONESIA', 521),
(113, 'BANK AKITA', 525),
(114, 'LIMAN INTERNATIONAL BANK', 526),
(115, 'ANGLOMAS INTERNASIONAL BANK', 531),
(116, 'BANK DIPO INTERNATIONAL', 523),
(117, 'BANK KESEJAHTERAAN EKONOMI', 535),
(118, 'BANK UIB', 536),
(119, 'BANK ARTOS IND', 542),
(120, 'BANK PURBA DANARTA', 547),
(121, 'BANK MULTI ARTA SENTOSA', 548),
(122, 'BANK MAYORA', 553),
(123, 'BANK INDEX SELINDO', 555),
(124, 'BANK VICTORIA INTERNATIONAL', 566),
(125, 'BANK EKSEKUTIF', 558),
(126, 'CENTRATAMA NASIONAL BANK', 559),
(127, 'BANK FAMA INTERNASIONAL', 562),
(128, 'BANK SINAR HARAPAN BALI', 564),
(129, 'BANK HARDA', 567),
(130, 'BANK FINCONESIA', 945),
(131, 'BANK MERINCORP', 946),
(132, 'BANK MAYBANK INDOCORP', 947),
(133, 'BANK OCBC ? INDONESIA', 948),
(134, 'BANK CHINA TRUST INDONESIA', 949),
(135, 'BANK COMMONWEALTH', 950);
-- --------------------------------------------------------
--
-- Table structure for table `rims_branch`
--
CREATE TABLE IF NOT EXISTS `rims_branch` (
`id` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`address` text NOT NULL,
`province_id` int(11) NOT NULL,
`city_id` int(11) NOT NULL,
`zipcode` varchar(10) NOT NULL,
`phone` varchar(20) DEFAULT NULL,
`fax` varchar(20) DEFAULT NULL,
`email` varchar(60) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;
--
-- Dumping data for table `rims_branch`
--
INSERT INTO `rims_branch` (`id`, `code`, `name`, `address`, `province_id`, `city_id`, `zipcode`, `phone`, `fax`, `email`, `status`) VALUES
(1, 'B01', 'Branch 1', 'TEst', 12, 39, '11460', '1234578900', '1231321312', 'test@test.com', 'Active'),
(2, 'B02', 'Branch 2', 'Grogol', 12, 39, '10230', '261202713', '261202713', 'bett@gmail.com', 'Active'),
(3, 'B03', 'Branch 3', 'Grogol', 12, 39, '10230', '261202713', '261202713', 'dindin@gmail.com', 'Active'),
(4, 'B04', 'Branch 4', 'Bekasi', 12, 39, '10230', '261202713', '261202713', 'lolo@gmail,com', 'Active'),
(5, 'B05', 'Branch 5', 'grogol', 12, 39, '10230', '261202713', '261202713', 'irir@gmail.com', 'Active'),
(6, 'B06', 'Branch 6', 'Grogol', 12, 39, '10230', '261202713', '261202713', 'keket@gmail.com', 'Active'),
(7, 'B07', 'Branch 7', 'Grogol', 12, 39, '10230', '261202713', '261202713', 'alal@.gmail.com', 'Active'),
(8, 'B08', 'Branch 8', 'Grogol', 12, 39, '10230', '261202713', '261202713', 'rere@gmail.com', 'Active'),
(11, 'B12', 'Branch 12', 'Jl Asdfghk', 12, 41, '12345', '1234578900', '1231321312', 'test@test.com', 'Active'),
(12, 'R1', 'raperind Kalimalang', 'kalimalang', 12, 41, '13450', '0218643595', '8641717', 'customerservice@raperind.com', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_branch_fax`
--
CREATE TABLE IF NOT EXISTS `rims_branch_fax` (
`id` int(11) NOT NULL,
`branch_id` int(11) NOT NULL,
`fax_no` varchar(20) NOT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `rims_branch_fax`
--
INSERT INTO `rims_branch_fax` (`id`, `branch_id`, `fax_no`, `status`) VALUES
(1, 1, '0987662123', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_branch_phone`
--
CREATE TABLE IF NOT EXISTS `rims_branch_phone` (
`id` int(11) NOT NULL,
`branch_id` int(11) DEFAULT NULL,
`phone_no` varchar(20) NOT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `rims_branch_phone`
--
INSERT INTO `rims_branch_phone` (`id`, `branch_id`, `phone_no`, `status`) VALUES
(1, 1, '0218881231', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_branch_warehouse`
--
CREATE TABLE IF NOT EXISTS `rims_branch_warehouse` (
`id` int(11) NOT NULL,
`branch_id` int(11) DEFAULT NULL,
`warehouse_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_chasis_code`
--
CREATE TABLE IF NOT EXISTS `rims_chasis_code` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`year_end` int(11) DEFAULT NULL,
`year_start` int(11) DEFAULT NULL,
`status` varchar(10) NOT NULL,
`brand_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_city`
--
CREATE TABLE IF NOT EXISTS `rims_city` (
`id` int(11) NOT NULL,
`province_id` int(11) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`code` varchar(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=99 ;
--
-- Dumping data for table `rims_city`
--
INSERT INTO `rims_city` (`id`, `province_id`, `name`, `code`) VALUES
(1, 1, 'Banda Aceh', NULL),
(2, 1, 'Langsa', NULL),
(3, 1, 'Lhokseumawe', NULL),
(4, 2, 'Binjai', NULL),
(5, 2, 'Gunung Sitoli', NULL),
(6, 2, 'Medan', NULL),
(7, 2, 'Lubuk Pakam', NULL),
(8, 2, 'Padang Sidempuan', NULL),
(9, 2, 'Pematang Siantar', NULL),
(10, 2, 'Sibolga', NULL),
(11, 2, 'Tanjung Balai', NULL),
(12, 2, 'Tebing Tinggi', NULL),
(13, 3, 'Bukittinggi', NULL),
(14, 3, 'Padang', NULL),
(15, 3, 'Padang Panjang', NULL),
(16, 3, 'Pariaman', NULL),
(17, 3, 'Payakumbuh', NULL),
(18, 3, 'Sawah Lunto', NULL),
(19, 3, 'Solok', NULL),
(20, 4, 'Dumai', NULL),
(21, 4, 'Pekanbaru', NULL),
(22, 5, 'Batam', NULL),
(23, 5, 'Tanjung Pinang', NULL),
(24, 6, 'Pangkal Pinang', NULL),
(25, 7, 'Jambi', NULL),
(26, 7, 'Sungai Penuh', NULL),
(27, 8, 'Bengkulu', NULL),
(28, 9, 'Lubuklinggau', NULL),
(29, 9, 'Pagar Alam', NULL),
(30, 9, 'Palembang', NULL),
(31, 9, 'Prabumulih', NULL),
(32, 10, 'Bandar Lampung', NULL),
(33, 10, 'Metro', NULL),
(34, 11, 'Cilegon', NULL),
(35, 12, 'Serang', NULL),
(36, 12, 'Tangerang', NULL),
(37, 12, 'Tangerang Selatan', NULL),
(38, 12, 'Jakarta Barat', NULL),
(39, 12, 'Jakarta Pusat', NULL),
(40, 12, 'Jakarta Selatan', NULL),
(41, 12, 'Jakarta Timur', NULL),
(42, 12, 'Jakara Utara', NULL),
(43, 13, 'Bandung', NULL),
(44, 13, 'Banjar', NULL),
(45, 13, 'Bekasi', NULL),
(46, 13, 'Bogor', NULL),
(47, 13, 'Cimahi', NULL),
(48, 13, 'Cirebon', NULL),
(49, 13, 'Depok', NULL),
(50, 13, 'Sukabumi', NULL),
(51, 13, 'Tasikmalaya', NULL),
(52, 14, 'Magelang', NULL),
(53, 14, 'Pekalongan', NULL),
(54, 14, 'Salatiga', NULL),
(55, 14, 'Semarang', NULL),
(56, 14, 'Surakarta', NULL),
(57, 14, 'Tegal', NULL),
(58, 15, 'Yogyakarta', NULL),
(59, 16, 'Batj', NULL),
(60, 16, 'Blitar', NULL),
(61, 16, 'Kediri', NULL),
(62, 16, 'Madiun', NULL),
(63, 16, 'Malang', NULL),
(64, 16, 'Mojokerto', NULL),
(65, 16, 'Pasuruan', NULL),
(66, 16, 'Probolinggo', NULL),
(67, 16, 'Surabaya', NULL),
(68, 17, 'Denpasar', NULL),
(69, 18, 'Bima', NULL),
(70, 18, 'Mataram', NULL),
(71, 19, 'Kupang', NULL),
(72, 20, 'Pontianak', NULL),
(73, 20, 'Singkawang', NULL),
(74, 21, 'Palangkaraya', NULL),
(75, 22, 'Banjar Baru', NULL),
(76, 22, 'Banjarmasin', NULL),
(77, 23, 'Balikpapan', NULL),
(78, 23, 'Bontang', NULL),
(79, 23, 'Samarinda', NULL),
(80, 23, 'Tarakan', NULL),
(81, 24, 'Gorontalo', NULL),
(82, 25, 'Makassar', NULL),
(83, 25, 'Palopo', NULL),
(84, 25, 'Pare - pare', NULL),
(85, 26, 'Bau - bau', NULL),
(86, 26, 'Kendari', NULL),
(87, 27, 'Palu', NULL),
(88, 28, 'Bitung', NULL),
(89, 28, 'Kotamobagu', NULL),
(90, 28, 'Manado', NULL),
(91, 28, 'Tomohon', NULL),
(92, 30, 'Ambon', NULL),
(93, 30, 'Tual', NULL),
(94, 31, 'Ternate', NULL),
(95, 31, 'Tidore Kepulauan', NULL),
(96, 32, 'Sorong', NULL),
(97, 33, 'Jayapura', NULL),
(98, 34, 'Tarakan', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `rims_colors`
--
CREATE TABLE IF NOT EXISTS `rims_colors` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `rims_colors`
--
INSERT INTO `rims_colors` (`id`, `name`, `status`) VALUES
(1, 'Red', 'Active'),
(2, 'Black', 'Active'),
(3, 'Blue', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_customer`
--
CREATE TABLE IF NOT EXISTS `rims_customer` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`address` text NOT NULL,
`province_id` int(11) NOT NULL,
`city_id` int(11) NOT NULL,
`zipcode` varchar(10) NOT NULL,
`fax` varchar(20) NOT NULL,
`email` varchar(100) NOT NULL,
`note` text NOT NULL,
`customer_type` varchar(10) NOT NULL,
`default_payment_type` int(11) NOT NULL,
`tenor` int(11) DEFAULT NULL,
`status` varchar(10) NOT NULL,
`birthdate` date NOT NULL,
`flat_rate` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=30 ;
--
-- Dumping data for table `rims_customer`
--
INSERT INTO `rims_customer` (`id`, `name`, `address`, `province_id`, `city_id`, `zipcode`, `fax`, `email`, `note`, `customer_type`, `default_payment_type`, `tenor`, `status`, `birthdate`, `flat_rate`) VALUES
(1, 'Budi', 'Jl. abc no 1234', 12, 39, '13231', '123456789', 'budi@gmail.com', 'Testing', 'Individual', 0, 30, 'Active', '0000-00-00', '0.00'),
(2, 'John Legend', 'Jl. Kebon Kacang 2', 12, 39, '12344', '', 'john@legend.co.id', 'Test test test', 'Company', 0, 20, 'Active', '0000-00-00', '0.00'),
(3, 'Stefani', 'Jl. Kebon Melati', 12, 39, '12314', '1231321312', 'test@test.com', '', 'Individual', 0, 0, 'Active', '0000-00-00', '0.00'),
(4, 'Fajar', 'Jalan Aceh No 4', 12, 39, '', '', 'test@test.com', '', 'Individual', 0, 0, 'Active', '0000-00-00', '0.00'),
(5, 'Newira', 'Billy & Moon', 12, 39, '', '', 'abc@yahoo.com', '', 'Individual', 0, 0, 'Active', '0000-00-00', '0.00'),
(6, 'Bambang Pamungkas', 'Jalan Anggrek Loka 4 blok D no.15', 12, 39, '14140', '123456', 'Bambang_pamungkas@yahoo.com', '', 'Company', 0, 10, 'Active', '0000-00-00', '0.00'),
(7, 'Ajeng inem', 'jalan camar 5 no.10', 12, 39, '141710', '123456', 'ajenginem@gmail.com', '', 'Individual', 0, 10, 'Active', '0000-00-00', '0.00'),
(8, 'Ria Astika', 'Jalan kasuari 7 no.13', 12, 39, '171710', '123456', 'riaastika@gmail.com', '', 'Individual', 0, 10, 'Active', '0000-00-00', '0.00'),
(9, 'Sasa Angin', 'jalan cendrawasih 10', 12, 39, '141710', '1243654', 'sasa.angin@yahoo.com', '', 'Individual', 0, 15, 'Active', '0000-00-00', '0.00'),
(10, 'Amin sungkar', 'jalan sesama', 12, 39, '171709', '123456', 'aminsungkar@yahoo.com', '', 'Individual', 0, 20, 'Active', '0000-00-00', '0.00'),
(11, 'sharen ajeng', 'jalan salak 10', 12, 39, '14146', '123456', 'apaaja@yahoo.com', '', 'Individual', 0, 15, 'Active', '0000-00-00', '0.00'),
(12, 'PT CITA PRAKASA', 'Jalan abang irama 10 no.13', 12, 39, '141432', '365452', 'citaprakasa.co.id', '', 'Company', 0, 123, 'Active', '0000-00-00', '1.00'),
(13, 'Pretty Maksimal ', 'Jalan Cabe Terong 5', 12, 39, '171736', '123654', 'Pretty_maksimal@yahoo.com', '', 'Company', 0, 12, 'Active', '0000-00-00', '2.00'),
(14, 'Tommy', 'Jalan Cabe Terong 5', 12, 39, '171736', '123654', 'tommy@yahoo.com', '', 'Individual', 0, 12, 'Active', '0000-00-00', '2.00'),
(15, 'Husni Thamrin', 'Jl.husni thamrin no 101', 12, 39, '161345', '65412354', 'Husni_thamrin@yahoo.com', '', 'Company', 0, 12, 'Active', '0000-00-00', '1.00'),
(16, 'Chiko jeriko', 'Jalan sudirman 10 no.11', 12, 39, '36541236', '6545659', 'Chikojer@yahoo.com', '', 'Company', 0, 123, 'Active', '0000-00-00', '2.00'),
(17, 'Iman Sitepu', 'Jalan Mawar 5', 12, 39, '191865', '6321545', 'Iman@ymail.com', '', 'Individual', 0, 65, 'Active', '0000-00-00', '3.00'),
(18, 'Yenny wulandari', 'Bontang', 12, 39, '321546', '123456', 'yenny_wulandari@yahoo.com', '', 'Individual', 0, 12, 'Active', '0000-00-00', '3.00'),
(19, 'Tora Suyatno', 'Palangkaraya', 12, 39, '141630', '6541263', 'tora_suyatno', '', 'Company', 0, 12, 'Active', '0000-00-00', '12.00'),
(20, 'Rike supriyadi', 'Bogor', 12, 39, '161325', '', 'test@test.com', '', 'Company', 0, 0, 'Active', '0000-00-00', '0.00'),
(21, 'Bblabla', 'blabl', 12, 39, '', '', 'irwansyahdastan@gmail.com', '', 'Individual', 0, 0, 'Active', '0000-00-00', '0.00'),
(22, 'Alini', 'Jl Thamrin2312', 12, 39, '12311', '12312132131321', 'test@test.com', '', 'Individual', 0, 20, '', '1959-02-01', '1.00'),
(27, 'PT. ABCDEFGH', 'afsdafsdfa', 12, 36, '123211', '12312132131321', 'test@test.com', '', 'Individual', 3, 30, '', '1959-02-01', '1.00'),
(28, 'Tester', 'Testing', 12, 38, '12421', '12312132131321', 'test@test.com', '', 'Individual', 1, 20, '', '1987-04-17', '1.00'),
(29, 'Newira', 'Billy Moon', 12, 41, '13450', '', '', '', 'Individual', 1, 30, '', '2015-10-08', '100000.00');
-- --------------------------------------------------------
--
-- Table structure for table `rims_customer_mobile`
--
CREATE TABLE IF NOT EXISTS `rims_customer_mobile` (
`id` int(11) NOT NULL,
`customer_id` int(11) DEFAULT NULL,
`mobile_no` varchar(20) DEFAULT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `rims_customer_mobile`
--
INSERT INTO `rims_customer_mobile` (`id`, `customer_id`, `mobile_no`, `status`) VALUES
(1, 1, '0812', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_customer_phone`
--
CREATE TABLE IF NOT EXISTS `rims_customer_phone` (
`id` int(11) NOT NULL,
`customer_id` int(11) DEFAULT NULL,
`phone_no` varchar(20) DEFAULT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `rims_customer_phone`
--
INSERT INTO `rims_customer_phone` (`id`, `customer_id`, `phone_no`, `status`) VALUES
(1, 22, '122212231', NULL),
(2, 28, '09281664241', 'Active'),
(3, 28, '982112122', 'Active'),
(4, 1, '0212212212', 'Active'),
(5, 29, '0218859852', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_customer_pic`
--
CREATE TABLE IF NOT EXISTS `rims_customer_pic` (
`id` int(11) NOT NULL,
`customer_id` int(11) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`address` text,
`province_id` int(11) DEFAULT NULL,
`city_id` int(11) DEFAULT NULL,
`zipcode` varchar(10) DEFAULT NULL,
`fax` varchar(20) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`note` text,
`status` varchar(10) DEFAULT 'Active',
`birthdate` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `rims_customer_pic`
--
INSERT INTO `rims_customer_pic` (`id`, `customer_id`, `name`, `address`, `province_id`, `city_id`, `zipcode`, `fax`, `email`, `note`, `status`, `birthdate`) VALUES
(1, 1, 'Tono', 'Jl def', 12, 41, '21091', '', 'tono@gmail.com', 'Testing', 'Active', '1976-09-12'),
(2, 29, 'Andi', 'kalimalang', 13, 45, '17145', '', '', '', 'Active', '0000-00-00');
-- --------------------------------------------------------
--
-- Table structure for table `rims_customer_pic_mobile`
--
CREATE TABLE IF NOT EXISTS `rims_customer_pic_mobile` (
`id` int(11) NOT NULL,
`customer_pic_id` int(11) DEFAULT NULL,
`mobile_no` varchar(20) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_customer_pic_phone`
--
CREATE TABLE IF NOT EXISTS `rims_customer_pic_phone` (
`id` int(11) NOT NULL,
`customer_pic_id` int(11) DEFAULT NULL,
`phone_no` varchar(20) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_customer_service_rate`
--
CREATE TABLE IF NOT EXISTS `rims_customer_service_rate` (
`id` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`service_id` int(11) NOT NULL,
`rate` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_deduction`
--
CREATE TABLE IF NOT EXISTS `rims_deduction` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`description` text NOT NULL,
`amount` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `rims_deduction`
--
INSERT INTO `rims_deduction` (`id`, `name`, `description`, `amount`) VALUES
(1, 'Uniform', '', ''),
(2, 'Shoes', 'Shoes', ''),
(3, 'BPJS', 'Insurance', '');
-- --------------------------------------------------------
--
-- Table structure for table `rims_division`
--
CREATE TABLE IF NOT EXISTS `rims_division` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) DEFAULT 'Active',
`code` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `rims_division`
--
INSERT INTO `rims_division` (`id`, `name`, `status`, `code`) VALUES
(1, 'HR Department', 'Active', 'D01'),
(2, 'Body Repair', 'Active', 'D02'),
(3, 'General Repair', 'Active', 'D03'),
(4, 'Tire', 'Active', 'D04'),
(5, 'Accounting', 'Active', 'D06');
-- --------------------------------------------------------
--
-- Table structure for table `rims_division_branch`
--
CREATE TABLE IF NOT EXISTS `rims_division_branch` (
`id` int(11) NOT NULL,
`division_id` int(11) NOT NULL,
`branch_id` int(11) NOT NULL,
`email` varchar(60) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
--
-- Dumping data for table `rims_division_branch`
--
INSERT INTO `rims_division_branch` (`id`, `division_id`, `branch_id`, `email`) VALUES
(1, 5, 4, NULL),
(2, 5, 1, 'accounting@test.com'),
(3, 3, 11, NULL),
(4, 1, 1, 'hr@test.com'),
(5, 2, 12, NULL),
(6, 1, 12, NULL),
(7, 5, 12, NULL),
(8, 4, 12, NULL),
(9, 3, 12, NULL),
(10, 3, 1, 'gr@test.com');
-- --------------------------------------------------------
--
-- Table structure for table `rims_division_position`
--
CREATE TABLE IF NOT EXISTS `rims_division_position` (
`id` int(11) NOT NULL,
`division_id` int(11) NOT NULL,
`position_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
--
-- Dumping data for table `rims_division_position`
--
INSERT INTO `rims_division_position` (`id`, `division_id`, `position_id`) VALUES
(1, 1, 4),
(2, 1, 7),
(3, 3, 4),
(4, 3, 6),
(6, 4, 4),
(7, 5, 7);
-- --------------------------------------------------------
--
-- Table structure for table `rims_employee`
--
CREATE TABLE IF NOT EXISTS `rims_employee` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`local_address` text NOT NULL,
`home_address` text NOT NULL,
`province_id` int(11) NOT NULL,
`city_id` int(11) NOT NULL,
`home_province` int(11) NOT NULL,
`home_city` int(11) NOT NULL,
`sex` varchar(10) NOT NULL,
`email` varchar(60) NOT NULL,
`id_card` varchar(30) NOT NULL,
`driving_licence` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL DEFAULT 'Active',
`salary_type` varchar(50) NOT NULL,
`basic_salary` decimal(10,2) NOT NULL,
`payment_type` varchar(50) NOT NULL,
`code` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=28 ;
--
-- Dumping data for table `rims_employee`
--
INSERT INTO `rims_employee` (`id`, `name`, `local_address`, `home_address`, `province_id`, `city_id`, `home_province`, `home_city`, `sex`, `email`, `id_card`, `driving_licence`, `status`, `salary_type`, `basic_salary`, `payment_type`, `code`) VALUES
(26, 'Test', 'Jl perdana', 'jl perdana', 12, 38, 12, 38, 'Male', 'test@test.com', '12314124123231', '79879776870334', 'Active', 'Monthly', '2000000.00', 'Transfer', 'E01'),
(27, 'Sunar', 'Bedeng B123, Pondok Kelapa', 'Simpang 5, pati', 14, 55, 1, 1, 'Male', 's@raperind.com', '834343k3434', '34234', 'Active', 'Daily', '75000.00', 'Transfer', '1001');
-- --------------------------------------------------------
--
-- Table structure for table `rims_employee_bank`
--
CREATE TABLE IF NOT EXISTS `rims_employee_bank` (
`id` int(11) NOT NULL,
`bank_id` int(11) NOT NULL,
`employee_id` int(11) NOT NULL,
`account_no` varchar(20) NOT NULL,
`account_name` varchar(100) NOT NULL,
`status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `rims_employee_bank`
--
INSERT INTO `rims_employee_bank` (`id`, `bank_id`, `employee_id`, `account_no`, `account_name`, `status`) VALUES
(3, 5, 26, 'Ardi', '12312321312', 0),
(4, 7, 27, '2312', '3545345', 0);
-- --------------------------------------------------------
--
-- Table structure for table `rims_employee_deductions`
--
CREATE TABLE IF NOT EXISTS `rims_employee_deductions` (
`id` int(11) NOT NULL,
`employee_id` int(11) NOT NULL,
`deduction_id` int(11) NOT NULL,
`amount` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `rims_employee_deductions`
--
INSERT INTO `rims_employee_deductions` (`id`, `employee_id`, `deduction_id`, `amount`) VALUES
(1, 27, 1, '50000.00'),
(2, 27, 2, '50000.00'),
(3, 27, 3, '50000.00'),
(4, 26, 1, '300000.00');
-- --------------------------------------------------------
--
-- Table structure for table `rims_employee_division_position_level`
--
CREATE TABLE IF NOT EXISTS `rims_employee_division_position_level` (
`id` int(11) NOT NULL,
`employee_id` int(11) NOT NULL,
`division_id` int(11) NOT NULL,
`position_id` int(11) NOT NULL,
`level_id` int(11) NOT NULL,
`status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `rims_employee_division_position_level`
--
INSERT INTO `rims_employee_division_position_level` (`id`, `employee_id`, `division_id`, `position_id`, `level_id`, `status`) VALUES
(2, 26, 1, 4, 3, 0);
-- --------------------------------------------------------
--
-- Table structure for table `rims_employee_incentives`
--
CREATE TABLE IF NOT EXISTS `rims_employee_incentives` (
`id` int(11) NOT NULL,
`employee_id` int(11) DEFAULT NULL,
`incentive_id` int(11) DEFAULT NULL,
`amount` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `rims_employee_incentives`
--
INSERT INTO `rims_employee_incentives` (`id`, `employee_id`, `incentive_id`, `amount`) VALUES
(1, 26, 2, '40000.00'),
(2, 27, 2, '75000.00'),
(3, 27, 3, '200000.00'),
(4, 27, 4, '300000.00');
-- --------------------------------------------------------
--
-- Table structure for table `rims_employee_mobile`
--
CREATE TABLE IF NOT EXISTS `rims_employee_mobile` (
`id` int(11) NOT NULL,
`employee_id` int(11) DEFAULT NULL,
`mobile_no` varchar(20) DEFAULT NULL,
`status` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `rims_employee_mobile`
--
INSERT INTO `rims_employee_mobile` (`id`, `employee_id`, `mobile_no`, `status`) VALUES
(1, 26, '08754868782', NULL),
(2, 27, '0877222111', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `rims_employee_phone`
--
CREATE TABLE IF NOT EXISTS `rims_employee_phone` (
`id` int(11) NOT NULL,
`employee_id` int(11) DEFAULT NULL,
`phone_no` varchar(20) DEFAULT NULL,
`status` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `rims_employee_phone`
--
INSERT INTO `rims_employee_phone` (`id`, `employee_id`, `phone_no`, `status`) VALUES
(1, 26, '0921266616', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `rims_incentive`
--
CREATE TABLE IF NOT EXISTS `rims_incentive` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`description` text NOT NULL,
`amount` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `rims_incentive`
--
INSERT INTO `rims_incentive` (`id`, `name`, `description`, `amount`) VALUES
(2, 'Overtime', 'Work hour > 10 hours', ''),
(3, 'Handphone', 'handphone', ''),
(4, 'Transport', 'transport', '');
-- --------------------------------------------------------
--
-- Table structure for table `rims_level`
--
CREATE TABLE IF NOT EXISTS `rims_level` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
--
-- Dumping data for table `rims_level`
--
INSERT INTO `rims_level` (`id`, `name`, `status`) VALUES
(3, 'Junior', 'Active'),
(4, 'Senior', 'Active'),
(5, 'Intern', 'Active'),
(6, 'Head', 'Active'),
(7, 'Manager', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_onvetrains`
--
CREATE TABLE IF NOT EXISTS `rims_onvetrains` (
`id` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_position`
--
CREATE TABLE IF NOT EXISTS `rims_position` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
--
-- Dumping data for table `rims_position`
--
INSERT INTO `rims_position` (`id`, `name`, `status`) VALUES
(4, 'Mechanic', 'Active'),
(5, 'Manager', 'Active'),
(6, 'Service Advisor', 'Active'),
(7, 'Accounting', 'Active'),
(8, 'Finance', 'Active'),
(9, 'Supervisor', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_position_level`
--
CREATE TABLE IF NOT EXISTS `rims_position_level` (
`id` int(11) NOT NULL,
`position_id` int(11) NOT NULL,
`level_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
--
-- Dumping data for table `rims_position_level`
--
INSERT INTO `rims_position_level` (`id`, `position_id`, `level_id`) VALUES
(3, 9, 6),
(4, 4, 3),
(5, 4, 4),
(6, 4, 6),
(7, 4, 5);
-- --------------------------------------------------------
--
-- Table structure for table `rims_powercc`
--
CREATE TABLE IF NOT EXISTS `rims_powercc` (
`id` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_product`
--
CREATE TABLE IF NOT EXISTS `rims_product` (
`id` int(11) NOT NULL,
`code` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`description` text NOT NULL,
`production_year` int(11) NOT NULL,
`product_master_category_id` int(11) NOT NULL,
`product_sub_master_category_id` int(11) NOT NULL,
`product_sub_category_id` int(11) NOT NULL,
`product_specification_type_id` int(11) NOT NULL,
`vehicle_car_make_id` int(11) NOT NULL,
`vehicle_car_model_id` int(11) NOT NULL,
`purchase_price` decimal(10,2) NOT NULL,
`minimum_selling_price` decimal(10,2) NOT NULL,
`hpp` decimal(10,2) NOT NULL,
`retail_price` decimal(10,2) NOT NULL,
`minimum_stock` int(11) NOT NULL,
`margin_type` int(11) NOT NULL,
`margin_amount` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_product_master_category`
--
CREATE TABLE IF NOT EXISTS `rims_product_master_category` (
`id` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`description` text,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;
--
-- Dumping data for table `rims_product_master_category`
--
INSERT INTO `rims_product_master_category` (`id`, `code`, `name`, `description`, `status`) VALUES
(1, 'A', 'Air, Fuel, Emission & Exhaust', '', 'Active'),
(2, 'B', 'Accessories, Body & Wipers', '', 'Active'),
(3, 'C', 'Batteries, Electrical & Wiring', '', 'Active'),
(4, 'D', 'Brakes, Steering & Suspension', '', 'Active'),
(5, 'E', 'Cooling & Heating', '', 'Active'),
(6, 'F', 'Electronics & Navigation', '', 'Active'),
(7, 'G', 'Engines & Ignition', '', 'Active'),
(8, 'H', 'Tools, Fluids & Garage', '', 'Active'),
(9, 'I', 'Transmission & Drivetrain', '', 'Active'),
(10, 'J', 'Service Material & Supply ', 'Bahan/Perlengkapan', 'Active'),
(11, 'K', 'Service Tools', 'Tools/Alat', 'Active'),
(12, 'L', 'In-Out Parts (Bonus)', '', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_product_specification_info`
--
CREATE TABLE IF NOT EXISTS `rims_product_specification_info` (
`id` int(11) NOT NULL,
`product_specification_type_id` int(11) NOT NULL,
`name` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_product_specification_type`
--
CREATE TABLE IF NOT EXISTS `rims_product_specification_type` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`description` text NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_product_sub_category`
--
CREATE TABLE IF NOT EXISTS `rims_product_sub_category` (
`id` int(11) NOT NULL,
`product_master_category` int(11) NOT NULL,
`product_sub_master_category_id` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`description` text,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1116 ;
--
-- Dumping data for table `rims_product_sub_category`
--
INSERT INTO `rims_product_sub_category` (`id`, `product_master_category`, `product_sub_master_category_id`, `code`, `name`, `description`, `status`) VALUES
(1, 1, 1, '01', 'Air Cleaner Assemblies', '', 'Active'),
(2, 1, 1, '02', 'Air Cleaner Components', '', 'Active'),
(3, 1, 1, '03', 'Air Filter Hardware', '', 'Active'),
(4, 1, 1, '04', 'Air Filter Housing', '', 'Active'),
(5, 1, 1, '05', 'Air Filter Oils & Cleaners', '', 'Active'),
(6, 1, 1, '06', 'Air Filters', '', 'Active'),
(7, 1, 1, '07', 'Air Filters Components', '', 'Active'),
(8, 1, 1, '08', 'Air Intake Kits', '', 'Active'),
(9, 1, 1, '09', 'Cabin Air Filter Hardware', '', 'Active'),
(10, 1, 1, '10', 'Cabin Air Filters', '', 'Active'),
(11, 1, 1, '11', 'Dual Flanged Oval Filters', '', 'Active'),
(12, 1, 1, '12', 'Filters - Performance', '', 'Active'),
(13, 1, 1, '13', 'Motorcycle Air Filters', '', 'Active'),
(14, 1, 1, '14', 'Oval Straight Air Filters', '', 'Active'),
(15, 1, 1, '15', 'Oval Tapered Air Filters', '', 'Active'),
(16, 1, 1, '16', 'Rectangular Air Filters', '', 'Active'),
(17, 1, 1, '17', 'Round Straight Air Filters', '', 'Active'),
(18, 1, 1, '18', 'Round Tapered Air Filters', '', 'Active'),
(19, 1, 1, '19', 'Triangular Air Filters', '', 'Active'),
(20, 1, 1, '20', 'Universal Air Filters', '', 'Active'),
(21, 1, 2, '01', 'Accelerator Cables', '', 'Active'),
(22, 1, 2, '02', 'Air Cleaner Assemblies', '', 'Active'),
(23, 1, 2, '03', 'Carburetor Adapter Plates', '', 'Active'),
(24, 1, 2, '04', 'Carburetor Choke Parts', '', 'Active'),
(25, 1, 2, '05', 'Carburetor Dash Pots', '', 'Active'),
(26, 1, 2, '06', 'Carburetor Floats', '', 'Active'),
(27, 1, 2, '07', 'Carburetor Fuel Parts', '', 'Active'),
(28, 1, 2, '08', 'Carburetor Gaskets & Spacers', '', 'Active'),
(29, 1, 2, '09', 'Carburetor Hardware', '', 'Active'),
(30, 1, 2, '10', 'Carburetor Parts', '', 'Active'),
(31, 1, 2, '11', 'Carburetor Repair Kits', '', 'Active'),
(32, 1, 2, '12', 'Carburetor Solenoids', '', 'Active'),
(33, 1, 2, '13', 'Carburetor Studs & Kits', '', 'Active'),
(34, 1, 2, '14', 'Carburetors', '', 'Active'),
(35, 1, 2, '15', 'Carburetors - Performance', '', 'Active'),
(36, 1, 2, '16', 'Holley Jets', '', 'Active'),
(37, 1, 2, '17', 'Intake Manifold Components', '', 'Active'),
(38, 1, 2, '18', 'Intake Manifold Hardware', '', 'Active'),
(39, 1, 2, '19', 'Intake Manifold', '', 'Active'),
(40, 1, 3, '01', 'Air Injection Air Supplies', '', 'Active'),
(41, 1, 3, '02', 'Air Injection Pipes & Tubes', '', 'Active'),
(42, 1, 3, '03', 'Air Injection Valves', '', 'Active'),
(43, 1, 3, '04', 'Air Pump Filters', '', 'Active'),
(44, 1, 3, '05', 'Air Pump Hoses & Grommets', '', 'Active'),
(45, 1, 3, '06', 'Auxilliary Air Valve Parts', '', 'Active'),
(46, 1, 3, '07', 'Auxilliary Air Valves', '', 'Active'),
(47, 1, 3, '08', 'Canister Purge Solenoids', '', 'Active'),
(48, 1, 3, '09', 'Canister Purge Valves', '', 'Active'),
(49, 1, 3, '10', 'Connectors, Valves & Solenoids', '', 'Active'),
(50, 1, 3, '11', 'EGR Valve Parts & Accessories', '', 'Active'),
(51, 1, 3, '12', 'EGR Valves', '', 'Active'),
(52, 1, 3, '13', 'Emission Gaskets & Seals', '', 'Active'),
(53, 1, 3, '14', 'Emission Hardware', '', 'Active'),
(54, 1, 3, '15', 'Emission Mounts', '', 'Active'),
(55, 1, 3, '16', 'Emission Sensors & Solenoids', '', 'Active'),
(56, 1, 3, '18', 'Oxygen Sensor Components', '', 'Active'),
(57, 1, 3, '19', 'PCV Valves & Related', '', 'Active'),
(58, 1, 3, '20', 'Smog Pumps & Pulleys', '', 'Active'),
(59, 1, 3, '21', 'Vacuum Distributor Parts', '', 'Active'),
(60, 1, 3, '22', 'Vacuum Pump Lines & Fittings', '', 'Active'),
(61, 1, 3, '23', 'Vacuum Valves & Brackets', '', 'Active'),
(62, 1, 3, '24', 'Vacuum Valves & Levers', '', 'Active'),
(63, 1, 4, '01', 'Catalytic Converter Brackets', '', 'Active'),
(64, 1, 4, '02', 'Catalytic Converters', '', 'Active'),
(65, 1, 4, '03', 'Exhaust Adapters & Connectors', '', 'Active'),
(66, 1, 4, '04', 'Exhaust Clamps', '', 'Active'),
(67, 1, 4, '05', 'Exhaust Flange Components', '', 'Active'),
(68, 1, 4, '06', 'Exhaust Hangers & Hardware', '', 'Active'),
(69, 1, 4, '07', 'Exhaust Hardware', '', 'Active'),
(70, 1, 4, '08', 'Exhaust Header Hardware', '', 'Active'),
(71, 1, 4, '09', 'Exhaust Headers', '', 'Active'),
(72, 1, 4, '10', 'Exhaust Headers - Performance', '', 'Active'),
(73, 1, 4, '11', 'Exhaust Heat Shields', '', 'Active'),
(74, 1, 4, '12', 'Exhaust Pipes & Related', '', 'Active'),
(75, 1, 4, '13', 'Exhaust Resonators', '', 'Active'),
(76, 1, 4, '14', 'Exhaust Seals', '', 'Active'),
(77, 1, 4, '15', 'Exhaust System Gaskets', '', 'Active'),
(78, 1, 4, '16', 'Exhaust System Kits', '', 'Active'),
(79, 1, 4, '17', 'Exhaust System Kits - Performa', '', 'Active'),
(80, 1, 4, '18', 'Exhaust Tail Pipes', '', 'Active'),
(81, 1, 4, '19', 'Exhaust Tail Spouts', '', 'Active'),
(82, 1, 4, '20', 'Exhaust Tips', '', 'Active'),
(83, 1, 4, '21', 'Exhaust Tubing', '', 'Active'),
(84, 1, 4, '22', 'Header Components', '', 'Active'),
(85, 1, 4, '23', 'Muffler Installation & Repair', '', 'Active'),
(86, 1, 4, '24', 'Muffler Tips', '', 'Active'),
(87, 1, 4, '25', 'Mufflers', '', 'Active'),
(88, 1, 4, '26', 'Mufflers - Performance', '', 'Active'),
(89, 1, 5, '01', 'Fuel Filter Components', '', 'Active'),
(90, 1, 5, '02', 'Fuel Filter Hoses', '', 'Active'),
(91, 1, 5, '03', 'Fuel Filters', '', 'Active'),
(92, 1, 5, '04', 'Oil Filter Components', '', 'Active'),
(93, 1, 5, '05', 'Oil Filters', '', 'Active'),
(94, 1, 5, '06', 'PCV Valves & Related', '', 'Active'),
(95, 1, 6, '01', 'Engine Air Intake Parts', '', 'Active'),
(96, 1, 6, '02', 'Engine RPM Components', '', 'Active'),
(97, 1, 6, '03', 'Fuel Injection Air Flow Meters', '', 'Active'),
(98, 1, 6, '04', 'Fuel Injection Electronics', '', 'Active'),
(99, 1, 6, '05', 'Fuel Injection Gaskets', '', 'Active'),
(100, 1, 6, '06', 'Fuel Injection Hardware', '', 'Active'),
(101, 1, 6, '07', 'Fuel Injection Idle Air Parts', '', 'Active'),
(102, 1, 6, '08', 'Fuel Injection Intake Parts', '', 'Active'),
(103, 1, 6, '09', 'Fuel Injection Kits', '', 'Active'),
(104, 1, 6, '10', 'Fuel Injection Lines', '', 'Active'),
(105, 1, 6, '11', 'Fuel Injection Parts', '', 'Active'),
(106, 1, 6, '12', 'Fuel Injection Rails', '', 'Active'),
(107, 1, 6, '13', 'Fuel Injection Regulators', '', 'Active'),
(108, 1, 6, '14', 'Fuel Injection seals', '', 'Active'),
(109, 1, 6, '15', 'Fuel Injection Solenoids', '', 'Active'),
(110, 1, 6, '16', 'Fuel Injection Valves', '', 'Active'),
(111, 1, 6, '17', 'Fuel Injectors', '', 'Active'),
(112, 1, 6, '18', 'Fuel Lines & Kits', '', 'Active'),
(113, 1, 6, '19', 'Fuel System - Performance', '', 'Active'),
(114, 1, 6, '20', 'Throttle Body Parts', '', 'Active'),
(115, 1, 6, '21', 'Vacuum Parts', '', 'Active'),
(116, 1, 7, '01', 'Fuel Injection Pumps', '', 'Active'),
(117, 1, 7, '02', 'Fuel Injection System componen', '', 'Active'),
(118, 1, 7, '03', 'Fuel Pump Assemblies', '', 'Active'),
(119, 1, 7, '04', 'Fuel Pump Components', '', 'Active'),
(120, 1, 7, '05', 'Fuel Pump Electronics', '', 'Active'),
(121, 1, 7, '06', 'Fuel Pump Hardware', '', 'Active'),
(122, 1, 7, '07', 'Fuel Pump Harnesses', '', 'Active'),
(123, 1, 7, '08', 'Fuel Pump Hoses', '', 'Active'),
(124, 1, 7, '09', 'Fuel Pump Lines', '', 'Active'),
(125, 1, 7, '10', 'Fuel Pump Parts', '', 'Active'),
(126, 1, 7, '11', 'Fuel Pump Pushrods', '', 'Active'),
(127, 1, 7, '12', 'Fuel Pump Seals', '', 'Active'),
(128, 1, 7, '13', 'Fuel Pumps', '', 'Active'),
(129, 1, 7, '14', 'Fuel Pumps - Performance', '', 'Active'),
(130, 1, 7, '15', 'Fuel Sensors', '', 'Active'),
(131, 1, 7, '16', 'Fuel Tank Hardware', '', 'Active'),
(132, 1, 7, '17', 'Fuel Tank Pickup Lines', '', 'Active'),
(133, 1, 7, '18', 'Fuel Tank Sending Units', '', 'Active'),
(134, 1, 7, '19', 'Fuel Tank Straps', '', 'Active'),
(135, 1, 7, '20', 'Fuel Tank Valves', '', 'Active'),
(136, 1, 7, '21', 'Fuel Tanks', '', 'Active'),
(137, 1, 7, '22', 'Fuel Tanks & Sending Units', '', 'Active'),
(138, 1, 7, '23', 'Fuel Tanks Filler Necks', '', 'Active'),
(139, 1, 7, '24', 'Fuel Tanks Hardware', '', 'Active'),
(140, 1, 7, '25', 'Gas Caps', '', 'Active'),
(141, 1, 8, '01', 'Carbon Dioxide Components', '', 'Active'),
(142, 1, 8, '02', 'Carbon dioxide Fuel Bars', '', 'Active'),
(143, 1, 8, '03', 'Cabon Dioxide Purge Systems', '', 'Active'),
(144, 1, 8, '04', 'Carbon Dioxide Sprayers', '', 'Active'),
(145, 1, 8, '05', 'Carbon Dioxide System Hoses', '', 'Active'),
(146, 1, 8, '06', 'carbon Dioxide System Switches', '', 'Active'),
(147, 1, 8, '07', 'Carbon dioxide Tanks', '', 'Active'),
(148, 1, 8, '08', 'Nitrous Bottles & Related', '', 'Active'),
(149, 1, 8, '09', 'Nitrous Oxide Accessories', '', 'Active'),
(150, 1, 8, '10', 'Nitrous Oxide Controllers', '', 'Active'),
(151, 1, 8, '11', 'Nitrous Oxide Distribution', '', 'Active'),
(152, 1, 8, '12', 'Nitrous Oxide Filters', '', 'Active'),
(153, 1, 8, '13', 'Nitrous Oxide Fittings', '', 'Active'),
(154, 1, 8, '14', 'Nitrous Oxide Gauges & Valves', '', 'Active'),
(155, 1, 8, '15', 'Nitrous Oxide Hardware', '', 'Active'),
(156, 1, 8, '16', 'Nitrous Oxide Hoses', '', 'Active'),
(157, 1, 8, '17', 'Nitrous Oxide Injection System', '', 'Active'),
(158, 1, 8, '18', 'Nitrous Oxide Jets', '', 'Active'),
(159, 1, 8, '19', 'Nitrous Oxide Purge Kits', '', 'Active'),
(160, 1, 8, '20', 'Nitrous Oxide Solenoids', '', 'Active'),
(161, 1, 8, '21', 'Nitrous Oxide Tools', '', 'Active'),
(162, 1, 9, '01', 'Oxygen Sensor Components', '', 'Active'),
(163, 1, 9, '02', 'Oxygen Sensors', '', 'Active'),
(164, 1, 10, '01', 'Intercoolers', '', 'Active'),
(165, 1, 10, '02', 'Small Block Superchargers', '', 'Active'),
(166, 1, 10, '03', 'Supercharger Belts & Pulleys', '', 'Active'),
(167, 1, 10, '04', 'Supercharger Gaskets & Seals', '', 'Active'),
(168, 1, 10, '05', 'Supercharger Parts', '', 'Active'),
(169, 1, 10, '06', 'Superchargers', '', 'Active'),
(170, 1, 10, '07', 'Turbocharger Gaskets & Seals', '', 'Active'),
(171, 1, 10, '08', 'Turbocharger Hardware', '', 'Active'),
(172, 1, 10, '09', 'Turbocharger Hoses', '', 'Active'),
(173, 1, 10, '10', 'Turbocharger Parts', '', 'Active'),
(174, 1, 10, '11', 'Turbochargers', '', 'Active'),
(175, 2, 1, '01', 'Air Fresheners & Fragrances', '', 'Active'),
(176, 2, 1, '02', 'Brushes & Vacuums', '', 'Active'),
(177, 2, 1, '03', 'Buckets, Hoses & Nozzles', '', 'Active'),
(178, 2, 1, '04', 'Bug & Tar Removers', '', 'Active'),
(179, 2, 1, '05', 'Carpet & Upholstery Cleaners', '', 'Active'),
(180, 2, 1, '06', 'Cleaners & Polishes', '', 'Active'),
(181, 2, 1, '07', 'Headlight Restoration Kits', '', 'Active'),
(182, 2, 1, '08', 'Leather Cleaners', '', 'Active'),
(183, 2, 1, '09', 'Protectants', '', 'Active'),
(184, 2, 1, '10', 'Shop Towels', '', 'Active'),
(185, 2, 1, '11', 'Sponges, Wash Towels & Chamois', '', 'Active'),
(186, 2, 1, '12', 'Tire Cleaners & Polishes', '', 'Active'),
(187, 2, 1, '13', 'Vehicle Care kits', '', 'Active'),
(188, 2, 1, '14', 'Wash & Shampoos', '', 'Active'),
(189, 2, 1, '15', 'Waxes', '', 'Active'),
(190, 2, 1, '16', 'Window Cleaning Tools', '', 'Active'),
(191, 2, 2, '01', 'Air Bag Components', '', 'Active'),
(192, 2, 2, '02', 'Antennas & Accessories', '', 'Active'),
(193, 2, 2, '03', 'Arm Rest', '', 'Active'),
(194, 2, 2, '04', 'Body Panels & Molding', '', 'Active'),
(195, 2, 2, '05', 'Bulk Items', '', 'Active'),
(196, 2, 2, '06', 'Bumper Components', '', 'Active'),
(197, 2, 2, '07', 'Bumpers', '', 'Active'),
(198, 2, 2, '08', 'Dashboard & Console', '', 'Active'),
(199, 2, 2, '09', 'Door Parts', '', 'Active'),
(200, 2, 2, '10', 'Fender Parts & Accessories', '', 'Active'),
(201, 2, 2, '11', 'Fenders', '', 'Active'),
(202, 2, 2, '12', 'Fuel doors & Related', '', 'Active'),
(203, 2, 2, '13', 'Glass & Window repair', '', 'Active'),
(204, 2, 2, '14', 'Headlamps, Headlights & Parts', '', 'Active'),
(205, 2, 2, '15', 'Hood & Front End', '', 'Active'),
(206, 2, 2, '16', 'Horn Parts', '', 'Active'),
(207, 2, 2, '17', 'Lifts, Latches & Handles', '', 'Active'),
(208, 2, 2, '18', 'Mirrors & Lights', '', 'Active'),
(209, 2, 2, '19', 'Pedals', '', 'Active'),
(210, 2, 2, '20', 'Props, Latches & Mounts', '', 'Active'),
(211, 2, 2, '21', 'Roof tops, Parts & Racks', '', 'Active'),
(212, 2, 2, '22', 'Running Boards & steps', '', 'Active'),
(213, 2, 2, '23', 'Seats', '', 'Active'),
(214, 2, 2, '24', 'Trailer & Towing', '', 'Active'),
(215, 2, 2, '25', 'Trailer Hitch & accessories', '', 'Active'),
(216, 2, 2, '26', 'Trailer Winches', '', 'Active'),
(217, 2, 2, '27', 'Trunk & Tailgate', '', 'Active'),
(218, 2, 2, '28', 'Undercar Protection', '', 'Active'),
(219, 2, 2, '29', 'Windshields, Doors & Windows', '', 'Active'),
(220, 2, 3, '01', 'Body Styling - Performance', '', 'Active'),
(221, 2, 3, '02', 'Body Styling Kits - Performanc', '', 'Active'),
(222, 2, 3, '03', 'Chrome & Dress-Up', '', 'Active'),
(223, 2, 3, '04', 'Chrome & Dress-Up covers', '', 'Active'),
(224, 2, 3, '05', 'Chrome Accessories', '', 'Active'),
(225, 2, 3, '06', 'Chrome Bolts & Brackets', '', 'Active'),
(226, 2, 3, '07', 'Chrome shift Handles', '', 'Active'),
(227, 2, 3, '08', 'Decals & Emblems', '', 'Active'),
(228, 2, 3, '09', 'License Plate Frames', '', 'Active'),
(229, 2, 3, '10', 'Steering Wheel Covers', '', 'Active'),
(230, 2, 3, '11', 'Steering Wheels & Accessories', '', 'Active'),
(231, 2, 3, '12', 'Steering Wheels & Related', '', 'Active'),
(232, 2, 3, '13', 'Wheel Covers', '', 'Active'),
(233, 2, 4, '01', 'ATV Covers', '', 'Active'),
(234, 2, 4, '02', 'Bench Seat Covers', '', 'Active'),
(235, 2, 4, '03', 'Bucket Seat Covers', '', 'Active'),
(236, 2, 4, '04', 'Bug Guards & Shields', '', 'Active'),
(237, 2, 4, '05', 'Bumper Covers', '', 'Active'),
(238, 2, 4, '06', 'Canopy Shelters & Accessories', '', 'Active'),
(239, 2, 4, '07', 'Car Covers & Accessories', '', 'Active'),
(240, 2, 4, '08', 'Dashboard & Console', '', 'Active'),
(241, 2, 4, '09', 'Floor Coverings & Protectors', '', 'Active'),
(242, 2, 4, '10', 'Floormats', '', 'Active'),
(243, 2, 4, '11', 'Front End Covers & Bras', '', 'Active'),
(244, 2, 4, '12', 'Guards, Flaps & Film', '', 'Active'),
(245, 2, 4, '13', 'Motorcycle Covers', '', 'Active'),
(246, 2, 4, '14', 'Pet Pads & Protectors', '', 'Active'),
(247, 2, 4, '15', 'Seat Covers', '', 'Active'),
(248, 2, 4, '16', 'Sun Shades & Shields', '', 'Active'),
(249, 2, 4, '17', 'Sun Visors & Clips', '', 'Active'),
(250, 2, 4, '18', 'Tire & wheel Covers', '', 'Active'),
(251, 2, 4, '19', 'Undercar Protection', '', 'Active'),
(252, 2, 4, '20', 'Visors', '', 'Active'),
(253, 2, 4, '21', 'Window Covers', '', 'Active'),
(254, 2, 4, '22', 'Window Tint', '', 'Active'),
(255, 2, 5, '01', 'Coating & Under-Coating', '', 'Active'),
(256, 2, 5, '02', 'filler Mixing Pallettes', '', 'Active'),
(257, 2, 5, '03', 'Masking Film, Tape & Supplies', '', 'Active'),
(258, 2, 5, '04', 'Paint Removers & Strippers', '', 'Active'),
(259, 2, 5, '05', 'Paints & Enamels', '', 'Active'),
(260, 2, 5, '06', 'Polishers, Buffers & Pads', '', 'Active'),
(261, 2, 5, '07', 'Repair Parts & Accessories', '', 'Active'),
(262, 2, 5, '08', 'Repair Vinyl & Leather', '', 'Active'),
(263, 2, 5, '09', 'Respirators & Accessories', '', 'Active'),
(264, 2, 5, '10', 'Scratch Removers', '', 'Active'),
(265, 2, 5, '11', 'Touch-Up Liquids', '', 'Active'),
(266, 2, 5, '12', 'Touch-Up sprays', '', 'Active'),
(267, 2, 5, '13', 'Truck & Van Paints', '', 'Active'),
(268, 2, 5, '14', 'Wax & Grease removers', '', 'Active'),
(269, 2, 6, '01', 'Alarm Relays & Switches', '', 'Active'),
(270, 2, 6, '02', 'Alcohol Detectors', '', 'Active'),
(271, 2, 6, '03', 'Back-Up Systems', '', 'Active'),
(272, 2, 6, '04', 'Car Alarms & Accessories', '', 'Active'),
(273, 2, 6, '05', 'Deer Warning Whistles', '', 'Active'),
(274, 2, 6, '06', 'Emergency Roadside Kits', '', 'Active'),
(275, 2, 6, '07', 'Fire Extinguishers', '', 'Active'),
(276, 2, 6, '08', 'First Aid Kits', '', 'Active'),
(277, 2, 6, '09', 'Flares & Reflectors', '', 'Active'),
(278, 2, 6, '10', 'Key Covers & Storage', '', 'Active'),
(279, 2, 6, '11', 'Keyless Entry Systems', '', 'Active'),
(280, 2, 6, '12', 'Keys & Accessories', '', 'Active'),
(281, 2, 6, '13', 'Locks', '', 'Active'),
(282, 2, 6, '14', 'Remote Starters & Kits', '', 'Active'),
(283, 2, 6, '15', 'Safety Equipment', '', 'Active'),
(284, 2, 7, '01', '12-Volt Interior Heaters', '', 'Active'),
(285, 2, 7, '02', 'Cable chains', '', 'Active'),
(286, 2, 7, '03', 'De-Icers & Scrapers', '', 'Active'),
(287, 2, 7, '04', 'Engine & Battery Heaters', '', 'Active'),
(288, 2, 7, '05', 'Heat & sound Insulation', '', 'Active'),
(289, 2, 7, '06', 'Snow Plows & Accessories', '', 'Active'),
(290, 2, 7, '07', 'Snow Shovels', '', 'Active'),
(291, 2, 7, '08', 'Tire Chains', '', 'Active'),
(292, 2, 8, '01', 'Cab & Glove Box Organizers', '', 'Active'),
(293, 2, 8, '02', 'Cargo Carriers', '', 'Active'),
(294, 2, 8, '03', 'Cargo Dividers', '', 'Active'),
(295, 2, 8, '04', 'Cargo Nets', '', 'Active'),
(296, 2, 8, '05', 'Cargo Systems', '', 'Active'),
(297, 2, 8, '06', 'Carrier Accessories', '', 'Active'),
(298, 2, 8, '07', 'CD & DVD Holders', '', 'Active'),
(299, 2, 8, '08', 'Consoles & Parts', '', 'Active'),
(300, 2, 8, '09', 'Convertible Interior Covers', '', 'Active'),
(301, 2, 8, '10', 'Coolers', '', 'Active'),
(302, 2, 8, '11', 'Cup Holders', '', 'Active'),
(303, 2, 8, '12', 'Liquid transfer Thanks', '', 'Active'),
(304, 2, 8, '13', 'Miscellaneous Storage', '', 'Active'),
(305, 2, 8, '14', 'Roof Racks & Parts', '', 'Active'),
(306, 2, 8, '15', 'Saddle Bags', '', 'Active'),
(307, 2, 8, '16', 'Trunk & Tailgate', '', 'Active'),
(308, 2, 8, '17', 'Universal Pet Barriers', '', 'Active'),
(309, 2, 9, '01', 'Glass & Window Repair', '', 'Active'),
(310, 2, 9, '02', 'Lifts, Latches & Handles', '', 'Active'),
(311, 2, 9, '03', 'Specialty Wiper Blades', '', 'Active'),
(312, 2, 9, '04', 'Sunroof Parts', '', 'Active'),
(313, 2, 9, '05', 'Washer Fluid Reservoirs', '', 'Active'),
(314, 2, 9, '06', 'Washer Pumps & Repair Kits', '', 'Active'),
(315, 2, 9, '07', 'Window Motors & Parts', '', 'Active'),
(316, 2, 9, '08', 'Windshield Wiper Blades', '', 'Active'),
(317, 2, 9, '09', 'Windshield Wiper Motor Covers', '', 'Active'),
(318, 2, 9, '10', 'Windshield Wiper Motors', '', 'Active'),
(319, 2, 9, '11', 'Windshield Wiper Refills', '', 'Active'),
(320, 2, 9, '12', 'Wipers & Washer Parts', '', 'Active'),
(321, 3, 1, '01', 'Air Bag Components', '', 'Active'),
(322, 3, 1, '02', 'Air Bag Modules', '', 'Active'),
(323, 3, 2, '01', 'Accessory Drive Belts', '', 'Active'),
(324, 3, 2, '02', 'Alternator Bolts & Sets', '', 'Active'),
(325, 3, 2, '03', 'Alternator Brackets', '', 'Active'),
(326, 3, 2, '04', 'Alternator Brush Sets', '', 'Active'),
(327, 3, 2, '05', 'Alternator Commutator End Bear', '', 'Active'),
(328, 3, 2, '06', 'Alternator Components', '', 'Active'),
(329, 3, 2, '07', 'Alternator Connectors', '', 'Active'),
(330, 3, 2, '08', 'Alternator Drive End Bearings', '', 'Active'),
(331, 3, 2, '09', 'Alternator Hardware', '', 'Active'),
(332, 3, 2, '10', 'Alternator Pulleys', '', 'Active'),
(333, 3, 2, '11', 'Alternator Rectifier Sets', '', 'Active'),
(334, 3, 2, '12', 'Alternator Repair Kits', '', 'Active'),
(335, 3, 2, '13', 'Alternator Rotors', '', 'Active'),
(336, 3, 2, '14', 'Alternators', '', 'Active'),
(337, 3, 2, '15', 'Belt Tensioners', '', 'Active'),
(338, 3, 2, '16', 'Belts, Brackets & Bushings', '', 'Active'),
(339, 3, 2, '17', 'Brush Parts', '', 'Active'),
(340, 3, 2, '18', 'Drive Belt Idler & Related', '', 'Active'),
(341, 3, 2, '19', 'Generators', '', 'Active'),
(342, 3, 2, '20', 'Sepertine Belts', '', 'Active'),
(343, 3, 3, '01', 'Automotive Batteries', '', 'Active'),
(344, 3, 3, '02', 'Electronic Batteries', '', 'Active'),
(345, 3, 3, '03', 'Farm & Truck Batteries', '', 'Active'),
(346, 3, 3, '04', 'Golf Cart Batteries', '', 'Active'),
(347, 3, 3, '05', 'Lawn & Garden Batteries', '', 'Active'),
(348, 3, 3, '06', 'Marine Batteries', '', 'Active'),
(349, 3, 3, '07', 'Motorcycle & ATV Batteries', '', 'Active'),
(350, 3, 3, '08', 'Powersport Batteries', '', 'Active'),
(351, 3, 4, '01', 'Battery Accessories', '', 'Active'),
(352, 3, 4, '02', 'Battery Cables', '', 'Active'),
(353, 3, 4, '03', 'Battery Chargers', '', 'Active'),
(354, 3, 4, '04', 'Battery Parts & Tools', '', 'Active'),
(355, 3, 4, '05', 'Battery Straps & Hold-Downs', '', 'Active'),
(356, 3, 4, '06', 'Battery Switches & relays', '', 'Active'),
(357, 3, 4, '07', 'Battery Terminal Components', '', 'Active'),
(358, 3, 4, '08', 'Battery Tools', '', 'Active'),
(359, 3, 4, '09', 'Battery Trays', '', 'Active'),
(360, 3, 5, '01', 'Charging System Harness Parts', '', 'Active'),
(361, 3, 5, '02', 'Drive End Bearings', '', 'Active'),
(362, 3, 5, '03', 'Voltage Regulators', '', 'Active'),
(363, 3, 6, '01', 'Buttons & Knobs', '', 'Active'),
(364, 3, 6, '02', 'Electrical Harness Wire', '', 'Active'),
(365, 3, 6, '03', 'Electrical Tape, Ties & Clamps', '', 'Active'),
(366, 3, 6, '04', 'Extension Cords', '', 'Active'),
(367, 3, 6, '05', 'Heat Shrink Sleeving & Tubing', '', 'Active'),
(368, 3, 6, '06', 'Miscellaneous Wire', '', 'Active'),
(369, 3, 6, '07', 'Pigtails & Sockets', '', 'Active'),
(370, 3, 6, '08', 'Power Cord Reels', '', 'Active'),
(371, 3, 6, '09', 'Primary Wire', '', 'Active'),
(372, 3, 6, '10', 'Soldering Iron & Solder', '', 'Active'),
(373, 3, 6, '11', 'Tolls & Tester', '', 'Active'),
(374, 3, 6, '12', 'Wire Conduit', '', 'Active'),
(375, 3, 6, '13', 'Wire Connectors', '', 'Active'),
(376, 3, 6, '14', 'Wiring Kits', '', 'Active'),
(377, 3, 7, '01', 'Auxilliary Lights', '', 'Active'),
(378, 3, 7, '02', 'Back-Up Lamps & Lights', '', 'Active'),
(379, 3, 7, '03', 'Cornering Lamps & Lights', '', 'Active'),
(380, 3, 7, '04', 'Daytime Running Lamps & Lights', '', 'Active'),
(381, 3, 7, '05', 'Dome Lights & Accessories', '', 'Active'),
(382, 3, 7, '06', 'Emergency Lights', '', 'Active'),
(383, 3, 7, '07', 'Exterior Lights & Bulbs', '', 'Active'),
(384, 3, 7, '08', 'Flashers', '', 'Active'),
(385, 3, 7, '09', 'Fog Lamps & Lights', '', 'Active'),
(386, 3, 7, '10', 'Fuse Blocks, Boxes & Holders', '', 'Active'),
(387, 3, 7, '11', 'Fuses', '', 'Active'),
(388, 3, 7, '12', 'Fusible Links', '', 'Active'),
(389, 3, 7, '13', 'Glass Fuses', '', 'Active'),
(390, 3, 7, '14', 'Headlamps & Lights', '', 'Active'),
(391, 3, 7, '15', 'License Plate Lamps', '', 'Active'),
(392, 3, 7, '16', 'Mirror Lights & Accessories', '', 'Active'),
(393, 3, 7, '17', 'Miscellaneous Accessories', '', 'Active'),
(394, 3, 7, '18', 'Miscellaneous Lamps & Bulbs', '', 'Active'),
(395, 3, 7, '19', 'Parking Lamps & Lights', '', 'Active'),
(396, 3, 7, '20', 'Side Marker Lamps & Lights', '', 'Active'),
(397, 3, 7, '21', 'Spade Fuses', '', 'Active'),
(398, 3, 7, '22', 'Spot & Trouble Lights', '', 'Active'),
(399, 3, 7, '23', 'Tail Lamps & Lights', '', 'Active'),
(400, 3, 7, '24', 'Turn Signal Lights & Bulbs', '', 'Active'),
(401, 3, 8, '01', 'Relays', '', 'Active'),
(402, 3, 8, '02', 'Sensors', '', 'Active'),
(403, 3, 8, '03', 'Switches', '', 'Active'),
(404, 3, 8, '04', 'Off-Road Lamp Relay', '', 'Active'),
(405, 3, 9, '01', 'Starter Brushes', '', 'Active'),
(406, 3, 9, '02', 'Starter Bushings', '', 'Active'),
(407, 3, 9, '03', 'Starter Parts', '', 'Active'),
(408, 3, 9, '04', 'Starter Solenoids & Kits', '', 'Active'),
(409, 3, 9, '05', 'Starters', '', 'Active'),
(410, 4, 1, '01', 'ABS Accumulators & Repair Kits', '', 'Active'),
(411, 4, 1, '02', 'ABS Cables & Brackets', '', 'Active'),
(412, 4, 1, '03', 'ABS Control Modules', '', 'Active'),
(413, 4, 1, '04', 'ABS Harnesses & Connectors', '', 'Active'),
(414, 4, 1, '05', 'ABS Hydraulic Units', '', 'Active'),
(415, 4, 1, '06', 'ABS Pump & Motor Assemblies', '', 'Active'),
(416, 4, 1, '07', 'ABS Rings', '', 'Active'),
(417, 4, 1, '08', 'ABS Speed Sensors', '', 'Active'),
(418, 4, 1, '09', 'ABS Switches, Sensors & Relays', '', 'Active'),
(419, 4, 1, '10', 'ABS Valves & Valve Kits', '', 'Active'),
(420, 4, 2, '01', 'Brake Caliper components', '', 'Active'),
(421, 4, 2, '02', 'Brake Calipers', '', 'Active'),
(422, 4, 3, '01', 'Brake Drum Hardware', '', 'Active'),
(423, 4, 3, '02', 'Brake Drums', '', 'Active'),
(424, 4, 3, '03', 'brake Rotors', '', 'Active'),
(425, 4, 4, '01', 'Brake Adapters & Fittings', '', 'Active'),
(426, 4, 4, '02', 'Brake Adjustment Hardware', '', 'Active'),
(427, 4, 4, '03', 'Brake Bleeders', '', 'Active'),
(428, 4, 4, '04', 'Brake Boosters', '', 'Active'),
(429, 4, 4, '05', 'Brake Cables', '', 'Active'),
(430, 4, 4, '06', 'Brake Clutches', '', 'Active'),
(431, 4, 4, '07', 'Brake Hardware', '', 'Active'),
(432, 4, 4, '08', 'Brake Hoses & Lines', '', 'Active'),
(433, 4, 4, '09', 'Brake Lubricant', '', 'Active'),
(434, 4, 4, '10', 'Brake Master Cylinder Parts', '', 'Active'),
(435, 4, 4, '11', 'Brake Servos & Sensors', '', 'Active'),
(436, 4, 4, '12', 'Brake Shoe Hardware', '', 'Active'),
(437, 4, 4, '13', 'Brake Tools', '', 'Active'),
(438, 4, 4, '14', 'Brake Valves', '', 'Active'),
(439, 4, 4, '15', 'Brake Wheel Cylinders & Kits', '', 'Active'),
(440, 4, 4, '16', 'Parking Brake Parts', '', 'Active'),
(441, 4, 5, '01', 'Brake Pad Components', '', 'Active'),
(442, 4, 5, '02', 'Brake Pads & Shoes', '', 'Active'),
(443, 4, 6, '01', 'Power Steering Control Valves', '', 'Active'),
(444, 4, 6, '02', 'Power Steering Coolers', '', 'Active'),
(445, 4, 6, '03', 'Power Steering Cylinders & Kit', '', 'Active'),
(446, 4, 6, '04', 'Power Steering Filters', '', 'Active'),
(447, 4, 6, '05', 'Power Steering Hose Hardware', '', 'Active'),
(448, 4, 6, '06', 'Power Steering Hoses', '', 'Active'),
(449, 4, 6, '07', 'Power Steering Pulley Bearings', '', 'Active'),
(450, 4, 6, '08', 'Power Steering Pulleys', '', 'Active'),
(451, 4, 6, '09', 'Power Steering Pump Hardware', '', 'Active'),
(452, 4, 6, '10', 'Power Steering Pumps', '', 'Active'),
(453, 4, 6, '11', 'Power Steering Reservoirs', '', 'Active'),
(454, 4, 6, '12', 'Power Steering Seals', '', 'Active'),
(455, 4, 6, '13', 'Power Steering Switches', '', 'Active'),
(456, 4, 7, '01', 'Coil Spring Hardware', '', 'Active'),
(457, 4, 7, '02', 'Coil Springs', '', 'Active'),
(458, 4, 7, '03', 'Leaf Spring Hardware', '', 'Active'),
(459, 4, 7, '04', 'Leaf Springs', '', 'Active'),
(460, 4, 7, '05', 'Shock & Strut Fittings', '', 'Active'),
(461, 4, 7, '06', 'Shock & Strut Installation Gui', '', 'Active'),
(462, 4, 7, '07', 'Shock Absorber Boots', '', 'Active'),
(463, 4, 7, '08', 'Shock Absorber Bumpers', '', 'Active'),
(464, 4, 7, '09', 'Shock Absorber Bushings', '', 'Active'),
(465, 4, 7, '10', 'Shock Absorber Conversion Kit', '', 'Active'),
(466, 4, 7, '11', 'Shock Absorber Hardware', '', 'Active'),
(467, 4, 7, '12', 'Shock Absorber Mounts', '', 'Active'),
(468, 4, 7, '13', 'Shock Absorbers', '', 'Active'),
(469, 4, 7, '14', 'Shocks & Struts Hardware', '', 'Active'),
(470, 4, 7, '15', 'Strut Bearings', '', 'Active'),
(471, 4, 7, '16', 'Strut Bellows', '', 'Active'),
(472, 4, 7, '17', 'Strut Bumpers', '', 'Active'),
(473, 4, 7, '18', 'Strut Hardware', '', 'Active'),
(474, 4, 7, '19', 'Strut Mounts', '', 'Active'),
(475, 4, 7, '20', 'Strut Support', '', 'Active'),
(476, 4, 8, '01', 'Bearings & Bushings', '', 'Active'),
(477, 4, 8, '02', 'Housing & Box Components', '', 'Active'),
(478, 4, 8, '03', 'Idler Arms & Related', '', 'Active'),
(479, 4, 8, '04', 'Pitman Arms & Related', '', 'Active'),
(480, 4, 8, '05', 'Rack & Pinion Bushings', '', 'Active'),
(481, 4, 8, '06', 'Rack & Pinion Components', '', 'Active'),
(482, 4, 8, '07', 'Rack & Pinion Mounts', '', 'Active'),
(483, 4, 8, '08', 'Rack & Pinion Parts', '', 'Active'),
(484, 4, 8, '09', 'Rack & Pinion Rebuild Kits', '', 'Active'),
(485, 4, 8, '10', 'Rack & Pinion Seals', '', 'Active'),
(486, 4, 8, '11', 'Rack & Pinions', '', 'Active'),
(487, 4, 8, '12', 'Radium Arms & Related', '', 'Active'),
(488, 4, 8, '13', 'Steering Bell Cranks', '', 'Active'),
(489, 4, 8, '14', 'Steering Column Components', '', 'Active'),
(490, 4, 8, '15', 'Steering Column Parts', '', 'Active'),
(491, 4, 8, '16', 'Steering Components', '', 'Active'),
(492, 4, 8, '17', 'Steering Gear Kits', '', 'Active'),
(493, 4, 8, '18', 'Steering Gear Shaft Seals', '', 'Active'),
(494, 4, 8, '19', 'Steering Hardware', '', 'Active'),
(495, 4, 8, '20', 'Steering Knuckle Parts', '', 'Active'),
(496, 4, 8, '21', 'Steering Parts', '', 'Active'),
(497, 4, 8, '22', 'Tie Rod Ends & Related', '', 'Active'),
(498, 4, 9, '01', 'Alignment Accessories', '', 'Active'),
(499, 4, 9, '02', 'Alignment Hardware', '', 'Active'),
(500, 4, 9, '03', 'Alignment Kits', '', 'Active'),
(501, 4, 9, '04', 'Alignment Tools', '', 'Active'),
(502, 4, 9, '05', 'Axle Support Hardware', '', 'Active'),
(503, 4, 9, '06', 'Ball Joints & Control arms', '', 'Active'),
(504, 4, 9, '07', 'Chassis', '', 'Active'),
(505, 4, 9, '08', 'Chassis Kits', '', 'Active'),
(506, 4, 9, '09', 'Control Arm Components', '', 'Active'),
(507, 4, 9, '10', 'Lateral Arms & Parts', '', 'Active'),
(508, 4, 9, '11', 'Lifts & Lowering Kits', '', 'Active'),
(509, 4, 9, '12', 'Spindle Parts', '', 'Active'),
(510, 4, 9, '13', 'Strut Parts', '', 'Active'),
(511, 4, 9, '14', 'Suspension Air Components', '', 'Active'),
(512, 4, 9, '15', 'Suspension Ball Joints', '', 'Active'),
(513, 4, 9, '16', 'suspension Components', '', 'Active'),
(514, 4, 9, '17', 'Suspension Control Arm Parts', '', 'Active'),
(515, 4, 9, '18', 'Suspension Control Arms', '', 'Active'),
(516, 4, 9, '19', 'Suspension Hardware', '', 'Active'),
(517, 4, 9, '20', 'Suspension Mounts', '', 'Active'),
(518, 4, 9, '21', 'Suspension Parts', '', 'Active'),
(519, 4, 9, '22', 'Suspension Spring Components', '', 'Active'),
(520, 4, 9, '23', 'Sway Bar Bushings & Brackets', '', 'Active'),
(521, 4, 9, '24', 'Sway Bar Parts & Kits', '', 'Active'),
(522, 4, 9, '25', 'Torsion Bars & Parts', '', 'Active'),
(523, 4, 9, '26', 'Track Bars & Parts', '', 'Active'),
(524, 4, 9, '27', 'Upper Control Arms & Parts', '', 'Active'),
(525, 4, 10, '01', 'Tire Repair', '', 'Active'),
(526, 4, 10, '02', 'Wheel covers', '', 'Active'),
(527, 4, 10, '03', 'Wheel Lug Nuts', '', 'Active'),
(528, 4, 10, '04', 'Wheel Nut Caps', '', 'Active'),
(529, 4, 10, '05', 'Wheel Nut Covers', '', 'Active'),
(530, 4, 10, '06', 'Wheel Nuts', '', 'Active'),
(531, 4, 10, '07', 'Wheel Spacers', '', 'Active'),
(532, 4, 10, '08', 'Wheel Washers', '', 'Active'),
(533, 4, 10, '09', 'Wheel Weights', '', 'Active'),
(534, 4, 10, '10', 'Wheels & Parts', '', 'Active'),
(535, 5, 1, '01', 'AC Ventillation Systems', '', 'Active'),
(536, 5, 1, '02', 'Accumulator Tubing', '', 'Active'),
(537, 5, 1, '03', 'Accumulators & Receiver Driers', '', 'Active'),
(538, 5, 1, '04', 'Receiver Drier Elements', '', 'Active'),
(539, 5, 2, '01', 'AC Clutch Bearings', '', 'Active'),
(540, 5, 2, '02', 'AC Clutch Install Kits', '', 'Active'),
(541, 5, 2, '03', 'AC Clutch Parts', '', 'Active'),
(542, 5, 2, '04', 'AC Clutches', '', 'Active'),
(543, 5, 2, '05', 'AC Compressor Bearing', '', 'Active'),
(544, 5, 2, '06', 'AC Compressor Mounts', '', 'Active'),
(545, 5, 2, '07', 'AC Compressor Pulleys', '', 'Active'),
(546, 5, 2, '08', 'AC Compressor Shaft Parts', '', 'Active'),
(547, 5, 2, '09', 'AC Compressors', '', 'Active'),
(548, 5, 2, '10', 'AC Condenser Fan Shrouds & Bla', '', 'Active'),
(549, 5, 2, '11', 'AC Condensers', '', 'Active'),
(550, 5, 2, '12', 'AC Evaporator Repair Kits', '', 'Active'),
(551, 5, 2, '13', 'AC Evaporator Motors & Related', '', 'Active'),
(552, 5, 2, '14', 'AC Evaporators', '', 'Active'),
(553, 5, 2, '15', 'AC Fan Motors', '', 'Active'),
(554, 5, 2, '16', 'AC Gaskets & Seals', '', 'Active'),
(555, 5, 2, '17', 'AC Hoses & Fittings', '', 'Active'),
(556, 5, 2, '18', 'AC Switches & Resistors', '', 'Active'),
(557, 5, 2, '19', 'AC Valves & Tubing', '', 'Active'),
(558, 5, 2, '20', 'Other Specialty Tools', '', 'Active'),
(559, 5, 3, '01', 'AC Actuators', '', 'Active'),
(560, 5, 3, '02', 'AC Adapters', '', 'Active'),
(561, 5, 3, '03', 'AC Clutch Install Kits', '', 'Active'),
(562, 5, 3, '04', 'AC Connectors', '', 'Active'),
(563, 5, 3, '05', 'AC Drive Belt Tensioners', '', 'Active'),
(564, 5, 3, '06', 'AC Gaskets & Seals', '', 'Active'),
(565, 5, 3, '07', 'AC Hoses & Fittings', '', 'Active'),
(566, 5, 3, '08', 'AC Pipes', '', 'Active'),
(567, 5, 3, '09', 'AC Retro-Fit Kits', '', 'Active'),
(568, 5, 3, '10', 'AC Tools', '', 'Active'),
(569, 5, 3, '11', 'AC Valves & Tubing', '', 'Active'),
(570, 5, 3, '12', 'Fan Switches', '', 'Active'),
(571, 5, 3, '13', 'Gauges & Specialty Tools', '', 'Active'),
(572, 5, 3, '14', 'Leak Detectors', '', 'Active'),
(573, 5, 3, '15', 'Pressure Side Switches', '', 'Active'),
(574, 5, 3, '16', 'Programmers', '', 'Active'),
(575, 5, 3, '17', 'Repair Kits', '', 'Active'),
(576, 5, 3, '18', 'Temperature Sensors', '', 'Active'),
(577, 5, 3, '19', 'Trinary Switches', '', 'Active'),
(578, 5, 4, '01', 'AC Drive Belt Tensioners', '', 'Active'),
(579, 5, 4, '02', 'Accessory Drive Belts', '', 'Active'),
(580, 5, 4, '03', 'Belt Components', '', 'Active'),
(581, 5, 4, '04', 'Belts', '', 'Active'),
(582, 5, 4, '05', 'Bulk Hose', '', 'Active'),
(583, 5, 4, '06', 'Hose Hardware', '', 'Active'),
(584, 5, 4, '07', 'Hoses', '', 'Active'),
(585, 5, 4, '08', 'Pulley Components', '', 'Active'),
(586, 5, 4, '09', 'Pulleys', '', 'Active'),
(587, 5, 5, '01', 'Coolant Air Bleeders', '', 'Active'),
(588, 5, 5, '02', 'Coolant Bypass Parts', '', 'Active'),
(589, 5, 5, '03', 'Coolant Hoses', '', 'Active'),
(590, 5, 5, '04', 'Coolant Pipes & Accessories', '', 'Active'),
(591, 5, 5, '05', 'Coolant Reservoirs & Caps', '', 'Active'),
(592, 5, 5, '06', 'Coolant Sensors', '', 'Active'),
(593, 5, 5, '07', 'Coolant Thermostats', '', 'Active'),
(594, 5, 5, '08', 'Hose Clamps', '', 'Active'),
(595, 5, 5, '09', 'Miscellaneous Coolant Parts', '', 'Active'),
(596, 5, 5, '10', 'Oil Cooler Parts', '', 'Active'),
(597, 5, 5, '11', 'Radiator Fan Switches', '', 'Active'),
(598, 5, 5, '12', 'Transmission Coolers', '', 'Active'),
(599, 5, 5, '13', 'Water Pump Bolts', '', 'Active'),
(600, 5, 5, '14', 'Water Pump Covers', '', 'Active'),
(601, 5, 5, '15', 'Water Pump Fittings', '', 'Active'),
(602, 5, 5, '16', 'Water Pump Gaskets', '', 'Active'),
(603, 5, 5, '17', 'Water Pump Installation', '', 'Active'),
(604, 5, 5, '18', 'Water Pump Pulleys', '', 'Active'),
(605, 5, 5, '19', 'Water Pump Relays', '', 'Active'),
(606, 5, 5, '20', 'Water Pump Repair Kits', '', 'Active'),
(607, 5, 5, '21', 'Water Pump Seals', '', 'Active'),
(608, 5, 5, '22', 'Water Pump Sockets', '', 'Active'),
(609, 5, 5, '23', 'Water Pump Tubing', '', 'Active'),
(610, 5, 5, '24', 'Water Pumps', '', 'Active'),
(611, 5, 5, '25', 'Water Temperature Gauges', '', 'Active'),
(612, 5, 6, '01', 'Blower Motor Components', '', 'Active'),
(613, 5, 6, '02', 'Blower Motor Control Units', '', 'Active'),
(614, 5, 6, '03', 'Blower Motor Resistor Connecto', '', 'Active'),
(615, 5, 6, '04', 'Blower Motor Wheels', '', 'Active'),
(616, 5, 6, '05', 'Blower Motors', '', 'Active'),
(617, 5, 6, '06', 'Cooling Fan Blades', '', 'Active'),
(618, 5, 6, '07', 'Cooling Fan Components', '', 'Active'),
(619, 5, 6, '08', 'Cooling Fan Controllers', '', 'Active'),
(620, 5, 6, '09', 'Cooling Fan Shrouds', '', 'Active'),
(621, 5, 6, '10', 'Cooling Fans', '', 'Active'),
(622, 5, 6, '11', 'Engine Cooling Fans', '', 'Active'),
(623, 5, 6, '12', 'Fan Accessories', '', 'Active'),
(624, 5, 6, '13', 'Fan Clutch Hardware & Brackets', '', 'Active'),
(625, 5, 6, '14', 'Transmission Coolers', '', 'Active'),
(626, 5, 6, '15', 'Water Necks & Shrouds', '', 'Active'),
(627, 5, 7, '01', 'AC Flushes & Solvents ', '', 'Active'),
(628, 5, 7, '02', 'AC Lubricants', '', 'Active'),
(629, 5, 7, '03', 'AC Refrigerants', '', 'Active'),
(630, 5, 7, '04', 'Antifreeze Flush Kits', '', 'Active'),
(631, 5, 7, '05', 'Coolant & Antifreeze', '', 'Active'),
(632, 5, 7, '06', 'Coolant Recovery', '', 'Active'),
(633, 5, 7, '07', 'Odor Eliminators', '', 'Active'),
(634, 5, 7, '08', 'Refrigerant Oil', '', 'Active'),
(635, 5, 8, '01', 'Heater Blend Doors & Parts', '', 'Active'),
(636, 5, 8, '02', 'Heater Boxes & Accessories', '', 'Active'),
(637, 5, 8, '03', 'Heater Control Assemblies', '', 'Active'),
(638, 5, 8, '04', 'Heater Control Knobs', '', 'Active'),
(639, 5, 8, '05', 'Heater Cores & Seals', '', 'Active'),
(640, 5, 8, '06', 'Heater Hoses & Fittings', '', 'Active'),
(641, 5, 8, '07', 'Heater Valves & Related', '', 'Active'),
(642, 5, 8, '08', 'Miscellaneous Heater Parts', '', 'Active'),
(643, 5, 9, '01', 'Coolant Reservoirs & Caps', '', 'Active'),
(644, 5, 9, '02', 'Heater Hoses & Fittings', '', 'Active'),
(645, 5, 9, '03', 'Heater Valves & Related', '', 'Active'),
(646, 5, 9, '04', 'Oil Cooler Seals', '', 'Active'),
(647, 5, 9, '05', 'Oil Coolers', '', 'Active'),
(648, 5, 9, '06', 'Radiator Fan Blades', '', 'Active'),
(649, 5, 9, '07', 'Radiator Fan Clutch', '', 'Active'),
(650, 5, 9, '08', 'Radiator Fan Hardware', '', 'Active'),
(651, 5, 9, '09', 'Radiator Fan Motors', '', 'Active'),
(652, 5, 9, '10', 'Radiator Fans & Parts', '', 'Active'),
(653, 5, 9, '11', 'Radiator Hardware', '', 'Active'),
(654, 5, 9, '12', 'Radiator Hoses', '', 'Active'),
(655, 5, 9, '13', 'Radiator Mounts', '', 'Active'),
(656, 5, 9, '14', 'Radiator Overflow Hoses', '', 'Active'),
(657, 5, 9, '15', 'Radiator Sensors', '', 'Active'),
(658, 5, 9, '16', 'Radiator Support', '', 'Active'),
(659, 5, 9, '17', 'Radiators', '', 'Active'),
(660, 5, 9, '18', 'Radiators Caps', '', 'Active'),
(661, 5, 9, '19', 'Tank Caps, Hoses & Mounts', '', 'Active'),
(662, 5, 9, '20', 'Transmission Coolers', '', 'Active'),
(663, 5, 9, '21', 'Tubing', '', 'Active'),
(664, 5, 10, '01', 'Climate Control Modules', '', 'Active'),
(665, 5, 10, '02', 'Climate Control Sensors', '', 'Active'),
(666, 5, 10, '03', 'Coolant Thermostats', '', 'Active'),
(667, 5, 10, '04', 'Outlet Gaskets', '', 'Active'),
(668, 5, 10, '05', 'Temperature Control Modules', '', 'Active'),
(669, 5, 10, '06', 'Temperature Indicators', '', 'Active'),
(670, 5, 10, '07', 'Thermostat & Outlet Assemblies', '', 'Active'),
(671, 5, 10, '08', 'Thermostat Gaskets', '', 'Active'),
(672, 5, 10, '09', 'Thermostat Housing Covers', '', 'Active'),
(673, 5, 10, '10', 'Thermostat Housing Gaskets', '', 'Active'),
(674, 5, 10, '11', 'Thermostat Housings', '', 'Active'),
(675, 5, 10, '12', 'Thermostat Seals', '', 'Active'),
(676, 5, 10, '13', 'Thermostats', '', 'Active'),
(677, 5, 10, '14', 'Water Outlet', '', 'Active'),
(678, 6, 1, '01', 'Cameras & Cases', '', 'Active'),
(679, 6, 1, '02', 'Cell Phone Accessories', '', 'Active'),
(680, 6, 1, '03', 'Cell Phone Chargers & Batterie', '', 'Active'),
(681, 6, 1, '04', 'Cell Phone Hands-Free', '', 'Active'),
(682, 6, 1, '05', 'Two-Way Radios', '', 'Active'),
(683, 6, 2, '01', 'Adapters & Converters', '', 'Active'),
(684, 6, 2, '02', 'HD Audio Components', '', 'Active'),
(685, 6, 2, '03', 'Mobile Electronics', '', 'Active'),
(686, 6, 2, '04', 'MP3 Player Components', '', 'Active'),
(687, 6, 2, '05', 'MP3 Players', '', 'Active'),
(688, 6, 2, '06', 'Radio Components', '', 'Active'),
(689, 6, 2, '07', 'Radios, MP3 & CD Players', '', 'Active'),
(690, 6, 2, '08', 'Sound Enhancement', '', 'Active'),
(691, 6, 2, '09', 'Speakers & Accessories', '', 'Active'),
(692, 6, 2, '10', 'Televisions & Video Consoles', '', 'Active'),
(693, 6, 3, '01', 'Computer Accessories', '', 'Active'),
(694, 6, 4, '01', 'Air & Water Gauges', '', 'Active'),
(695, 6, 4, '02', 'Amp Gauges', '', 'Active'),
(696, 6, 4, '03', 'Fuel Gauges', '', 'Active'),
(697, 6, 4, '04', 'Gauge Accessories', '', 'Active'),
(698, 6, 4, '05', 'Meter Gauges', '', 'Active'),
(699, 6, 4, '06', 'Oil & Fuel Gauges', '', 'Active'),
(700, 6, 4, '07', 'Pressure Gauges', '', 'Active'),
(701, 6, 4, '08', 'Pyrometers', '', 'Active'),
(702, 6, 4, '09', 'Speedometers & Related', '', 'Active'),
(703, 6, 4, '10', 'Tachometers & Related', '', 'Active'),
(704, 6, 4, '11', 'Temperature Gauges', '', 'Active'),
(705, 6, 4, '12', 'Vacuum Gaguges', '', 'Active'),
(706, 6, 4, '13', 'Volt Gauges', '', 'Active'),
(707, 6, 5, '01', 'Clocks & Compasses', '', 'Active'),
(708, 6, 5, '02', 'Instrument Clusters', '', 'Active'),
(709, 6, 5, '03', 'Instrument Panels', '', 'Active'),
(710, 6, 5, '04', 'Lighters', '', 'Active'),
(711, 6, 6, '01', 'GPS Systems', '', 'Active'),
(712, 6, 7, '01', 'Radar Detectors', '', 'Active'),
(713, 7, 1, '01', 'Case Hardware', '', 'Active'),
(714, 7, 1, '02', 'Connecting Rods & Related', '', 'Active'),
(715, 7, 1, '03', 'Crankshafts & Parts', '', 'Active'),
(716, 7, 1, '04', 'Cylinder Head Components', '', 'Active'),
(717, 7, 1, '05', 'Cylinder Head Harware', '', 'Active'),
(718, 7, 1, '06', 'Cylinder Head Seals', '', 'Active'),
(719, 7, 1, '07', 'Cylinder Heads', '', 'Active'),
(720, 7, 1, '08', 'Cylinders & Related', '', 'Active'),
(721, 7, 1, '09', 'Engine Components', '', 'Active'),
(722, 7, 1, '10', 'Engine Hardware', '', 'Active'),
(723, 7, 1, '11', 'Engine Torque & Related', '', 'Active'),
(724, 7, 1, '12', 'Freeze Plugs', '', 'Active'),
(725, 7, 1, '13', 'Master Kits', '', 'Active'),
(726, 7, 1, '14', 'Oil Pans, Pumps & Parts', '', 'Active'),
(727, 7, 1, '15', 'Pistons & Piston Parts', '', 'Active'),
(728, 7, 1, '16', 'Pushrods & Related', '', 'Active'),
(729, 7, 2, '01', 'Engine Mount Hardware', '', 'Active'),
(730, 7, 2, '02', 'Engine Mounts', '', 'Active'),
(731, 7, 2, '03', 'Engine Parts', '', 'Active'),
(732, 7, 2, '04', 'Engines', '', 'Active'),
(733, 7, 2, '05', 'Harmonic Balancers', '', 'Active'),
(734, 7, 3, '01', 'Analyzers', '', 'Active'),
(735, 7, 3, '02', 'Computer Chips - Performance', '', 'Active'),
(736, 7, 3, '03', 'Computer Chips & Boards', '', 'Active'),
(737, 7, 3, '04', 'Control Modules', '', 'Active'),
(738, 7, 3, '05', 'Engine Computers', '', 'Active'),
(739, 7, 3, '06', 'Engine Control ', '', 'Active'),
(740, 7, 3, '07', 'Engine Modules', '', 'Active'),
(741, 7, 3, '08', 'Engine Wiring', '', 'Active'),
(742, 7, 3, '09', 'Ignition Modules', '', 'Active'),
(743, 7, 3, '10', 'Sensors', '', 'Active'),
(744, 7, 4, '01', 'Camshaft Gaskets', '', 'Active'),
(745, 7, 4, '02', 'Crankshaft Seals', '', 'Active'),
(746, 7, 4, '03', 'Cylinder Head Gaskets', '', 'Active'),
(747, 7, 4, '04', 'Drive Seals', '', 'Active'),
(748, 7, 4, '05', 'Main Bearing Gaskets', '', 'Active'),
(749, 7, 4, '06', 'Manifold Gaskets', '', 'Active'),
(750, 7, 4, '07', 'Rear Main Seals', '', 'Active'),
(751, 7, 4, '08', 'Silicone Sealers & Gaskets', '', 'Active'),
(752, 7, 4, '09', 'Take Off Shaft Seals', '', 'Active'),
(753, 7, 5, '01', 'Ballast Components', '', 'Active'),
(754, 7, 5, '02', 'Diesel Glow Plug Components', '', 'Active'),
(755, 7, 5, '03', 'Diesel glow Plugs', '', 'Active'),
(756, 7, 5, '04', 'Distributor Components', '', 'Active'),
(757, 7, 5, '05', 'Distributors', '', 'Active'),
(758, 7, 5, '06', 'Distributors - Performance', '', 'Active'),
(759, 7, 5, '07', 'Ignition Coil Components', '', 'Active'),
(760, 7, 5, '08', 'Ignition Coil Parts', '', 'Active'),
(761, 7, 5, '09', 'Ignition Coils - Performance', '', 'Active'),
(762, 7, 5, '10', 'Ignition Components', '', 'Active'),
(763, 7, 5, '11', 'Spark Plug Accessories', '', 'Active'),
(764, 7, 5, '12', 'Spark Plug Boots & Shields', '', 'Active'),
(765, 7, 5, '13', 'Spark Plug Inserts', '', 'Active'),
(766, 7, 5, '14', 'Spark Plug Tubes', '', 'Active'),
(767, 7, 5, '15', 'Spark Plugs', '', 'Active'),
(768, 7, 5, '16', 'Spark Wires & Tools', '', 'Active'),
(769, 7, 6, '01', 'Diesel Motor Oil', '', 'Active'),
(770, 7, 6, '02', 'Engine Oil Treatment & Additiv', '', 'Active'),
(771, 7, 6, '03', 'Motor Oil', '', 'Active'),
(772, 7, 6, '04', 'Motorcycle & Powersport', '', 'Active'),
(773, 7, 6, '05', 'Non-Detergent 30W Motor Oil', '', 'Active'),
(774, 7, 6, '06', 'Oil Absorbent', '', 'Active'),
(775, 7, 6, '07', 'Racing Motor Oil', '', 'Active'),
(776, 7, 6, '08', 'Synthetic & Blend', '', 'Active'),
(777, 7, 7, '01', 'Balance Shaft Bearings', '', 'Active'),
(778, 7, 7, '02', 'Balance Shaft Belts', '', 'Active'),
(779, 7, 7, '03', 'Balance Shaft Chain Parts', '', 'Active'),
(780, 7, 7, '04', 'Balance Shaft Chains', '', 'Active'),
(781, 7, 7, '05', 'Balance Shaft Kits', '', 'Active'),
(782, 7, 7, '06', 'Balance Shaft Seals', '', 'Active'),
(783, 7, 7, '07', 'Balance Shaft Sprockets', '', 'Active'),
(784, 7, 7, '08', 'Camshaft Hardware', '', 'Active'),
(785, 7, 7, '09', 'Camshafts', '', 'Active'),
(786, 7, 7, '10', 'Camshafts - Performance', '', 'Active'),
(787, 7, 7, '11', 'Engine Valve Components', '', 'Active'),
(788, 7, 7, '12', 'Engine Valves', '', 'Active'),
(789, 7, 7, '13', 'Push Rods', '', 'Active'),
(790, 7, 7, '14', 'Rocker Arm Hardware', '', 'Active'),
(791, 7, 7, '15', 'Rocker Arms', '', 'Active'),
(792, 7, 7, '16', 'Timing Belt Components', '', 'Active'),
(793, 7, 7, '17', 'Timing Belt Hardware', '', 'Active'),
(794, 7, 7, '18', 'Timing Belts', '', 'Active'),
(795, 7, 7, '19', 'Timing Chain Components', '', 'Active'),
(796, 7, 7, '20', 'Timing Chains', '', 'Active'),
(797, 7, 7, '21', 'Timing Cover Components', '', 'Active'),
(798, 7, 7, '22', 'Timing Covers', '', 'Active'),
(799, 7, 7, '23', 'Timing Hardware', '', 'Active'),
(800, 7, 7, '24', 'Timing Sets', '', 'Active'),
(801, 7, 7, '25', 'Valve Cover Hardware', '', 'Active'),
(802, 7, 7, '26', 'Valve Covers', '', 'Active'),
(803, 7, 7, '27', 'Valve Train Hardware', '', 'Active'),
(804, 8, 1, '01', 'AC Flushes & Solvents', '', 'Active'),
(805, 8, 1, '02', 'AC Lubricants', '', 'Active'),
(806, 8, 1, '03', 'AC Refrigerants', '', 'Active'),
(807, 8, 1, '04', 'Coolant & Antifreeze', '', 'Active'),
(808, 8, 1, '05', 'Antifreeze Flush Kits', '', 'Active'),
(809, 8, 1, '06', 'Brake Cleaners & Fluid', '', 'Active'),
(810, 8, 1, '07', 'Carb Cleaners', '', 'Active'),
(811, 8, 1, '08', 'Coolant Recovery', '', 'Active'),
(812, 8, 1, '09', 'Cylinder Lubricants', '', 'Active'),
(813, 8, 1, '10', 'Exhaust Fluid', '', 'Active'),
(814, 8, 1, '11', 'Fuel Treatments & Cleaners', '', 'Active'),
(815, 8, 1, '12', 'Lead Subtitutes', '', 'Active'),
(816, 8, 1, '13', 'Mercon/Dextron AT Fluid', '', 'Active'),
(817, 8, 1, '14', 'Octane Boost ', '', 'Active'),
(818, 8, 1, '15', 'Odor Eliminators', '', 'Active'),
(819, 8, 1, '16', 'Power Steering Fluids & Stop L', '', 'Active'),
(820, 8, 1, '17', 'Radiator Additives & Flushes', '', 'Active'),
(821, 8, 1, '18', 'Refrigerant Oil', '', 'Active'),
(822, 8, 1, '19', 'Starting Fluids', '', 'Active'),
(823, 8, 1, '20', 'Transmission & Drivetrain', '', 'Active'),
(824, 8, 1, '21', 'Transmission Treatment & Addit', '', 'Active'),
(825, 8, 1, '22', 'Windshield Washers & Treatment', '', 'Active'),
(826, 8, 2, '01', '2 Cycle & Outboard Lubes', '', 'Active'),
(827, 8, 2, '02', 'Assembly Lubes', '', 'Active'),
(828, 8, 2, '03', 'Belt Treatments', '', 'Active'),
(829, 8, 2, '04', 'Brake Grease', '', 'Active'),
(830, 8, 2, '05', 'Brake Lubricant', '', 'Active'),
(831, 8, 2, '06', 'Chain Lubes', '', 'Active'),
(832, 8, 2, '07', 'Cooling & Heating', '', 'Active'),
(833, 8, 2, '08', 'CV Joint Grease', '', 'Active'),
(834, 8, 2, '09', 'Electrical Lubes', '', 'Active'),
(835, 8, 2, '10', 'Engine Gaskets', '', 'Active'),
(836, 8, 2, '11', 'Engine Gaskets & Seals', '', 'Active'),
(837, 8, 2, '12', 'Exhaust Gaskets', '', 'Active'),
(838, 8, 2, '13', 'Gasket Sets', '', 'Active'),
(839, 8, 2, '14', 'Gear Oil', '', 'Active'),
(840, 8, 2, '15', 'Gear Oil Pumps', '', 'Active'),
(841, 8, 2, '16', 'Graphites & Lubricants', '', 'Active'),
(842, 8, 2, '17', 'Grease Cartridges', '', 'Active'),
(843, 8, 2, '18', 'Grease Fittings', '', 'Active'),
(844, 8, 2, '19', 'Grease Injectors', '', 'Active'),
(845, 8, 2, '20', 'Hydraulic Fluids', '', 'Active'),
(846, 8, 2, '21', 'Lithium Grease', '', 'Active'),
(847, 8, 2, '22', 'Marine Lubes', '', 'Active'),
(848, 8, 2, '23', 'Miscellaneous Gaskets', '', 'Active'),
(849, 8, 2, '24', 'Oil Filters', '', 'Active'),
(850, 8, 2, '25', 'Outlet Gaskets', '', 'Active'),
(851, 8, 2, '26', 'Penetrating & Fogging Oil', '', 'Active'),
(852, 8, 2, '27', 'Sealers', '', 'Active'),
(853, 8, 2, '28', 'Thermostat gaskets', '', 'Active'),
(854, 8, 2, '29', 'Transmission & Drivetrain', '', 'Active'),
(855, 8, 2, '30', 'Transmission & Drivetrain Gask', '', 'Active'),
(856, 8, 3, '01', '1/2 Drive', '', 'Active'),
(857, 8, 3, '02', '1/4 Drive', '', 'Active'),
(858, 8, 3, '03', '3/8 Drive', '', 'Active'),
(859, 8, 3, '04', 'Allen & Hex Key Sets', '', 'Active'),
(860, 8, 3, '05', 'Breaker Bars', '', 'Active'),
(861, 8, 3, '06', 'External Torx Sockets', '', 'Active'),
(862, 8, 3, '07', 'Flashlights & Batteries', '', 'Active'),
(863, 8, 3, '08', 'Pliers & Pliers Sets', '', 'Active'),
(864, 8, 3, '09', 'Ratchets', '', 'Active'),
(865, 8, 3, '10', 'Screwdrivers & Sets', '', 'Active'),
(866, 8, 3, '11', 'Socket Sets', '', 'Active'),
(867, 8, 3, '12', 'Sockets', '', 'Active'),
(868, 8, 3, '13', 'Tool Sets', '', 'Active'),
(869, 8, 3, '14', 'Torque & Impact Wrenches', '', 'Active'),
(870, 8, 3, '15', 'Wrenches & Wrenches Sets', '', 'Active'),
(871, 8, 4, '01', 'Adapters', '', 'Active'),
(872, 8, 4, '02', 'AN Fittings', '', 'Active'),
(873, 8, 4, '03', 'Belt Components', '', 'Active'),
(874, 8, 4, '04', 'Bolts', '', 'Active'),
(875, 8, 4, '05', 'Ends', '', 'Active'),
(876, 8, 4, '06', 'Fasteners', '', 'Active'),
(877, 8, 4, '07', 'Fittings', '', 'Active'),
(878, 8, 4, '08', 'Flare Fittings', '', 'Active'),
(879, 8, 4, '09', 'Hoses & Assemblies', '', 'Active'),
(880, 8, 4, '10', 'Industrial Belts', '', 'Active'),
(881, 8, 4, '11', 'Miscellaneous Fittings', '', 'Active'),
(882, 8, 4, '12', 'Nuts', '', 'Active'),
(883, 8, 4, '13', 'Pipe Thread Fittings', '', 'Active'),
(884, 8, 4, '14', 'Radius Ends', '', 'Active'),
(885, 8, 4, '15', 'Screws', '', 'Active'),
(886, 8, 4, '16', 'Swifel Ends', '', 'Active'),
(887, 8, 4, '17', 'Washers', '', 'Active'),
(888, 8, 5, '01', 'Diesel Motor Oil', '', 'Active'),
(889, 8, 5, '02', 'Engine Oil Treatment & Additiv', '', 'Active'),
(890, 8, 5, '03', 'Motor Oil', '', 'Active'),
(891, 8, 5, '04', 'Motorcycle & Powersport', '', 'Active'),
(892, 8, 5, '05', 'Non-Detergent 30W Motor Oil', '', 'Active'),
(893, 8, 5, '06', 'Oil Absorbent', '', 'Active'),
(894, 8, 5, '07', 'Racing Motor Oil', '', 'Active'),
(895, 8, 5, '08', 'Synthetic & Blended', '', 'Active'),
(896, 8, 6, '01', 'Foreign Language Manuals', '', 'Active'),
(897, 8, 6, '02', 'Labor Guides', '', 'Active'),
(898, 8, 6, '03', 'Repair Manuals', '', 'Active'),
(899, 8, 6, '04', 'Shop Manuals', '', 'Active'),
(900, 8, 6, '05', 'Specialty Manuals', '', 'Active'),
(901, 8, 6, '06', 'Wiring Diagrams', '', 'Active'),
(902, 8, 7, '01', 'Air Compressors', '', 'Active'),
(903, 8, 7, '02', 'Benches, Tables, Carts & Stool', '', 'Active'),
(904, 8, 7, '03', 'Brooms, Mops & Floor Squeegees', '', 'Active'),
(905, 8, 7, '04', 'Cleaners & Degreasers', '', 'Active'),
(906, 8, 7, '05', 'Commercial tools & Equipment', '', 'Active'),
(907, 8, 7, '06', 'Creepers, Dollys & Ramps', '', 'Active'),
(908, 8, 7, '07', 'Engine Diagnostics & Flush', '', 'Active'),
(909, 8, 7, '08', 'Floor Protection', '', 'Active'),
(910, 8, 7, '09', 'Fluid Exchangers', '', 'Active'),
(911, 8, 7, '10', 'Garage Organizers', '', 'Active'),
(912, 8, 7, '11', 'Generators', '', 'Active'),
(913, 8, 7, '12', 'Hoists, Stand & Accessories', '', 'Active'),
(914, 8, 7, '13', 'Jacks & Accessories', '', 'Active'),
(915, 8, 7, '14', 'Lift & Accessories', '', 'Active'),
(916, 8, 7, '15', 'Refrigerant Systems', '', 'Active'),
(917, 8, 7, '16', 'Shops Coolers & Heaters', '', 'Active'),
(918, 8, 7, '17', 'Tire & Wheel Tools', '', 'Active'),
(919, 8, 7, '18', 'Training Supplies', '', 'Active'),
(920, 8, 7, '19', 'Vacuums & Pressure Washers', '', 'Active'),
(921, 8, 7, '20', 'Welding Tools & Accessories', '', 'Active'),
(922, 8, 8, '01', 'AC Clutch Install Kits', '', 'Active'),
(923, 8, 8, '02', 'AC Tools, Hardware & Adapters', '', 'Active'),
(924, 8, 8, '03', 'Air Tools', '', 'Active'),
(925, 8, 8, '04', 'Brake Tools', '', 'Active');
INSERT INTO `rims_product_sub_category` (`id`, `product_master_category`, `product_sub_master_category_id`, `code`, `name`, `description`, `status`) VALUES
(926, 8, 8, '05', 'Cutting & Drilling Tools', '', 'Active'),
(927, 8, 8, '06', 'Diagnostic Tools', '', 'Active'),
(928, 8, 8, '07', 'Measuring Tools', '', 'Active'),
(929, 8, 8, '08', 'Oil & Lube Tools', '', 'Active'),
(930, 8, 8, '09', 'Other Specialty Tools', '', 'Active'),
(931, 8, 8, '10', 'Suspension, Springs & Related', '', 'Active'),
(932, 8, 9, '01', 'Drip & Drain Pans', '', 'Active'),
(933, 8, 9, '02', 'Fuel Can Spouts & Accessories', '', 'Active'),
(934, 8, 9, '03', 'Fuel Containers', '', 'Active'),
(935, 8, 9, '04', 'Funnels', '', 'Active'),
(936, 8, 9, '05', 'Garage Accessories', '', 'Active'),
(937, 8, 9, '06', 'Oil change Stickers', '', 'Active'),
(938, 8, 9, '07', 'Plastiv Fuel Cans', '', 'Active'),
(939, 8, 9, '08', 'Siphons', '', 'Active'),
(940, 8, 9, '09', 'Tool Bags', '', 'Active'),
(941, 8, 9, '10', 'Tool Boxes & Accessories', '', 'Active'),
(942, 8, 9, '11', 'Tool Organizers', '', 'Active'),
(943, 8, 9, '12', 'Trailer Mount Tool Boxes', '', 'Active'),
(944, 8, 9, '13', 'Truck Tool Boxes', '', 'Active'),
(945, 8, 9, '14', 'Water Containers', '', 'Active'),
(946, 8, 10, '01', 'Gear Bags & Work Belts', '', 'Active'),
(947, 8, 10, '02', 'Kids Gloves', '', 'Active'),
(948, 8, 10, '03', 'Knee Pads', '', 'Active'),
(949, 8, 10, '04', 'Large Gloves', '', 'Active'),
(950, 8, 10, '05', 'Latex & Nitrile Gloves', '', 'Active'),
(951, 8, 10, '06', 'Medium Gloves', '', 'Active'),
(952, 8, 10, '07', 'Miscellaneous Gloves', '', 'Active'),
(953, 8, 10, '08', 'Personal Care', '', 'Active'),
(954, 8, 10, '09', 'Protective Gear', '', 'Active'),
(955, 8, 10, '10', 'Shoes & Boots', '', 'Active'),
(956, 8, 10, '11', 'Small Gloves ', '', 'Active'),
(957, 8, 10, '12', 'Solvent & Welding Gloves', '', 'Active'),
(958, 8, 10, '13', 'Welding Helmets', '', 'Active'),
(959, 8, 10, '14', 'X-Large Gloves', '', 'Active'),
(960, 8, 10, '15', 'XX-Large Gloves', '', 'Active'),
(961, 9, 1, '01', 'Actuator Cables & Valves', '', 'Active'),
(962, 9, 1, '02', 'Automatic Transmission Compone', '', 'Active'),
(963, 9, 1, '03', 'Bearings & Bearing Kits', '', 'Active'),
(964, 9, 1, '04', 'Control Modules & Connectors', '', 'Active'),
(965, 9, 1, '05', 'Cooler Hoses, Clips & Lines', '', 'Active'),
(966, 9, 1, '06', 'Dipsticks & Dipstick Tubes', '', 'Active'),
(967, 9, 1, '07', 'Gear Shift Levers', '', 'Active'),
(968, 9, 1, '08', 'Line Assemblies & Connectors', '', 'Active'),
(969, 9, 1, '09', 'Modulator Valves, Caps & Pins', '', 'Active'),
(970, 9, 1, '10', 'Oil Pans', '', 'Active'),
(971, 9, 1, '11', 'rebuild Kits', '', 'Active'),
(972, 9, 1, '12', 'Seals & O-Rings', '', 'Active'),
(973, 9, 1, '13', 'Shift Handles', '', 'Active'),
(974, 9, 1, '14', 'Shifters', '', 'Active'),
(975, 9, 1, '15', 'Speedometer Components', '', 'Active'),
(976, 9, 1, '16', 'Temperature Gauges & Sensors', '', 'Active'),
(977, 9, 1, '17', 'Torque Converters & Components', '', 'Active'),
(978, 9, 1, '18', 'Transmission Kits & Components', '', 'Active'),
(979, 9, 1, '19', 'Wiring Harness Connectors', '', 'Active'),
(980, 9, 2, '01', 'Cruise Control Amplifiers & Mo', '', 'Active'),
(981, 9, 2, '02', 'Cruise Control Cables & Bracke', '', 'Active'),
(982, 9, 2, '03', 'Cruise Control Relays', '', 'Active'),
(983, 9, 2, '04', 'Cruise Control Sensor Connecto', '', 'Active'),
(984, 9, 2, '05', 'Cruise Control Sensor Transduc', '', 'Active'),
(985, 9, 2, '06', 'Cruise Control Switch Connecto', '', 'Active'),
(986, 9, 2, '07', 'Cruise Control Switches', '', 'Active'),
(987, 9, 2, '08', 'Cruise Control Units', '', 'Active'),
(988, 9, 2, '09', 'Cruise Control Valves', '', 'Active'),
(989, 9, 3, '01', '4-Wheel Drive (4WD) Hubs', '', 'Active'),
(990, 9, 3, '02', 'Axle Beam Assemblies & Mounts', '', 'Active'),
(991, 9, 3, '03', 'Axle Bearings', '', 'Active'),
(992, 9, 3, '04', 'Axle Flange Gaskets', '', 'Active'),
(993, 9, 3, '05', 'Axle Hardware', '', 'Active'),
(994, 9, 3, '06', 'Axle Hubs & Gaskets', '', 'Active'),
(995, 9, 3, '07', 'Axle Nuts & Lock Plates', '', 'Active'),
(996, 9, 3, '08', 'Axle Shaft & Components', '', 'Active'),
(997, 9, 3, '09', 'Axle Shafts', '', 'Active'),
(998, 9, 3, '10', 'Axle Spindles & Bearings', '', 'Active'),
(999, 9, 3, '11', 'CV Joint Components', '', 'Active'),
(1000, 9, 3, '12', 'Drive Shaft Seals', '', 'Active'),
(1001, 9, 3, '13', 'Intermediate Shaft Bearing', '', 'Active'),
(1002, 9, 3, '14', 'Intermediate Shafts & Related', '', 'Active'),
(1003, 9, 3, '15', 'Pinion Seals', '', 'Active'),
(1004, 9, 3, '16', 'Spindle Lock Nuts', '', 'Active'),
(1005, 9, 3, '17', 'Spindle Nut Sockets', '', 'Active'),
(1006, 9, 3, '18', 'Stub Axles', '', 'Active'),
(1007, 9, 4, '01', 'Differential Bearings', '', 'Active'),
(1008, 9, 4, '02', 'Differential Carrier Bushings', '', 'Active'),
(1009, 9, 4, '03', 'Differential Cases', '', 'Active'),
(1010, 9, 4, '04', 'Differential Covers & Gaskets', '', 'Active'),
(1011, 9, 4, '05', 'Differential Crush Sleeves', '', 'Active'),
(1012, 9, 4, '06', 'Differential Hardware', '', 'Active'),
(1013, 9, 4, '07', 'Differential Mounts', '', 'Active'),
(1014, 9, 4, '08', 'Differential Open Units', '', 'Active'),
(1015, 9, 4, '09', 'Differential Pinions & Related', '', 'Active'),
(1016, 9, 4, '10', 'Differential Seals & Kits', '', 'Active'),
(1017, 9, 4, '11', 'Differential Shims & Kits', '', 'Active'),
(1018, 9, 4, '12', 'Differentials', '', 'Active'),
(1019, 9, 4, '13', 'Differentials & Axles', '', 'Active'),
(1020, 9, 4, '14', 'Fluids & Chemicals', '', 'Active'),
(1021, 9, 4, '15', 'Posi Units', '', 'Active'),
(1022, 9, 5, '01', 'Carrier bearing Spacers', '', 'Active'),
(1023, 9, 5, '02', 'Center Support Bearings', '', 'Active'),
(1024, 9, 5, '03', 'Drive Shaft Bearings', '', 'Active'),
(1025, 9, 5, '04', 'Drive Shaft Couplings & Boots', '', 'Active'),
(1026, 9, 5, '05', 'Drive Shaft Slip Yoke Sleeves', '', 'Active'),
(1027, 9, 5, '06', 'Drie Shaft Support Bushings', '', 'Active'),
(1028, 9, 5, '07', 'Drive Shaft Support Washers', '', 'Active'),
(1029, 9, 5, '08', 'Drive Shafts', '', 'Active'),
(1030, 9, 5, '09', 'Drive Shafts & Axles', '', 'Active'),
(1031, 9, 5, '10', 'Propeller Assemblies', '', 'Active'),
(1032, 9, 5, '11', 'Propeller Shaft Hardware', '', 'Active'),
(1033, 9, 5, '12', 'U-Joint Components', '', 'Active'),
(1034, 9, 5, '13', 'U-Joints', '', 'Active'),
(1035, 9, 6, '01', 'Transmission Fluid', '', 'Active'),
(1036, 9, 6, '02', 'Treatments & Additives', '', 'Active'),
(1037, 9, 7, '01', 'Clutch Cable Hardware', '', 'Active'),
(1038, 9, 7, '02', 'Clutch Cables', '', 'Active'),
(1039, 9, 7, '03', 'Clutch Components', '', 'Active'),
(1040, 9, 7, '04', 'Clutch Discs', '', 'Active'),
(1041, 9, 7, '05', 'Clutch Master Cylinders & Kits', '', 'Active'),
(1042, 9, 7, '06', 'Clutch Operating Shaft Compone', '', 'Active'),
(1043, 9, 7, '07', 'Clutch Pilot Bearings', '', 'Active'),
(1044, 9, 7, '08', 'Clutch Pilot Bushings', '', 'Active'),
(1045, 9, 7, '09', 'Flywheel Components', '', 'Active'),
(1046, 9, 7, '10', 'Flywheels & Flexplates', '', 'Active'),
(1047, 9, 7, '11', 'Gear Shift Components', '', 'Active'),
(1048, 9, 7, '12', 'Manual Transmission Bearings', '', 'Active'),
(1049, 9, 7, '13', 'Manual Transmission Cables', '', 'Active'),
(1050, 9, 7, '14', 'Manual Transmission Components', '', 'Active'),
(1051, 9, 7, '15', 'Manual Transmission Seals', '', 'Active'),
(1052, 9, 7, '16', 'Master & Slave Cylinder Assemb', '', 'Active'),
(1053, 9, 7, '17', 'Pressure Plates & Disc Sets', '', 'Active'),
(1054, 9, 7, '18', 'Release Bearings & Accessories', '', 'Active'),
(1055, 9, 7, '19', 'Shifters', '', 'Active'),
(1056, 9, 7, '20', 'Shifters - Performance', '', 'Active'),
(1057, 9, 8, '01', 'Bearing & Seal Overhaul Kits', '', 'Active'),
(1058, 9, 8, '02', 'Chain Case Seals', '', 'Active'),
(1059, 9, 8, '03', 'Companion Flange Seals', '', 'Active'),
(1060, 9, 8, '04', 'Countershaft Bearings', '', 'Active'),
(1061, 9, 8, '05', 'Differential Bearings', '', 'Active'),
(1062, 9, 8, '06', 'Drive Sprocket Bearings', '', 'Active'),
(1063, 9, 8, '07', 'Idler Shaft Bearings & Seals', '', 'Active'),
(1064, 9, 8, '08', 'Oil Pump Housing Bearings', '', 'Active'),
(1065, 9, 8, '09', 'Oil Pump Housing Seals', '', 'Active'),
(1066, 9, 8, '10', 'Output Shaft Components', '', 'Active'),
(1067, 9, 8, '11', 'Pinion Shaft Components', '', 'Active'),
(1068, 9, 8, '12', 'Transfer Case Assemblies', '', 'Active'),
(1069, 9, 8, '13', 'Transfer Case Bearings & Seals', '', 'Active'),
(1070, 9, 8, '14', 'Transfer Case components', '', 'Active'),
(1071, 9, 9, '01', '(AT) Housing Baskets', '', 'Active'),
(1072, 9, 9, '02', '(AT) Side Cover Gaskets', '', 'Active'),
(1073, 9, 9, '03', 'Differential Carrier Gaskets', '', 'Active'),
(1074, 9, 9, '04', 'Differential Cover Gaskets', '', 'Active'),
(1075, 9, 9, '05', 'Drive Axle Gaskets', '', 'Active'),
(1076, 9, 9, '06', 'Extension Housing Gaskets', '', 'Active'),
(1077, 9, 9, '07', 'Manual Transmission Gasket Sea', '', 'Active'),
(1078, 9, 9, '08', 'Transfer Gear Gaskets', '', 'Active'),
(1079, 9, 9, '09', 'Transmission Gaskets & Sets', '', 'Active'),
(1080, 9, 9, '10', 'Transmission Oil Cooler O-Ring', '', 'Active'),
(1081, 9, 9, '11', 'Valve Body Cover Gaskets', '', 'Active'),
(1082, 9, 10, '01', 'Wheel Bearings', '', 'Active'),
(1083, 9, 10, '02', 'Wheel Hub Hardware', '', 'Active'),
(1084, 9, 10, '03', 'Wheel Races', '', 'Active'),
(1085, 9, 10, '04', 'Wheel Seals', '', 'Active'),
(1086, 9, 10, '05', 'Wheel Spacers', '', 'Active'),
(1087, 9, 10, '06', 'Wheel Studs', '', 'Active'),
(1088, 9, 10, '07', 'Wheels & Components', '', 'Active'),
(1089, 10, 1, '01', 'Base Coat ', 'Cat', 'Active'),
(1090, 10, 1, '02', 'Clear Coat', 'Furnish', 'Active'),
(1091, 10, 1, '03', 'Activators ', 'Penguat Furnish', 'Active'),
(1092, 10, 1, '04', 'Primers', 'Lapisan Dasar', 'Active'),
(1093, 10, 1, '05', 'Thinners', 'Pengencer Cat', 'Active'),
(1094, 10, 1, '06', 'Polyester Putty', 'Dempul', 'Active'),
(1095, 10, 1, '07', 'Polishing Compound', 'Poles', 'Active'),
(1096, 10, 1, '08', 'Plastic Paint System', '', 'Active'),
(1097, 10, 1, '09', 'Sand Paper', 'Amplas', 'Active'),
(1098, 10, 1, '10', 'CPB Brush', 'Kuas', 'Active'),
(1099, 10, 1, '11', 'Other Materials', '', 'Active'),
(1100, 10, 2, '01', 'Engine Repair', '', 'Active'),
(1101, 10, 3, '01', 'Tire Service', '', 'Active'),
(1102, 10, 4, '01', 'Oil Service', '', 'Active'),
(1103, 10, 5, '01', 'Battery service', '', 'Active'),
(1104, 10, 6, '01', 'Car Wash ', '', 'Active'),
(1105, 10, 7, '01', 'Other Services', '', 'Active'),
(1106, 11, 1, '01', 'Body Repair Tools', '', 'Active'),
(1107, 11, 2, '01', 'Engine Repair Tools', '', 'Active'),
(1108, 11, 3, '01', 'Tire Tools', '', 'Active'),
(1109, 11, 4, '01', 'Oil Tools', '', 'Active'),
(1110, 11, 5, '01', 'Battery Tools', '', 'Active'),
(1111, 11, 6, '01', 'Car Wash Tools', '', 'Active'),
(1112, 11, 7, '01', 'Other Services Tools', '', 'Active'),
(1113, 12, 1, '01', 'In-house Bonus', '', 'Active'),
(1114, 12, 2, '01', 'Program Bonus & Discount', '', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_product_sub_master_category`
--
CREATE TABLE IF NOT EXISTS `rims_product_sub_master_category` (
`id` int(11) NOT NULL,
`product_master_category_id` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=97 ;
--
-- Dumping data for table `rims_product_sub_master_category`
--
INSERT INTO `rims_product_sub_master_category` (`id`, `product_master_category_id`, `code`, `name`, `status`) VALUES
(1, 1, 'A', 'Air Filters & Related', 'Active'),
(2, 1, 'B', 'Carburetors & Intake Manifolds', 'Active'),
(3, 1, 'C', 'Carburetion', 'Active'),
(4, 1, 'D', 'Emission', 'Active'),
(5, 1, 'E', 'Exhaust', 'Active'),
(6, 1, 'F', 'Fuel & Oil Filters', 'Active'),
(7, 1, 'G', 'Fuel Injection Sytem', 'Active'),
(8, 1, 'H', 'Fuel Pumps & Tanks', 'Active'),
(9, 1, 'I', 'Nitrous Oxide Systems', 'Active'),
(10, 1, 'J', 'Turbos & Superchargers', 'Active'),
(11, 2, 'A', 'Appearance, Wash & Wax', 'Active'),
(12, 2, 'B', 'Auto Body Parts', 'Active'),
(13, 2, 'C', 'Body Styling & Dress-Up', 'Active'),
(14, 2, 'D', 'Car Covers & Body Protection', 'Active'),
(15, 2, 'E', 'Paint & Body Repair', 'Active'),
(16, 2, 'F', 'Roadside Safety, Lock & Alarms', 'Active'),
(17, 2, 'G', 'Seasonal Accessories', 'Active'),
(18, 2, 'H', 'Storage & Cargo', 'Active'),
(19, 2, 'I', 'Windshield, Doors & Window', 'Active'),
(20, 3, 'A', 'Air Bag System & Related', 'Active'),
(21, 3, 'B', 'Alternators, Generators & rela', 'Active'),
(22, 3, 'C', 'Batterie', 'Active'),
(23, 3, 'D', 'Battery Components & Tools', 'Active'),
(24, 3, 'E', 'Charging System', 'Active'),
(25, 3, 'F', 'Electrical Connectors & Socket', 'Active'),
(26, 3, 'G', 'Lights, Flasher Units, Fuses', 'Active'),
(27, 3, 'H', 'Relays, Switches & Sensors', 'Active'),
(28, 3, 'I', 'Starters & Related', 'Active'),
(29, 4, 'A', 'ABS Components', 'Active'),
(30, 4, 'B', 'Brake Calipers & Related', 'Active'),
(31, 4, 'C', 'Brake Drums & Rotors', 'Active'),
(32, 4, 'D', 'Brake Hardware & Components', 'Active'),
(33, 4, 'E', 'Brake Pads & Shoes', 'Active'),
(34, 4, 'F', 'Power Steering Hoses & Pumps', 'Active'),
(35, 4, 'G', 'Shocks & Struts', 'Active'),
(36, 4, 'H', 'Steering, Gear & Pumps', 'Active'),
(37, 4, 'I', 'Suspension, Springs & Related', 'Active'),
(38, 4, 'J', 'Wheel & Tire Parts', 'Active'),
(39, 5, 'A', 'AC Accumulators & Driers', 'Active'),
(40, 5, 'B', 'AC Clutches & Compressors', 'Active'),
(41, 5, 'C', 'AC Tools, Hardware & Adapters', 'Active'),
(42, 5, 'D', 'Belts & Hoses', 'Active'),
(43, 5, 'E', 'Cooling & Water Pumps', 'Active'),
(44, 5, 'F', 'Cooling Fans, Clutches & Motor', 'Active'),
(45, 5, 'G', 'Fluids & Chemicals', 'Active'),
(46, 5, 'H', 'Heater Motors & Cores', 'Active'),
(47, 5, 'I', 'Radiators, Coolers & Related', 'Active'),
(48, 5, 'J', 'Thermostats, Gaskets & Housing', 'Active'),
(49, 6, 'A', 'Camera & Cell Phone Accessorie', 'Active'),
(50, 6, 'B', 'Car Audio & Video', 'Active'),
(51, 6, 'C', 'Gauges & Components', 'Active'),
(52, 6, 'D', 'Instrument Panel & Dash', 'Active'),
(53, 6, 'E', 'Navigation', 'Active'),
(54, 6, 'F', 'Radar & Laser Detection', 'Active'),
(55, 7, 'A', 'Cylinder Block Components', 'Active'),
(56, 7, 'B', 'Engine Components', 'Active'),
(57, 7, 'C', 'Engine Electronics', 'Active'),
(58, 7, 'D', 'Engine Gaskets & Seals', 'Active'),
(59, 7, 'E', 'Ignition & Tune-Up', 'Active'),
(60, 7, 'F', 'Motor Oil & Additives', 'Active'),
(61, 7, 'G', 'Valve Train Components', 'Active'),
(62, 8, 'A', 'Fluids & Chemicals', 'Active'),
(63, 8, 'B', 'Gaskets, Sealers, Grease & Lub', 'Active'),
(64, 8, 'C', 'Hand Tools', 'Active'),
(65, 8, 'D', 'Hardware & Fasteners', 'Active'),
(66, 8, 'E', 'Repair Manuals & Diagrams', 'Active'),
(67, 8, 'F', 'Shop Equipment', 'Active'),
(68, 8, 'G', 'Specialty Tools', 'Active'),
(69, 8, 'H', 'Storage & Containers', 'Active'),
(70, 8, 'I', 'Workwear & Gloves', 'Active'),
(71, 9, 'A', 'Automatic Transmission', 'Active'),
(72, 9, 'B', 'Cruise Control', 'Active'),
(73, 9, 'C', 'CV Axles & Parts', 'Active'),
(74, 9, 'D', 'Differential', 'Active'),
(75, 9, 'E', 'Drive Shaft', 'Active'),
(76, 9, 'F', 'Fluids & Chemicals', 'Active'),
(77, 9, 'G', 'Manual Transmissions', 'Active'),
(78, 9, 'H', 'Transfer Case Parts', 'Active'),
(79, 9, 'I', 'Transmission Gaskets', 'Active'),
(80, 9, 'J', 'Wheels Bearings, Seals & Relat', 'Active'),
(81, 10, 'A', 'Body Repair', 'Active'),
(82, 10, 'B', 'Engine Repair', 'Active'),
(83, 10, 'C', 'Tire Service', 'Active'),
(84, 10, 'D', 'Oil Service', 'Active'),
(85, 10, 'E', 'Battery Service', 'Active'),
(86, 10, 'F', 'Car Wash', 'Active'),
(87, 10, 'G', 'Other Services', 'Active'),
(88, 11, 'A', 'Body Repair Tools', 'Active'),
(89, 11, 'B', 'Engine Repair Tools', 'Active'),
(90, 11, 'C', 'Tire Tools', 'Active'),
(91, 11, 'D', 'Oil Tools', 'Active'),
(92, 11, 'E', 'Battery Tools', 'Active'),
(93, 11, 'F', 'Car Wash Tools', 'Active'),
(94, 11, 'G', 'Other Services Tools', 'Active'),
(95, 12, 'A', 'In-house Bonus', 'Active'),
(96, 12, 'B', 'Program Bonus & Discount', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_province`
--
CREATE TABLE IF NOT EXISTS `rims_province` (
`id` int(11) NOT NULL,
`name` varchar(100) DEFAULT NULL,
`code` varchar(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=35 ;
--
-- Dumping data for table `rims_province`
--
INSERT INTO `rims_province` (`id`, `name`, `code`) VALUES
(1, 'Nanggroe Aceh Darussalam', NULL),
(2, 'Sumatera Utara', NULL),
(3, 'Sumatera Barat', NULL),
(4, 'Riau', NULL),
(5, 'Kepulauan Riau', NULL),
(6, 'Kepulauan Bangka-Belitung', NULL),
(7, 'Jambi', NULL),
(8, 'Bengkulu', NULL),
(9, 'Sumatera Selatan', NULL),
(10, 'Lampung', NULL),
(11, 'Banten', NULL),
(12, 'DKI Jakarta', NULL),
(13, 'Jawa Barat', NULL),
(14, 'Jawa Tengah', NULL),
(15, 'Daerah Istimewa Yogyakarta', NULL),
(16, 'Jawa Timur', NULL),
(17, 'Bali', NULL),
(18, 'Nusa Tenggara Barat', NULL),
(19, 'Nusa Tenggara Timur', NULL),
(20, 'Kalimantan Barat', NULL),
(21, 'Kalimantan Tengah', NULL),
(22, 'Kalimantan Selatan', NULL),
(23, 'Kalimantan Timur', NULL),
(24, 'Gorontalo', NULL),
(25, 'Sulawesi Selatan', NULL),
(26, 'Sulawesi Tenggara', NULL),
(27, 'Sulawesi Tengah', NULL),
(28, 'Sulawesi Utara', NULL),
(29, 'Sulawesi Barat', NULL),
(30, 'Maluku', NULL),
(31, 'Maluku Utara', NULL),
(32, 'Papua Barat', NULL),
(33, 'Papua', NULL),
(34, 'Kalimantan Utara', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `rims_section`
--
CREATE TABLE IF NOT EXISTS `rims_section` (
`id` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`rack_number` varchar(20) NOT NULL,
`column` varchar(20) NOT NULL,
`row` varchar(20) NOT NULL,
`status` varchar(10) NOT NULL,
`warehouse_id` int(11) NOT NULL,
`product_category_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_section_detail`
--
CREATE TABLE IF NOT EXISTS `rims_section_detail` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_supplier`
--
CREATE TABLE IF NOT EXISTS `rims_supplier` (
`id` int(11) NOT NULL,
`date` date DEFAULT NULL,
`code` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`company` varchar(30) NOT NULL,
`position` varchar(30) NOT NULL,
`address` text NOT NULL,
`province_id` int(11) NOT NULL,
`city_id` int(11) NOT NULL,
`zipcode` varchar(10) NOT NULL,
`fax` varchar(20) NOT NULL,
`email_personal` varchar(60) NOT NULL,
`email_company` varchar(60) NOT NULL,
`npwp` varchar(20) NOT NULL,
`description` varchar(60) NOT NULL,
`tenor` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `rims_supplier`
--
INSERT INTO `rims_supplier` (`id`, `date`, `code`, `name`, `company`, `position`, `address`, `province_id`, `city_id`, `zipcode`, `fax`, `email_personal`, `email_company`, `npwp`, `description`, `tenor`) VALUES
(1, '2015-10-13', 'S-01', 'Supplier1', 'PT. Astra Internasional', 'Anything', 'Gading', 12, 42, '32121', '02198321212', 'supplier1@gmail.com', 'supplier1@astra.com', '123123123132132131', 'Testing', 30),
(2, '2015-10-15', 'S-02', 'Supplier 2', 'PT. ABCDEFEGESDFS', 'Marketing', 'JL 123450943402', 12, 40, '32121', '0219832121', 'supplier2@gmail.com', 'supplier2@abcdefghijklm.com', '123878983231', 'Testing2', 30);
-- --------------------------------------------------------
--
-- Table structure for table `rims_supplier_bank`
--
CREATE TABLE IF NOT EXISTS `rims_supplier_bank` (
`id` int(11) NOT NULL,
`bank_id` int(11) DEFAULT NULL,
`supplier_id` int(11) DEFAULT NULL,
`account_no` varchar(20) DEFAULT NULL,
`account_name` varchar(100) DEFAULT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=13 ;
--
-- Dumping data for table `rims_supplier_bank`
--
INSERT INTO `rims_supplier_bank` (`id`, `bank_id`, `supplier_id`, `account_no`, `account_name`, `status`) VALUES
(2, 9, 2, '9231232131', 'Test', 'Active'),
(10, 1, 1, '132', '78905', 'Active'),
(11, 7, 1, '345', '9846', 'Active'),
(12, 3, 1, '456', '123490', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_supplier_mobile`
--
CREATE TABLE IF NOT EXISTS `rims_supplier_mobile` (
`id` int(11) NOT NULL,
`supplier_id` int(11) DEFAULT NULL,
`mobile_no` varchar(20) DEFAULT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `rims_supplier_mobile`
--
INSERT INTO `rims_supplier_mobile` (`id`, `supplier_id`, `mobile_no`, `status`) VALUES
(1, 1, '08675562712', NULL),
(2, 1, '081239120345', NULL),
(3, 2, '09875567211', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_supplier_phone`
--
CREATE TABLE IF NOT EXISTS `rims_supplier_phone` (
`id` int(11) NOT NULL,
`supplier_id` int(11) DEFAULT NULL,
`phone_no` varchar(20) DEFAULT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Dumping data for table `rims_supplier_phone`
--
INSERT INTO `rims_supplier_phone` (`id`, `supplier_id`, `phone_no`, `status`) VALUES
(1, 1, '02198123121', NULL),
(2, 2, '0212231879', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_supplier_pic`
--
CREATE TABLE IF NOT EXISTS `rims_supplier_pic` (
`id` int(11) NOT NULL,
`supplier_id` int(11) DEFAULT NULL COMMENT 'foreign key from supplier table',
`date` date DEFAULT NULL,
`code` varchar(20) DEFAULT NULL,
`name` varchar(30) DEFAULT NULL,
`company` varchar(30) DEFAULT NULL,
`position` varchar(30) DEFAULT NULL,
`address` text,
`province_id` int(11) DEFAULT NULL,
`city_id` int(11) DEFAULT NULL,
`zipcode` varchar(10) DEFAULT NULL,
`fax` varchar(20) DEFAULT NULL,
`email_personal` varchar(60) DEFAULT NULL,
`email_company` varchar(60) DEFAULT NULL,
`npwp` varchar(20) DEFAULT NULL,
`description` varchar(60) DEFAULT NULL,
`status` varchar(10) DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data for table `rims_supplier_pic`
--
INSERT INTO `rims_supplier_pic` (`id`, `supplier_id`, `date`, `code`, `name`, `company`, `position`, `address`, `province_id`, `city_id`, `zipcode`, `fax`, `email_personal`, `email_company`, `npwp`, `description`, `status`) VALUES
(1, 1, '2015-10-28', 'pic 1', 'pic 1234', 'PT. Astra International', 'Purchasing', 'Testing', 12, 39, '11340', '02198321212', 'pic@gmail.com', 'pic@astra.com', '323138912313', 'Testing', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_supplier_pic_mobile`
--
CREATE TABLE IF NOT EXISTS `rims_supplier_pic_mobile` (
`id` int(11) NOT NULL,
`supplier_pic_id` int(11) DEFAULT NULL,
`mobile_no` varchar(20) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_supplier_pic_phone`
--
CREATE TABLE IF NOT EXISTS `rims_supplier_pic_phone` (
`id` int(11) NOT NULL,
`supplier_pic_id` int(11) DEFAULT NULL,
`phone_no` varchar(20) DEFAULT NULL,
`status` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `rims_unit`
--
CREATE TABLE IF NOT EXISTS `rims_unit` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
--
-- Dumping data for table `rims_unit`
--
INSERT INTO `rims_unit` (`id`, `name`, `status`) VALUES
(7, 'Pieces', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_vehicle`
--
CREATE TABLE IF NOT EXISTS `rims_vehicle` (
`id` int(11) NOT NULL,
`plate_number` varchar(10) NOT NULL,
`machine_number` varchar(30) NOT NULL,
`frame_number` varchar(30) NOT NULL,
`car_make_id` int(11) DEFAULT NULL,
`car_model_id` int(11) DEFAULT NULL,
`car_sub_model_id` int(11) DEFAULT NULL,
`color_id` int(11) DEFAULT NULL,
`year` varchar(10) DEFAULT NULL,
`customer_id` int(11) DEFAULT NULL,
`customer_pic_id` int(11) DEFAULT NULL,
`chasis_id` varchar(30) DEFAULT NULL,
`power_cc` int(30) DEFAULT NULL,
`luxury_value` decimal(8,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `rims_vehicle`
--
INSERT INTO `rims_vehicle` (`id`, `plate_number`, `machine_number`, `frame_number`, `car_make_id`, `car_model_id`, `car_sub_model_id`, `color_id`, `year`, `customer_id`, `customer_pic_id`, `chasis_id`, `power_cc`, `luxury_value`) VALUES
(1, 'B1231ERT', '123-456-PPT-32', '234-567-123-FN', 1, 1, 1, 1, '2012', 1, 1, 'E01', 1500, '1.00'),
(2, 'B 1171 TYR', '0433jk94353', 'jkl0234', 1, 1, 1, 1, '2012', 29, 2, '988765677655', 1500, '1.20'),
(3, 'b1167jkl', '4234234234', 'fadsfa799767', 1, 1, 1, 1, '2015', 29, 2, '0985544677', 1500, '1.00');
-- --------------------------------------------------------
--
-- Table structure for table `rims_vehicle_car_make`
--
CREATE TABLE IF NOT EXISTS `rims_vehicle_car_make` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `rims_vehicle_car_make`
--
INSERT INTO `rims_vehicle_car_make` (`id`, `name`, `status`) VALUES
(1, 'BMW', 'Active'),
(2, 'Toyota', 'Active'),
(3, 'Honda', 'Active'),
(4, 'Mercedes Benz', 'Active'),
(5, 'Daihatsu', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_vehicle_car_model`
--
CREATE TABLE IF NOT EXISTS `rims_vehicle_car_model` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`description` varchar(60) NOT NULL,
`car_make_id` int(11) NOT NULL COMMENT 'foreign key from vehicle brand table',
`status` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Dumping data for table `rims_vehicle_car_model`
--
INSERT INTO `rims_vehicle_car_model` (`id`, `name`, `description`, `car_make_id`, `status`) VALUES
(1, 'E320', 'BMW E320', 1, 'Active'),
(2, 'Avanza', 'MPV', 2, 'Active'),
(3, 'Harrier', 'SUV', 2, 'Active'),
(4, 'C Class', 'C Class', 4, 'Active'),
(5, 'E Class', 'E Series', 4, 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_vehicle_car_sub_detail`
--
CREATE TABLE IF NOT EXISTS `rims_vehicle_car_sub_detail` (
`id` int(11) NOT NULL,
`style_name` varchar(10) NOT NULL,
`assembly_year` varchar(10) NOT NULL,
`assembly_year_end` varchar(10) NOT NULL,
`transmission_id` int(11) NOT NULL,
`fuel_type` varchar(20) NOT NULL,
`brand_id` int(11) NOT NULL,
`sub_brand_id` int(11) NOT NULL,
`status` varchar(10) NOT NULL,
`power_id` int(11) NOT NULL,
`drivetrain` varchar(10) NOT NULL,
`chasis_id` int(11) NOT NULL,
`description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `rims_vehicle_car_sub_detail`
--
INSERT INTO `rims_vehicle_car_sub_detail` (`id`, `style_name`, `assembly_year`, `assembly_year_end`, `transmission_id`, `fuel_type`, `brand_id`, `sub_brand_id`, `status`, `power_id`, `drivetrain`, `chasis_id`, `description`) VALUES
(1, 'S01', '2013', '2015', 0, 'Gasoline', 1, 1, 'Active', 500, '4WD', 0, ''),
(2, 'C200', '2007', '2014', 0, 'Gasoline', 4, 4, 'Active', 2000, '2WD', 0, ''),
(3, 'C200', '2015', '2016', 0, 'Gasoline', 4, 4, 'Active', 2500, '2WD', 0, '');
-- --------------------------------------------------------
--
-- Table structure for table `rims_warehouse`
--
CREATE TABLE IF NOT EXISTS `rims_warehouse` (
`id` int(11) NOT NULL,
`code` varchar(20) NOT NULL,
`name` varchar(30) NOT NULL,
`description` varchar(60) NOT NULL,
`status` varchar(10) NOT NULL DEFAULT 'Active'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;
--
-- Dumping data for table `rims_warehouse`
--
INSERT INTO `rims_warehouse` (`id`, `code`, `name`, `description`, `status`) VALUES
(1, 'B01-W01', 'Warehouse1', 'Testing', 'Inactive'),
(2, 'B02-W02', 'Warehouse 2', 'Testing2', 'Active'),
(3, 'B03-W03', 'Warehouse 3', 'Testing', 'Active'),
(4, 'B04-W04', 'Warehouse 4', 'Testing', 'Active'),
(5, 'B05-W05', 'Warehouse 5', 'Testing', 'Active'),
(6, 'B06-W06', 'Warehouse 6', 'Testing', 'Active'),
(7, 'B07-W07', 'Warehouse 7', 'Testing', 'Active'),
(8, 'B08-W08', 'Warehouse 8', 'Testing2', 'Active'),
(9, 'B08-W09', 'Warehouse 9', 'Testing', 'Active'),
(10, 'B03-W03', 'Warehouse 10', 'Testing2', 'Active'),
(11, 'B03-W03', '365421', 'Testing2', 'Active'),
(12, 'B01-W07', 'Warehouse B-7', 'Testing', 'Active'),
(13, 'W-R1-01', 'Warehouse - GR', 'General Repair Warehouse', 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `rims_warehouse_division`
--
CREATE TABLE IF NOT EXISTS `rims_warehouse_division` (
`id` int(11) NOT NULL,
`warehouse_id` int(11) DEFAULT NULL,
`division_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `rims_warehouse_division`
--
INSERT INTO `rims_warehouse_division` (`id`, `warehouse_id`, `division_id`) VALUES
(3, 1, 4),
(4, 1, 5),
(1, 5, 1),
(2, 10, 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `rims_bank`
--
ALTER TABLE `rims_bank`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_branch`
--
ALTER TABLE `rims_branch`
ADD PRIMARY KEY (`id`), ADD KEY `province_id` (`province_id`), ADD KEY `city_id` (`city_id`);
--
-- Indexes for table `rims_branch_fax`
--
ALTER TABLE `rims_branch_fax`
ADD PRIMARY KEY (`id`), ADD KEY `branch_id` (`branch_id`);
--
-- Indexes for table `rims_branch_phone`
--
ALTER TABLE `rims_branch_phone`
ADD PRIMARY KEY (`id`), ADD KEY `branch_id` (`branch_id`);
--
-- Indexes for table `rims_branch_warehouse`
--
ALTER TABLE `rims_branch_warehouse`
ADD PRIMARY KEY (`id`), ADD KEY `warehouse_id` (`warehouse_id`), ADD KEY `branch_id` (`branch_id`);
--
-- Indexes for table `rims_chasis_code`
--
ALTER TABLE `rims_chasis_code`
ADD PRIMARY KEY (`id`), ADD KEY `brand_id` (`brand_id`);
--
-- Indexes for table `rims_city`
--
ALTER TABLE `rims_city`
ADD PRIMARY KEY (`id`), ADD KEY `province_id` (`province_id`);
--
-- Indexes for table `rims_colors`
--
ALTER TABLE `rims_colors`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_customer`
--
ALTER TABLE `rims_customer`
ADD PRIMARY KEY (`id`), ADD KEY `province_id` (`province_id`), ADD KEY `city_id` (`city_id`);
--
-- Indexes for table `rims_customer_mobile`
--
ALTER TABLE `rims_customer_mobile`
ADD PRIMARY KEY (`id`), ADD KEY `customer_id` (`customer_id`);
--
-- Indexes for table `rims_customer_phone`
--
ALTER TABLE `rims_customer_phone`
ADD PRIMARY KEY (`id`), ADD KEY `customer_id` (`customer_id`);
--
-- Indexes for table `rims_customer_pic`
--
ALTER TABLE `rims_customer_pic`
ADD PRIMARY KEY (`id`), ADD KEY `province_id` (`province_id`), ADD KEY `city_id` (`city_id`), ADD KEY `customer_id` (`customer_id`);
--
-- Indexes for table `rims_customer_pic_mobile`
--
ALTER TABLE `rims_customer_pic_mobile`
ADD PRIMARY KEY (`id`), ADD KEY `customer_pic_id` (`customer_pic_id`);
--
-- Indexes for table `rims_customer_pic_phone`
--
ALTER TABLE `rims_customer_pic_phone`
ADD PRIMARY KEY (`id`), ADD KEY `customer_pic_id` (`customer_pic_id`);
--
-- Indexes for table `rims_customer_service_rate`
--
ALTER TABLE `rims_customer_service_rate`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_deduction`
--
ALTER TABLE `rims_deduction`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_division`
--
ALTER TABLE `rims_division`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_division_branch`
--
ALTER TABLE `rims_division_branch`
ADD PRIMARY KEY (`id`), ADD KEY `division_id` (`division_id`), ADD KEY `branch_id` (`branch_id`);
--
-- Indexes for table `rims_division_position`
--
ALTER TABLE `rims_division_position`
ADD PRIMARY KEY (`id`), ADD KEY `position_id` (`position_id`), ADD KEY `division_id` (`division_id`);
--
-- Indexes for table `rims_employee`
--
ALTER TABLE `rims_employee`
ADD PRIMARY KEY (`id`), ADD KEY `province_id` (`province_id`), ADD KEY `city_id` (`city_id`), ADD KEY `home_city` (`home_city`), ADD KEY `home_province` (`home_province`);
--
-- Indexes for table `rims_employee_bank`
--
ALTER TABLE `rims_employee_bank`
ADD PRIMARY KEY (`id`), ADD KEY `bank_id` (`bank_id`,`employee_id`), ADD KEY `employee_id` (`employee_id`);
--
-- Indexes for table `rims_employee_deductions`
--
ALTER TABLE `rims_employee_deductions`
ADD PRIMARY KEY (`id`), ADD KEY `employee_id` (`employee_id`), ADD KEY `deduction_id` (`deduction_id`);
--
-- Indexes for table `rims_employee_division_position_level`
--
ALTER TABLE `rims_employee_division_position_level`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_employee_incentives`
--
ALTER TABLE `rims_employee_incentives`
ADD PRIMARY KEY (`id`), ADD KEY `employee_id` (`employee_id`), ADD KEY `incentive_id` (`incentive_id`);
--
-- Indexes for table `rims_employee_mobile`
--
ALTER TABLE `rims_employee_mobile`
ADD PRIMARY KEY (`id`), ADD KEY `employee_id` (`employee_id`);
--
-- Indexes for table `rims_employee_phone`
--
ALTER TABLE `rims_employee_phone`
ADD PRIMARY KEY (`id`), ADD KEY `employee_id` (`employee_id`);
--
-- Indexes for table `rims_incentive`
--
ALTER TABLE `rims_incentive`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_level`
--
ALTER TABLE `rims_level`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_onvetrains`
--
ALTER TABLE `rims_onvetrains`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_position`
--
ALTER TABLE `rims_position`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_position_level`
--
ALTER TABLE `rims_position_level`
ADD PRIMARY KEY (`id`), ADD KEY `level_id` (`level_id`), ADD KEY `position_id` (`position_id`);
--
-- Indexes for table `rims_powercc`
--
ALTER TABLE `rims_powercc`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_product`
--
ALTER TABLE `rims_product`
ADD PRIMARY KEY (`id`), ADD KEY `product_master_category_id` (`product_master_category_id`), ADD KEY `product_sub_master_category_id` (`product_sub_master_category_id`), ADD KEY `product_sub_category_id` (`product_sub_category_id`), ADD KEY `product_type_id` (`product_specification_type_id`), ADD KEY `car_make_id` (`vehicle_car_make_id`), ADD KEY `car_model_id` (`vehicle_car_model_id`);
--
-- Indexes for table `rims_product_master_category`
--
ALTER TABLE `rims_product_master_category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_product_specification_info`
--
ALTER TABLE `rims_product_specification_info`
ADD PRIMARY KEY (`id`), ADD KEY `product_specification_type_id` (`product_specification_type_id`);
--
-- Indexes for table `rims_product_specification_type`
--
ALTER TABLE `rims_product_specification_type`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_product_sub_category`
--
ALTER TABLE `rims_product_sub_category`
ADD PRIMARY KEY (`id`), ADD KEY `product_sub_master_category_id` (`product_sub_master_category_id`), ADD KEY `product_master_category` (`product_master_category`);
--
-- Indexes for table `rims_product_sub_master_category`
--
ALTER TABLE `rims_product_sub_master_category`
ADD PRIMARY KEY (`id`), ADD KEY `product_category_id` (`product_master_category_id`);
--
-- Indexes for table `rims_province`
--
ALTER TABLE `rims_province`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_section`
--
ALTER TABLE `rims_section`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_section_detail`
--
ALTER TABLE `rims_section_detail`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_supplier`
--
ALTER TABLE `rims_supplier`
ADD PRIMARY KEY (`id`), ADD KEY `province_id` (`province_id`), ADD KEY `city_id` (`city_id`);
--
-- Indexes for table `rims_supplier_bank`
--
ALTER TABLE `rims_supplier_bank`
ADD PRIMARY KEY (`id`), ADD KEY `bank_id` (`bank_id`,`supplier_id`), ADD KEY `supplier_id` (`supplier_id`);
--
-- Indexes for table `rims_supplier_mobile`
--
ALTER TABLE `rims_supplier_mobile`
ADD PRIMARY KEY (`id`), ADD KEY `supplier_id` (`supplier_id`);
--
-- Indexes for table `rims_supplier_phone`
--
ALTER TABLE `rims_supplier_phone`
ADD PRIMARY KEY (`id`), ADD KEY `supplier_id` (`supplier_id`);
--
-- Indexes for table `rims_supplier_pic`
--
ALTER TABLE `rims_supplier_pic`
ADD PRIMARY KEY (`id`), ADD KEY `supplier_id` (`supplier_id`), ADD KEY `city_id` (`city_id`), ADD KEY `province_id` (`province_id`);
--
-- Indexes for table `rims_supplier_pic_mobile`
--
ALTER TABLE `rims_supplier_pic_mobile`
ADD PRIMARY KEY (`id`), ADD KEY `supplier_pic_id` (`supplier_pic_id`);
--
-- Indexes for table `rims_supplier_pic_phone`
--
ALTER TABLE `rims_supplier_pic_phone`
ADD PRIMARY KEY (`id`), ADD KEY `supplier_pic_id` (`supplier_pic_id`);
--
-- Indexes for table `rims_unit`
--
ALTER TABLE `rims_unit`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_vehicle`
--
ALTER TABLE `rims_vehicle`
ADD PRIMARY KEY (`id`), ADD KEY `customer_id` (`customer_id`), ADD KEY `customer_pic_id` (`customer_pic_id`), ADD KEY `car_make_id` (`car_make_id`), ADD KEY `car_model_id` (`car_model_id`), ADD KEY `car_sub_model_id` (`car_sub_model_id`);
--
-- Indexes for table `rims_vehicle_car_make`
--
ALTER TABLE `rims_vehicle_car_make`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_vehicle_car_model`
--
ALTER TABLE `rims_vehicle_car_model`
ADD PRIMARY KEY (`id`), ADD KEY `car_make_id` (`car_make_id`), ADD KEY `car_make_id_2` (`car_make_id`);
--
-- Indexes for table `rims_vehicle_car_sub_detail`
--
ALTER TABLE `rims_vehicle_car_sub_detail`
ADD PRIMARY KEY (`id`), ADD KEY `brand_id` (`brand_id`), ADD KEY `brand_id_2` (`brand_id`), ADD KEY `chasis_id` (`chasis_id`), ADD KEY `chasis_id_2` (`chasis_id`), ADD KEY `brand_id_3` (`brand_id`), ADD KEY `sub_brand_id` (`sub_brand_id`), ADD KEY `chasis_id_3` (`chasis_id`), ADD KEY `chasis_id_4` (`chasis_id`), ADD KEY `chasis_id_5` (`chasis_id`), ADD KEY `chasis_id_6` (`chasis_id`);
--
-- Indexes for table `rims_warehouse`
--
ALTER TABLE `rims_warehouse`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `rims_warehouse_division`
--
ALTER TABLE `rims_warehouse_division`
ADD PRIMARY KEY (`id`), ADD KEY `warehouse_id` (`warehouse_id`,`division_id`), ADD KEY `division_id` (`division_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `rims_bank`
--
ALTER TABLE `rims_bank`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=136;
--
-- AUTO_INCREMENT for table `rims_branch`
--
ALTER TABLE `rims_branch`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `rims_branch_fax`
--
ALTER TABLE `rims_branch_fax`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `rims_branch_phone`
--
ALTER TABLE `rims_branch_phone`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `rims_branch_warehouse`
--
ALTER TABLE `rims_branch_warehouse`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `rims_chasis_code`
--
ALTER TABLE `rims_chasis_code`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `rims_city`
--
ALTER TABLE `rims_city`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=99;
--
-- AUTO_INCREMENT for table `rims_colors`
--
ALTER TABLE `rims_colors`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `rims_customer`
--
ALTER TABLE `rims_customer`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=30;
--
-- AUTO_INCREMENT for table `rims_customer_mobile`
--
ALTER TABLE `rims_customer_mobile`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `rims_customer_phone`
--
ALTER TABLE `rims_customer_phone`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `rims_customer_pic`
--
ALTER TABLE `rims_customer_pic`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `rims_customer_pic_mobile`
--
ALTER TABLE `rims_customer_pic_mobile`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_customer_pic_phone`
--
ALTER TABLE `rims_customer_pic_phone`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_customer_service_rate`
--
ALTER TABLE `rims_customer_service_rate`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_deduction`
--
ALTER TABLE `rims_deduction`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `rims_division`
--
ALTER TABLE `rims_division`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `rims_division_branch`
--
ALTER TABLE `rims_division_branch`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `rims_division_position`
--
ALTER TABLE `rims_division_position`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `rims_employee`
--
ALTER TABLE `rims_employee`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `rims_employee_bank`
--
ALTER TABLE `rims_employee_bank`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `rims_employee_deductions`
--
ALTER TABLE `rims_employee_deductions`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `rims_employee_division_position_level`
--
ALTER TABLE `rims_employee_division_position_level`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `rims_employee_incentives`
--
ALTER TABLE `rims_employee_incentives`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `rims_employee_mobile`
--
ALTER TABLE `rims_employee_mobile`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `rims_employee_phone`
--
ALTER TABLE `rims_employee_phone`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `rims_incentive`
--
ALTER TABLE `rims_incentive`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `rims_level`
--
ALTER TABLE `rims_level`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `rims_onvetrains`
--
ALTER TABLE `rims_onvetrains`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_position`
--
ALTER TABLE `rims_position`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `rims_position_level`
--
ALTER TABLE `rims_position_level`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `rims_powercc`
--
ALTER TABLE `rims_powercc`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `rims_product`
--
ALTER TABLE `rims_product`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_product_master_category`
--
ALTER TABLE `rims_product_master_category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `rims_product_specification_info`
--
ALTER TABLE `rims_product_specification_info`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_product_specification_type`
--
ALTER TABLE `rims_product_specification_type`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_product_sub_category`
--
ALTER TABLE `rims_product_sub_category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1116;
--
-- AUTO_INCREMENT for table `rims_product_sub_master_category`
--
ALTER TABLE `rims_product_sub_master_category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=97;
--
-- AUTO_INCREMENT for table `rims_province`
--
ALTER TABLE `rims_province`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=35;
--
-- AUTO_INCREMENT for table `rims_section`
--
ALTER TABLE `rims_section`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_section_detail`
--
ALTER TABLE `rims_section_detail`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_supplier`
--
ALTER TABLE `rims_supplier`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `rims_supplier_bank`
--
ALTER TABLE `rims_supplier_bank`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `rims_supplier_mobile`
--
ALTER TABLE `rims_supplier_mobile`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `rims_supplier_phone`
--
ALTER TABLE `rims_supplier_phone`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `rims_supplier_pic`
--
ALTER TABLE `rims_supplier_pic`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `rims_supplier_pic_mobile`
--
ALTER TABLE `rims_supplier_pic_mobile`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_supplier_pic_phone`
--
ALTER TABLE `rims_supplier_pic_phone`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `rims_unit`
--
ALTER TABLE `rims_unit`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `rims_vehicle`
--
ALTER TABLE `rims_vehicle`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `rims_vehicle_car_make`
--
ALTER TABLE `rims_vehicle_car_make`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `rims_vehicle_car_model`
--
ALTER TABLE `rims_vehicle_car_model`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `rims_vehicle_car_sub_detail`
--
ALTER TABLE `rims_vehicle_car_sub_detail`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `rims_warehouse`
--
ALTER TABLE `rims_warehouse`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `rims_warehouse_division`
--
ALTER TABLE `rims_warehouse_division`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `rims_branch`
--
ALTER TABLE `rims_branch`
ADD CONSTRAINT `rims_branch_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `rims_province` (`id`),
ADD CONSTRAINT `rims_branch_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `rims_city` (`id`);
--
-- Constraints for table `rims_branch_fax`
--
ALTER TABLE `rims_branch_fax`
ADD CONSTRAINT `rims_branch_fax_ibfk_1` FOREIGN KEY (`branch_id`) REFERENCES `rims_branch` (`id`);
--
-- Constraints for table `rims_branch_phone`
--
ALTER TABLE `rims_branch_phone`
ADD CONSTRAINT `rims_branch_phone_ibfk_1` FOREIGN KEY (`branch_id`) REFERENCES `rims_branch` (`id`);
--
-- Constraints for table `rims_branch_warehouse`
--
ALTER TABLE `rims_branch_warehouse`
ADD CONSTRAINT `rims_branch_warehouse_ibfk_1` FOREIGN KEY (`branch_id`) REFERENCES `rims_branch` (`id`),
ADD CONSTRAINT `rims_branch_warehouse_ibfk_2` FOREIGN KEY (`warehouse_id`) REFERENCES `rims_warehouse` (`id`);
--
-- Constraints for table `rims_chasis_code`
--
ALTER TABLE `rims_chasis_code`
ADD CONSTRAINT `rims_chasis_code_ibfk_1` FOREIGN KEY (`brand_id`) REFERENCES `rims_vehicle_car_make` (`id`);
--
-- Constraints for table `rims_city`
--
ALTER TABLE `rims_city`
ADD CONSTRAINT `rims_city_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `rims_province` (`id`);
--
-- Constraints for table `rims_customer`
--
ALTER TABLE `rims_customer`
ADD CONSTRAINT `rims_customer_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `rims_province` (`id`),
ADD CONSTRAINT `rims_customer_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `rims_city` (`id`);
--
-- Constraints for table `rims_customer_mobile`
--
ALTER TABLE `rims_customer_mobile`
ADD CONSTRAINT `rims_customer_mobile_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `rims_customer` (`id`);
--
-- Constraints for table `rims_customer_phone`
--
ALTER TABLE `rims_customer_phone`
ADD CONSTRAINT `rims_customer_phone_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `rims_customer` (`id`);
--
-- Constraints for table `rims_customer_pic`
--
ALTER TABLE `rims_customer_pic`
ADD CONSTRAINT `rims_customer_pic_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `rims_province` (`id`),
ADD CONSTRAINT `rims_customer_pic_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `rims_city` (`id`),
ADD CONSTRAINT `rims_customer_pic_ibfk_3` FOREIGN KEY (`customer_id`) REFERENCES `rims_customer` (`id`);
--
-- Constraints for table `rims_customer_pic_mobile`
--
ALTER TABLE `rims_customer_pic_mobile`
ADD CONSTRAINT `rims_customer_pic_mobile_ibfk_1` FOREIGN KEY (`customer_pic_id`) REFERENCES `rims_customer_pic` (`id`);
--
-- Constraints for table `rims_customer_pic_phone`
--
ALTER TABLE `rims_customer_pic_phone`
ADD CONSTRAINT `rims_customer_pic_phone_ibfk_1` FOREIGN KEY (`customer_pic_id`) REFERENCES `rims_customer_pic` (`id`);
--
-- Constraints for table `rims_division_branch`
--
ALTER TABLE `rims_division_branch`
ADD CONSTRAINT `rims_division_branch_ibfk_1` FOREIGN KEY (`division_id`) REFERENCES `rims_division` (`id`),
ADD CONSTRAINT `rims_division_branch_ibfk_2` FOREIGN KEY (`branch_id`) REFERENCES `rims_branch` (`id`);
--
-- Constraints for table `rims_division_position`
--
ALTER TABLE `rims_division_position`
ADD CONSTRAINT `rims_division_position_ibfk_1` FOREIGN KEY (`division_id`) REFERENCES `rims_division` (`id`),
ADD CONSTRAINT `rims_division_position_ibfk_2` FOREIGN KEY (`position_id`) REFERENCES `rims_position` (`id`);
--
-- Constraints for table `rims_employee`
--
ALTER TABLE `rims_employee`
ADD CONSTRAINT `rims_employee_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `rims_province` (`id`),
ADD CONSTRAINT `rims_employee_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `rims_city` (`id`),
ADD CONSTRAINT `rims_employee_ibfk_3` FOREIGN KEY (`home_province`) REFERENCES `rims_province` (`id`),
ADD CONSTRAINT `rims_employee_ibfk_4` FOREIGN KEY (`home_city`) REFERENCES `rims_city` (`id`);
--
-- Constraints for table `rims_employee_bank`
--
ALTER TABLE `rims_employee_bank`
ADD CONSTRAINT `rims_employee_bank_ibfk_1` FOREIGN KEY (`bank_id`) REFERENCES `rims_bank` (`id`),
ADD CONSTRAINT `rims_employee_bank_ibfk_2` FOREIGN KEY (`employee_id`) REFERENCES `rims_employee` (`id`);
--
-- Constraints for table `rims_employee_deductions`
--
ALTER TABLE `rims_employee_deductions`
ADD CONSTRAINT `rims_employee_deductions_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `rims_employee` (`id`),
ADD CONSTRAINT `rims_employee_deductions_ibfk_2` FOREIGN KEY (`deduction_id`) REFERENCES `rims_deduction` (`id`);
--
-- Constraints for table `rims_employee_incentives`
--
ALTER TABLE `rims_employee_incentives`
ADD CONSTRAINT `rims_employee_incentives_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `rims_employee` (`id`),
ADD CONSTRAINT `rims_employee_incentives_ibfk_2` FOREIGN KEY (`incentive_id`) REFERENCES `rims_incentive` (`id`);
--
-- Constraints for table `rims_employee_mobile`
--
ALTER TABLE `rims_employee_mobile`
ADD CONSTRAINT `rims_employee_mobile_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `rims_employee` (`id`);
--
-- Constraints for table `rims_employee_phone`
--
ALTER TABLE `rims_employee_phone`
ADD CONSTRAINT `rims_employee_phone_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `rims_employee` (`id`);
--
-- Constraints for table `rims_position_level`
--
ALTER TABLE `rims_position_level`
ADD CONSTRAINT `rims_position_level_ibfk_1` FOREIGN KEY (`position_id`) REFERENCES `rims_position` (`id`),
ADD CONSTRAINT `rims_position_level_ibfk_2` FOREIGN KEY (`level_id`) REFERENCES `rims_level` (`id`);
--
-- Constraints for table `rims_product`
--
ALTER TABLE `rims_product`
ADD CONSTRAINT `rims_product_ibfk_1` FOREIGN KEY (`product_master_category_id`) REFERENCES `rims_product_master_category` (`id`),
ADD CONSTRAINT `rims_product_ibfk_2` FOREIGN KEY (`product_sub_master_category_id`) REFERENCES `rims_product_sub_master_category` (`id`),
ADD CONSTRAINT `rims_product_ibfk_3` FOREIGN KEY (`product_sub_category_id`) REFERENCES `rims_product_sub_category` (`id`),
ADD CONSTRAINT `rims_product_ibfk_4` FOREIGN KEY (`product_specification_type_id`) REFERENCES `rims_product_specification_type` (`id`),
ADD CONSTRAINT `rims_product_ibfk_5` FOREIGN KEY (`vehicle_car_make_id`) REFERENCES `rims_vehicle_car_make` (`id`),
ADD CONSTRAINT `rims_product_ibfk_6` FOREIGN KEY (`vehicle_car_model_id`) REFERENCES `rims_vehicle_car_model` (`id`);
--
-- Constraints for table `rims_product_specification_info`
--
ALTER TABLE `rims_product_specification_info`
ADD CONSTRAINT `rims_product_specification_info_ibfk_1` FOREIGN KEY (`product_specification_type_id`) REFERENCES `rims_product_specification_type` (`id`);
--
-- Constraints for table `rims_product_sub_category`
--
ALTER TABLE `rims_product_sub_category`
ADD CONSTRAINT `rims_product_sub_category_ibfk_1` FOREIGN KEY (`product_sub_master_category_id`) REFERENCES `rims_product_sub_master_category` (`id`),
ADD CONSTRAINT `rims_product_sub_category_ibfk_2` FOREIGN KEY (`product_master_category`) REFERENCES `rims_product_master_category` (`id`);
--
-- Constraints for table `rims_product_sub_master_category`
--
ALTER TABLE `rims_product_sub_master_category`
ADD CONSTRAINT `rims_product_sub_master_category_ibfk_1` FOREIGN KEY (`product_master_category_id`) REFERENCES `rims_product_master_category` (`id`);
--
-- Constraints for table `rims_supplier`
--
ALTER TABLE `rims_supplier`
ADD CONSTRAINT `rims_supplier_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `rims_province` (`id`),
ADD CONSTRAINT `rims_supplier_ibfk_2` FOREIGN KEY (`city_id`) REFERENCES `rims_city` (`id`);
--
-- Constraints for table `rims_supplier_bank`
--
ALTER TABLE `rims_supplier_bank`
ADD CONSTRAINT `rims_supplier_bank_ibfk_1` FOREIGN KEY (`bank_id`) REFERENCES `rims_bank` (`id`),
ADD CONSTRAINT `rims_supplier_bank_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `rims_supplier` (`id`);
--
-- Constraints for table `rims_supplier_mobile`
--
ALTER TABLE `rims_supplier_mobile`
ADD CONSTRAINT `rims_supplier_mobile_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `rims_supplier` (`id`);
--
-- Constraints for table `rims_supplier_phone`
--
ALTER TABLE `rims_supplier_phone`
ADD CONSTRAINT `rims_supplier_phone_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `rims_supplier` (`id`);
--
-- Constraints for table `rims_supplier_pic`
--
ALTER TABLE `rims_supplier_pic`
ADD CONSTRAINT `rims_supplier_pic_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `rims_supplier` (`id`),
ADD CONSTRAINT `rims_supplier_pic_ibfk_2` FOREIGN KEY (`province_id`) REFERENCES `rims_province` (`id`),
ADD CONSTRAINT `rims_supplier_pic_ibfk_3` FOREIGN KEY (`city_id`) REFERENCES `rims_city` (`id`);
--
-- Constraints for table `rims_supplier_pic_mobile`
--
ALTER TABLE `rims_supplier_pic_mobile`
ADD CONSTRAINT `rims_supplier_pic_mobile_ibfk_1` FOREIGN KEY (`supplier_pic_id`) REFERENCES `rims_supplier_pic` (`id`);
--
-- Constraints for table `rims_supplier_pic_phone`
--
ALTER TABLE `rims_supplier_pic_phone`
ADD CONSTRAINT `rims_supplier_pic_phone_ibfk_1` FOREIGN KEY (`supplier_pic_id`) REFERENCES `rims_supplier_pic` (`id`);
--
-- Constraints for table `rims_vehicle`
--
ALTER TABLE `rims_vehicle`
ADD CONSTRAINT `rims_vehicle_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `rims_customer` (`id`),
ADD CONSTRAINT `rims_vehicle_ibfk_2` FOREIGN KEY (`customer_pic_id`) REFERENCES `rims_customer_pic` (`id`),
ADD CONSTRAINT `rims_vehicle_ibfk_3` FOREIGN KEY (`car_make_id`) REFERENCES `rims_vehicle_car_make` (`id`),
ADD CONSTRAINT `rims_vehicle_ibfk_4` FOREIGN KEY (`car_model_id`) REFERENCES `rims_vehicle_car_model` (`id`),
ADD CONSTRAINT `rims_vehicle_ibfk_5` FOREIGN KEY (`car_sub_model_id`) REFERENCES `rims_vehicle_car_sub_detail` (`id`);
--
-- Constraints for table `rims_vehicle_car_model`
--
ALTER TABLE `rims_vehicle_car_model`
ADD CONSTRAINT `rims_vehicle_car_model_ibfk_1` FOREIGN KEY (`car_make_id`) REFERENCES `rims_vehicle_car_make` (`id`);
--
-- Constraints for table `rims_vehicle_car_sub_detail`
--
ALTER TABLE `rims_vehicle_car_sub_detail`
ADD CONSTRAINT `rims_vehicle_car_sub_detail_ibfk_1` FOREIGN KEY (`brand_id`) REFERENCES `rims_vehicle_car_make` (`id`),
ADD CONSTRAINT `rims_vehicle_car_sub_detail_ibfk_2` FOREIGN KEY (`sub_brand_id`) REFERENCES `rims_vehicle_car_model` (`id`);
--
-- Constraints for table `rims_warehouse_division`
--
ALTER TABLE `rims_warehouse_division`
ADD CONSTRAINT `rims_warehouse_division_ibfk_1` FOREIGN KEY (`warehouse_id`) REFERENCES `rims_warehouse` (`id`),
ADD CONSTRAINT `rims_warehouse_division_ibfk_2` FOREIGN KEY (`division_id`) REFERENCES `rims_division` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
SELECT
ROUND(SQRT(POWER(MAX(LAT_N) - MIN(LAT_N), 2) + POWER(MAX(LONG_W) - MIN(LONG_W), 2)), 4)
FROM
STATION;
|
/*
10079, 00000, "trace data sent/received via SQL*Net"
*Cause:
*Action: level 1 - trace network ops to/from client
level 2 - in addition to level 1, dump data
level 4 - trace network ops to/from dblink
level 8 - in addition to level 4, dump data
*/
-- all attempts to set with alter session result in ora-0131 insufficient privileges
--alter session set events '10079 trace name context forever, level 2';
oradebug setmypid
oradebug event 10079 trace name context forever, level 2
|
CREATE SCHEMA IF NOT EXISTS aoc2021;
SET SCHEMA 'aoc2021';
DROP TABLE IF EXISTS dec08;
CREATE TABLE dec08 (
line_number bigint NOT NULL GENERATED ALWAYS AS IDENTITY,
input text NOT NULL,
output text NOT NULL
);
\COPY dec08 (input, output) FROM '2021/dec08.input' DELIMITER '|'
VACUUM ANALYZE dec08;
/* FIRST STAR */
SELECT count(*)
FROM dec08
CROSS JOIN LATERAL string_to_table(output, ' ') AS s
WHERE length(s) IN (2, 3, 4, 7)
;
/* SECOND STAR */
/*
* Some---but by no means all---of this was inspired by Feike Steenbergen.
* https://gitlab.com/feike/adventofcode/-/blob/master/2021/day08/08-2.sql
*/
WITH
/* Split all the inputs into arrays */
inputs (id, segments) AS (
SELECT line_number, string_to_array(segments, NULL)
FROM dec08
CROSS JOIN LATERAL string_to_table(input, ' ') AS s (segments)
WHERE segments <> ''
),
/* Do the same for the outputs but here we need to remember the order */
outputs (id, segments, exp) AS (
SELECT line_number,
string_to_array(segments, NULL),
row_number() OVER w - 1
FROM dec08
CROSS JOIN LATERAL string_to_table(trim(output), ' ') WITH ORDINALITY AS s (segments)
WHERE segments <> ''
WINDOW w AS (PARTITION BY line_number ORDER BY ordinality DESC)
),
/* These are the easy ones */
unique_segments (id, segments, number) AS (
SELECT i.id,
i.segments,
CASE cardinality(i.segments)
WHEN 2 THEN 1
WHEN 3 THEN 7
WHEN 4 THEN 4
WHEN 7 THEN 8
END
FROM inputs AS i
WHERE cardinality(i.segments) IN (2, 3, 4, 7)
),
/*
* Next look at the numbers with six segments. They each contain within them a
* different number of the previous numbers.
*/
six_segments (id, segments, number) AS (
SELECT i.id,
i.segments,
CASE count(*) FILTER (WHERE i.segments @> us.segments)
WHEN 0 THEN 6 /* Doesn't contain anything */
WHEN 2 THEN 0 /* Contains 1 and 7 */
WHEN 3 THEN 9 /* Contains 1, 4, and 7 */
END
FROM inputs AS i
JOIN unique_segments AS us ON us.id = i.id
WHERE cardinality(i.segments) = 6
GROUP BY i.id, i.segments
),
/*
* Finally we can look at the numbers with five segments. Five is hiding in
* both 6 and 9, but three is only hiding in 9, so we can distinguish them that
* way. The last one must be 2.
*/
five_segments (id, segments, number) AS (
SELECT i.id,
i.segments,
CASE WHEN nine.segments @> i.segments
THEN CASE WHEN six.segments @> i.segments
THEN 5
ELSE 3
END
ELSE 2
END
FROM inputs AS i
JOIN six_segments AS nine ON nine.id = i.id
JOIN six_segments AS six ON six.id = i.id
WHERE cardinality(i.segments) = 5
AND nine.number = 9
AND six.number = 6
),
/* Put them all together... */
digits AS (
TABLE unique_segments
UNION ALL
TABLE six_segments
UNION ALL
TABLE five_segments
),
/* ...and use them to convert the outputs */
results (number) AS (
SELECT sum(d.number * power(10, o.exp))
FROM outputs AS o
JOIN digits AS d ON d.id = o.id
AND cardinality(d.segments) = cardinality(o.segments)
AND d.segments @> o.segments
GROUP BY d.id
)
/* Add it all up and we're done */
SELECT sum(number) AS second_star
FROM results
;
|
INDIVIDUAL_ID Gebdat Geslacht Overleden Overldat
PAT1 15AUG2000 M 0
PAT2 18FEB1989 M 0
PAT3 07NOV2001 M 0
PAT15 08JAN1999 V 0
PAT16 25DEC1997 V 0
PAT17 29SEP1991 V 0
|
SELECT
s.SEQSCHEMA AS schema_name
, s.SEQNAME AS sequence_name
, s.*
FROM SYSCAT.SEQUENCES s
WHERE 1=1
/*if isNotEmpty(schemaName) */
AND rtrim(s.SEQSCHEMA) IN /*schemaName*/('%')
/*end*/
/*if isNotEmpty(sequenceName) */
AND rtrim(s.SEQNAME) IN /*sequenceName*/('%')
/*end*/
AND s.SEQTYPE='S'
ORDER BY s.SEQSCHEMA, s.SEQNAME
WITH UR
|
drop table IF EXISTS t_account;
drop table IF EXISTS t_broker;
drop table IF EXISTS t_permission;
drop table IF EXISTS t_rule_database;
drop table IF EXISTS t_rule_engine;
drop table IF EXISTS t_rule_engine_condition;
drop table IF EXISTS t_topic;
drop table IF EXISTS t_topic_historical;
drop table IF EXISTS t_timer_scheduler;
create TABLE t_account (
id INTEGER generated BY DEFAULT AS identity,
create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
delete_at BIGINT NOT NULL,
email VARCHAR (255),
PASSWORD VARCHAR (255),
username VARCHAR (255),
PRIMARY KEY (id)
);
create TABLE t_broker (
id INTEGER generated BY DEFAULT AS identity,
create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
broker_url VARCHAR (64),
delete_at BIGINT NOT NULL,
NAME VARCHAR (255),
user_id INTEGER CHECK (user_id >= 1),
webase_url VARCHAR (255),
PRIMARY KEY (id)
);
create TABLE t_permission (
id INTEGER generated BY DEFAULT AS identity,
create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
broker_id INTEGER,
user_id INTEGER,
PRIMARY KEY (id)
);
create TABLE t_rule_database (
id INTEGER generated BY DEFAULT AS identity,
create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
broker_id INTEGER,
database_type VARCHAR (1),
database_url VARCHAR (255),
database_ip VARCHAR (32),
database_port VARCHAR (32),
database_name VARCHAR (128),
datasource_name VARCHAR (255),
optional_parameter VARCHAR (256),
PASSWORD VARCHAR (255),
system_tag BOOLEAN,
table_name VARCHAR (255),
user_id INTEGER,
username VARCHAR (255),
PRIMARY KEY (id)
);
create TABLE t_rule_engine (
id INTEGER generated BY DEFAULT AS identity,
create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
broker_id INTEGER,
cep_id VARCHAR (255),
condition_field VARCHAR (4096),
condition_field_json VARCHAR (4096),
condition_type INTEGER,
delete_at BIGINT NOT NULL,
error_destination VARCHAR (255),
from_destination VARCHAR (255),
function_array VARCHAR (1024),
group_id VARCHAR (255),
payload VARCHAR (4096),
rule_description VARCHAR (255),
payload_type INTEGER,
rule_database_id INTEGER,
rule_name VARCHAR (128),
select_field VARCHAR (4096),
STATUS INTEGER,
system_tag BOOLEAN,
table_name VARCHAR (128),
to_destination VARCHAR (255),
user_id INTEGER,
PRIMARY KEY (id)
);
create TABLE t_topic (
id INTEGER generated BY DEFAULT AS identity,
create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
broker_id INTEGER,
creater VARCHAR (255),
delete_at BIGINT NOT NULL,
description VARCHAR (255),
group_id VARCHAR (64),
topic_name VARCHAR (128),
PRIMARY KEY (id)
);
create TABLE t_topic_historical (
id INTEGER generated BY DEFAULT AS identity,
create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
brokerId INTEGER,
eventId VARCHAR (64),
groupId VARCHAR (64),
topicName VARCHAR (128),
PRIMARY KEY (id)
);
CREATE TABLE t_timer_scheduler (
id INTEGER generated BY DEFAULT AS identity,
create_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
broker_id INTEGER,
user_id INTEGER,
scheduler_name VARCHAR(128),
rule_database_id INTEGER,
period_params VARCHAR (64),
parsing_sql VARCHAR (1024),
PRIMARY KEY (id)
) ;
alter table t_broker add CONSTRAINT brokerUrlDeleteAt UNIQUE (broker_url, delete_at) ;
alter table t_rule_engine add CONSTRAINT ruleNameDeleteAt UNIQUE (rule_name, delete_at);
alter table t_topic add CONSTRAINT topicNameBrokerGroupDelete UNIQUE (topic_name,broker_id,group_id,delete_at);
alter table t_topic_historical add CONSTRAINT brokerIdGroupIdEventId UNIQUE (brokerId, groupId, eventId);
|
-- bind.test
--
-- db eval {DELETE FROM t4}
DELETE FROM t4
|
{DEFAULT @concept_counts_database_schema = scratch.dbo}
{DEFAULT @concept_counts_table = concept_counts}
{DEFAULT @concept_counts_table_is_temp = FALSE}
{DEFAULT @cdm_database_schema = cdm_optum_extended_dod_v1027.dbo}
SELECT codeset_id AS concept_set_id,
standard_concept.concept_id,
standard_concept.concept_name,
source_concept.concept_code,
source_concept.vocabulary_id AS source_vocabulary_id,
source_concept.concept_id AS source_concept_id,
source_concept.concept_name AS source_concept_name,
source_concept.concept_count,
source_concept.concept_subjects
FROM #Codesets codesets
INNER JOIN @vocabulary_database_schema.concept standard_concept
ON standard_concept.concept_id = codesets.concept_id
INNER JOIN (
SELECT concept_id_2 AS standard_concept_id,
concept.concept_id,
concept.concept_name,
concept.concept_code,
concept.vocabulary_id,
concept_count,
concept_subjects
FROM @vocabulary_database_schema.concept_relationship
INNER JOIN @vocabulary_database_schema.concept
ON concept.concept_id = concept_id_1
{@concept_counts_table_is_temp} ? {
INNER JOIN @concept_counts_table concept_counts
} : {
INNER JOIN @concept_counts_database_schema.@concept_counts_table concept_counts
}
ON concept_counts.concept_id = concept.concept_id
WHERE relationship_id = 'Maps to'
AND (standard_concept IS NULL OR standard_concept != 'S')
) source_concept
ON source_concept.standard_concept_id = standard_concept.concept_id
WHERE standard_concept.standard_concept = 'S';
|
drop database if exists ctd;
create database ctd;
\c ctd
create table Groups(
group_id int,
group_no char(4)
);
create table Students(
student_id int,
name varchar(30),
group_id int
);
-- table constraints
alter table Groups
add constraint group_id_unique unique(group_id);
alter table Students add foreign key (group_id)
references Groups (group_id);
insert into Groups
(group_id, group_no) values
(1, '4538'),
(2, '4539');
insert into Students
(student_id, name, group_id) values
(1, 'Mechanikov Denis', 1),
(2, 'Piankova Ulia', 2),
(3, 'Baglai Bogdan', 2);
-- select examples
select group_id, group_no from Groups;
select * from Students;
select name, group_no
from Students natural join Groups;
select Students.name, Groups.group_no
from Students
inner join Groups
on Students.group_id = Groups.group_id;
insert into Students
(student_id, name, group_id) values
(4, 'Иван Петров', 1),
(5, 'Иван Сидоров', 1),
(6, 'Яков Сергеев', 1);
select count(*) from Groups;
select count(*) from Students;
select count(*) from Students where name like '%ван%' or name like '%oв';
delete from Groups;
delete from Students;
delete from Groups;
insert into Groups
(group_id, group_no) values
(1, '1537'),
(2, '1538'),
(3, '1539');
insert into Students
(student_id, name, group_id) values
(1, 'A', 1),
(2, 'B', 2),
(3, 'C', 2),
(4, 'D', 3),
(5, 'E', 3),
(6, 'F', 3);
select group_no, count(*)
from Groups inner join Students on Groups.group_id = Students.group_id
group by group_no order by group_no desc;
|
SELECT
{{ columnNames }}
FROM
plays
WHERE
user_id = '{{ userID }}' AND
song_id in(
SELECT
song_id
FROM
songs
WHERE
album_id = '{{ albumID }}'
);
|
UPDATE character_quests SET name='Q00227_TestOfTheReformer' WHERE name='227_TestOfReformer';
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 14, 2016 at 05:30 PM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sofia`
--
-- --------------------------------------------------------
--
-- Table structure for table `alokasi`
--
CREATE TABLE `alokasi` (
`id_booking` int(11) NOT NULL,
`id_ruangan` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `alokasi`
--
INSERT INTO `alokasi` (`id_booking`, `id_ruangan`) VALUES
(1, 1),
(2, 2),
(3, 3),
(4, 4),
(5, 5),
(6, 6),
(7, 7),
(8, 8),
(9, 9),
(10, 10),
(11, 11),
(12, 12),
(13, 13),
(14, 14),
(15, 15),
(16, 16),
(17, 17),
(18, 18),
(19, 19),
(20, 20),
(21, 21),
(22, 22),
(23, 23),
(24, 24),
(25, 25);
-- --------------------------------------------------------
--
-- Table structure for table `booking`
--
CREATE TABLE `booking` (
`id` int(11) NOT NULL,
`id_pelanggan` int(11) NOT NULL,
`status` varchar(10) NOT NULL,
`tanggal_pemesanan` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`tanggal_checkin` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`tanggal_checkout` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`jumlah` int(11) NOT NULL,
`jenis` varchar(10) NOT NULL,
`total_harga` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `booking`
--
INSERT INTO `booking` (`id`, `id_pelanggan`, `status`, `tanggal_pemesanan`, `tanggal_checkin`, `tanggal_checkout`, `jumlah`, `jenis`, `total_harga`) VALUES
(1, 1, 'paid', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(2, 2, 'paid', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(3, 3, 'cancel', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'double', 200000),
(4, 4, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(5, 5, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'double', 200000),
(6, 6, 'cancel', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'executive', 200000),
(7, 7, 'cancel', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(8, 8, 'paid', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(9, 9, 'cancel', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(10, 10, 'paid', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'double', 200000),
(11, 11, 'paid', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'executive', 200000),
(12, 12, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'double', 200000),
(13, 13, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(14, 14, 'cancel', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'executive', 200000),
(15, 15, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(16, 16, 'paid', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(17, 17, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'executive', 200000),
(18, 18, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(19, 19, 'paid', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'executive', 200000),
(20, 20, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(21, 21, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(22, 22, 'paid', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'single', 200000),
(23, 23, 'pending', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'executive', 200000),
(24, 24, 'cancel', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'full-day', 200000),
(25, 25, 'cancel', '2016-04-13 17:00:00', '2016-04-13 17:00:00', '2016-04-14 17:00:00', 1, 'full-day', 200000);
-- --------------------------------------------------------
--
-- Table structure for table `kamar`
--
CREATE TABLE `kamar` (
`id_ruangan` int(11) NOT NULL,
`jenis_kamar` varchar(10) NOT NULL,
`harga_kamar` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kamar`
--
INSERT INTO `kamar` (`id_ruangan`, `jenis_kamar`, `harga_kamar`) VALUES
(1, 'executive', 200000),
(2, 'single', 200000),
(3, 'single', 200000),
(4, 'executive', 200000),
(5, 'single', 200000),
(6, 'double', 200000),
(7, 'executive', 200000),
(8, 'single', 200000),
(9, 'single', 200000),
(10, 'double', 200000),
(11, 'double', 200000),
(12, 'executive', 200000),
(13, 'double', 200000),
(14, 'single', 200000),
(15, 'double', 200000),
(16, 'single', 200000),
(17, 'executive', 200000),
(18, 'single', 200000),
(19, 'executive', 200000),
(20, 'single', 200000),
(21, 'double', 200000),
(22, 'double', 200000),
(23, 'single', 200000);
-- --------------------------------------------------------
--
-- Table structure for table `konfirmasi`
--
CREATE TABLE `konfirmasi` (
`id` int(11) NOT NULL,
`id_booking` int(11) NOT NULL,
`tanggal_konfirmasi` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`jenis_pembayaran` varchar(10) NOT NULL,
`nominal` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `konfirmasi`
--
INSERT INTO `konfirmasi` (`id`, `id_booking`, `tanggal_konfirmasi`, `jenis_pembayaran`, `nominal`) VALUES
(1, 1, '2016-04-13 17:00:00', 'lunas', 200000),
(2, 2, '2016-04-13 17:00:00', 'dp', 100000),
(3, 3, '2016-04-13 17:00:00', 'lunas', 200000),
(4, 4, '2016-04-13 17:00:00', 'dp', 100000),
(5, 5, '2016-04-13 17:00:00', 'dp', 100000),
(6, 6, '2016-04-13 17:00:00', 'lunas', 200000),
(7, 7, '2016-04-13 17:00:00', 'dp', 100000),
(8, 8, '2016-04-13 17:00:00', 'lunas', 100000),
(9, 9, '2016-04-13 17:00:00', 'dp', 200000),
(10, 10, '2016-04-13 17:00:00', 'lunas', 100000),
(11, 11, '2016-04-13 17:00:00', 'dp', 100000),
(12, 12, '2016-04-13 17:00:00', 'dp', 100000),
(13, 13, '2016-04-13 17:00:00', 'dp', 200000),
(14, 14, '2016-04-13 17:00:00', 'dp', 200000),
(15, 15, '2016-04-13 17:00:00', 'dp', 100000),
(16, 16, '2016-04-13 17:00:00', 'dp', 200000),
(17, 17, '2016-04-13 17:00:00', 'lunas', 200000),
(18, 18, '2016-04-13 17:00:00', 'dp', 200000),
(19, 19, '2016-04-13 17:00:00', 'lunas', 200000),
(20, 20, '2016-04-13 17:00:00', 'lunas', 100000),
(21, 21, '2016-04-13 17:00:00', 'dp', 100000),
(22, 22, '2016-04-13 17:00:00', 'lunas', 200000),
(23, 23, '2016-04-13 17:00:00', 'lunas', 100000),
(24, 24, '2016-04-13 17:00:00', 'lunas', 100000),
(25, 25, '2016-04-13 17:00:00', 'dp', 200000);
-- --------------------------------------------------------
--
-- Table structure for table `paket_meeting_room`
--
CREATE TABLE `paket_meeting_room` (
`paket` varchar(10) NOT NULL,
`harga` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `paket_meeting_room`
--
INSERT INTO `paket_meeting_room` (`paket`, `harga`) VALUES
('full-day', 200000),
('half-day', 100000);
-- --------------------------------------------------------
--
-- Table structure for table `pelanggan`
--
CREATE TABLE `pelanggan` (
`id` int(11) NOT NULL,
`nama` varchar(40) NOT NULL,
`alamat` varchar(60) NOT NULL,
`email` varchar(20) NOT NULL,
`nomor_hp` varchar(12) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pelanggan`
--
INSERT INTO `pelanggan` (`id`, `nama`, `alamat`, `email`, `nomor_hp`) VALUES
(1, 'Sandra Hart', 'Desa Temon, Sawoo, Ponorogo', 'shart0@house.gov', '082116826050'),
(2, 'Edward Long', 'Jl. Kalibaru Barat Iv Rt.001/07 No.38 Cilincing, Jakarta Uta', 'elong1@webs.com', '08568141566'),
(3, 'Henry Frazier', 'Jl. Sultan Syahrir no. 147 Silaing Bawah, Padang Panjang', 'hfrazier2@google.com', '085740300724'),
(4, 'Marie Carpenter', 'Jl. Merkuri Utara 4 no.10 blok W133 Margahayu Raya, Bandung', 'mcarpenter3@bbb.org', '085730354203'),
(5, 'Brian Watson', 'Jln Rambutan No.1066 A, Palembang', 'bwatson4@g.co', '081224185310'),
(6, 'Louise Knight', 'Kp. Pekopen Rt 06/Rw 07 Desa Tambun Kec. Tambun Selatan Kab.', 'lknight5@marriott.co', '085793350088'),
(7, 'Sarah Turner', 'Jl Jembatan Gambang Ii B/21, Jakarta Utara, Dki Jakarta', 'sturner6@wiley.com', '089665406740'),
(8, 'Jimmy Gardner', 'Jl. Pengasinan Ii No.28 Rt02/002 Bekasi Timur 17115', 'jgardner7@alibaba.co', '085263716795'),
(9, 'Terry Baker', 'Jl. Sumber Resik No. 4', 'tbaker8@hao123.com', '087824778650'),
(10, 'Louise Flores', 'Jalan Anggrek No. 35, Payakumbuh', 'lflores9@marketwatch', '085664938135'),
(11, 'Willie Myers', 'Kalideres Permai Blok G6 No 20 Rt 005/ Rw 014. Kalideres. Ja', 'wmyersa@clickbank.ne', '089627761245'),
(12, 'Bobby Grant', 'Aglik Selatan Rt3 Rw6 Semawung Daleman, Kutoarjo, Purworejo,', 'bgrantb@abc.net.au', '083876757757'),
(13, 'Evelyn Hicks', 'Jl. Tritura No. 161-B Medan', 'ehicksc@unc.edu', '081514289944'),
(14, 'Tammy Matthews', 'Cipaku Indah V no 51', 'tmatthewsd@wikispace', '081320397886'),
(15, 'Mildred Cruz', 'Jln. Ciwaregu No. 3B, Bandung 40121', 'mcruze@usda.gov', '08972501470'),
(16, 'Johnny Carroll', 'Jl. Urea No. 3 Komp. Pusri Kebon Sirih Kenten Palembang', 'jcarrollf@wikia.com', '089637983208'),
(17, 'Carol Day', 'Jl. Taman Duren Sawit B1/5', 'cdayg@yellowbook.com', '08995179942'),
(18, 'Carol Phillips', 'Jln. Biologi 7, Bandung', 'cphillipsh@umich.edu', '08566334900'),
(19, 'Steve Palmer', 'Jalan Hijau Daun C1 No 17, Kelapa Gading, Jakarta Utara', 'spalmeri@issuu.com', '087775452541'),
(20, 'Judy Howell', 'Jl. Kalingga No. 3 Medan 20112', 'jhowellj@fda.gov', '081219705514'),
(21, 'Norma Lee', 'Harapan Indah Regency Bc/2, Bekasi Barat', 'nleek@soup.io', '081373611126'),
(22, 'Fred Williamson', 'Jl. Danau Melintang No. 124A Medan', 'fwilliamsonl@wikia.c', '085710093690'),
(23, 'Amanda Reed', 'Jl. Cempaka Putih Barat 21 no. 20 Jakarta Pusat 10520', 'areedm@sakura.ne.jp', '08562113917'),
(24, 'Sarah Murphy', 'Apartemen Ambassador 2 Lt. 17 No. 2 Jalan Prof Dr.Satrio, Ja', 'smurphyn@netvibes.co', '08999737598'),
(25, 'Nancy Graham', 'Jl. Sutomo No. 29 D', 'ngrahamo@vinaora.com', '087869565758');
-- --------------------------------------------------------
--
-- Table structure for table `ruangan`
--
CREATE TABLE `ruangan` (
`id` int(11) NOT NULL,
`status` varchar(10) NOT NULL,
`kapasitas` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `ruangan`
--
INSERT INTO `ruangan` (`id`, `status`, `kapasitas`) VALUES
(1, 'available', 4),
(2, 'booked', 4),
(3, 'available', 4),
(4, 'booked', 4),
(5, 'used', 4),
(6, 'used', 4),
(7, 'available', 4),
(8, 'booked', 4),
(9, 'used', 4),
(10, 'available', 4),
(11, 'used', 4),
(12, 'used', 4),
(13, 'used', 4),
(14, 'available', 4),
(15, 'available', 4),
(16, 'used', 4),
(17, 'booked', 4),
(18, 'used', 4),
(19, 'available', 4),
(20, 'booked', 4),
(21, 'used', 4),
(22, 'used', 4),
(23, 'booked', 4),
(24, 'available', 50),
(25, 'available', 50);
-- --------------------------------------------------------
--
-- Table structure for table `ruang_pertemuan`
--
CREATE TABLE `ruang_pertemuan` (
`id_ruangan` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `ruang_pertemuan`
--
INSERT INTO `ruang_pertemuan` (`id_ruangan`) VALUES
(24),
(25);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `alokasi`
--
ALTER TABLE `alokasi`
ADD PRIMARY KEY (`id_booking`,`id_ruangan`),
ADD KEY `id_ruangan` (`id_ruangan`);
--
-- Indexes for table `booking`
--
ALTER TABLE `booking`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id_pelanggan` (`id_pelanggan`);
--
-- Indexes for table `kamar`
--
ALTER TABLE `kamar`
ADD UNIQUE KEY `id_ruangan` (`id_ruangan`);
--
-- Indexes for table `konfirmasi`
--
ALTER TABLE `konfirmasi`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `id_booking` (`id_booking`);
--
-- Indexes for table `paket_meeting_room`
--
ALTER TABLE `paket_meeting_room`
ADD PRIMARY KEY (`paket`);
--
-- Indexes for table `pelanggan`
--
ALTER TABLE `pelanggan`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `ruangan`
--
ALTER TABLE `ruangan`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `ruang_pertemuan`
--
ALTER TABLE `ruang_pertemuan`
ADD UNIQUE KEY `id_ruangan` (`id_ruangan`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `booking`
--
ALTER TABLE `booking`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT for table `konfirmasi`
--
ALTER TABLE `konfirmasi`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT for table `pelanggan`
--
ALTER TABLE `pelanggan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT for table `ruangan`
--
ALTER TABLE `ruangan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `alokasi`
--
ALTER TABLE `alokasi`
ADD CONSTRAINT `alokasi_ibfk_1` FOREIGN KEY (`id_booking`) REFERENCES `booking` (`id`),
ADD CONSTRAINT `alokasi_ibfk_2` FOREIGN KEY (`id_ruangan`) REFERENCES `ruangan` (`id`);
--
-- Constraints for table `booking`
--
ALTER TABLE `booking`
ADD CONSTRAINT `booking_ibfk_1` FOREIGN KEY (`id_pelanggan`) REFERENCES `pelanggan` (`id`);
--
-- Constraints for table `kamar`
--
ALTER TABLE `kamar`
ADD CONSTRAINT `kamar_ibfk_1` FOREIGN KEY (`id_ruangan`) REFERENCES `ruangan` (`id`);
--
-- Constraints for table `konfirmasi`
--
ALTER TABLE `konfirmasi`
ADD CONSTRAINT `konfirmasi_ibfk_1` FOREIGN KEY (`id_booking`) REFERENCES `booking` (`id`);
--
-- Constraints for table `ruang_pertemuan`
--
ALTER TABLE `ruang_pertemuan`
ADD CONSTRAINT `ruang_pertemuan_ibfk_1` FOREIGN KEY (`id_ruangan`) REFERENCES `ruangan` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<!--
Copyright (c) 2021, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
-->
<?xml version="1.0" encoding="UTF-8"?>
<CustomTab xmlns="http://soap.sforce.com/2006/04/metadata">
<customObject>true</customObject>
<motif>Custom31: Car</motif>
</CustomTab>
|
SELECT e.DepartmentID,
MAX(e.Salary) AS [MinimumSalary]
FROM Employees e
GROUP BY e.DepartmentID
HAVING MAX(e.Salary) NOT BETWEEN 30000 AND 70000
|
-- CreateTable
CREATE TABLE "User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"email" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL
);
-- CreateTable
CREATE TABLE "Post" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" TEXT NOT NULL,
"content" TEXT NOT NULL,
"published" BOOLEAN NOT NULL DEFAULT false,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"userId" INTEGER NOT NULL,
CONSTRAINT "Post_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
|
CREATE OR REPLACE PACKAGE Trapit_Run AUTHID CURRENT_USER AS
/***************************************************************************************************
Name: trapit_run.pks Author: Brendan Furey Date: 08-June-2019
Package body component in the trapit_oracle_tester module. It requires a minimum Oracle
database version of 12.2, owing to the use of v12.2 PL/SQL JSON features.
This module facilitates unit testing in Oracle PL/SQL following 'The Math Function Unit Testing
design pattern', as described here:
The Math Function Unit Testing design pattern, implemented in nodejs:
https://github.com/BrenPatF/trapit_nodejs_tester
This module on GitHub:
Oracle PL/SQL unit testing module
https://github.com/BrenPatF/trapit_oracle_tester
====================================================================================================
| Package | Notes |
|==================================================================================================|
| Trapit | Unit test utility package (Definer rights) |
|--------------|-----------------------------------------------------------------------------------|
| *Trapit_Run* | Unit test driver package (Invoker rights) |
====================================================================================================
This file has the package spec for Trapit_Run, the unit test driver package. See README for API
specification, and the other modules mentioned there for examples of use.
This package runs with Invoker rights, so that dynamic SQL calls to the test packages in the calling
schema do not require execute privilege to be granted to owning schema (if different from caller)
***************************************************************************************************/
PROCEDURE Run_Tests(
p_group_nm VARCHAR2);
END Trapit_Run;
/
SHOW ERROR
|
USE [VipunenTK_SA]
GO
/****** Object: View [dbo].[v_sa_2_8_Korkeakoulut_opiskelijat] Script Date: 11.12.2019 10:38:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[v_sa_2_8_Korkeakoulut_opiskelijat] AS
-- truncate table vipunentk_dw..sa_2_8_Korkeakoulut_opiskelijat
-- insert into vipunentk_dw..sa_2_8_Korkeakoulut_opiskelijat select * from v_sa_2_8_Korkeakoulut_opiskelijat
select
tilv = cast(kaikkivuodet.tilv as varchar(4))
,tilv_date = cast(kaikkivuodet.tilv+'0101' as date)
,aineisto = cast(kaikkivuodet.aineisto as varchar(1))
,lahde = cast(kaikkivuodet.lahde as varchar(2))
,tunn = cast(kaikkivuodet.tunn as varchar(5))
,jarj = cast(kaikkivuodet.jarj as varchar(10))
,koulk = cast(kaikkivuodet.koulk as varchar(6))
,kkun = cast(kaikkivuodet.kkun as varchar(3))
,sp = cast(kaikkivuodet.sp as varchar(1))
,aikielir1x = cast(kaikkivuodet.aikielir1x as varchar(2))
,syntv = cast(kaikkivuodet.syntv as varchar(4))
,tilvaskun = cast(kaikkivuodet.tilvaskun as varchar(6))
,tilvaskunx = cast(kaikkivuodet.tilvaskunx as varchar(3))
,tilvaskun2x = cast(kaikkivuodet.tilvaskun2x as varchar(3))
,kansalr2 = cast(kaikkivuodet.kansalr2 as varchar(1))
,alvv = cast(kaikkivuodet.alvv as varchar(4))
,allk = cast(kaikkivuodet.allk as varchar(1))
,olotamm = cast(kaikkivuodet.olotamm as varchar(1))
,olosyys = cast(kaikkivuodet.olosyys as varchar(1))
,rahlahde = cast(kaikkivuodet.rahlahde as varchar(1))
,fte = cast(kaikkivuodet.fte as varchar(1))
,alvv_kksek = cast(kaikkivuodet.alvv_kksek as varchar(4))
,alvv_kksek_lasna = cast(kaikkivuodet.alvv_kksek_lasna as varchar(4))
,alvv_sek = cast(kaikkivuodet.alvv_sek as varchar(4))
,alvv_sek_lasna = cast(kaikkivuodet.alvv_sek_lasna as varchar(4))
,alvv_kk = cast(kaikkivuodet.alvv_kk as varchar(4))
,alvv_kk_lasna = cast(kaikkivuodet.alvv_kk_lasna as varchar(4))
,alvv_opa = cast(kaikkivuodet.alvv_opa as varchar(4))
,alvv_opa_lasna = cast(kaikkivuodet.alvv_opa_lasna as varchar(4))
,lkm = cast(kaikkivuodet.lkm as int)
,opyht0 = cast(kaikkivuodet.opyht0 as int)
,opyht14 = cast(kaikkivuodet.opyht14 as int)
,opyht29 = cast(kaikkivuodet.opyht29 as int)
,opyht44 = cast(kaikkivuodet.opyht44 as int)
,opyht59 = cast(kaikkivuodet.opyht59 as int)
,opyht74 = cast(kaikkivuodet.opyht74 as int)
,opyht89 = cast(kaikkivuodet.opyht89 as int)
,opyht104 = cast(kaikkivuodet.opyht104 as int)
,opyht119 = cast(kaikkivuodet.opyht119 as int)
,opyht120 = cast(kaikkivuodet.opyht120 as int)
,op55 = cast(kaikkivuodet.op55 as varchar(1))
,opes = cast(kaikkivuodet.opes as int)
,opek = cast(kaikkivuodet.opek as int)
,opker = cast(kaikkivuodet.opker as int)
,tutkamk = cast(kaikkivuodet.tutkamk as varchar(3))
,tunimamk = cast(kaikkivuodet.tunimamk as nvarchar(60))
,koamk = cast(kaikkivuodet.koamk as varchar(4))
,konimamk = cast(kaikkivuodet.konimamk as nvarchar(60))
,suun_v = cast(kaikkivuodet.suun_v as varchar(5))
,svnim = cast(kaikkivuodet.svnim as nvarchar(40))
,koultyp = cast(kaikkivuodet.koultyp as varchar(1))
,kkieli = cast(kaikkivuodet.kkieli as varchar(2))
,lasnalk = cast(kaikkivuodet.lasnalk as int)
,poissalk = cast(kaikkivuodet.poissalk as int)
,oplaaj = cast(kaikkivuodet.oplaaj as int)
,kirtu1v = cast(kaikkivuodet.kirtu1v as varchar(4))
,kirtu1k = cast(kaikkivuodet.kirtu1k as varchar(1))
,ensisop = cast(kaikkivuodet.ensisop as varchar(1))
,tilmaa = cast(kaikkivuodet.tilmaa as varchar(1))
,tutkyo = cast(kaikkivuodet.tutkyo as varchar(3))
,tunimyo = cast(kaikkivuodet.tunimyo as nvarchar(40))
,koyo = cast(kaikkivuodet.koyo as varchar(4))
,konimyo = cast(kaikkivuodet.konimyo as nvarchar(50))
,paine = cast(kaikkivuodet.paine as varchar(4))
,painenim = cast(kaikkivuodet.painenim as nvarchar(60))
,kk = cast(kaikkivuodet.kk as varchar(2))
,tdk = cast(kaikkivuodet.tdk as varchar(2))
,fuksi = cast(kaikkivuodet.fuksi as varchar(1))
,opoikv = cast(kaikkivuodet.opoikv as varchar(4))
,om = cast(kaikkivuodet.om as varchar(1))
,opkelp = cast(kaikkivuodet.opkelp as varchar(1))
,avo = cast(kaikkivuodet.avo as varchar(1))
,laak = cast(kaikkivuodet.laak as varchar(1))
,tietolahde = cast(kaikkivuodet.tietolahde as nvarchar(250))
,rivinumero = cast(kaikkivuodet.rivinumero as varchar(10))
FROM (
--Historia-aineisto
SELECT
tilv
, aineisto = 'L'
, lahde =
case
when lahde = 3 then 41
when lahde = 4 then 51
else -1
end
, tunn
, jarj = op.koulutuksen_jarjestajakoodi
, koulk
, kkun
, sp
, aikielir1x = aikielir1
, syntv = CASE WHEN LTRIM(ika) in ('.','') then null else cast(tilv as int)-cast(LTRIM(ika) as int) end
, tilvaskun = case when asmaak is null or asmaak=99 then null else 'MAAK'+asmaak end
, tilvaskunx = null
, tilvaskun2x = null
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde = null
, fte
, alvv_kksek = null
, alvv_kksek_lasna = null
, alvv_sek = null
, alvv_sek_lasna = null
, alvv_kk = null
, alvv_kk_lasna = null
, alvv_opa = null
, alvv_opa_lasna = null
, lkm
, opyht0 = null
, opyht14 = null
, opyht29 = null
, opyht44 = null
, opyht59 = null
, opyht74 = null
, opyht89 = null
, opyht104 = null
, opyht119 = null
, opyht120 = null
, null as op55 -- uusi 2012
, opes
, opek
, opker
, tutkamk = null
, tunimamk = null
, koamk = null
, konimamk = null
, suun_v = null
, svnim = null
, koultyp
, kkieli = case kkielir1 when 'fs' then 'fi' else kkielir1 end
, lasnalk = null
, poissalk = null
, oplaaj = null
, kirtu1v = null
, kirtu1k = null
, ensisop = null
, tilmaa = null
, tutkyo = null
, tunimyo = null
, koyo = null
, konimyo = null
, paine = null
, painenim = null
, kk = null
, tdk = null
, fuksi = null
, opoikv = null
, om = null
, opkelp = null
, avo = NULL, laak = NULL
,[tietolahde]='8_2_Historia'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_8_2_sopv_16] tk
LEFT JOIN VipunenTK.dbo.d_oppilaitoksen_taustatiedot op on op.oppilaitos_avain=tk.tunn
WHERE lahde in (3,4) and tilv<2010
UNION ALL
/*
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, null as op55 -- uusi 2012
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8a_sopv_11'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8a_sopv_11]
UNION ALL
*/
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, null as op55 -- uusi 2012
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8b_sopv_11'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8b_sopv_11]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, null as op55 -- uusi 2012
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8c_sopv_11'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8c_sopv_11]
/* 2.8d v2011? */
/* 2.8a v2012? */
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55 -- uusi 2012
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8b_sopv_12'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8b_sopv_12]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55 -- uusi 2012
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8c_sopv_12'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8c_sopv_12]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55 -- uusi 2012
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8d_sopv_12'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8d_sopv_12]
/* 2.8a v2013? */
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8b_sopv_13'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8b_sopv_13]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8c_sopv_13'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8c_sopv_13]
/* 2.8d v2013? */
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8d_sopv_13'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8d_sopv_13]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8b_sopv_14'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8b_sopv_14]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8d_sopv_14'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM [TK_H9098_CSC].[dbo].[TK_2_8d_sopv_14]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak= NULL
,[tietolahde]='2_8b_sopv_15'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM TK_H9098_CSC.[dbo].[TK_2_8b_sopv_15]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, NULL AS tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak
,[tietolahde]='2_8b_sopv_16'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM TK_H9098_CSC.[dbo].[TK_2_8b_sopv_16]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, NULL AS tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo, laak
,[tietolahde]='2_8b_sopv_17'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM TK_H9098_CSC.[dbo].[TK_2_8b_sopv_17]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, NULL AS tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo
, laak
,[tietolahde]='2_8b_sopv_18'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM TK_H9098_CSC.[dbo].[TK_2_8b_sopv_18]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, case when koulk in ('775101','775201') then '999999'
else koulk
end as koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk = null
, tunimamk = null
, koamk = null
, konimamk = null
, suun_v = null
, svnim = null
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, NULL AS tilmaa
, tutkyo = null
, tunimyo = null
, koyo = null
, konimyo = null
, paine = null
, painenim = null
, kk
, tdk = null
, fuksi
, opoikv
, om
, opkelp
, avo
, laak = CASE koulk WHEN '775101' THEN 1 WHEN '775201' THEN 2 ELSE NULL END
,[tietolahde] = 'antero sa_virta_otp_tkOpiskOKMEnnakko'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM Antero.sa.[sa_virta_otp_tkOPISKOKMEnnakko]
UNION ALL
SELECT
tilv
, aineisto
, lahde
, tunn
, jarj
, koulk
, kkun
, sp
, aikielir1x
, syntv
, tilvaskun
, tilvaskunx
, tilvaskun2x
, kansalr2
, alvv
, allk
, olotamm
, olosyys
, rahlahde
, fte
, alvv_kksek
, alvv_kksek_lasna
, alvv_sek
, alvv_sek_lasna
, alvv_kk
, alvv_kk_lasna
, alvv_opa
, alvv_opa_lasna
, lkm
, opyht0
, opyht14
, opyht29
, opyht44
, opyht59
, opyht74
, opyht89
, opyht104
, opyht119
, opyht120
, op55
, opes
, opek
, opker
, tutkamk
, tunimamk
, koamk
, konimamk
, suun_v
, svnim
, koultyp
, kkieli
, lasnalk
, poissalk
, oplaaj
, kirtu1v
, kirtu1k
, ensisop
, NULL AS tilmaa
, tutkyo
, tunimyo
, koyo
, konimyo
, paine
, painenim
, kk
, tdk
, fuksi
, opoikv
, om
, opkelp
, avo
, laak
,[tietolahde]='2_8b_sopv_19'
,[rivinumero] = ROW_NUMBER() OVER(ORDER BY tilv)
FROM TK_H9098_CSC.[dbo].[TK_K2_8b_sopv_19]
) kaikkivuodet
GO
USE [ANTERO]
|
§#
#----------------------------------------#
# this eo_goods.tab file was generated by csv2dat #
# created by Phystam (@Phystam_hnew) #
#------------------------------------------#
Passagiere
Pasa?eroj
Post
po?toj
None
Neuzebla
BrownRice
Bruna rizo
PolishedRice
Polurita rizo
Coal
Karbo
Log
?tipo
Wood
Arba?o
Charcoal
Arba?a karbo
LiveFish
Viva fi?o
FreshFish
Fre?a fi?o
|
CREATE PROCEDURE [<3>].[P_ReceiveSubscription]
@V_ReceiveTimeout int = 150000 -- After 5 min retry getting message from queue.
AS
BEGIN
DECLARE @V_Cmd NVARCHAR(max);
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
SET NOCOUNT ON;
DECLARE @V_DBName SYSNAME = '<0>' ;
DECLARE @V_MainName SYSNAME = '<1>' ;
DECLARE @V_LoginName SYSNAME = '<2>' ;
DECLARE @V_SchemaName SYSNAME = '<3>' ;
DECLARE @V_UserName SYSNAME = '<4>' ;
DECLARE @V_QueueName SYSNAME = '<5>' ;
DECLARE @V_ServiceName SYSNAME = '<6>' ;
DECLARE @V_SubscribersTableName SYSNAME = '<7>' ;
-- Start Listening
SET @V_Cmd = '
DECLARE @V_ConvHandle UNIQUEIDENTIFIER
DECLARE @V_Message VARBINARY(MAX)
DECLARE @V_MessageTypeId int = 2 -- end conversation msg
DECLARE @V_ConnectionState varchar(2)
DECLARE @V_IsFound bit
WHILE @V_MessageTypeId = 2
BEGIN
BEGIN TRANSACTION ;
SET @V_MessageTypeId = 0 ;
SET @V_ConvHandle = null ;
WAITFOR (
RECEIVE TOP(1)
@V_ConvHandle = Conversation_Handle ,
@V_Message = message_body ,
@V_MessageTypeId = message_type_id
FROM ' + QUOTENAME( @V_SchemaName ) + '.' + QUOTENAME( @V_QueueName ) + '
)
, TIMEOUT ' + CAST( @V_ReceiveTimeout AS NVARCHAR(200)) + ';
SET @V_IsFound = 0 ;
SELECT
@V_ConnectionState = CAST( state AS varchar(2)) ,
@V_IsFound = 1
FROM sys.conversation_endpoints
WHERE conversation_handle = @V_ConvHandle ;
IF ( @V_IsFound = 1 AND ( @V_ConnectionState = ''CO'' OR @V_ConnectionState = ''DI'') )
END CONVERSATION @V_ConvHandle;
COMMIT TRANSACTION ;
END
SELECT ISNULL( CAST( @V_Message AS NVARCHAR(MAX) ), '''') ;
'
EXEC sp_executesql @V_Cmd ;
RETURN 0 ;
END ;
|
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[Provider_GetById]
@ProviderId INT
/*
exec dbo.Provider_GetById
@ProviderId = 1
*/
AS
BEGIN
SET NOCOUNT ON;
SELECT p.*
FROM Provider p
WHERE p.active = 1
AND p.ProviderID = @ProviderId
END
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 21, 2018 at 07:53 AM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `dbport`
--
-- --------------------------------------------------------
--
-- Table structure for table `characters`
--
CREATE TABLE `characters` (
`id` int(11) NOT NULL,
`nama` varchar(50) NOT NULL,
`desc` varchar(500) NOT NULL,
`foto` varchar(20) NOT NULL,
`slide1` varchar(20) NOT NULL,
`slide2` varchar(20) NOT NULL,
`slide3` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `characters`
--
INSERT INTO `characters` (`id`, `nama`, `desc`, `foto`, `slide1`, `slide2`, `slide3`) VALUES
(1, 'Sheriff Woody', 'Sheriff Woody Pride is a fictional character and the main protagonist in the Toy Story franchise created by Pixar. He is a floppy pull-string cowboy doll and the leader of the toys in the movies. His facial features are based on Tone Thyne, a former Disney animator.[2] He is voiced by Tom Hanks in the feature-length films and short films, and Tom\'s brother Jim Hanks in video games and shorts until Disney Magic Kingdoms.', 'woody.jpg', 'woody1.png', 'woody2.png', 'woody3.png'),
(2, 'Buzz Lightyear', 'Buzz Lightyear is a fictional character in the Toy Story franchise. He is a toy Space Ranger superhero according to the movies and an action figure in the franchise. Along with Sheriff Woody, he is one of the two lead characters in all three Toy Story movies. He also appeared in the movie Buzz Lightyear of Star Command: The Adventure Begins and the television series spin-off Buzz Lightyear of Star Command.', 'buzz.jpg', 'buzz1.png', 'buzz2.png', 'buzz3.png'),
(3, 'Jessie', 'Jessie the Yodeling Cowgirl is a fictional character from the films Toy Story 2 and Toy Story 3. In the movie, she is a very rare toy modeled after a character on the fictional television show Woody\'s Roundup, where the characters included Sheriff Woody, Jessie, Stinky Pete the Prospector and Bullseye, Woody\'s horse. Her hair is formed in a braid tied with a bow.', 'jessie.jpeg', 'jessie1.png', 'jessie2.png', 'jessie3.png'),
(4, 'Mr. Potato Head', 'Mr. Potato Head (often referred to as simply Potato Head) is a supporting character in the Disney/Pixar Toy Story series. He is a moody, Brooklyn-accented toy based on the Hasbro and Playskool doll of the same name.', 'potato.jpg', 'potato1.png', 'potato2.png', 'potato3.png'),
(5, 'Mrs. Potato Head', 'Mrs. Potato Head is a supporting character in the Toy Story series. She is the female counterpart to Mr. Potato Head based on the famous toy from Playskool.', 'mspotato.jpg', 'mspotato1.png', 'mspotato2.png', 'mspotato3.png'),
(6, 'Rex', 'Rex is insecure about his lack of ferociousness, as he\'s not scary enough and seems to just be annoying. Rex\'s worst fear (after Sid) is that Andy may gain another, scarier dinosaur to replace him.', 'rex.jpg', 'rex1.png', 'rex2.png', 'rex3.png'),
(7, 'Slinky Dog', 'Slinky possesses a plastic front and hindquarters, with a very stretchable metal slinky as his middle (hence his name), vinyl ears and a green collar.', 'slinky.jpg', 'slinky1.png', 'slinky2.png', 'slinky3.png'),
(8, 'Hamm', 'Hamm appears to be best friends with Mr. Potato Head and is usually seen insulting Rex.\r\n\r\nOut of all the toys, he seems to be the one with the most common sense, although when he trips and his coins fall out, he\'s a few cents short of a dollar, and always says exactly what he thinks of the other toys.', 'hamm.jpg', 'hamm1.png', 'hamm2.png', 'hamm3.png'),
(9, 'Bullseye', 'Bullseye is Woody\'s horse and one of the characters introduced in Toy Story 2. Despite the fact that he is a horse, he can remind you of a puppy by the way he acts at times. He is extremely affectionate towards Woody, Jessie and the other toys. He doesn\'t have a speaking voice; instead, he neighs and makes other horse noises.', 'bullseye.jpg', 'bullseye1.png', 'bullseye2.png', 'bullseye3.png'),
(10, 'Lotso', 'Lots-o\'-Huggin\' Bear (\"Lotso\" for short) is the main antagonist of Toy Story 3. He is a large, pink strawberry-scented teddy bear who used to rule Sunnyside Daycare like a prison with his former minions.', 'lotso.jpg', 'lotso1.png', 'lotso2.png', 'lotso3.png'),
(11, 'Bo Beep', 'Bo Peep is a supporting character in Toy Story and Toy Story 2. She is a porcelain figurine based on the nursery rhyme character Little Bo-Peep. She is also Woody\'s girlfriend. In private, she is a great deal more daring with her words and actions, which Woody seems to be quite fond of. The sassy shepherdess shows a great deal of concern for Woody, as well as all the other toys.', 'bobeep.jpg', 'bobeep1.png', 'bobeep2.png', 'bobeep3.png'),
(12, 'Andy Davis', 'Andy Davis is a major character in the Toy Story movies. He is the owner of many of the main toys (such as Woody and Buzz) in the films until the end of Toy Story 3 where he give them to Bonnie Anderson.', 'andy.jpg', 'andy1.png', 'andy2.png', 'andy3.png');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `characters`
--
ALTER TABLE `characters`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `characters`
--
ALTER TABLE `characters`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*
Target Server Type : MYSQL
Target Server Version : 50638
File Encoding : 65001
Date: 2018-05-31 18:15:12
*/
use `admin-template`;
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for demo_category
-- ----------------------------
DROP TABLE IF EXISTS `demo_category`;
CREATE TABLE `demo_category` (
`id` varchar(36) NOT NULL,
`name` varchar(40) DEFAULT NULL,
`detail` varchar(400) DEFAULT NULL,
`delFlg` int(1) DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
`updateTime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for demo_item
-- ----------------------------
DROP TABLE IF EXISTS `demo_item`;
CREATE TABLE `demo_item` (
`id` varchar(36) NOT NULL,
`name` varchar(40) DEFAULT NULL,
`detail` varchar(400) DEFAULT NULL,
`img` varchar(1000) DEFAULT NULL,
`categoryId` varchar(36) DEFAULT NULL,
`delFlg` int(1) DEFAULT NULL,
`createTime` datetime DEFAULT NULL,
`updateTime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
-- some setting to make the output less verbose
\set QUIET on
\set ON_ERROR_STOP on
set client_min_messages to warning;
-- load some variables from the env
\set anonymous `echo $DB_ANON_ROLE`
\set authenticator `echo $DB_USER`
\set authenticator_pass `echo $DB_PASS`
\set jwt_secret `echo $JWT_SECRET`
\set quoted_jwt_secret '\'' :jwt_secret '\''
\echo # Loading database definition
begin;
\echo # Loading dependencies
-- functions for storing different settins in a table
\ir libs/settings/schema.sql
-- functions implementing authentication (parts of the lib are included in data and api schema)
\ir libs/auth/schema.sql
-- functions for reading different http request properties exposed by PostgREST
\ir libs/request/schema.sql
-- save app settings
select settings.set('jwt_secret', :quoted_jwt_secret);
select settings.set('jwt_lifetime', '3600');
select settings.set('auth.default-role', 'webuser');
\echo # Loading application definitions
-- private schema where all tables will be defined
-- you can use othere names besides "data" or even spread the tables
-- between different schemas. The schema name "data" is just a convention
\ir data/schema.sql
-- entities inside this schema (which should be only views and stored procedures) will be
-- exposed as API endpoints. Access to them however is still governed by the
-- privileges defined for the current PostgreSQL role making the requests
\ir api/schema.sql
\echo # Loading roles and privilege settings
\ir authorization/roles.sql
\ir authorization/privileges.sql
\echo # Loading sample data
\ir sample_data/dump.sql
commit;
\echo # ==========================================
|
DROP DATABASE IF EXISTS employee_status;
CREATE DATABASE employee_status;
USE employee_status;
CREATE TABLE department (
id INT NOT NULL AUTO_INCREMENT,
dept_name VARCHAR(30) NULL,
PRIMARY KEY (id)
);
CREATE TABLE role (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(30) NULL,
salary DECIMAL(10.3) NULL,
department_id INT NULL,
PRIMARY KEY (id)
);
CREATE TABLE employee (
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(30) NULL,
last_name VARCHAR(30) NULL,
role_id INT NULL,
manage_id INT NULL,
PRIMARY KEY (id)
);
|
-- MySQL dump 10.16 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: admin_dev
-- ------------------------------------------------------
-- Server version 10.1.26-MariaDB-0+deb9u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT = @@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS = @@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION = @@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE = @@TIME_ZONE */;
/*!40103 SET TIME_ZONE = '+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS, UNIQUE_CHECKS = 0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0 */;
/*!40101 SET @OLD_SQL_MODE = @@SQL_MODE, SQL_MODE = 'NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES = @@SQL_NOTES, SQL_NOTES = 0 */;
--
-- Table structure for table `account`
--
DROP TABLE IF EXISTS `test`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `test`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户Id',
`email` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin COMMENT '邮箱',
`name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '用户名',
`password` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin COMMENT '密码',
`register_time` datetime DEFAULT NOW() COMMENT '注册时间',
`login_time` datetime DEFAULT NULL COMMENT '上一次登录时间',
PRIMARY KEY (`id`),
UNIQUE KEY `ix_account_name` (`name`),
UNIQUE KEY `ix_account_email` (`email`)
) ENGINE = InnoDB
AUTO_INCREMENT = 4
DEFAULT CHARSET = utf8mb4 COMMENT ='测试表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `account`
--
LOCK TABLES `test` WRITE;
/*!40000 ALTER TABLE `account`
DISABLE KEYS */;
INSERT INTO `test`
VALUES (1, 'admin@qq.com', 'admin', '$2a$10$wg0f10n.30UbU.9hPpucbef/ya62LdTKs72xJfjxvTFsL0Xaewbra',
'2019-07-01 00:00:00', '2019-07-01 00:00:00');
INSERT INTO `test`
VALUES (2, 'editor@qq.com', 'editor', '$2a$10$/m4SgZ.ZFVZ7rcbQpJW2tezmuhf/UzQtpAtXb0WZiAE3TeHxq2DYu',
'2019-07-02 00:00:00', '2019-07-02 00:00:00');
INSERT INTO `test`
VALUES (3, 'test@qq.com', 'test', '$2a$10$.0gBYBHAtdkxUUQNg3kII.fqGOngF4BLe8JavthZFalt2QIXHlrhm',
'2019-07-03 00:00:00', '2019-07-03 00:00:00');
/*!40000 ALTER TABLE `account`
ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE = @OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE = @OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS = @OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS = @OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT = @OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS = @OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION = @OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES = @OLD_SQL_NOTES */;
-- Dump completed on 2018-02-16 19:24:53
|
-- Rampup
-- Create Views for common queries
-- BQ Views are logical -not materialized
-- Underlying query will execute
SELECT * FROM [bigq-projects:babynames.babynames] LIMIT 10;
SELECT name, count
FROM [bigq-projects:babynames.babynames]
WHERE gender = 'M'
ORDER BY count DESC LIMIT 10;
SELECT
weight_pounds, state, year, gestation_weeks
FROM [bigquery-public-data.samples.natality]
ORDER BY weight_pounds DESC LIMIT 10;
-- AGGREGATIONS
-- With No Aggregation
SELECT airline,
date,
departure_delay
FROM
`bigquery-samples.airline_ontime_data.flights`
WHERE
departure_delay > 0
AND departure_airport = 'LGA'
GROUP BY airline
ORDER BY airline DESC
-- With Aggregation
SELECT airline,
count(departure_delay)
FROM
`bigquery-samples.airline_ontime_data.flights`
WHERE
departure_delay > 0
AND departure_airport = 'LGA'
AND date = '2008-05-13'
GROUP BY airline
ORDER BY airline DESC
-- Find Total Number of Flights and Number of
SELECT
f.airline,
COUNT(f.departure_delay) AS total_flights,
SUM(IF(f.departure_delay > 0, 1,0)) as num_delayed
FROM
`bigquery-samples.airline_ontime_data.flights`
WHERE
f.departure_airport = 'LGA'
AND
f.date = '2008-05-13'
GROUP BY f.airline
-- Get Delays on Rainy Days with JOIN
SELECT
CONCAT(CAST(year AS STRING), '-', LPAD(CAST(month AS STRING),2,0), LPAD(CAST(day AS STRING),2,0))
FROM
`bigquery-samples.airline_ontime_data.flights`
-- More GCP Stuff: Flights by Delay stats
SELECT
airline,
COUNT(departure_delay)
FROM
`bigquery-samples.airline_ontime_data.flights`
WHERE departure_delay > 0
AND departure_airport = 'LGA'
AND date = "2008-05-13"
GROUP BY
airline
ORDER BY airline DESC
-- More Aggregations: Get all flights per day and number of delay flights per day
SELECT
f.airline,
COUNT(f.departure_delay) AS total_flights
SUM(IF(f.departure_delay > 0, 1,0)) AS num_delayed
FROM
`bigquery-samples.airline_ontime_data.flights` AS f
WHERE f.departure_airport = 'LGA'
AND f.date = "2008-05-13"
GROUP BY
f.airline
ORDER BY f.airline DESC
-- SubQueries and Joins
-- Check another table for rainy days
SELECT year, month, day
FROM `bigquery-samples.weather_geo.gsod`
WHERE
station_number = 725030 -- New York
AND total_precipitation > 0
SELECT
CONCAT(CAST(year AS STRING), '-', LPAD(CAST(month AS STRING),2,0), LPAD(CAST(day AS STRING),2,0))
FROM
`bigquery-samples.weather_geo.gsod`
-- Create Complex Query
SELECT
f.airline,
COUNT(f.departure_delay) AS total_flights
SUM(IF(f.departure_delay > 0, 1,0)) AS num_delayed
FROM
`bigquery-samples.airline_ontime_data.flights` AS f
JOIN (
SELECT
CONCAT(CAST(year AS STRING), '-', LPAD(CAST(month AS STRING),2,0), LPAD(CAST(day AS STRING),2,0))
FROM `bigquery-samples.weather_geo.gsod`
WHERE
station_number = 725030 -- New York
AND total_precipitation > 0
) AS w
ON w.rainyday = f.date
WHERE f.departure_airport = 'LGA'
AND f.date = "2008-05-13"
GROUP BY
f.airline
ORDER BY f.airline DESC
-- Find percentage of delayed flights
SELECT
airline,
num_delayed,
total_flights,
num_delayed/total_flights AS frac_delayed
FROM
(
SELECT
f.airline,
COUNT(f.departure_delay) AS total_flights
SUM(IF(f.departure_delay > 0, 1,0)) AS num_delayed
FROM
`bigquery-samples.airline_ontime_data.flights` AS f
JOIN (
SELECT
CONCAT(CAST(year AS STRING), '-', LPAD(CAST(month AS STRING),2,0), LPAD(CAST(day AS STRING),2,0))
FROM `bigquery-samples.weather_geo.gsod`
WHERE
station_number = 725030 -- New York
AND total_precipitation > 0
) AS w
ON w.rainyday = f.date
WHERE f.departure_airport = 'LGA'
AND f.date = "2008-05-13"
GROUP BY
f.airline
ORDER BY
f.airline DESC
)
ORDER BY
frac_delayed DESC
-- BQ Regular Expressions Sample
-- Using Web logs
SELECT
SUM(views)
FROM [bigquery-samples.wikimedia_pageviews.201112]
-- Get Wikipedia specific results : Use Standard SQL
SELECT
SUM(views), wikimedia_project
FROM [bigquery-samples.wikimedia_pageviews.201112]
WHERE wikimedia_project = "wp"
GROUP BY wikimedia_project
-- Get titles that contain Red
SELECT
title,
SUM(views) views
FROM --multiple tables
[bigquery-samples.wikimedia_pageviews.201111],
[bigquery-samples.wikimedia_pageviews.201112]
WHERE wikimedia_project = "wp"
AND REGEXP_MATCH(title, 'Red.*t')
GROUP BY title
ORDER BY views DESC
-- RegExp Version?
SELECT
title,
SUM(views) views
FROM --multiple tables
TABLE_QUERY([bigquery-samples.wikimedia_pageview],
'REGEXP_MATCH(table_id, r""2011[\d](2)")')
WHERE wikimedia_project = "wp"
AND REGEXP_MATCH(title, 'Red.*t')
GROUP BY title
ORDER BY views DESC
-- using WITH
-- Github Querying Task
WITH
commits AS (
SELECT
author.email,
EXTRACT(DAYOFWEEK
FROM
author.date) BETWEEN 2 AND 6 is_weekday,
LOWER(REGEXP_EXTRACT(diff.new_path, r'\.([^\./\(~_ \- #]*)$')) lang,
diff.new_path AS path,
author.date
FROM `bigquery-public-data.github_repos.commits`,
UNNEST(difference) diff
WHERE
EXTRACT(YEAR
FROM
author.date) = 2016
)
-- Use the 'commits' query
SELECT
lang,
is_weekday,
COUNT(path) AS numcommits
FROM
commits
WHERE
length(lang) < 8
AND lang IS NOT NULL
AND REGEXP_CONTAINS(lang, '[a-zA-Z]')
GROUP BY
lang,is_weekday
HAVING
numcommits > 100
ORDER BY
numcommits DESC
-- BIGQUERY FLASHCARD
-- Data Partitioning
-- Legacy SQL
SELECT TIMESTAMP(_PARTITIONTIME), * FROM [PartitionedTablesDemo.Employee_Details]
-- Standard SQL
#standardSQL
SELECT CAST(_PARTITIONTIME as DATETIME), * FROM `PartitionedTablesDemo.Employee_Details`
-- Commandline Load Data
```bq query --destination_table PartitionTaxiTables.trips_20150330 "SELECT * FROM [nyc-tlc:green.trips_2015] WHERE TIMESTAMP(pickup_datetime) between TIMESTAMP('2015-03-30 00:00:00 UTC') and TIMESTAMP('2015-03-30 23:59:59 UTC')"```
SELECT * FROM [PartitionTaxiTables.trips_non_partition]
WHERE pickup_datetime between TIMESTAMP("2015-04-01 00:00:00") and TIMESTAMP("2015-04-02 23:59:59")
SELECT * FROM [my-first-project-170319:PartitionTaxiTables.trips_partitioned]
WHERE _PARTITIONTIME BETWEEN TIMESTAMP("2015-04-01 00:00:00") and TIMESTAMP("2015-04-02 23:59:59")
-- Get data from 2 partitions
SELECT *
FROM [PartitionTaxiTables.trips_partitioned$20150401],[PartitionTaxiTables.trips_partitioned$20150402]
-- Get Partitions Details in a table
#legacySQL
SELECT partition_id
FROM [PartitionTaxiTables.trips_partitioned$__PARTITIONS_SUMMARY__]
#standardSQL
SELECT
DISTINCT _PARTITIONTIME as pt
FROM
`PartitionTaxiTables.trips_partitioned`
-- Table UNION
#standardSQL
SELECT MAX(EXTRACT(YEAR from pickup_datetime)) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_2009`
UNION ALL
SELECT MAX(EXTRACT(YEAR from pickup_datetime)) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_2010`
UNION ALL
SELECT MAX(EXTRACT(YEAR from pickup_datetime)) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_2011`
UNION ALL
SELECT MAX(EXTRACT(YEAR from pickup_datetime)) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_2012`
UNION ALL
SELECT MAX(EXTRACT(YEAR from pickup_datetime)) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_2013`
UNION ALL
SELECT MAX(EXTRACT(YEAR from pickup_datetime)) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_2014`
UNION ALL
SELECT MAX(EXTRACT(YEAR from pickup_datetime)) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_2015`
UNION ALL
SELECT MAX(EXTRACT(YEAR from pickup_datetime)) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_2016`
order by TripYear
-- Another Implementation
#standardSQL
SELECT EXTRACT(YEAR from pickup_datetime) as TripYear, count(1) as TripCount FROM `bigquery-public-data.new_york.tlc_yellow_trips_*`
GROUP BY TripYear
ORDER BY TripYear
-- OR using _TABLE_SUFFIX
#standardSQL
SELECT EXTRACT(YEAR from pickup_datetime) as TripYear, count(1) as TripCount
FROM `bigquery-public-data.new_york.tlc_yellow_trips_*`
WHERE _TABLE_SUFFIX BETWEEN '2009' AND '2012'
GROUP BY TripYear
ORDER BY TripYear
#standardSQL
SELECT EXTRACT(YEAR from pickup_datetime) as TripYear, count(1) as TripCount
FROM `bigquery-public-data.new_york.tlc_yellow_trips_*`
WHERE (_TABLE_SUFFIX = '2010'
OR _TABLE_SUFFIX = '2016')
GROUP BY TripYear
ORDER BY TripYear
-- Temporary Functions
#standardSQL
CREATE TEMPORARY FUNCTION GetOtherCharges(tipamount FLOAT64, tollsamount FLOAT64)
RETURNS INT64
LANGUAGE js AS """
return tipamount + tollsamount;
""";
SELECT vendor_id, GetOtherCharges( tip_amount, tolls_amount )
FROM `bigquery-public-data.new_york.tlc_green_trips_2013`
-- More Functions
#standardSQL
CREATE TEMPORARY FUNCTION GetOtherCharges(tipamount FLOAT64, tollsamount FLOAT64)
AS (
(
SELECT MAX(VAL1) FROM (
SELECT tipamount AS VAL1
UNION ALL
SELECT tollsamount AS VAL1
)
)
);
SELECT vendor_id, GetOtherCharges( tip_amount, tolls_amount )
FROM `bigquery-public-data.new_york.tlc_green_trips_2013`
-- Querying Nested Columns
#standardSQL
SELECT EmployeeID, Employee_Names.FirstName, Employee_Names.LastName, Employee_Location
FROM `my-first-project-170319.HumanResourceDS.Employee_Nested_Demo`
-- This query returns the list of employees who have worked in at least two countries:
#standardSQL
SELECT EmployeeID, Employee_Names.FirstName, Employee_Names.LastName
FROM `my-first-project-170319.HumanResourceDS.Employee_Repeated_Demo`
WHERE ARRAY_LENGTH(Employee_Location) > 1
#legacySQL
SELECT EmployeeID, Employee_Names.FirstName, Employee_Names.LastName, COUNT(Employee_Location.Country) WITHIN RECORD as countrycount
FROM [HumanResourceDS.Employee_Repeated_Demo]
|
-- @testpoint:openGauss关键字unlogged(非保留)同时作为表名和列名带引号,并使用该列结合limit排序,unlogged列的值按字母大小排序且只显示前2条数据
drop table if exists "explain";
create table "explain"(
c_id int, c_int int, c_integer integer, c_bool int, c_boolean int, c_bigint integer,
c_real real, c_double real,
c_decimal decimal(38), c_number number(38), c_numeric numeric(38),
c_char char(50) default null, c_varchar varchar(20), c_varchar2 varchar2(4000),
c_date date, c_datetime date, c_timestamp timestamp,
"explain" varchar(100) default 'explain'
)
PARTITION BY RANGE (c_integer)
(
partition P_20180121 values less than (0),
partition P_20190122 values less than (50000),
partition P_20200123 values less than (100000),
partition P_max values less than (maxvalue)
);
delete from "explain";
insert into "explain"(c_id,"explain") values(1,'hello');
insert into "explain"(c_id,"explain") values(2,'china');
insert into "explain"(c_id,"explain") values(3,'gauss');
select "explain" from "explain" where "explain"!='hello' order by "explain" limit 2 ;
drop table "explain";
|
declare
l_dgrm_content clob;
begin
l_dgrm_content := apex_string.join_clob(
apex_t_varchar2(
q'[<?xml version='1.0' encoding='UTF-8'?>]'
,q'[<bpmn:definitions xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:bpmn='http://www.omg.org/spec/BPMN/20100524/MODEL' xmlns:bpmndi='http://www.omg.org/spec/BPMN/20100524/DI' xmlns:dc='http://www.omg.org/spec/DD/20100524/DC' xmlns:di='http://www.omg.org/spec/DD/20100524/DI' xmlns:apex='http://www.apex.mt-ag.com' id='Definitions_1wzb475' targetNamespace='http://bpmn.io/schema/bpmn' exporter='bpmn-js (https://demo.bpmn.io)' exporterVersion='7.2.0'>]'
,q'[ <bpmn:process id='Tutorial_AA6' name='Tutorial 6 - Errors and Escalations' isExecutable='false'>]'
,q'[ <bpmn:documentation>Tutorials by Richard Allen.]'
,q'[Flowquest Consulting.]'
,q'[twitter: @FlowquestR</bpmn:documentation>]'
,q'[ <bpmn:startEvent id='Event_0iygv59'>]'
,q'[ <bpmn:outgoing>Flow_1gz0sgq</bpmn:outgoing>]'
,q'[ </bpmn:startEvent>]'
,q'[ <bpmn:task id='Activity_13yt1ft' name='Tutorial 5 SubProcesses'>]'
,q'[ <bpmn:incoming>Flow_1gz0sgq</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_1ha31js</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_1gz0sgq' sourceRef='Event_0iygv59' targetRef='Activity_13yt1ft' />]'
,q'[ <bpmn:sequenceFlow id='Flow_1ha31js' sourceRef='Activity_13yt1ft' targetRef='Activity_1lt3f7j' />]'
,q'[ <bpmn:subProcess id='Activity_1lt3f7j' name='SubProcess B'>]'
,q'[ <bpmn:incoming>Flow_1ha31js</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_1trgt3r</bpmn:outgoing>]'
,q'[ <bpmn:startEvent id='Event_0j57auc' name='A subProcess Starts with a Start Event'>]'
,q'[ <bpmn:outgoing>Flow_1bfswcs</bpmn:outgoing>]'
,q'[ </bpmn:startEvent>]'
,q'[ <bpmn:task id='Activity_0kcgja9' name='B1'>]'
,q'[ <bpmn:incoming>Flow_1bfswcs</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_1dfsgk8</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_1bfswcs' sourceRef='Event_0j57auc' targetRef='Activity_0kcgja9' />]'
,q'[ <bpmn:sequenceFlow id='Flow_1dfsgk8' sourceRef='Activity_0kcgja9' targetRef='Gateway_0tapl6i' />]'
,q'[ <bpmn:parallelGateway id='Gateway_0tapl6i' name='B Split'>]'
,q'[ <bpmn:incoming>Flow_1dfsgk8</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_14jrwrx</bpmn:outgoing>]'
,q'[ <bpmn:outgoing>Flow_0sw8mct</bpmn:outgoing>]'
,q'[ </bpmn:parallelGateway>]'
,q'[ <bpmn:task id='Activity_1n7m2kj' name='B2'>]'
,q'[ <bpmn:incoming>Flow_14jrwrx</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_0l8zsga</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_14jrwrx' sourceRef='Gateway_0tapl6i' targetRef='Activity_1n7m2kj' />]'
,q'[ <bpmn:task id='Activity_1ox4cmk' name='B3'>]'
,q'[ <bpmn:incoming>Flow_0l8zsga</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_1smtq7r</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_0l8zsga' sourceRef='Activity_1n7m2kj' targetRef='Activity_1ox4cmk' />]'
,q'[ <bpmn:endEvent id='Event_1v77s5u' name='B2 B3 B6 End'>]'
,q'[ <bpmn:incoming>Flow_1o2xxi5</bpmn:incoming>]'
,q'[ </bpmn:endEvent>]'
,q'[ <bpmn:sequenceFlow id='Flow_1smtq7r' sourceRef='Activity_1ox4cmk' targetRef='Gateway_0okheq5' />]'
,q'[ <bpmn:sequenceFlow id='Flow_0sw8mct' sourceRef='Gateway_0tapl6i' targetRef='Activity_1l75ys0' />]'
,q'[ <bpmn:subProcess id='Activity_1l75ys0' name='SubProcess B4'>]'
,q'[ <bpmn:incoming>Flow_0sw8mct</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_0dxi3lp</bpmn:outgoing>]'
,q'[ <bpmn:startEvent id='Event_094xygx' name='B4 Start'>]'
,q'[ <bpmn:outgoing>Flow_1ji74dg</bpmn:outgoing>]'
,q'[ </bpmn:startEvent>]'
,q'[ <bpmn:task id='Activity_1rct9yd' name='B4A'>]'
,q'[ <bpmn:incoming>Flow_1ji74dg</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_0lkjrzz</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_1ji74dg' sourceRef='Event_094xygx' targetRef='Activity_1rct9yd' />]'
,q'[ <bpmn:task id='Activity_1nqf2t2' name='B4B'>]'
,q'[ <bpmn:incoming>Flow_1x95h95</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_0t7vhh2</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_0lkjrzz' sourceRef='Activity_1rct9yd' targetRef='Gateway_0qtnlf2' />]'
,q'[ <bpmn:endEvent id='Event_0ytprrh' name='B4 end'>]'
,q'[ <bpmn:incoming>Flow_0t7vhh2</bpmn:incoming>]'
,q'[ </bpmn:endEvent>]'
,q'[ <bpmn:sequenceFlow id='Flow_0t7vhh2' sourceRef='Activity_1nqf2t2' targetRef='Event_0ytprrh' />]'
,q'[ <bpmn:exclusiveGateway id='Gateway_0qtnlf2' name='Anything really bad?' default='Flow_18i162p'>]'
,q'[ <bpmn:incoming>Flow_0lkjrzz</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_1x95h95</bpmn:outgoing>]'
,q'[ <bpmn:outgoing>Flow_18i162p</bpmn:outgoing>]'
,q'[ </bpmn:exclusiveGateway>]'
,q'[ <bpmn:sequenceFlow id='Flow_1x95h95' name='N' sourceRef='Gateway_0qtnlf2' targetRef='Activity_1nqf2t2' />]'
,q'[ <bpmn:task id='Activity_1ummob2' name='B4 Pre-Error Step'>]'
,q'[ <bpmn:incoming>Flow_18i162p</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_1e22oat</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_18i162p' name='Y' sourceRef='Gateway_0qtnlf2' targetRef='Activity_1ummob2' />]'
,q'[ <bpmn:sequenceFlow id='Flow_1e22oat' sourceRef='Activity_1ummob2' targetRef='Event_185dh52' />]'
,q'[ <bpmn:endEvent id='Event_185dh52' name='B4 Error End'>]'
,q'[ <bpmn:incoming>Flow_1e22oat</bpmn:incoming>]'
,q'[ <bpmn:errorEventDefinition id='ErrorEventDefinition_1jh4n0h' />]'
,q'[ </bpmn:endEvent>]'
,q'[ </bpmn:subProcess>]'
,q'[ <bpmn:task id='Activity_0ems563' name='B5'>]'
,q'[ <bpmn:incoming>Flow_0dxi3lp</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_03kjiig</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_0dxi3lp' sourceRef='Activity_1l75ys0' targetRef='Activity_0ems563' />]'
,q'[ <bpmn:endEvent id='Event_1mr01vo' name='B4 B5 end'>]'
,q'[ <bpmn:incoming>Flow_03kjiig</bpmn:incoming>]'
,q'[ </bpmn:endEvent>]'
,q'[ <bpmn:sequenceFlow id='Flow_03kjiig' sourceRef='Activity_0ems563' targetRef='Event_1mr01vo' />]'
,q'[ <bpmn:exclusiveGateway id='Gateway_0okheq5' name='Everything OK?' default='Flow_1n7yz35'>]'
,q'[ <bpmn:incoming>Flow_1smtq7r</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_00jpo2b</bpmn:outgoing>]'
,q'[ <bpmn:outgoing>Flow_1n7yz35</bpmn:outgoing>]'
,q'[ </bpmn:exclusiveGateway>]'
,q'[ <bpmn:sequenceFlow id='Flow_00jpo2b' name='Yes' sourceRef='Gateway_0okheq5' targetRef='Activity_0ksy34k' />]'
,q'[ <bpmn:task id='Activity_0ksy34k' name='B6'>]'
,q'[ <bpmn:incoming>Flow_00jpo2b</bpmn:incoming>]'
,q'[ <bpmn:incoming>Flow_01yn0la</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_1o2xxi5</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_1o2xxi5' sourceRef='Activity_0ksy34k' targetRef='Event_1v77s5u' />]'
,q'[ <bpmn:sequenceFlow id='Flow_1n7yz35' sourceRef='Gateway_0okheq5' targetRef='Event_1yflz91' />]'
,q'[ <bpmn:sequenceFlow id='Flow_01yn0la' sourceRef='Event_1yflz91' targetRef='Activity_0ksy34k' />]'
,q'[ <bpmn:intermediateThrowEvent id='Event_1yflz91' name='Throw Escalation Event'>]'
,q'[ <bpmn:incoming>Flow_1n7yz35</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_01yn0la</bpmn:outgoing>]'
,q'[ <bpmn:escalationEventDefinition id='EscalationEventDefinition_1todiyv' />]'
,q'[ </bpmn:intermediateThrowEvent>]'
,q'[ <bpmn:boundaryEvent id='Event_0ilybau' name='Interrupting Error Boundary Event' attachedToRef='Activity_1l75ys0'>]'
,q'[ <bpmn:outgoing>Flow_0rzsiz6</bpmn:outgoing>]'
,q'[ <bpmn:errorEventDefinition id='ErrorEventDefinition_13fuvpw' />]'
,q'[ </bpmn:boundaryEvent>]'
,q'[ <bpmn:task id='Activity_0czq539' name='Process Error Handler'>]'
,q'[ <bpmn:incoming>Flow_0rzsiz6</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_0pw6aqw</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_0rzsiz6' sourceRef='Event_0ilybau' targetRef='Activity_0czq539' />]'
,q'[ <bpmn:endEvent id='Event_0jj0hcj' name='B4 Bad End'>]'
,q'[ <bpmn:incoming>Flow_0pw6aqw</bpmn:incoming>]'
,q'[ </bpmn:endEvent>]'
,q'[ <bpmn:sequenceFlow id='Flow_0pw6aqw' sourceRef='Activity_0czq539' targetRef='Event_0jj0hcj' />]'
,q'[ <bpmn:textAnnotation id='TextAnnotation_0mjqcjn'>]'
,q'[ <bpmn:text>All of the active subflows have to complete for the sub process to complete, and then return to the parent subflow.</bpmn:text>]'
,q'[ </bpmn:textAnnotation>]'
,q'[ <bpmn:association id='Association_0n233kd' sourceRef='Event_1v77s5u' targetRef='TextAnnotation_0mjqcjn' />]'
,q'[ </bpmn:subProcess>]'
,q'[ <bpmn:task id='Activity_0n0h791' name='C'>]'
,q'[ <bpmn:incoming>Flow_1trgt3r</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_0wppxk7</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_1trgt3r' sourceRef='Activity_1lt3f7j' targetRef='Activity_0n0h791' />]'
,q'[ <bpmn:endEvent id='Event_1h0lzcv' name='End'>]'
,q'[ <bpmn:incoming>Flow_0wppxk7</bpmn:incoming>]'
,q'[ </bpmn:endEvent>]'
,q'[ <bpmn:sequenceFlow id='Flow_0wppxk7' sourceRef='Activity_0n0h791' targetRef='Event_1h0lzcv' />]'
,q'[ <bpmn:boundaryEvent id='Event_05m9taf' name='Non-Interrupting Escalation Catch Event' cancelActivity='false' attachedToRef='Activity_1lt3f7j'>]'
,q'[ <bpmn:outgoing>Flow_0oc2x09</bpmn:outgoing>]'
,q'[ <bpmn:escalationEventDefinition id='EscalationEventDefinition_157jo9p' />]'
,q'[ </bpmn:boundaryEvent>]'
,q'[ <bpmn:sequenceFlow id='Flow_0oc2x09' sourceRef='Event_05m9taf' targetRef='Activity_1mbzten' />]'
,q'[ <bpmn:serviceTask id='Activity_1b9ghnl' name='Email Manager for Help'>]'
,q'[ <bpmn:incoming>Flow_1wddzwq</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_0jim7nk</bpmn:outgoing>]'
,q'[ <apex:plsqlCode>null;</apex:plsqlCode>]'
,q'[ </bpmn:serviceTask>]'
,q'[ <bpmn:endEvent id='Event_099tlz0' name='Escalation Handler End'>]'
,q'[ <bpmn:incoming>Flow_0jim7nk</bpmn:incoming>]'
,q'[ </bpmn:endEvent>]'
,q'[ <bpmn:sequenceFlow id='Flow_0jim7nk' sourceRef='Activity_1b9ghnl' targetRef='Event_099tlz0' />]'
,q'[ <bpmn:task id='Activity_1mbzten' name='This gets started in Parallel when escalated...'>]'
,q'[ <bpmn:incoming>Flow_0oc2x09</bpmn:incoming>]'
,q'[ <bpmn:outgoing>Flow_1wddzwq</bpmn:outgoing>]'
,q'[ </bpmn:task>]'
,q'[ <bpmn:sequenceFlow id='Flow_1wddzwq' sourceRef='Activity_1mbzten' targetRef='Activity_1b9ghnl' />]'
,q'[ <bpmn:textAnnotation id='TextAnnotation_0m1p9cx'>]'
,q'[ <bpmn:text>Tutorial 6 - Introducing Escalations and Error Events]'
,q'[]'
,q'[Let's build on our Sub Process Model.]'
,q'[]'
,q'[Escalations are used when a process has a warning, or something happens when you need to bring in an extra process to help. ]'
,q'[]'
,q'[We use an Escalation Intermediate Throw Event between B3 and B6 to signal that we have an escalation. The escalation is caught by the Non-Interrupting Escalation Boundary Event on the sub process boundary, where our escalation handling process is defined. This is non-interrupting - so the main process continues. ]'
,q'[]'
,q'[Escalations can be non-interrupting (usual) or can interrupt the process.]'
,q'[]'
,q'[Sub process B4 has an Error End Event - so in this tutorial it always ends with an error - which interrupts the sub-process, and passes control to the error handler if you have one defined.]'
,q'[]'
,q'[Note that we're talking about business process Escalations (and Errors) here - not technical escalations (or errors!).</bpmn:text>]'
,q'[ </bpmn:textAnnotation>]'
,q'[ <bpmn:association id='Association_0ccwauj' sourceRef='Activity_1lt3f7j' targetRef='TextAnnotation_0m1p9cx' />]'
,q'[ </bpmn:process>]'
,q'[ <bpmndi:BPMNDiagram id='BPMNDiagram_1'>]'
,q'[ <bpmndi:BPMNPlane id='BPMNPlane_1' bpmnElement='Tutorial_AA6'>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1wddzwq_di' bpmnElement='Flow_1wddzwq'>]'
,q'[ <di:waypoint x='1430' y='890' />]'
,q'[ <di:waypoint x='1460' y='890' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0jim7nk_di' bpmnElement='Flow_0jim7nk'>]'
,q'[ <di:waypoint x='1560' y='890' />]'
,q'[ <di:waypoint x='1612' y='890' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0oc2x09_di' bpmnElement='Flow_0oc2x09'>]'
,q'[ <di:waypoint x='1290' y='828' />]'
,q'[ <di:waypoint x='1290' y='890' />]'
,q'[ <di:waypoint x='1330' y='890' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0wppxk7_di' bpmnElement='Flow_0wppxk7'>]'
,q'[ <di:waypoint x='1900' y='480' />]'
,q'[ <di:waypoint x='1962' y='480' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1trgt3r_di' bpmnElement='Flow_1trgt3r'>]'
,q'[ <di:waypoint x='1700' y='480' />]'
,q'[ <di:waypoint x='1800' y='480' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1ha31js_di' bpmnElement='Flow_1ha31js'>]'
,q'[ <di:waypoint x='430' y='310' />]'
,q'[ <di:waypoint x='530' y='310' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1gz0sgq_di' bpmnElement='Flow_1gz0sgq'>]'
,q'[ <di:waypoint x='278' y='310' />]'
,q'[ <di:waypoint x='330' y='310' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNShape id='Event_0iygv59_di' bpmnElement='Event_0iygv59'>]'
,q'[ <dc:Bounds x='242' y='292' width='36' height='36' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_13yt1ft_di' bpmnElement='Activity_13yt1ft'>]'
,q'[ <dc:Bounds x='330' y='270' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_0x9pws1_di' bpmnElement='Activity_1lt3f7j' isExpanded='true'>]'
,q'[ <dc:Bounds x='530' y='210' width='1170' height='600' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0pw6aqw_di' bpmnElement='Flow_0pw6aqw'>]'
,q'[ <di:waypoint x='1580' y='710' />]'
,q'[ <di:waypoint x='1612' y='710' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0rzsiz6_di' bpmnElement='Flow_0rzsiz6'>]'
,q'[ <di:waypoint x='1428' y='710' />]'
,q'[ <di:waypoint x='1480' y='710' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_01yn0la_di' bpmnElement='Flow_01yn0la'>]'
,q'[ <di:waypoint x='1318' y='440' />]'
,q'[ <di:waypoint x='1349' y='440' />]'
,q'[ <di:waypoint x='1349' y='350' />]'
,q'[ <di:waypoint x='1380' y='350' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1n7yz35_di' bpmnElement='Flow_1n7yz35'>]'
,q'[ <di:waypoint x='1240' y='355' />]'
,q'[ <di:waypoint x='1240' y='440' />]'
,q'[ <di:waypoint x='1282' y='440' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1o2xxi5_di' bpmnElement='Flow_1o2xxi5'>]'
,q'[ <di:waypoint x='1480' y='330' />]'
,q'[ <di:waypoint x='1602' y='330' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_00jpo2b_di' bpmnElement='Flow_00jpo2b'>]'
,q'[ <di:waypoint x='1265' y='330' />]'
,q'[ <di:waypoint x='1380' y='330' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1280' y='312' width='18' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_03kjiig_di' bpmnElement='Flow_03kjiig'>]'
,q'[ <di:waypoint x='1550' y='550' />]'
,q'[ <di:waypoint x='1602' y='550' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0dxi3lp_di' bpmnElement='Flow_0dxi3lp'>]'
,q'[ <di:waypoint x='1410' y='550' />]'
,q'[ <di:waypoint x='1450' y='550' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0sw8mct_di' bpmnElement='Flow_0sw8mct'>]'
,q'[ <di:waypoint x='830' y='355' />]'
,q'[ <di:waypoint x='830' y='510' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1smtq7r_di' bpmnElement='Flow_1smtq7r'>]'
,q'[ <di:waypoint x='1170' y='330' />]'
,q'[ <di:waypoint x='1215' y='330' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0l8zsga_di' bpmnElement='Flow_0l8zsga'>]'
,q'[ <di:waypoint x='1010' y='330' />]'
,q'[ <di:waypoint x='1070' y='330' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_14jrwrx_di' bpmnElement='Flow_14jrwrx'>]'
,q'[ <di:waypoint x='855' y='330' />]'
,q'[ <di:waypoint x='910' y='330' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1dfsgk8_di' bpmnElement='Flow_1dfsgk8'>]'
,q'[ <di:waypoint x='750' y='330' />]'
,q'[ <di:waypoint x='805' y='330' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1bfswcs_di' bpmnElement='Flow_1bfswcs'>]'
,q'[ <di:waypoint x='598' y='330' />]'
,q'[ <di:waypoint x='650' y='330' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNShape id='Event_0j57auc_di' bpmnElement='Event_0j57auc'>]'
,q'[ <dc:Bounds x='561.6666666666666' y='312' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='537' y='355' width='87' height='40' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_0kcgja9_di' bpmnElement='Activity_0kcgja9'>]'
,q'[ <dc:Bounds x='650' y='290' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Gateway_0iissxc_di' bpmnElement='Gateway_0tapl6i'>]'
,q'[ <dc:Bounds x='805' y='305' width='50' height='50' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='784' y='293' width='32' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_1n7m2kj_di' bpmnElement='Activity_1n7m2kj'>]'
,q'[ <dc:Bounds x='910' y='290' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_1ox4cmk_di' bpmnElement='Activity_1ox4cmk'>]'
,q'[ <dc:Bounds x='1070' y='290' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_1v77s5u_di' bpmnElement='Event_1v77s5u'>]'
,q'[ <dc:Bounds x='1602' y='312' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1586' y='355' width='70' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_19cs6tz_di' bpmnElement='Activity_1l75ys0' isExpanded='true'>]'
,q'[ <dc:Bounds x='770' y='510' width='640' height='250' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1e22oat_di' bpmnElement='Flow_1e22oat'>]'
,q'[ <di:waypoint x='1220' y='700' />]'
,q'[ <di:waypoint x='1272' y='700' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_18i162p_di' bpmnElement='Flow_18i162p'>]'
,q'[ <di:waypoint x='1080' y='615' />]'
,q'[ <di:waypoint x='1080' y='700' />]'
,q'[ <di:waypoint x='1120' y='700' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1091' y='655' width='8' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1x95h95_di' bpmnElement='Flow_1x95h95'>]'
,q'[ <di:waypoint x='1105' y='590' />]'
,q'[ <di:waypoint x='1170' y='590' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1134' y='572' width='8' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0t7vhh2_di' bpmnElement='Flow_0t7vhh2'>]'
,q'[ <di:waypoint x='1270' y='590' />]'
,q'[ <di:waypoint x='1342' y='590' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_0lkjrzz_di' bpmnElement='Flow_0lkjrzz'>]'
,q'[ <di:waypoint x='1000' y='590' />]'
,q'[ <di:waypoint x='1055' y='590' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNEdge id='Flow_1ji74dg_di' bpmnElement='Flow_1ji74dg'>]'
,q'[ <di:waypoint x='838' y='590' />]'
,q'[ <di:waypoint x='900' y='590' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNShape id='Event_094xygx_di' bpmnElement='Event_094xygx'>]'
,q'[ <dc:Bounds x='802' y='572' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='800' y='615' width='40' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_1rct9yd_di' bpmnElement='Activity_1rct9yd'>]'
,q'[ <dc:Bounds x='900' y='550' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_1nqf2t2_di' bpmnElement='Activity_1nqf2t2'>]'
,q'[ <dc:Bounds x='1170' y='550' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_0ytprrh_di' bpmnElement='Event_0ytprrh'>]'
,q'[ <dc:Bounds x='1342' y='572' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1343' y='615' width='35' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Gateway_0qtnlf2_di' bpmnElement='Gateway_0qtnlf2' isMarkerVisible='true'>]'
,q'[ <dc:Bounds x='1055' y='565' width='50' height='50' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1078' y='546' width='73' height='27' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_1ummob2_di' bpmnElement='Activity_1ummob2'>]'
,q'[ <dc:Bounds x='1120' y='660' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_0ppaw77_di' bpmnElement='Event_185dh52'>]'
,q'[ <dc:Bounds x='1272' y='682' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1258' y='725' width='64' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_0ems563_di' bpmnElement='Activity_0ems563'>]'
,q'[ <dc:Bounds x='1450' y='510' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_1mr01vo_di' bpmnElement='Event_1mr01vo'>]'
,q'[ <dc:Bounds x='1602' y='532' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1594' y='575' width='52' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Gateway_0okheq5_di' bpmnElement='Gateway_0okheq5' isMarkerVisible='true'>]'
,q'[ <dc:Bounds x='1215' y='305' width='50' height='50' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1201' y='283' width='78' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_0ksy34k_di' bpmnElement='Activity_0ksy34k'>]'
,q'[ <dc:Bounds x='1380' y='290' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_0inroqp_di' bpmnElement='Event_1yflz91'>]'
,q'[ <dc:Bounds x='1282' y='422' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1258' y='465' width='85' height='27' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_0czq539_di' bpmnElement='Activity_0czq539'>]'
,q'[ <dc:Bounds x='1480' y='670' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_0jj0hcj_di' bpmnElement='Event_0jj0hcj'>]'
,q'[ <dc:Bounds x='1612' y='692' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1601' y='735' width='59' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='TextAnnotation_0mjqcjn_di' bpmnElement='TextAnnotation_0mjqcjn'>]'
,q'[ <dc:Bounds x='1390' y='230' width='248' height='54' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_0nr80d2_di' bpmnElement='Event_0ilybau'>]'
,q'[ <dc:Bounds x='1392' y='692' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1418' y='636' width='84' height='27' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNEdge id='Association_0n233kd_di' bpmnElement='Association_0n233kd'>]'
,q'[ <di:waypoint x='1617' y='313' />]'
,q'[ <di:waypoint x='1611' y='284' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ <bpmndi:BPMNShape id='Activity_0n0h791_di' bpmnElement='Activity_0n0h791'>]'
,q'[ <dc:Bounds x='1800' y='440' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_1h0lzcv_di' bpmnElement='Event_1h0lzcv'>]'
,q'[ <dc:Bounds x='1962' y='462' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1970' y='505' width='20' height='14' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_13xmf2s_di' bpmnElement='Activity_1b9ghnl'>]'
,q'[ <dc:Bounds x='1460' y='850' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_099tlz0_di' bpmnElement='Event_099tlz0'>]'
,q'[ <dc:Bounds x='1612' y='872' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1599' y='915' width='62' height='27' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Activity_1mbzten_di' bpmnElement='Activity_1mbzten'>]'
,q'[ <dc:Bounds x='1330' y='850' width='100' height='80' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='TextAnnotation_0m1p9cx_di' bpmnElement='TextAnnotation_0m1p9cx'>]'
,q'[ <dc:Bounds x='550' y='-120' width='929.9997728924418' height='220.31823745410037' />]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNShape id='Event_170xafm_di' bpmnElement='Event_05m9taf'>]'
,q'[ <dc:Bounds x='1272' y='792' width='36' height='36' />]'
,q'[ <bpmndi:BPMNLabel>]'
,q'[ <dc:Bounds x='1178' y='835' width='83' height='40' />]'
,q'[ </bpmndi:BPMNLabel>]'
,q'[ </bpmndi:BPMNShape>]'
,q'[ <bpmndi:BPMNEdge id='Association_0ccwauj_di' bpmnElement='Association_0ccwauj'>]'
,q'[ <di:waypoint x='875' y='210' />]'
,q'[ <di:waypoint x='771' y='100' />]'
,q'[ </bpmndi:BPMNEdge>]'
,q'[ </bpmndi:BPMNPlane>]'
,q'[ </bpmndi:BPMNDiagram>]'
,q'[</bpmn:definitions>]'
,q'[]'
));
flow_bpmn_parser_pkg.upload_and_parse(
pi_dgrm_name => 'AA6 - Errors and Escalations',
pi_dgrm_version => '21.1',
pi_dgrm_category => 'Tutorials',
pi_dgrm_content => l_dgrm_content
);
end;
/
|
UPDATE user SET pending_roles = roles;
UPDATE user SET roles = 'ROLE_USER';
|
-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 16, 2017 at 03:38 PM
-- Server version: 5.6.35
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `strata_new`
--
-- --------------------------------------------------------
--
-- Table structure for table `building_admins_tbl`
--
CREATE TABLE `building_admins_tbl` (
`id` int(255) NOT NULL,
`building_id` int(255) NOT NULL COMMENT 'FK ',
`building_admin_id` int(255) DEFAULT NULL COMMENT 'FK',
`user_id` int(255) DEFAULT NULL,
`tenant_id` int(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `building_admins_tbl`
--
INSERT INTO `building_admins_tbl` (`id`, `building_id`, `building_admin_id`, `user_id`, `tenant_id`) VALUES
(5, 1, 18, NULL, NULL),
(6, 5, 11, NULL, NULL),
(7, 6, 17, NULL, NULL),
(9, 7, 19, NULL, NULL),
(10, 5, NULL, 23, NULL),
(11, 5, 24, NULL, NULL),
(12, 7, NULL, 25, NULL),
(13, 1, NULL, NULL, 26),
(14, 5, NULL, 27, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `building_dashboard`
--
CREATE TABLE `building_dashboard` (
`id` int(255) NOT NULL,
`building_id` int(255) NOT NULL,
`banner_image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `building_dashboard`
--
INSERT INTO `building_dashboard` (`id`, `building_id`, `banner_image`) VALUES
(2, 1, 'http://127.0.0.1/strata_new/assets/img/building_banner/1354.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `building_data`
--
CREATE TABLE `building_data` (
`id` int(255) NOT NULL,
`building_name` varchar(255) NOT NULL,
`building_email` varchar(255) NOT NULL,
`building_phone` varchar(255) NOT NULL,
`building_admin_id` int(255) DEFAULT NULL,
`building_units` int(255) NOT NULL,
`status` enum('0','1') NOT NULL DEFAULT '1',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`building_title` varchar(200) NOT NULL COMMENT 'user building title',
`building_text` text NOT NULL COMMENT 'user building text',
`building_image` varchar(200) DEFAULT NULL COMMENT 'this is user building image'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `building_data`
--
INSERT INTO `building_data` (`id`, `building_name`, `building_email`, `building_phone`, `building_admin_id`, `building_units`, `status`, `created_at`, `updated_at`, `building_title`, `building_text`, `building_image`) VALUES
(1, 'Strata365.com', 'support@strata365.com', '604-789-6350', 18, 99, '1', '2017-12-12 03:29:17', '2017-12-11 10:37:02', '', '', ''),
(5, 'building1', 'building1@strata365.com', '+1987654321456', 11, 220, '1', '2017-12-14 10:30:46', '2017-12-10 04:53:48', 'Strata365 - Building1', 'building 1 text', 'http://127.0.0.1/strata_new/assets/img/building_banner/fantasy_banner_vector.jpg'),
(6, 'building_2', 'building2@gmail.com', '09987654312', 17, 11, '1', '2017-12-12 03:29:23', '2017-12-10 04:53:59', '', '', ''),
(7, 'building4', 'building4@demo.com', '9876543210', 19, 12, '1', '2017-12-13 03:01:22', '2017-12-11 10:38:28', 'Building 4', 'Some information about the building, like notice etc', 'http://127.0.0.1/strata_new/assets/img/building_banner/img_mouseover3.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `calendar_events`
--
CREATE TABLE `calendar_events` (
`id` int(255) NOT NULL,
`title` varchar(500) NOT NULL,
`start` datetime NOT NULL,
`end` datetime NOT NULL,
`description` varchar(1000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `calendar_events`
--
INSERT INTO `calendar_events` (`id`, `title`, `start`, `end`, `description`) VALUES
(1, 'Test Event', '2017-12-18 00:00:00', '0000-00-00 00:00:00', ''),
(2, 'New Event', '2017-12-19 00:00:00', '0000-00-00 00:00:00', ''),
(3, 'CRM - E-MAIL LISTING AND MARKETING SYSTEM', '2017-12-15 14:30:00', '2017-12-17 14:30:00', 'Front wheel tyres are tubeless. Extra assessories are all with the vehicle.'),
(4, 'Test Event', '2017-12-16 00:00:00', '2017-03-16 00:00:00', ''),
(5, 'New Event', '2017-12-23 00:00:00', '2017-03-23 00:00:00', ''),
(6, 'Binary MLM Website Script', '2017-12-15 14:30:00', '2017-12-16 14:30:00', 'Front wheel tyres are tubeless. Extra assessories are all with the vehicle.'),
(7, 'Ashwani Garg', '2017-12-18 14:30:00', '2017-12-19 14:30:00', 'Front wheel tyres are tubeless. Extra assessories are all with the vehicle.');
-- --------------------------------------------------------
--
-- Table structure for table `calender`
--
CREATE TABLE `calender` (
`id` int(255) NOT NULL,
`notice` varchar(200) NOT NULL,
`description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `main_landing_page`
--
CREATE TABLE `main_landing_page` (
`id` int(255) NOT NULL,
`building_id` int(255) NOT NULL,
`admin_id` int(255) NOT NULL,
`page_title` varchar(200) NOT NULL,
`page_text` text NOT NULL,
`sub_title1` varchar(200) NOT NULL,
`sub_text1` text NOT NULL,
`sub_title2` varchar(200) NOT NULL,
`sub_text2` text NOT NULL,
`sub_title3` varchar(200) NOT NULL,
`sub_text3` text NOT NULL,
`provide_title` varchar(200) NOT NULL,
`provide_content` text NOT NULL,
`about_text` text NOT NULL,
`landing_email` varchar(200) NOT NULL,
`landing_phone` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `main_landing_page`
--
INSERT INTO `main_landing_page` (`id`, `building_id`, `admin_id`, `page_title`, `page_text`, `sub_title1`, `sub_text1`, `sub_title2`, `sub_text2`, `sub_title3`, `sub_text3`, `provide_title`, `provide_content`, `about_text`, `landing_email`, `landing_phone`) VALUES
(1, 1, 1, 'Strata Management made easy to use and to follow up ', 'Home Text data', 'Sub Title 1', 'Sub Text 1', 'sub Title 2', 'Sub Text 2', 'Sub Title 3', 'Sub Text 3', 'Provide Title', 'Provide Content Provide Content Provide Content Provide Content Provide Content Provide Content', 'About Us About Us About Us About Us', 'akgarg007@gmail.com', '+919660025446');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`user_id` int(255) NOT NULL,
`user_name` varchar(100) NOT NULL,
`user_email` varchar(100) NOT NULL,
`user_password` varchar(200) NOT NULL,
`user_phone` varchar(20) NOT NULL,
`building_unit` int(200) NOT NULL COMMENT 'Building Unit number of the User',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`status` enum('0','1') NOT NULL DEFAULT '1' COMMENT '1 = Active(default), 0 = Inactive',
`user_role` enum('0','1','2','3') NOT NULL DEFAULT '2' COMMENT '0=Manager,1=Admin,2=User,3=Tenant',
`user_ip` int(39) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`user_id`, `user_name`, `user_email`, `user_password`, `user_phone`, `building_unit`, `created_at`, `updated_at`, `status`, `user_role`, `user_ip`) VALUES
(1, 'Manager', 'manager@strata365.com', '123', '9660025446', 0, '2017-11-21 15:53:27', '2017-11-21 15:53:27', '1', '0', 0),
(11, 'admin1', 'admin1@demo.com', '123', '12312312', 11, '2017-12-06 17:00:36', '2017-12-06 17:00:36', '1', '1', 0),
(12, 'User3', 'user3@demo.com', '123', '+919660025446', 6, '2017-12-06 17:32:33', '2017-12-10 12:04:21', '1', '2', 0),
(14, 'Tenant User', 'akgarg008@gmail.com', '123', '9660025446', 10, '2017-12-07 02:20:04', '2017-12-10 01:45:29', '1', '3', 0),
(16, 'akgarg007', 'akgarg007@gmail.com', '123', '+919660025446', 11, '2017-12-10 02:12:20', '2017-12-10 01:45:51', '0', '2', 0),
(17, 'Admin 2', 'eclabsindasaia@gmail.com', '123123123', '08699215511', 123, '2017-12-10 05:28:36', '2017-12-10 05:28:36', '1', '1', 0),
(18, 'admin3', 'admin3@demo.com', '123', '9880067577', 23, '2017-12-10 08:37:44', '2017-12-10 08:37:44', '1', '1', 0),
(19, 'Admin4', 'admin4@demo.com', '123', '1234567890', 12, '2017-12-11 15:08:20', '2017-12-11 15:08:20', '1', '1', 0),
(20, 'user4', 'user4@demo.com', '123', '123123213', 0, '2017-12-11 16:26:53', '2017-12-11 16:26:53', '1', '2', 0),
(24, 'admin5', 'admin5@demo.com', '123', '9588972643', 1, '2017-12-14 04:37:14', '2017-12-14 05:45:04', '1', '1', 0),
(25, 'user5', 'user5@demo.com', '123', '983213123123', 3, '2017-12-14 04:39:14', '2017-12-14 05:45:15', '1', '2', 0),
(26, 'tenant1', 'tenant1@demo.com', '123', '12312313212', 2, '2017-12-14 04:48:50', '2017-12-14 05:45:09', '1', '3', 0),
(27, 'User7', 'user7@demo.com', '123', '9660025446', 2, '2017-12-14 10:17:28', '2017-12-14 10:17:28', '1', '2', 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `building_admins_tbl`
--
ALTER TABLE `building_admins_tbl`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `building_dashboard`
--
ALTER TABLE `building_dashboard`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `building_data`
--
ALTER TABLE `building_data`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `calendar_events`
--
ALTER TABLE `calendar_events`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `calender`
--
ALTER TABLE `calender`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `main_landing_page`
--
ALTER TABLE `main_landing_page`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`user_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `building_admins_tbl`
--
ALTER TABLE `building_admins_tbl`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `building_dashboard`
--
ALTER TABLE `building_dashboard`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `building_data`
--
ALTER TABLE `building_data`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `calendar_events`
--
ALTER TABLE `calendar_events`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `calender`
--
ALTER TABLE `calender`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `main_landing_page`
--
ALTER TABLE `main_landing_page`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `user_id` int(255) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
|
/*
SQLyog Professional v13.1.7 (64 bit)
MySQL - 8.0.21 : Database - asc_world_new
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*Table structure for table `spawn_group_id` */
CREATE TABLE `spawn_group_id` (
`groupId` tinyint NOT NULL,
`groupName` text NOT NULL,
`groupFlags` tinyint NOT NULL DEFAULT '0',
`extraFlags` tinyint DEFAULT NULL,
`BossId` int DEFAULT NULL,
PRIMARY KEY (`groupId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `spawn_group_id` */
insert into `spawn_group_id`(`groupId`,`groupName`,`groupFlags`,`extraFlags`,`BossId`) values (1,'Hellfire Ramparts Vazruden Trash',1,3,17537),(2,'Hellfire Ramparts Bridge',1,0,17537),(3,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(4,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(5,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(6,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(7,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(8,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(9,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(10,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(11,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(12,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(13,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(14,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(15,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(16,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(17,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(18,'Hellfire Ramparts Trash ( Watchkeeper )',1,0,17306),(19,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(20,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(21,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(22,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(23,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(24,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(25,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(26,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(27,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(28,'Hellfire Ramparts Trash ( Omor )',1,0,17308),(29,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(30,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(31,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(32,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(33,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(34,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(35,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(36,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(37,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(38,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(39,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(40,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(41,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(42,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(43,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(44,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(45,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(46,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(47,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(48,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(49,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(50,'Hellfire Ramparts Blood Furnace ( The Maker )',1,0,17381),(51,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(52,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(53,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(54,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(55,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(56,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(57,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(58,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(59,'Hellfire Ramparts Blood Furnace ( Broggok )',1,0,17380),(60,'Hellfire Ramparts Blood Furnace ( Broggok )',1,2,17380),(61,'Hellfire Ramparts Blood Furnace ( Broggok )',1,2,17380),(62,'Hellfire Ramparts Blood Furnace ( Broggok )',1,2,17380),(63,'Hellfire Ramparts Blood Furnace ( Broggok )',1,2,17380),(64,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(65,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(66,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(67,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(68,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(69,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(70,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(71,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(72,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,0,17377),(73,'Hellfire Ramparts Blood Furnace ( Kelidan )',1,2,17377),(75,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(76,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(77,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(78,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(79,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(80,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(81,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(82,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(83,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(84,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(85,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(86,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(87,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,0,16807),(88,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,1,16807),(89,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,1,16807),(90,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,1,16807),(91,'Hellfire Ramparts Shatted Halls ( Grand Warlock )',1,1,16807),(92,'Hellfire Ramparts Shatted Halls ( Proung )',1,1,20923),(93,'Hellfire Ramparts Shatted Halls ( Proung )',1,1,20923),(94,'Hellfire Ramparts Shatted Halls ( Proung )',1,1,20923),(95,'Hellfire Ramparts Shatted Halls ( Proung )',1,1,20923),(96,'Hellfire Ramparts Shatted Halls ( Proung )',1,1,20923),(97,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,0,16809),(98,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,1,16809),(99,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,1,16809),(100,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,0,16809),(101,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,1,16809),(102,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,1,16809),(103,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,1,16809),(104,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,1,16809),(105,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,1,16809),(106,'Hellfire Ramparts Shatted Halls ( Warbringer O Mrogg )',1,1,16809),(107,'Hellfire Ramparts Shatted Halls ( Warchief Kargath Bladefist )',1,0,16808),(108,'Magtheridons Lair Channelers',1,2,17257),(109,'Magtheridons Lair Trash',1,0,17257),(110,'Magtheridons Lair Trash',1,0,17257),(111,'Magtheridons Lair Trash',1,0,17257),(112,'Magtheridons Lair Trash',1,0,17257),(113,'Magtheridons Lair World Trigger',1,2,17257);
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
CREATE TABLE [dbo].[Autores]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY(1,1),
[Nome] VARCHAR(100) NOT NULL,
[Descricao] VARCHAR(1000)
)
|
-- 1 row per custom event
{{
config(
materialized='incremental',
sql_where='TRUE',
unique_key='event_id'
)
}}
with custom_events as (
select * from {{ ref('parsely_all_events') }}
where action not in {{ var('parsely:actions') }} and action is not null
),
-- derived fields
custom_publish_read_time_xf as (
select
event_id,
(TIMESTAMP 'epoch'
+ left(metadata_pub_date_tmsp_tz,10)::bigint
* INTERVAL '1 Second ') as publish_time,
(TIMESTAMP 'epoch'
+ left(timestamp_info_nginx_ms_tz,10)::bigint
* INTERVAL '1 Second ') as event_time
from custom_events
)
select
-- metrics and counter fields
1 as custom_event_counter,
-- derived fields
datediff(hour, publish_time, event_time) as hours_since_publish,
datediff(day, publish_time, event_time) as days_since_publish,
datediff(week, publish_time, event_time) as weeks_since_publish,
publish_time,
event_time,
{{ var('custom:extradataname') }},
pageview_post_id,
flag_is_fbia,
ts_action_tz,
ts_session_current_tz,
ts_session_last_tz,
metadata_pub_date_tmsp_tz,
metadata_save_date_tmsp_tz,
timestamp_info_nginx_ms_tz,
session_last_session_timestamp_tz,
session_timestamp_tz,
timestamp_info_pixel_ms_tz,
-- standard fields
action,
apikey,
campaign_id,
display,
display_avail_height,
display_avail_width,
display_pixel_depth,
display_total_height,
display_total_width,
engaged_time_inc,
event_id,
extra_data,
flags_is_amp,
ip_city,
ip_continent,
ip_country,
ip_lat::FLOAT8,
ip_lon,
ip_postal,
ip_subdivision,
ip_timezone,
ip_market_name,
ip_market_nielsen,
ip_market_doubleclick,
metadata,
metadata_authors,
metadata_canonical_url,
metadata_custom_metadata,
metadata_duration,
metadata_data_source,
metadata_full_content_word_count,
metadata_image_url,
metadata_page_type,
metadata_post_id,
metadata_pub_date_tmsp,
metadata_save_date_tmsp,
metadata_section,
metadata_share_urls,
metadata_tags,
metadata_thumb_url,
metadata_title,
metadata_urls,
ref_category,
ref_clean,
ref_domain,
ref_fragment,
ref_netloc,
ref_params,
ref_path,
ref_query,
ref_scheme,
referrer,
session,
session_id,
session_initial_referrer,
session_initial_url,
session_last_session_timestamp,
session_timestamp,
slot,
sref_category,
sref_clean,
sref_domain,
sref_fragment,
sref_netloc,
sref_params,
sref_path,
sref_query,
sref_scheme,
surl_clean,
surl_domain,
surl_fragment,
surl_netloc,
surl_params,
surl_path,
surl_query,
surl_scheme,
timestamp_info,
timestamp_info_nginx_ms,
timestamp_info_override_ms,
timestamp_info_pixel_ms,
ts_action,
ts_session_current,
ts_session_last,
ua_browser,
ua_browserversion,
ua_device,
ua_devicebrand,
ua_devicemodel,
ua_devicetouchcapable,
ua_devicetype,
ua_os,
ua_osversion,
url,
url_clean,
url_domain,
url_fragment,
url_netloc,
url_params,
url_path,
url_query,
url_scheme,
utm_campaign,
utm_medium,
utm_source,
utm_term,
utm_content,
user_agent,
version,
visitor,
visitor_ip,
visitor_network_id,
visitor_site_id
from custom_events
left join custom_publish_read_time_xf using (event_id)
|
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
--
-- SYNC1 CO Part Table 1
--
CREATE TABLE sync1_co_alter_table_alter_part1 (
id int,
rank int,
year int,
gender char(1),
name text,
count int )
with ( appendonly='true', orientation='column') DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
SUBPARTITION BY RANGE (year)
SUBPARTITION TEMPLATE (
SUBPARTITION year1 START (2001),
SUBPARTITION year2 START (2002),
SUBPARTITION year6 START (2006) END (2007) )
(PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M') );
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part1 values (generate_series(1,10),1,2001,'F',6);
--
-- SYNC1 CO Part Table 2
--
CREATE TABLE sync1_co_alter_table_alter_part2 (
id int,
rank int,
year int,
gender char(1),
name text,
count int )
with ( appendonly='true', orientation='column') DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
SUBPARTITION BY RANGE (year)
SUBPARTITION TEMPLATE (
SUBPARTITION year1 START (2001),
SUBPARTITION year2 START (2002),
SUBPARTITION year6 START (2006) END (2007) )
(PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M') );
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part2 values (generate_series(1,10),1,2001,'F',6);
--
-- SYNC1 CO Part Table 3
--
CREATE TABLE sync1_co_alter_table_alter_part3 (
id int,
rank int,
year int,
gender char(1),
name text,
count int )
with ( appendonly='true', orientation='column') DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
SUBPARTITION BY RANGE (year)
SUBPARTITION TEMPLATE (
SUBPARTITION year1 START (2001),
SUBPARTITION year2 START (2002),
SUBPARTITION year6 START (2006) END (2007) )
(PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M') );
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part3 values (generate_series(1,10),1,2001,'F',6);
--
-- SYNC1 CO Part Table 4
--
CREATE TABLE sync1_co_alter_table_alter_part4(
id int,
rank int,
year int,
gender char(1),
name text,
count int )
with ( appendonly='true', orientation='column') DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
SUBPARTITION BY RANGE (year)
SUBPARTITION TEMPLATE (
SUBPARTITION year1 START (2001),
SUBPARTITION year2 START (2002),
SUBPARTITION year6 START (2006) END (2007) )
(PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M') );
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part4 values (generate_series(1,10),1,2001,'F',6);
--
-- SYNC1 CO Part Table 5
--
CREATE TABLE sync1_co_alter_table_alter_part5 (
id int,
rank int,
year int,
gender char(1),
name text,
count int )
with ( appendonly='true', orientation='column') DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
SUBPARTITION BY RANGE (year)
SUBPARTITION TEMPLATE (
SUBPARTITION year1 START (2001),
SUBPARTITION year2 START (2002),
SUBPARTITION year6 START (2006) END (2007) )
(PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M') );
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part5 values (generate_series(1,10),1,2001,'F',6);
--
-- SYNC1 CO Part Table 6
--
CREATE TABLE sync1_co_alter_table_alter_part6 (
id int,
rank int,
year int,
gender char(1),
name text,
count int )
with ( appendonly='true', orientation='column') DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
SUBPARTITION BY RANGE (year)
SUBPARTITION TEMPLATE (
SUBPARTITION year1 START (2001),
SUBPARTITION year2 START (2002),
SUBPARTITION year6 START (2006) END (2007) )
(PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M') );
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part6 values (generate_series(1,10),1,2001,'F',6);
--
-- SYNC1 CO Part Table 7
--
CREATE TABLE sync1_co_alter_table_alter_part7 (
id int,
rank int,
year int,
gender char(1),
name text,
count int )
with ( appendonly='true', orientation='column') DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
SUBPARTITION BY RANGE (year)
SUBPARTITION TEMPLATE (
SUBPARTITION year1 START (2001),
SUBPARTITION year2 START (2002),
SUBPARTITION year6 START (2006) END (2007) )
(PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M') );
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part7 values (generate_series(1,10),1,2001,'F',6);
--
-- SYNC1 CO Part Table 8
--
CREATE TABLE sync1_co_alter_table_alter_part8 (
id int,
rank int,
year int,
gender char(1),
name text,
count int )
with ( appendonly='true', orientation='column') DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
SUBPARTITION BY RANGE (year)
SUBPARTITION TEMPLATE (
SUBPARTITION year1 START (2001),
SUBPARTITION year2 START (2002),
SUBPARTITION year6 START (2006) END (2007) )
(PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M') );
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part8 values (generate_series(1,10),1,2001,'F',6);
--
--
--ALTER TABLE TO ALTER PART
--
--
--
-- ALTER SYNC1 CO Part ALTER TABLE TO ALTER PARTITION
--
--
-- Add Default partition for girls
--
alter table sync1_co_alter_table_alter_part1 alter partition girls add default partition gfuture;
--
-- Add Default partition for boys
--
alter table sync1_co_alter_table_alter_part1 alter partition boys add default partition bfuture;
select count(*) from sync1_co_alter_table_alter_part1;
--
-- Insert few records into the table
--
insert into sync1_co_alter_table_alter_part1 values (generate_series(1,10),1,2001,'F',6);
|
CREATE TABLE scxa_coords
(
experiment_accession VARCHAR(255) NOT NULL,
method VARCHAR(255) NOT NULL,
cell_id VARCHAR(255) NOT NULL,
x DOUBLE PRECISION,
y DOUBLE PRECISION,
parameterisation VARCHAR(255) NOT NULL,
CONSTRAINT scxa_coords_experiment_accession_method_cell_id_params_pk
PRIMARY KEY (experiment_accession, method, cell_id, parameterisation)
);
CREATE INDEX scxa_coords_experiment_accession_method_param ON scxa_coords(experiment_accession, method, parameterisation)
|
# migration-1 contains pre data migration steps
SET FOREIGN_KEY_CHECKS = 0;
####
# mh_archive_episode -> mh_assets_snapshot
##
# drop indices and constraints
DROP INDEX IX_mh_archive_episode_mediapackage ON mh_archive_episode;
DROP INDEX IX_mh_archive_episode_version ON mh_archive_episode;
DROP INDEX IX_mh_archive_episode_deleted ON mh_archive_episode;
DROP INDEX FK_mh_archive_episode_organization ON mh_archive_episode;
ALTER TABLE mh_archive_episode DROP FOREIGN KEY mh_archive_episode_organization;
# rename table; rename/add/drop columns
ALTER TABLE mh_archive_episode
RENAME TO mh_assets_snapshot,
DROP PRIMARY KEY,
CHANGE COLUMN id mediapackage_id VARCHAR(128) NOT NULL,
CHANGE COLUMN organization organization_id VARCHAR(128) NOT NULL,
CHANGE COLUMN modification_date archival_date DATETIME NOT NULL,
MODIFY COLUMN mediapackage_xml LONGTEXT NOT NULL,
MODIFY COLUMN version BIGINT(20) NOT NULL,
ADD COLUMN id BIGINT(20) NOT NULL,
ADD COLUMN availability VARCHAR(32) NOT NULL,
ADD COLUMN series_id VARCHAR(128),
DROP COLUMN access_control;
UPDATE mh_assets_snapshot SET availability = 'ONLINE';
####
# mh_archive_asset -> mh_assets_asset
##
# drop indices and constraints
DROP INDEX UNQ_mh_archive_asset_0 ON mh_archive_asset;
DROP INDEX IX_mh_archive_asset_mediapackage ON mh_archive_asset;
DROP INDEX IX_mh_archive_asset_checksum ON mh_archive_asset;
DROP INDEX IX_mh_archive_asset_uri ON mh_archive_asset;
ALTER TABLE mh_archive_asset DROP FOREIGN KEY mh_archive_asset_organization;
# rename table; rename/add/drop columns
ALTER TABLE mh_archive_asset
RENAME TO mh_assets_asset,
CHANGE COLUMN mediapackageelement mediapackage_element_id VARCHAR(128) NOT NULL,
MODIFY COLUMN checksum VARCHAR(64) NOT NULL,
ADD COLUMN snapshot_id BIGINT(20) NOT NULL,
ADD COLUMN mime_type VARCHAR(64),
ADD COLUMN size BIGINT(20) NOT NULL,
DROP COLUMN organization,
DROP COLUMN uri;
####
# mh_archive_version_claim -> mh_assets_version_claim
##
# drop indices and constraints
DROP INDEX IX_mh_archive_version_claim_mediapackage ON mh_archive_version_claim;
DROP INDEX IX_mh_archive_version_claim_last_claimed ON mh_archive_version_claim;
# rename table; rename/add/drop columns
ALTER TABLE mh_archive_version_claim
RENAME TO mh_assets_version_claim,
CHANGE COLUMN mediapackage mediapackage_id VARCHAR(128) NOT NULL,
MODIFY COLUMN last_claimed BIGINT(20) NOT NULL;
####
# mh_assets_properties
##
# create table
CREATE TABLE `mh_assets_properties` (
`id` BIGINT(20) NOT NULL,
`val_bool` TINYINT(1) DEFAULT '0',
`val_date` DATETIME DEFAULT NULL,
`val_long` BIGINT(20) DEFAULT NULL,
`val_string` VARCHAR(255) DEFAULT NULL,
`mediapackage_id` VARCHAR(128) NOT NULL,
`namespace` VARCHAR(128) NOT NULL,
`property_name` VARCHAR(128) NOT NULL,
PRIMARY KEY (`id`),
KEY `IX_mh_assets_properties_val_date` (`val_date`),
KEY `IX_mh_assets_properties_val_long` (`val_long`),
KEY `IX_mh_assets_properties_val_string` (`val_string`),
KEY `IX_mh_assets_properties_val_bool` (`val_bool`),
KEY `IX_mh_assets_properties_mediapackage_id` (`mediapackage_id`),
KEY `IX_mh_assets_properties_namespace` (`namespace`),
KEY `IX_mh_assets_properties_property_name` (`property_name`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8;
SET FOREIGN_KEY_CHECKS = 1;
|
-- @testpoint: 修改default为非空数值
drop table if exists test_modify cascade;
create table test_modify(
c_id int, c_integer integer,
c_real real,c_float float, c_cdouble binary_double,
c_decimal decimal(38), c_number number(38),c_number1 number,c_number2 number(20,10),c_numeric numeric(38),
c_char char(50) default null, c_varchar varchar(20), c_varchar2 varchar2(4000),
c_clob clob,
c_raw raw(20),
c_blob blob,
c_date date,
c_timestamp timestamp
);
alter table test_modify alter c_id set default 10;
alter table test_modify alter c_integer set default 10;
alter table test_modify alter c_real set default 10;
alter table test_modify alter c_float set default 10;
alter table test_modify alter c_cdouble set default 10;
alter table test_modify alter c_decimal set default 10;
alter table test_modify alter c_number set default 10;
alter table test_modify alter c_number1 set default 10;
alter table test_modify alter c_number2 set default 10;
alter table test_modify alter c_numeric set default 10;
alter table test_modify alter c_char set default 10;
alter table test_modify alter c_varchar set default 10;
alter table test_modify alter c_varchar2 set default 10;
alter table test_modify alter c_clob set default 10;
drop table if exists test_modify cascade;
|
SELECT T.Id,
CASE
WHEN MiddleName IS NULL THEN CONCAT(FirstName, ' ', LastName )
ELSE CONCAT(FirstName, ' ', MiddleName, ' ', LastName )
END AS [Full Name],
AC.[Name] AS [From],
HC.[Name] AS [To],
CASE
WHEN CancelDate IS NULL THEN CONCAT(DATEDIFF(DAY, ArrivalDate, ReturnDate),' days')
ELSE 'Canceled'
END AS [Duration]
FROM AccountsTrips AS [AT]
JOIN Accounts AS A ON [AT].AccountId = A.Id
JOIN Trips AS T ON T.Id = [AT].TripId
JOIN Rooms AS R ON T.RoomId = R.Id
JOIN Hotels AS H ON H.Id = R.HotelId
JOIN Cities AS AC ON A.CityId = AC.Id
JOIN Cities AS HC ON H.CityId = HC.Id
ORDER BY [Full Name], T.Id
|
/* Author: Robin Carnow for ticket 643 */
-- used to store json structure of rules send to server from UI
ALTER TABLE rule ADD COLUMN condition_json mediumtext;
-- add unique constraint to event table
ALTER TABLE event ADD CONSTRAINT ux_event_type_ref_obj UNIQUE (event_type_id, related_object_id);
-- fix blank or null measure.variable_name field entries
UPDATE measure m
join
(select m2.measure_id, ma.export_name
from measure m2
join measure_answer ma on m2.measure_id=ma.measure_id
where NULLIF(m2.variable_name, '') is NULL
group by m2.measure_id
) to_fix
ON to_fix.measure_id=m.measure_id
SET m.variable_name=to_fix.export_name;
-- update rules which contain measure AVs so they also list each measure's answer AVs as well
INSERT INTO rule_assessment_variable (rule_id, assessment_variable_id)
select r.rule_id, answer_av.assessment_variable_id
from rule r
join rule_assessment_variable rav on r.rule_id=rav.rule_id
join assessment_variable measure_av on rav.assessment_variable_id=measure_av.assessment_variable_id
join measure m on measure_av.measure_id=m.measure_id
join measure_answer ma on m.measure_id=ma.measure_id
join assessment_variable answer_av on ma.measure_answer_id=answer_av.measure_answer_id
left join rule_assessment_variable answer_rav on
r.rule_id=answer_rav.rule_id AND answer_av.assessment_variable_id=answer_rav.assessment_variable_id
WHERE
measure_av.assessment_variable_type_id=1 AND answer_rav.rule_assessment_variable_id is NULL;
-- update current question event names so they are set to the correct values
UPDATE `event` e
JOIN measure m ON m.measure_id=e.related_object_id AND e.event_type_id = 4
SET e.name=SUBSTRING(
IFNULL(NULLIF(m.variable_name, ''),
IFNULL(NULLIF(m.measure_text, ''),
CONCAT('question_', CAST(m.measure_id AS CHAR)))),
1, 50);
-- Update templates which contain measure AVs so they also list each measure's answer AVs as well
INSERT INTO variable_template (template_id, assessment_variable_id)
select t.template_id, answer_av.assessment_variable_id
from template t
join variable_template vt on t.template_id=vt.template_id
join assessment_variable measure_av on vt.assessment_variable_id=measure_av.assessment_variable_id
join measure m on measure_av.measure_id=m.measure_id
join measure_answer ma on m.measure_id=ma.measure_id
join assessment_variable answer_av on ma.measure_answer_id=answer_av.measure_answer_id
left join variable_template answer_vt on
t.template_id=answer_vt.template_id AND answer_av.assessment_variable_id=answer_vt.assessment_variable_id
WHERE
measure_av.assessment_variable_type_id=1 AND answer_vt.variable_template_id is NULL;
-- add event for every question (name is set with first value that is non-null in this order: the variable name, or measure text, or question_[measure_id])
INSERT INTO `event` (event_type_id, `name`, related_object_id)
SELECT 4, SUBSTRING(
IFNULL(NULLIF(m.variable_name, ''),
IFNULL(NULLIF(m.measure_text, ''),
CONCAT('question_', CAST(m.measure_id AS CHAR)))),
1, 50), m.measure_id
FROM measure m
LEFT JOIN `event` e ON m.measure_id=e.related_object_id AND e.event_type_id = 4
WHERE m.measure_type_id != 8 AND e.event_id IS NULL;
-- update current health factor events so their names are the same as the HF they represent
UPDATE `event` e
JOIN health_factor hf ON e.related_object_id=hf.health_factor_id AND e.event_type_id = 2
SET e.name=SUBSTRING(
IFNULL(NULLIF(hf.name, ''), CONCAT('health_factor_', CAST(hf.health_factor_id AS CHAR))),
1, 50)
WHERE e.event_type_id = 2;
-- add event for every health factor
INSERT INTO `event` (event_type_id, `name`, related_object_id)
SELECT 2, SUBSTRING(
IFNULL(NULLIF(hf.name, ''),
CONCAT('health_factor_', CAST(hf.health_factor_id AS CHAR))),
1, 50), hf.health_factor_id
FROM health_factor hf
LEFT JOIN `event` e ON hf.health_factor_id=e.related_object_id AND e.event_type_id = 2
WHERE e.event_id IS NULL;
-- add event for every dashboard alert
INSERT INTO `event` (event_type_id, `name`, related_object_id)
SELECT 3, SUBSTRING(
IFNULL(NULLIF(a.name, ''),
CONCAT('alert_', CAST(a.dashboard_alert_id AS CHAR))),
1, 50), a.dashboard_alert_id
FROM dashboard_alert a
LEFT JOIN `event` e ON a.dashboard_alert_id AND e.event_type_id = 3
WHERE e.event_id IS NULL;
-- remove duplicates and add unique constraint to assessment_var_children table
ALTER IGNORE TABLE assessment_var_children ADD CONSTRAINT ux_assessment_var_children_parent UNIQUE (variable_parent, variable_child);
-- Fix formulas so each one is associated with its children and if one of them is a formula, also its grand children, etc.
INSERT INTO assessment_var_children (variable_parent, variable_child)
select distinct parent_av.assessment_variable_id, grd_child_avc.variable_child
from assessment_variable parent_av
join assessment_var_children parent_avc on parent_av.assessment_variable_id=parent_avc.variable_parent
join assessment_variable child_av on parent_avc.variable_child=child_av.assessment_variable_id
join assessment_var_children grd_child_avc on child_av.assessment_variable_id=grd_child_avc.variable_parent
where
child_av.assessment_variable_type_id=4
and 0=(select count(*)
from assessment_var_children avc_test
where variable_parent=parent_av.assessment_variable_id
and variable_child=grd_child_avc.variable_child);
INSERT INTO assessment_var_children (variable_parent, variable_child)
select distinct parent_av.assessment_variable_id, grd_child_avc.variable_child
from assessment_variable parent_av
join assessment_var_children parent_avc on parent_av.assessment_variable_id=parent_avc.variable_parent
join assessment_variable child_av on parent_avc.variable_child=child_av.assessment_variable_id
join assessment_var_children grd_child_avc on child_av.assessment_variable_id=grd_child_avc.variable_parent
where
child_av.assessment_variable_type_id=4
and 0=(select count(*)
from assessment_var_children avc_test
where variable_parent=parent_av.assessment_variable_id
and variable_child=grd_child_avc.variable_child);
-- we removed the "f" from all numerical variables so we have to update this formula to keep it using
UPDATE assessment_variable SET formula_template='( [140] * 12.0 ) + [141]' WHERE assessment_variable_id='10';
|
CREATE TABLE #Codesets (
codeset_id int NOT NULL,
concept_id bigint NOT NULL
)
;
INSERT INTO #Codesets (codeset_id, concept_id)
SELECT 1 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (37397537,432870)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (37397537,432870)
and c.invalid_reason is null
) I
) C UNION ALL
SELECT 2 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (3007461,3031586,3024929,3039827,3024386,4267147,37393863)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (3007461,3031586,3024929,3039827,3024386,4267147,37393863)
and c.invalid_reason is null
) I
) C UNION ALL
SELECT 34 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (320741,4096099,44782752,44811347,45757409,4203836,4205652,4124856,4203618,4318407,762047,44782762,435565,45757410,4033521,762049,4055089,440738,444247,40481089,193512,45773536,36712892,4234997,439838,4133004,44782759,444097,4327889,4149782,762048,4317289)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (44782752,40481089,4133004)
and c.invalid_reason is null
) I
LEFT JOIN
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (36712971,435887,438820,4179911,4089917)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (36712971,435887,438820,4089917)
and c.invalid_reason is null
) E ON I.concept_id = E.concept_id
WHERE E.concept_id is null
) C UNION ALL
SELECT 35 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (254662,36713113,440417,4236271)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (254662,36713113,440417)
and c.invalid_reason is null
) I
LEFT JOIN
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (435616,435887,196715,4062269,442055,433832,435026,440477,318137,199837,438820,4235812,195294,4187790,444247,44782732,40479606,4240832)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (435616,435887,196715,4062269,442055,433832,435026,440477,318137,199837,438820,4235812,195294,4187790,444247,44782732,40479606)
and c.invalid_reason is null
) E ON I.concept_id = E.concept_id
WHERE E.concept_id is null
) C UNION ALL
SELECT 40 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (443454)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (443454)
and c.invalid_reason is null
) I
LEFT JOIN
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (40479572,4046360,372435,377254,379778,443790,443864,444091,4046089,4046090,4129534)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (40479572,4046360)
and c.invalid_reason is null
) E ON I.concept_id = E.concept_id
WHERE E.concept_id is null
) C UNION ALL
SELECT 41 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (439847,432923,4148906,4144154,4111709,42535426,43530728,43530727,4108952,4111708,35609033)
) I
LEFT JOIN
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (376713,4174299,36716544,4345688)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (4174299,36716544,4345688)
and c.invalid_reason is null
) E ON I.concept_id = E.concept_id
WHERE E.concept_id is null
) C UNION ALL
SELECT 43 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (4329847,4108680,4108678,438172,4124687,45766212,37109910,37109911,37109912)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (4329847,4108680,4108678,438172,4124687,45766212,37109910,37109911,37109912)
and c.invalid_reason is null
) I
LEFT JOIN
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (314666)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (314666)
and c.invalid_reason is null
) E ON I.concept_id = E.concept_id
WHERE E.concept_id is null
) C UNION ALL
SELECT 44 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (4195665,4148299,4173167,4317289,4319280,4144032,45757410,45757409,44811741,44811740,37117790,37016198,35622081,35622080,4345926,4342767,4341648,4341646,4340939,4340378,4340375,4318537,4318407,4240850,4239942,4237654,4215949,4214720,4192856,4188336,4174014,4149013,4148257,4148256,4124856,4055089,4055025,4045408,201894,192673)
) I
) C UNION ALL
SELECT 47 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (432870)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (432870)
and c.invalid_reason is null
) I
LEFT JOIN
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (37397537,36713112,40321716,435076,4239484,137829,4133981,436956,4316372,42536958,4247776,440982,42537688,437242,4221109,432881,4119134)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (37397537,36713112,435076,4239484,137829,4133981,436956,4316372,42536958,4247776,440982,42537688,437242,4221109,432881)
and c.invalid_reason is null
) E ON I.concept_id = E.concept_id
WHERE E.concept_id is null
) C UNION ALL
SELECT 49 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (4223098,4301208,4111853,196715,4277276)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (4223098,4301208,4111853,4277276)
and c.invalid_reason is null
) I
) C UNION ALL
SELECT 50 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (36712891,4033521,35615064,36712892,4044745,4048527)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (36712891,4033521,35615064,36712892,4044745)
and c.invalid_reason is null
) I
) C UNION ALL
SELECT 51 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (199837,37111372,4223670,196715,36717492,45757410,45757409,4124856,4173167,4144032,4055089,4318407,4317289)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (199837,37111372,4223670)
and c.invalid_reason is null
) I
) C UNION ALL
SELECT 53 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (318137,4111714,4045733,4179912)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (318137,4111714,4179912)
and c.invalid_reason is null
) I
LEFT JOIN
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (4061473,4273550,45765438,36717594,4223544)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (4061473,4273550,45765438,36717594,4223544)
and c.invalid_reason is null
) E ON I.concept_id = E.concept_id
WHERE E.concept_id is null
) C UNION ALL
SELECT 54 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (4049318,4223670,444264,4207615,4273526)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (4049318,4223670,444264,4207615,4273526)
and c.invalid_reason is null
) I
LEFT JOIN
(
select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (196715,199837,4317289,195294,4033521,4301208,4092406)
UNION select c.concept_id
from @vocabulary_database_schema.CONCEPT c
join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id
and ca.ancestor_concept_id in (196715,199837,4317289,195294,4033521,4301208,4092406)
and c.invalid_reason is null
) E ON I.concept_id = E.concept_id
WHERE E.concept_id is null
) C
;
with primary_events (event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id) as
(
-- Begin Primary Events
select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id
FROM
(
select E.person_id, E.start_date, E.end_date,
row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC) ordinal,
OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id
FROM
(
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 35)
) C
-- End Condition Occurrence Criteria
) E
JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date
WHERE DATEADD(day,0,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE
) P
-- End Primary Events
)
SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id
INTO #qualified_events
FROM
(
select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id
FROM primary_events pe
) QE
;
--- Inclusion Rule Inserts
select 0 as inclusion_rule_id, person_id, event_id
INTO #Inclusion_0
FROM
(
select pe.person_id, pe.event_id
FROM #qualified_events pe
JOIN (
-- Begin Criteria Group
select 0 as index_id, person_id, event_id
FROM
(
select E.person_id, E.event_id
FROM #qualified_events E
INNER JOIN
(
-- Begin Criteria Group
select 0 as index_id, person_id, event_id
FROM
(
select E.person_id, E.event_id
FROM #qualified_events E
INNER JOIN
(
-- Begin Correlated Criteria
select 0 as index_id, cc.person_id, cc.event_id
from (SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Measurement Criteria
select C.person_id, C.measurement_id as event_id, C.measurement_date as start_date, DATEADD(d,1,C.measurement_date) as END_DATE,
C.visit_occurrence_id, C.measurement_date as sort_date
from
(
select m.*
FROM @cdm_database_schema.MEASUREMENT m
JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 2)
) C
WHERE (C.value_as_number >= 10.0000 and C.value_as_number <= 150.0000)
AND C.unit_concept_id in (8686,8785,8848,8961,9444,9254,8816)
-- End Measurement Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-7,P.START_DATE) AND A.START_DATE <= DATEADD(day,7,P.START_DATE) ) cc
GROUP BY cc.person_id, cc.event_id
HAVING COUNT(cc.event_id) >= 1
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 1 as index_id, cc.person_id, cc.event_id
from (SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Measurement Criteria
select C.person_id, C.measurement_id as event_id, C.measurement_date as start_date, DATEADD(d,1,C.measurement_date) as END_DATE,
C.visit_occurrence_id, C.measurement_date as sort_date
from
(
select m.*
FROM @cdm_database_schema.MEASUREMENT m
JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 2)
) C
WHERE (C.value_as_number >= 10.0000 and C.value_as_number <= 150.0000)
AND (C.range_low >= 130.0000 and C.range_low <= 170.0000)
-- End Measurement Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-7,P.START_DATE) AND A.START_DATE <= DATEADD(day,7,P.START_DATE) ) cc
GROUP BY cc.person_id, cc.event_id
HAVING COUNT(cc.event_id) >= 1
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 2 as index_id, cc.person_id, cc.event_id
from (SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 47)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-7,P.START_DATE) AND A.START_DATE <= DATEADD(day,7,P.START_DATE) ) cc
GROUP BY cc.person_id, cc.event_id
HAVING COUNT(cc.event_id) >= 1
-- End Correlated Criteria
) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id
GROUP BY E.person_id, E.event_id
HAVING COUNT(index_id) > 0
) G
-- End Criteria Group
UNION ALL
-- Begin Criteria Group
select 1 as index_id, person_id, event_id
FROM
(
select E.person_id, E.event_id
FROM #qualified_events E
INNER JOIN
(
-- Begin Correlated Criteria
select 0 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Measurement Criteria
select C.person_id, C.measurement_id as event_id, C.measurement_date as start_date, DATEADD(d,1,C.measurement_date) as END_DATE,
C.visit_occurrence_id, C.measurement_date as sort_date
from
(
select m.*
FROM @cdm_database_schema.MEASUREMENT m
JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 2)
) C
WHERE (C.value_as_number >= 10.0000 and C.value_as_number <= 150.0000)
AND C.unit_concept_id in (8686,8785,8848,8961,9444,9254,45890995)
-- End Measurement Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-90,P.START_DATE) AND A.START_DATE <= DATEADD(day,-7,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 1 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Measurement Criteria
select C.person_id, C.measurement_id as event_id, C.measurement_date as start_date, DATEADD(d,1,C.measurement_date) as END_DATE,
C.visit_occurrence_id, C.measurement_date as sort_date
from
(
select m.*
FROM @cdm_database_schema.MEASUREMENT m
JOIN #Codesets cs on (m.measurement_concept_id = cs.concept_id and cs.codeset_id = 2)
) C
WHERE (C.value_as_number >= 10.0000 and C.value_as_number <= 150.0000)
AND (C.range_low >= 130.0000 and C.range_low <= 170.0000)
-- End Measurement Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-90,P.START_DATE) AND A.START_DATE <= DATEADD(day,-7,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 2 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 1)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-90,P.START_DATE) AND A.START_DATE <= DATEADD(day,-7,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id
GROUP BY E.person_id, E.event_id
HAVING COUNT(index_id) = 3
) G
-- End Criteria Group
) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id
GROUP BY E.person_id, E.event_id
HAVING COUNT(index_id) = 2
) G
-- End Criteria Group
) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id
) Results
;
select 1 as inclusion_rule_id, person_id, event_id
INTO #Inclusion_1
FROM
(
select pe.person_id, pe.event_id
FROM #qualified_events pe
JOIN (
-- Begin Criteria Group
select 0 as index_id, person_id, event_id
FROM
(
select E.person_id, E.event_id
FROM #qualified_events E
INNER JOIN
(
-- Begin Correlated Criteria
select 0 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 53)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 1 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 34)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 2 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 35)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 3 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 49)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 4 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 50)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 5 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 51)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 6 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 54)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 7 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 40)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 8 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 41)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 9 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 44)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
UNION ALL
-- Begin Correlated Criteria
select 10 as index_id, p.person_id, p.event_id
from #qualified_events p
LEFT JOIN (
SELECT p.person_id, p.event_id
FROM #qualified_events P
JOIN (
-- Begin Condition Occurrence Criteria
SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date,
C.visit_occurrence_id, C.condition_start_date as sort_date
FROM
(
SELECT co.*
FROM @cdm_database_schema.CONDITION_OCCURRENCE co
JOIN #Codesets cs on (co.condition_concept_id = cs.concept_id and cs.codeset_id = 43)
) C
-- End Condition Occurrence Criteria
) A on A.person_id = P.person_id AND A.START_DATE >= P.OP_START_DATE AND A.START_DATE <= P.OP_END_DATE AND A.START_DATE >= DATEADD(day,-365,P.START_DATE) AND A.START_DATE <= DATEADD(day,-1,P.START_DATE) ) cc on p.person_id = cc.person_id and p.event_id = cc.event_id
GROUP BY p.person_id, p.event_id
HAVING COUNT(cc.event_id) = 0
-- End Correlated Criteria
) CQ on E.person_id = CQ.person_id and E.event_id = CQ.event_id
GROUP BY E.person_id, E.event_id
HAVING COUNT(index_id) = 11
) G
-- End Criteria Group
) AC on AC.person_id = pe.person_id AND AC.event_id = pe.event_id
) Results
;
SELECT inclusion_rule_id, person_id, event_id
INTO #inclusion_events
FROM (select inclusion_rule_id, person_id, event_id from #Inclusion_0
UNION ALL
select inclusion_rule_id, person_id, event_id from #Inclusion_1) I;
TRUNCATE TABLE #Inclusion_0;
DROP TABLE #Inclusion_0;
TRUNCATE TABLE #Inclusion_1;
DROP TABLE #Inclusion_1;
with cteIncludedEvents(event_id, person_id, start_date, end_date, op_start_date, op_end_date, ordinal) as
(
SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal
from
(
select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask
from #qualified_events Q
LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id
GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date
) MG -- matching groups
{2 != 0}?{
-- the matching group with all bits set ( POWER(2,# of inclusion rules) - 1 = inclusion_rule_mask
WHERE (MG.inclusion_rule_mask = POWER(cast(2 as bigint),2)-1)
}
)
select event_id, person_id, start_date, end_date, op_start_date, op_end_date
into #included_events
FROM cteIncludedEvents Results
;
-- date offset strategy
select event_id, person_id,
case when DATEADD(day,1,start_date) > op_end_date then op_end_date else DATEADD(day,1,start_date) end as end_date
INTO #strategy_ends
from #included_events;
-- generate cohort periods into #final_cohort
with cohort_ends (event_id, person_id, end_date) as
(
-- cohort exit dates
-- End Date Strategy
SELECT event_id, person_id, end_date from #strategy_ends
),
first_ends (person_id, start_date, end_date) as
(
select F.person_id, F.start_date, F.end_date
FROM (
select I.event_id, I.person_id, I.start_date, E.end_date, row_number() over (partition by I.person_id, I.event_id order by E.end_date) as ordinal
from #included_events I
join cohort_ends E on I.event_id = E.event_id and I.person_id = E.person_id and E.end_date >= I.start_date
) F
WHERE F.ordinal = 1
)
select person_id, start_date, end_date
INTO #cohort_rows
from first_ends;
with cteEndDates (person_id, end_date) AS -- the magic
(
SELECT
person_id
, DATEADD(day,-1 * 0, event_date) as end_date
FROM
(
SELECT
person_id
, event_date
, event_type
, MAX(start_ordinal) OVER (PARTITION BY person_id ORDER BY event_date, event_type ROWS UNBOUNDED PRECEDING) AS start_ordinal
, ROW_NUMBER() OVER (PARTITION BY person_id ORDER BY event_date, event_type) AS overall_ord
FROM
(
SELECT
person_id
, start_date AS event_date
, -1 AS event_type
, ROW_NUMBER() OVER (PARTITION BY person_id ORDER BY start_date) AS start_ordinal
FROM #cohort_rows
UNION ALL
SELECT
person_id
, DATEADD(day,0,end_date) as end_date
, 1 AS event_type
, NULL
FROM #cohort_rows
) RAWDATA
) e
WHERE (2 * e.start_ordinal) - e.overall_ord = 0
),
cteEnds (person_id, start_date, end_date) AS
(
SELECT
c.person_id
, c.start_date
, MIN(e.end_date) AS end_date
FROM #cohort_rows c
JOIN cteEndDates e ON c.person_id = e.person_id AND e.end_date >= c.start_date
GROUP BY c.person_id, c.start_date
)
select person_id, min(start_date) as start_date, end_date
into #final_cohort
from cteEnds
group by person_id, end_date
;
DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id;
INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date)
select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date
FROM #final_cohort CO
;
{1 != 0}?{
-- BEGIN: Censored Stats
delete from @results_database_schema.cohort_censor_stats where cohort_definition_id = @target_cohort_id;
-- END: Censored Stats
}
{1 != 0 & 2 != 0}?{
-- Create a temp table of inclusion rule rows for joining in the inclusion rule impact analysis
select cast(rule_sequence as int) as rule_sequence
into #inclusion_rules
from (
SELECT CAST(0 as int) as rule_sequence UNION ALL SELECT CAST(1 as int) as rule_sequence
) IR;
-- Find the event that is the 'best match' per person.
-- the 'best match' is defined as the event that satisfies the most inclusion rules.
-- ties are solved by choosing the event that matches the earliest inclusion rule, and then earliest.
select q.person_id, q.event_id
into #best_events
from #qualified_events Q
join (
SELECT R.person_id, R.event_id, ROW_NUMBER() OVER (PARTITION BY R.person_id ORDER BY R.rule_count DESC,R.min_rule_id ASC, R.start_date ASC) AS rank_value
FROM (
SELECT Q.person_id, Q.event_id, COALESCE(COUNT(DISTINCT I.inclusion_rule_id), 0) AS rule_count, COALESCE(MIN(I.inclusion_rule_id), 0) AS min_rule_id, Q.start_date
FROM #qualified_events Q
LEFT JOIN #inclusion_events I ON q.person_id = i.person_id AND q.event_id = i.event_id
GROUP BY Q.person_id, Q.event_id, Q.start_date
) R
) ranked on Q.person_id = ranked.person_id and Q.event_id = ranked.event_id
WHERE ranked.rank_value = 1
;
-- modes of generation: (the same tables store the results for the different modes, identified by the mode_id column)
-- 0: all events
-- 1: best event
-- BEGIN: Inclusion Impact Analysis - event
-- calculte matching group counts
delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 0;
insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id)
select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 0 as mode_id
from
(
select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask
from #qualified_events Q
LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id
GROUP BY Q.person_id, Q.event_id
) MG -- matching groups
group by inclusion_rule_mask
;
-- calculate gain counts
delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 0;
insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id)
select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 0 as mode_id
from #inclusion_rules ir
left join
(
select i.inclusion_rule_id, count_big(i.event_id) as person_count
from #qualified_events Q
JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id
group by i.inclusion_rule_id
) T on ir.rule_sequence = T.inclusion_rule_id
CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal
CROSS JOIN (select count_big(event_id) as total from #qualified_events) EventTotal
LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 0 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule'
;
-- calculate totals
delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 0;
insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id)
select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 0 as mode_id
FROM
(select count_big(event_id) as total from #qualified_events) PC,
(select sum(sr.person_count) as total
from @results_database_schema.cohort_inclusion_result sr
CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal
where sr.mode_id = 0 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1
) FC
;
-- END: Inclusion Impact Analysis - event
-- BEGIN: Inclusion Impact Analysis - person
-- calculte matching group counts
delete from @results_database_schema.cohort_inclusion_result where cohort_definition_id = @target_cohort_id and mode_id = 1;
insert into @results_database_schema.cohort_inclusion_result (cohort_definition_id, inclusion_rule_mask, person_count, mode_id)
select @target_cohort_id as cohort_definition_id, inclusion_rule_mask, count_big(*) as person_count, 1 as mode_id
from
(
select Q.person_id, Q.event_id, CAST(SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) AS bigint) as inclusion_rule_mask
from #best_events Q
LEFT JOIN #inclusion_events I on q.person_id = i.person_id and q.event_id = i.event_id
GROUP BY Q.person_id, Q.event_id
) MG -- matching groups
group by inclusion_rule_mask
;
-- calculate gain counts
delete from @results_database_schema.cohort_inclusion_stats where cohort_definition_id = @target_cohort_id and mode_id = 1;
insert into @results_database_schema.cohort_inclusion_stats (cohort_definition_id, rule_sequence, person_count, gain_count, person_total, mode_id)
select @target_cohort_id as cohort_definition_id, ir.rule_sequence, coalesce(T.person_count, 0) as person_count, coalesce(SR.person_count, 0) gain_count, EventTotal.total, 1 as mode_id
from #inclusion_rules ir
left join
(
select i.inclusion_rule_id, count_big(i.event_id) as person_count
from #best_events Q
JOIN #inclusion_events i on Q.person_id = I.person_id and Q.event_id = i.event_id
group by i.inclusion_rule_id
) T on ir.rule_sequence = T.inclusion_rule_id
CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal
CROSS JOIN (select count_big(event_id) as total from #best_events) EventTotal
LEFT JOIN @results_database_schema.cohort_inclusion_result SR on SR.mode_id = 1 AND SR.cohort_definition_id = @target_cohort_id AND (POWER(cast(2 as bigint),RuleTotal.total_rules) - POWER(cast(2 as bigint),ir.rule_sequence) - 1) = SR.inclusion_rule_mask -- POWER(2,rule count) - POWER(2,rule sequence) - 1 is the mask for 'all except this rule'
;
-- calculate totals
delete from @results_database_schema.cohort_summary_stats where cohort_definition_id = @target_cohort_id and mode_id = 1;
insert into @results_database_schema.cohort_summary_stats (cohort_definition_id, base_count, final_count, mode_id)
select @target_cohort_id as cohort_definition_id, PC.total as person_count, coalesce(FC.total, 0) as final_count, 1 as mode_id
FROM
(select count_big(event_id) as total from #best_events) PC,
(select sum(sr.person_count) as total
from @results_database_schema.cohort_inclusion_result sr
CROSS JOIN (select count(*) as total_rules from #inclusion_rules) RuleTotal
where sr.mode_id = 1 and sr.cohort_definition_id = @target_cohort_id and sr.inclusion_rule_mask = POWER(cast(2 as bigint),RuleTotal.total_rules)-1
) FC
;
-- END: Inclusion Impact Analysis - person
TRUNCATE TABLE #best_events;
DROP TABLE #best_events;
TRUNCATE TABLE #inclusion_rules;
DROP TABLE #inclusion_rules;
}
TRUNCATE TABLE #strategy_ends;
DROP TABLE #strategy_ends;
TRUNCATE TABLE #cohort_rows;
DROP TABLE #cohort_rows;
TRUNCATE TABLE #final_cohort;
DROP TABLE #final_cohort;
TRUNCATE TABLE #inclusion_events;
DROP TABLE #inclusion_events;
TRUNCATE TABLE #qualified_events;
DROP TABLE #qualified_events;
TRUNCATE TABLE #included_events;
DROP TABLE #included_events;
TRUNCATE TABLE #Codesets;
DROP TABLE #Codesets;
|
--
-- CREATE_VIEW2
--
-- Enforce use of COMMIT instead of 2PC for temporary objects
SET enforce_two_phase_commit TO off;
-- tests for temporary views
CREATE SCHEMA temp_view_test
CREATE TABLE base_table (a int, id int)
CREATE TABLE base_table2 (a int, id int);
SET search_path TO temp_view_test, public;
CREATE TEMPORARY TABLE temp_table (a int, id int);
-- should be created in temp_view_test schema
CREATE VIEW v1 AS SELECT * FROM base_table;
-- should be created in temp object schema
CREATE VIEW v1_temp AS SELECT * FROM temp_table;
-- should be created in temp object schema
CREATE TEMP VIEW v2_temp AS SELECT * FROM base_table;
-- should be created in temp_views schema
CREATE VIEW temp_view_test.v2 AS SELECT * FROM base_table;
-- should fail
CREATE VIEW temp_view_test.v3_temp AS SELECT * FROM temp_table;
-- should fail
CREATE SCHEMA test_schema
CREATE TEMP VIEW testview AS SELECT 1;
-- joins: if any of the join relations are temporary, the view
-- should also be temporary
-- should be non-temp
CREATE VIEW v3 AS
SELECT t1.a AS t1_a, t2.a AS t2_a
FROM base_table t1, base_table2 t2
WHERE t1.id = t2.id;
-- should be temp (one join rel is temp)
CREATE VIEW v4_temp AS
SELECT t1.a AS t1_a, t2.a AS t2_a
FROM base_table t1, temp_table t2
WHERE t1.id = t2.id;
-- should be temp
CREATE VIEW v5_temp AS
SELECT t1.a AS t1_a, t2.a AS t2_a, t3.a AS t3_a
FROM base_table t1, base_table2 t2, temp_table t3
WHERE t1.id = t2.id and t2.id = t3.id;
-- subqueries
CREATE VIEW v4 AS SELECT * FROM base_table WHERE id IN (SELECT id FROM base_table2);
CREATE VIEW v5 AS SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM base_table2) t2;
CREATE VIEW v6 AS SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM base_table2);
CREATE VIEW v7 AS SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM base_table2);
CREATE VIEW v8 AS SELECT * FROM base_table WHERE EXISTS (SELECT 1);
CREATE VIEW v6_temp AS SELECT * FROM base_table WHERE id IN (SELECT id FROM temp_table);
CREATE VIEW v7_temp AS SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM temp_table) t2;
CREATE VIEW v8_temp AS SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM temp_table);
CREATE VIEW v9_temp AS SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM temp_table);
-- a view should also be temporary if it references a temporary view
CREATE VIEW v10_temp AS SELECT * FROM v7_temp;
CREATE VIEW v11_temp AS SELECT t1.id, t2.a FROM base_table t1, v10_temp t2;
CREATE VIEW v12_temp AS SELECT true FROM v11_temp;
-- a view should also be temporary if it references a temporary sequence
CREATE SEQUENCE seq1;
CREATE TEMPORARY SEQUENCE seq1_temp;
CREATE VIEW v9 AS SELECT seq1.is_called FROM seq1;
CREATE VIEW v13_temp AS SELECT seq1_temp.is_called FROM seq1_temp;
SELECT relname FROM pg_class
WHERE relname LIKE 'v_'
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'temp_view_test')
ORDER BY relname;
SELECT relname FROM pg_class
WHERE relname LIKE 'v%'
AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname LIKE 'pg_temp%')
ORDER BY relname;
CREATE SCHEMA testviewschm2;
SET search_path TO testviewschm2, public;
CREATE TABLE t1 (num int, name text);
CREATE TABLE t2 (num2 int, value text);
CREATE TEMP TABLE tt (num2 int, value text);
CREATE VIEW nontemp1 AS SELECT * FROM t1 CROSS JOIN t2;
CREATE VIEW temporal1 AS SELECT * FROM t1 CROSS JOIN tt;
CREATE VIEW nontemp2 AS SELECT * FROM t1 INNER JOIN t2 ON t1.num = t2.num2;
CREATE VIEW temporal2 AS SELECT * FROM t1 INNER JOIN tt ON t1.num = tt.num2;
CREATE VIEW nontemp3 AS SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num2;
CREATE VIEW temporal3 AS SELECT * FROM t1 LEFT JOIN tt ON t1.num = tt.num2;
CREATE VIEW nontemp4 AS SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num2 AND t2.value = 'xxx';
CREATE VIEW temporal4 AS SELECT * FROM t1 LEFT JOIN tt ON t1.num = tt.num2 AND tt.value = 'xxx';
SELECT relname FROM pg_class
WHERE relname LIKE 'nontemp%'
AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'testviewschm2')
ORDER BY relname;
SELECT relname FROM pg_class
WHERE relname LIKE 'temporal%'
AND relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname LIKE 'pg_temp%')
ORDER BY relname;
CREATE TABLE tbl1 ( a int, b int);
CREATE TABLE tbl2 (c int, d int);
CREATE TABLE tbl3 (e int, f int);
CREATE TABLE tbl4 (g int, h int);
CREATE TEMP TABLE tmptbl (i int, j int);
--Should be in testviewschm2
CREATE VIEW pubview AS SELECT * FROM tbl1 WHERE tbl1.a
BETWEEN (SELECT d FROM tbl2 WHERE c = 1) AND (SELECT e FROM tbl3 WHERE f = 2)
AND EXISTS (SELECT g FROM tbl4 LEFT JOIN tbl3 ON tbl4.h = tbl3.f);
SELECT count(*) FROM pg_class where relname = 'pubview'
AND relnamespace IN (SELECT OID FROM pg_namespace WHERE nspname = 'testviewschm2');
--Should be in temp object schema
CREATE VIEW mytempview AS SELECT * FROM tbl1 WHERE tbl1.a
BETWEEN (SELECT d FROM tbl2 WHERE c = 1) AND (SELECT e FROM tbl3 WHERE f = 2)
AND EXISTS (SELECT g FROM tbl4 LEFT JOIN tbl3 ON tbl4.h = tbl3.f)
AND NOT EXISTS (SELECT g FROM tbl4 LEFT JOIN tmptbl ON tbl4.h = tmptbl.j);
SELECT count(*) FROM pg_class where relname LIKE 'mytempview'
And relnamespace IN (SELECT OID FROM pg_namespace WHERE nspname LIKE 'pg_temp%');
--
-- CREATE VIEW and WITH(...) clause
--
CREATE VIEW mysecview1
AS SELECT * FROM tbl1 WHERE a = 0;
CREATE VIEW mysecview2 WITH (security_barrier=true)
AS SELECT * FROM tbl1 WHERE a > 0;
CREATE VIEW mysecview3 WITH (security_barrier=false)
AS SELECT * FROM tbl1 WHERE a < 0;
CREATE VIEW mysecview4 WITH (security_barrier)
AS SELECT * FROM tbl1 WHERE a <> 0;
CREATE VIEW mysecview5 WITH (security_barrier=100) -- Error
AS SELECT * FROM tbl1 WHERE a > 100;
CREATE VIEW mysecview6 WITH (invalid_option) -- Error
AS SELECT * FROM tbl1 WHERE a < 100;
SELECT relname, relkind, reloptions FROM pg_class
WHERE oid in ('mysecview1'::regclass, 'mysecview2'::regclass,
'mysecview3'::regclass, 'mysecview4'::regclass)
ORDER BY relname;
CREATE OR REPLACE VIEW mysecview1
AS SELECT * FROM tbl1 WHERE a = 256;
CREATE OR REPLACE VIEW mysecview2
AS SELECT * FROM tbl1 WHERE a > 256;
CREATE OR REPLACE VIEW mysecview3 WITH (security_barrier=true)
AS SELECT * FROM tbl1 WHERE a < 256;
CREATE OR REPLACE VIEW mysecview4 WITH (security_barrier=false)
AS SELECT * FROM tbl1 WHERE a <> 256;
SELECT relname, relkind, reloptions FROM pg_class
WHERE oid in ('mysecview1'::regclass, 'mysecview2'::regclass,
'mysecview3'::regclass, 'mysecview4'::regclass)
ORDER BY relname;
DROP SCHEMA temp_view_test CASCADE;
DROP SCHEMA testviewschm2 CASCADE;
|
select
-- Required Columns
arn as resource,
case
when engine ilike any (array ['%aurora-mysql%', '%aurora-postgres%']) then 'skip'
when multi_az then 'ok'
else 'alarm'
end as status,
case
when engine ilike any (array ['%aurora-mysql%', '%aurora-postgres%']) then title || ' cluster instance.'
when multi_az then title || ' Multi-AZ enabled.'
else title || ' Multi-AZ disabled.'
end as reason,
-- Add Dimensions
region,
account_id
from
aws_rds_db_instance;
|
--
-- Copyright 2005-2015 The Kuali Foundation
--
-- Licensed under the Educational Community License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.opensource.org/licenses/ecl2.php
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
-- KULRICE-9887: KRMS Attribute with name 'peopleFlowName' has invalid namespace
--
UPDATE krms_attr_defn_t SET nmspc_cd = 'KR-RULE' WHERE nm = 'peopleFlowName' AND nmspc_cd = 'KR_RULE'
/
|
DROP TABLE IF EXISTS [dbo].[applications]
GO
CREATE TABLE [dbo].[applications](
[app_modelname] [nchar](150) NOT NULL,
[app_publisher] [nvarchar](max) NOT NULL,
[app_title] [nvarchar](max) NOT NULL,
[app_description] [nvarchar](max) NOT NULL,
[app_created] [datetime] NULL,
[app_modified] [datetime] NULL,
CONSTRAINT [PK_applications] PRIMARY KEY CLUSTERED
(
[app_modelname] ASC
) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
ALTER TABLE [dbo].[applications] ADD CONSTRAINT [DF_applications_app_created] DEFAULT (CURRENT_TIMESTAMP) FOR [app_created]
GO
DROP TRIGGER IF EXISTS [dbo].[tr_applications_Modified]
GO
CREATE TRIGGER [dbo].[tr_applications_Modified]
ON [dbo].[applications]
AFTER UPDATE
AS BEGIN
SET NOCOUNT ON;
BEGIN
UPDATE [dbo].[applications]
SET app_modified = CURRENT_TIMESTAMP
END
END
GO
UPDATE [dbo].[db] SET "db_value"=3 WHERE "db_name" = 'db_version';
|
--
-- /packages/acs-kernel/sql/acs-install.sql
--
-- Mount the main site.
--
-- @author Peter Marklund
-- @creation-date 2000/10/01
-- @cvs-id $Id: acs-install.sql,v 1.28 2011/07/07 10:46:01 gustafn Exp $
--
--
-- procedure inline_0/0
--
CREATE OR REPLACE FUNCTION inline_0(
) RETURNS integer AS $$
DECLARE
node_id site_nodes.node_id%TYPE;
main_site_id site_nodes.node_id%TYPE;
BEGIN
main_site_id := apm_service__new(
null,
'#acs-kernel.Main_Site#',
'acs-subsite',
'apm_service',
now(),
null,
null,
acs__magic_object_id('default_context')
);
-- Make the -2 registered users group an application_group
insert into application_groups
(group_id, package_id)
values
(-2, main_site_id);
update acs_objects
set object_type = 'application_group',
context_id = main_site_id
where object_id = -2;
insert into group_rels
(group_rel_id, group_id, rel_type)
select nextval('t_acs_object_id_seq'), -2, 'admin_rel';
-- Create the members and admins rel segments
perform rel_segment__new(
null,
'rel_segment',
now(),
null,
null,
null,
null,
'#acs-kernel.Main_Site_Members#',
-2,
'membership_rel',
null
);
perform rel_segment__new(
null,
'rel_segment',
now(),
null,
null,
null,
null,
'#acs-kernel.lt_Main_Site_Administrat#',
-2,
'admin_rel',
null
);
node_id := site_node__new (
null,
null,
'',
main_site_id,
't',
't',
null,
null
);
perform acs_permission__grant_permission (
main_site_id,
acs__magic_object_id('the_public'),
'read'
);
return null;
END;
$$ LANGUAGE plpgsql;
select inline_0 ();
drop function inline_0 ();
|
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- Updating the schema version
UPDATE meta SET meta_value = 57 where meta_key = "schema_version";
-- a partitioned table cannot have any keys but the primary key
ALTER TABLE peptide_align_feature DROP KEY qgenome_db_id;
ALTER TABLE peptide_align_feature DROP KEY hgenome_db_id;
ALTER TABLE peptide_align_feature DROP KEY analysis_id;
ALTER TABLE peptide_align_feature DROP KEY qmember_id;
ALTER TABLE peptide_align_feature DROP KEY hmember_id;
ALTER TABLE peptide_align_feature DROP KEY hmember_qgenome;
ALTER TABLE peptide_align_feature DROP KEY qmember_hgenome;
-- this table is used for production only
DROP TABLE peptide_align_feature_prod;
-- This table holds the sequence exon boundaries information
CREATE TABLE sequence_exon_bounded (
sequence_exon_bounded_id int(10) unsigned NOT NULL auto_increment, # unique internal id
member_id int(10) unsigned NOT NULL, # unique internal id
length int(10) NOT NULL,
sequence_exon_bounded longtext NOT NULL,
FOREIGN KEY (member_id) REFERENCES member(member_id),
PRIMARY KEY (sequence_exon_bounded_id),
KEY (member_id),
KEY sequence_exon_bounded (sequence_exon_bounded(18))
);
# modifications to be applied to pre-57 databases to bring them to rel-57 state
## ---------------------renaming group_id into node_id in genomic_align_group table:
#
ALTER TABLE genomic_align_group DROP KEY genomic_align_id;
ALTER TABLE genomic_align_group DROP COLUMN type;
ALTER TABLE genomic_align_group CHANGE group_id node_id bigint unsigned NOT NULL AUTO_INCREMENT;
## The following two lines only "rename" a key, which is unlikely to be needed, but takes A LOT of time to complete:
#
#ALTER TABLE genomic_align_group ADD KEY node_id(node_id);
#ALTER TABLE genomic_align_group DROP KEY group_id;
ALTER TABLE genomic_align_group ADD UNIQUE KEY genomic_align_id(genomic_align_id);
## ---------------------add new keys for speeding things up:
#
ALTER TABLE genomic_align ADD KEY (method_link_species_set_id);
## --------------------making dnafrag_id bigint everywhere:
#
ALTER TABLE constrained_element MODIFY COLUMN dnafrag_id bigint(20) unsigned NOT NULL;
ALTER TABLE dnafrag MODIFY COLUMN dnafrag_id bigint(20) unsigned NOT NULL AUTO_INCREMENT;
ALTER TABLE dnafrag_region MODIFY COLUMN dnafrag_id bigint(20) unsigned NOT NULL DEFAULT '0';
ALTER TABLE genomic_align MODIFY COLUMN dnafrag_id bigint(20) unsigned NOT NULL DEFAULT '0';
## --------------------widening some analysis fields (Andy, you should have warned Compara and added these to the patch as well) :
#
ALTER TABLE analysis MODIFY COLUMN db_file varchar(255);
ALTER TABLE analysis MODIFY COLUMN program varchar(255);
ALTER TABLE analysis MODIFY COLUMN program_file varchar(255);
## ------------------- subset and subset_member tables are now becoming a part of the release:
#
CREATE TABLE subset (
subset_id int(10) NOT NULL auto_increment,
description varchar(255),
dump_loc varchar(255),
PRIMARY KEY (subset_id),
UNIQUE (description)
);
#
CREATE TABLE subset_member (
subset_id int(10) NOT NULL,
member_id int(10) NOT NULL,
KEY (member_id),
UNIQUE subset_member_id (subset_id, member_id)
);
## ---------------------- Used to populate subset member with a dummy set of data
insert into subset( subset_id, description ) values ( 1, 'DUMMY' );
insert into subset_member select 1, member_id from member;
## ---------------------- This table holds the sequence cds information
#
CREATE TABLE sequence_cds (
sequence_cds_id int(10) unsigned NOT NULL auto_increment, # unique internal id
member_id int(10) unsigned NOT NULL, # unique internal id
length int(10) NOT NULL,
sequence_cds longtext NOT NULL,
FOREIGN KEY (member_id) REFERENCES member(member_id),
PRIMARY KEY (sequence_cds_id),
KEY (member_id),
KEY sequence_cds (sequence_cds(64))
);
## ---------------------- Left-Right indices' offsets
#
CREATE TABLE lr_index_offset (
table_name varchar(64) NOT NULL,
lr_index int(10) unsigned NOT NULL,
PRIMARY KEY (table_name)
);
## ---------------------- species tags table structure
#
CREATE TABLE species_set_tag (
species_set_id int(10) unsigned NOT NULL, # FK species_set.species_set_id
tag varchar(50) DEFAULT NULL,
value mediumtext,
# FOREIGN KEY (species_set_id) REFERENCES species_set(species_set_id),
UNIQUE KEY tag_species_set_id (species_set_id,tag)
);
|
CREATE TABLE `identifiers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`docset_name` varchar(340) NOT NULL,
`docset_filename` varchar(340) NOT NULL,
`docset_platform` varchar(340) NOT NULL,
`docset_bundle` varchar(340) NOT NULL,
`docset_version` varchar(340) NOT NULL,
`page_path` longtext NOT NULL,
`page_title` varchar(340) NOT NULL,
`httrack_source` longtext NOT NULL,
`banned_from_public` tinyint(1) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
-- file:domain.sql ln:400 expect:true
alter table domain_test add column d str_domain2
|
DROP TABLE PARTICIPANT;
|
/****** Object: Table [dbo].[T_Protein_Collection_Types] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_Protein_Collection_Types](
[Collection_Type_ID] [tinyint] IDENTITY(3,1) NOT NULL,
[Type] [varchar](64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Display] [varchar](128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Description] [varchar](128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_T_Protein_Collection_Types] PRIMARY KEY CLUSTERED
(
[Collection_Type_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
|
update move
set cluster_ini = ?
, cluster_end = ?
where move_id = ?
|
select * from mgeometry_columns;
CREATE OR REPLACE FUNCTION public.append(
mdouble,
double precision [], timestamp without time zone [])
RETURNS mdouble AS
$BODY$
DECLARE
f_mgeometry alias for $1;
tp alias for $2;
timeline alias for $3;
f_mgeometry_segtable_name char(200);
mpid integer;
segid integer;
sql text;
annotations json;
trajid integer;
mgeometry_types char(50);
mgeometry_inter char(50);
BEGIN
mgeometry_types := 'mdouble';
mgeometry_inter := 'linear' ;
sql := 'select f_segtableoid from mgeometry_columns where f_segtableoid = ' ||quote_literal(f_mgeometry.segid );
EXECUTE sql INTO trajid;
sql := 'select f_mgeometry_segtable_name from mgeometry_columns where f_segtableoid = ' ||quote_literal(trajid );
EXECUTE sql INTO f_mgeometry_segtable_name;
mpid := f_mgeometry.moid;
sql := 'select segid from ' || quote_ident(f_mgeometry_segtable_name) ||
' where mpid = ' || f_mgeometry.moid;
RAISE DEBUG '%', sql;
EXECUTE sql INTO segid;
---array_cat(anyarray, anyarray)
IF( segid IS NOT NULL) THEN
EXECUTE 'UPDATE ' || quote_ident(f_mgeometry_segtable_name) ||
' set datetimes = array_cat(datetimes, $2) , values = array_cat(values, $3)
where mpid = $4 and segid = $5 '
USING tp, timeline, tp, mpid, segid;
sql := 'select row_to_json((SELECT d from (select datetimes, values, type, interpolation) d)) from ' || quote_ident(f_mgeometry_segtable_name) ;
RAISE DEBUG '%', sql;
EXECUTE sql INTO annotations;
EXECUTE 'update ' || quote_ident(f_mgeometry_segtable_name) || ' set annotations = ($4) WHERE mpid = $1'
USING mpid, tp, timeline,annotations;
ELSE
EXECUTE 'INSERT INTO ' || quote_ident(f_mgeometry_segtable_name) || '(mpid,segid, datetimes, values, type, interpolation)
VALUES($1, 1, $3, $2, $4, $5)'
USING mpid, tp, timeline, mgeometry_types, mgeometry_inter;
sql := 'select row_to_json((SELECT d from (select datetimes,values, type, interpolation) d)) from ' || quote_ident(f_mgeometry_segtable_name) ;
RAISE DEBUG '%', sql;
EXECUTE sql INTO annotations;
EXECUTE 'update ' || quote_ident(f_mgeometry_segtable_name) || ' set annotations = ($4) WHERE mpid = $1'
USING mpid, tp, timeline, annotations;
END IF;
return f_mgeometry;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT
COST 100;
ALTER FUNCTION public.append(mdouble, double precision [], timestamp without time zone [])
OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.append(
mpoint,
mcoordinate[],
timestamp without time zone[])
RETURNS mpoint
AS $BODY$
DECLARE
f_mgeometry alias for $1;
tp alias for $2;
timeline alias for $3;
segid integer;
f_mgeometry_segtable_name char(200);
mpid integer;
sql text;
annotations json;
trajid integer;
mgeometry_types char(50);
mgeometry_inter char(50);
BEGIN
mgeometry_types := 'mpoint';
mgeometry_inter := 'linear' ;
sql := 'select f_segtableoid from mgeometry_columns where f_segtableoid = ' ||quote_literal(f_mgeometry.segid );
EXECUTE sql INTO trajid;
sql := 'select f_mgeometry_segtable_name from mgeometry_columns where f_segtableoid = ' ||quote_literal(trajid );
EXECUTE sql INTO f_mgeometry_segtable_name;
mpid := f_mgeometry.moid;
sql := 'select segid from ' || quote_ident(f_mgeometry_segtable_name) ||
' where mpid = ' || f_mgeometry.moid;
RAISE DEBUG '%', sql;
EXECUTE sql INTO segid;
IF( segid IS NOT NULL) THEN
EXECUTE 'UPDATE ' || quote_ident(f_mgeometry_segtable_name) ||
' set datetimes = array_cat(datetimes, $2) , geo = array_cat(geo, $3)
where mpid = $4 and segid = $5 '
USING tp, timeline, tp, mpid, segid;
sql := 'select row_to_json((SELECT d from (select datetimes,geo, type, interpolation) d)) from ' || quote_ident(f_mgeometry_segtable_name) ;
RAISE DEBUG '%', sql;
EXECUTE sql INTO annotations;
EXECUTE 'update ' || quote_ident(f_mgeometry_segtable_name) || ' set annotations = ($4) WHERE mpid = $1'
USING mpid, tp, timeline,annotations;
ELSE
EXECUTE 'INSERT INTO ' || quote_ident(f_mgeometry_segtable_name) || '(mpid, segid, datetimes, geo, type, interpolation)
VALUES($1, 1, $3, $2, $4, $5)'
USING mpid, tp, timeline, mgeometry_types, mgeometry_inter;
--get json ;
sql := 'select row_to_json((SELECT d from (select datetimes,geo, type, interpolation ) d)) from ' || quote_ident(f_mgeometry_segtable_name) ;
RAISE DEBUG '%', sql;
EXECUTE sql INTO annotations;
EXECUTE 'update ' || quote_ident(f_mgeometry_segtable_name) || ' set annotations = ($4) WHERE mpid = $1'
USING mpid, tp, timeline, annotations;
END IF;
return f_mgeometry;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT
COST 100;
ALTER FUNCTION public.append(mpoint, mcoordinate[], timestamp without time zone[])
OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.append(
mvideo,
mcoordinate[], timestamp without time zone[], character varying[], double precision[], double precision[], double precision[], fov[])
RETURNS mvideo AS
$BODY$
DECLARE
f_mgeometry alias for $1;
tp alias for $2;
timeline alias for $3;
turi alias for $4;
tdistance alias for $5;
tdirection alias for $6;
tangle alias for $7;
tfov alias for $8;
segid integer;
f_mgeometry_segtable_name char(200);
mpid integer;
sql text;
trajid integer;
annotations json;
mgeometry_types char(50);
BEGIN
mgeometry_types := 'mvideo';
sql := 'select f_segtableoid from mgeometry_columns where f_segtableoid = ' ||quote_literal(f_mgeometry.segid );
EXECUTE sql INTO trajid;
sql := 'select f_mgeometry_segtable_name from mgeometry_columns where f_segtableoid = ' ||quote_literal(trajid );
EXECUTE sql INTO f_mgeometry_segtable_name;
mpid := f_mgeometry.moid;
sql := 'select segid from ' || quote_ident(f_mgeometry_segtable_name) ||
' where mpid = ' || f_mgeometry.moid;
RAISE DEBUG '%', sql;
EXECUTE sql INTO segid;
IF( segid IS NOT NULL) THEN
EXECUTE 'UPDATE ' || quote_ident(f_mgeometry_segtable_name) ||
' set datetimes = array_cat(datetimes, $2) , geo = array_cat(geo, $3)
where mpid = $4 and segid = $5 '
USING tp, timeline, tp, mpid, segid;
sql := 'select row_to_json((SELECT d from (select datetimes,geo,uri,fovs ) d)) from ' || quote_ident(f_mgeometry_segtable_name) ;
RAISE DEBUG '%', sql;
EXECUTE sql INTO annotations;
EXECUTE 'update ' || quote_ident(f_mgeometry_segtable_name) || ' set annotations = ($4) WHERE mpid = $1'
USING mpid, tp, timeline,annotations;
ELSE
EXECUTE 'INSERT INTO ' || quote_ident(f_mgeometry_segtable_name) || '(mpid, segid, datetimes, geo, uri, distance, direction2d, horizontalAngle, fovs, type)
VALUES($1, 1, $2, $3, $4, $5, $6, $7 , $8, $9)'
USING mpid, timeline, tp, turi, tdistance, tdirection, tangle, tfov, mgeometry_types;
--get json ;
sql := 'select row_to_json((SELECT d from (select datetimes,geo,uri,fovs ) d)) from ' || quote_ident(f_mgeometry_segtable_name) ;
RAISE DEBUG '%', sql;
EXECUTE sql INTO annotations;
EXECUTE 'update ' || quote_ident(f_mgeometry_segtable_name) || ' set annotations = ($4) WHERE mpid = $1'
USING mpid, tp, timeline,annotations;
END IF;
return f_mgeometry;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT
COST 100;
ALTER FUNCTION public.append(mvideo, mcoordinate[], timestamp without time zone[], character varying[], double precision[], double precision[], double precision[], fov[] )
OWNER TO postgres;
CREATE OR REPLACE FUNCTION append(mdouble, character varying) RETURNS mdouble AS
$$
DECLARE
c_trajectory alias for $1;
array_mdouble alias for $2;
array_time timestamp without time zone[];
array_double double precision[];
BEGIN
array_double =regexp_split_to_array(mdoubledouble(array_mdouble),';')::double precision[];
array_time = regexp_split_to_array(mdoubletime(array_mdouble),',') ::timestamp without time zone[];
execute 'select append( $1, $2, $3)'
using c_trajectory, array_double,array_time;
RETURN c_trajectory;
END
$$
LANGUAGE 'plpgsql' VOLATILE STRICT
COST 100;
CREATE OR REPLACE FUNCTION append(mpoint, character varying) RETURNS mpoint AS
$$
DECLARE
c_trajectory alias for $1;
array_mpoint alias for $2;
array_time timestamp without time zone[];
array_point mcoordinate[];
BEGIN
array_time = regexp_split_to_array(mpointtime(array_mpoint),',') ::timestamp without time zone[];
array_point = regexp_split_to_array(mpointpoint(array_mpoint),';') ::mcoordinate[];
execute 'select append( $1, $2, $3 )'
using c_trajectory, array_point,array_time;
RETURN c_trajectory;
END
$$
LANGUAGE 'plpgsql' VOLATILE STRICT
COST 100;
CREATE OR REPLACE FUNCTION mcoordinate(
double precision,
double precision,
double precision)
RETURNS mcoordinate AS
$BODY$
DECLARE
pointx alias for $1;
pointy alias for $2;
pointz alias for $3;
tp mcoordinate;
BEGIN
tp.pointx := pointx;
tp.pointy := pointy;
tp.pointz := pointz;
RETURN tp;
END
$BODY$
LANGUAGE plpgsql VOLATILE STRICT
COST 100;
ALTER FUNCTION mcoordinate(double precision, double precision, double precision)
OWNER TO postgres;
CREATE OR REPLACE FUNCTION append(mvideo, character varying) RETURNS mvideo AS
$$
DECLARE
c_trajectory alias for $1;
array_mvideo alias for $2;
array_time timestamp without time zone[];
array_point mcoordinate[];
array_uri character varying[];
array_fovdis double precision[];
array_fovdir double precision[];
array_fovang double precision[];
array_fov fov[];
i integer;
array_size integer;
fovs fov;
BEGIN
array_time = regexp_split_to_array(mvideotime(array_mvideo),',') ::timestamp without time zone[];
array_point = regexp_split_to_array(mvideopoint(array_mvideo),';') ::mcoordinate[];
array_uri = regexp_split_to_array(mvideouri(array_mvideo),';') ::character varying[];
array_fovdis = regexp_split_to_array(mvideodistance(array_mvideo),';') ::double precision[];
array_fovdir = regexp_split_to_array(mvideodirection(array_mvideo),';') ::double precision[];
array_fovang = regexp_split_to_array(mvideoangle(array_mvideo),';') ::double precision[];
execute 'select array_upper( $1, 1 )'
into array_size using array_point;
i := 1;
WHILE( i <= array_size ) LOOP
---fovs.geo := array_point[i];
fovs.horizontalAngle := array_fovang[i];
fovs.direction2d := array_fovdir[i];
fovs.distance := array_fovdis[i];
array_fov[i] = fovs;
i := i+1;
END LOOP;
execute 'select append( $1, $2, $3, $4, $5, $6, $7, $8 )'
using c_trajectory, array_point, array_time, array_uri, array_fovdis, array_fovdir, array_fovang, array_fov;
RETURN c_trajectory;
END
$$
LANGUAGE 'plpgsql' VOLATILE STRICT
COST 100;
CREATE OR REPLACE FUNCTION public.append(
stphoto,
character varying)
RETURNS stphoto AS
$BODY$
DECLARE
c_trajectory alias for $1;
stphotostring alias for $2;
moid oid;
uris text;
width integer;
height integer;
t timestamp without time zone;
geo mcoordinate;
fov fov;
sql text;
st stphoto;
BEGIN
uris = split_part(split_part(split_part(stphotostring,'(',2), ')',1),' ',1);
raise info '%', uris;
width = split_part(split_part(split_part(stphotostring,'(',2), ')',1),' ',2);
height = split_part(split_part(split_part(stphotostring,'(',2), ')',1),' ',3);
fov.horizontalAngle = split_part(split_part(split_part(stphotostring,'(',3), ')',1),' ',3);
fov.direction2d = split_part(split_part(split_part(stphotostring,'(',3), ')',1),' ',1);
fov.distance = split_part(split_part(split_part(stphotostring,'(',3), ')',1),' ',5);
geo.pointx = split_part(split_part(split_part(stphotostring,'(',4), ')',1),' ',1);
raise info '%', geo.pointx ;
geo.pointy = split_part(split_part(split_part(stphotostring,'(',4), ')',1),' ',2);
raise info '%', geo.pointy ;
geo.pointz = 'NaN';
raise info '%', geo.pointz ;
t = TIMESTAMP WITHOUT TIME ZONE 'epoch' + ((split_part(stphotostring,')',3))::bigint)* INTERVAL '1 second';
st.uri = uris;
st.fov =fov;
st.t = t;
st.geo = geo;
st.width = width;
st.height = height;
st.moid := c_trajectory.moid;
---EXECUTE 'update userstphotos set st = ($1) WHERE id = $2'
--- USING st, moid;
raise info '%', st;
return st;
END;
$BODY$
LANGUAGE plpgsql VOLATILE STRICT
COST 100;
|
-- create the usa dance schema
CREATE SCHEMA IF NOT EXISTS USADANCE;
|
INSERT INTO Person (ID, name, email, phone) VALUES
(1,'david walsh', 'david@wonder.com', '039877809'),
(2,'judy garnex', 'judy@wonder.com', '0898778709'),
(3,'audi sarnex', 'audi@ponder.com', '0898778709'),
(4,'nikita arjun', 'arjun@londer.com', '0898778709'),
(5,'paul1 Srenade', 'paul@serenade.com', '99612877809');
INSERT INTO Book (ID, title, author, isbn,borrowedby) VALUES
(1,'The Speilburg Affair', 'Joy Turnbull', '039877809', 'audi@ponder.com'),
(2,'The Poet never Lived', 'Urini Chiposki', '0aa39877809', ''),
(3,'The Heart Never Dies', 'Sruti Champion', '10679956-xdsd54399', 'paul@serenade.com'),
(4,'The Thousand Years of Loneliness', 'Priyanja Gaytri', '97479956-xdsd54399', 'paul@serenade.com');
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 05, 2020 at 06:08 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `ds`
--
-- --------------------------------------------------------
--
-- Table structure for table `drivers`
--
CREATE TABLE `drivers` (
`driver_id` int(11) NOT NULL,
`name` int(11) NOT NULL,
`aadhar_no` int(11) NOT NULL,
`phone_no` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf16;
-- --------------------------------------------------------
--
-- Table structure for table `live_orders`
--
CREATE TABLE `live_orders` (
`order_id` int(11) NOT NULL,
`driver_id` int(11) NOT NULL,
`route_id` int(11) NOT NULL,
`vehicle_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf16;
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE `orders` (
`order_id` int(11) NOT NULL,
`from_location` varchar(150) NOT NULL,
`to_location` varchar(150) NOT NULL,
`date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf16;
-- --------------------------------------------------------
--
-- Table structure for table `vehicle`
--
CREATE TABLE `vehicle` (
`vehicle_id` int(11) NOT NULL,
`registration_no` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf16;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`order_id`);
--
-- Indexes for table `vehicle`
--
ALTER TABLE `vehicle`
ADD PRIMARY KEY (`vehicle_id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- cse.test
--
-- execsql {
-- SELECT b, typeof(b), upper(b), typeof(b), b FROM t1
-- }
SELECT b, typeof(b), upper(b), typeof(b), b FROM t1
|
--
-- Current Schema CREATE statements go here
--
-- \Stationer\Barrel\models\ConfigLog
DROP TABLE IF EXISTS `ConfigLog`;
CREATE TABLE IF NOT EXISTS `ConfigLog` (
`configlog_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_uts` int(10) unsigned NOT NULL DEFAULT 0,
`updated_dts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`login_id` smallint(5) unsigned NOT NULL DEFAULT 0,
`tableName` varchar(255) NOT NULL,
`event_uts` int(10) unsigned NOT NULL DEFAULT 0,
`data` text NOT NULL,
`affected_id` int(10) unsigned NOT NULL DEFAULT 0,
KEY (`updated_dts`),
PRIMARY KEY(`configlog_id`)
);
-- \Stationer\Barrel\models\Email
DROP TABLE IF EXISTS `Email`;
CREATE TABLE IF NOT EXISTS `Email` (
`email_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_uts` int(10) unsigned NOT NULL DEFAULT 0,
`updated_dts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`headerRaw` text NOT NULL,
`bodyRaw` text NOT NULL,
`to` text NOT NULL,
`from` text NOT NULL,
`subject` text NOT NULL,
`date_uts` int(11) NOT NULL DEFAULT 0,
`messageId` varchar(155) NOT NULL,
KEY (`updated_dts`),
PRIMARY KEY(`email_id`)
);
|
CREATE INDEX "userid_idx" on requests ("userid");
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `active_sessions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `active_sessions` (
`id` binary(16) NOT NULL,
`person_id` varchar(22) NOT NULL,
`community_id` int NOT NULL,
`refreshed_at` datetime NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_active_sessions_on_person_id` (`person_id`),
KEY `index_active_sessions_on_community_id` (`community_id`),
KEY `index_active_sessions_on_refreshed_at` (`refreshed_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `active_storage_attachments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `active_storage_attachments` (
`id` bigint NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`record_type` varchar(255) NOT NULL,
`record_id` bigint NOT NULL,
`blob_id` bigint NOT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_active_storage_attachments_uniqueness` (`record_type`,`record_id`,`name`,`blob_id`),
KEY `index_active_storage_attachments_on_blob_id` (`blob_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `active_storage_blobs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `active_storage_blobs` (
`id` bigint NOT NULL AUTO_INCREMENT,
`key` varchar(255) NOT NULL,
`filename` varchar(255) NOT NULL,
`content_type` varchar(255) DEFAULT NULL,
`metadata` text,
`byte_size` bigint NOT NULL,
`checksum` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_active_storage_blobs_on_key` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `ar_internal_metadata`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `ar_internal_metadata` (
`key` varchar(255) NOT NULL,
`value` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `auth_tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `auth_tokens` (
`id` int NOT NULL AUTO_INCREMENT,
`token` varchar(255) DEFAULT NULL,
`token_type` varchar(255) DEFAULT 'unsubscribe',
`person_id` varchar(255) DEFAULT NULL,
`expires_at` datetime DEFAULT NULL,
`usages_left` int DEFAULT NULL,
`last_use_attempt` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_auth_tokens_on_token` (`token`),
KEY `index_on_person_id` (`person_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `billing_agreements`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `billing_agreements` (
`id` int NOT NULL AUTO_INCREMENT,
`paypal_account_id` int NOT NULL,
`billing_agreement_id` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`paypal_username_to` varchar(255) NOT NULL,
`request_token` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `index_billing_agreements_on_paypal_account_id` (`paypal_account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `bookings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `bookings` (
`id` int NOT NULL AUTO_INCREMENT,
`transaction_id` int DEFAULT NULL,
`start_on` date DEFAULT NULL,
`end_on` date DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`start_time` datetime DEFAULT NULL,
`end_time` datetime DEFAULT NULL,
`per_hour` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_bookings_on_transaction_id` (`transaction_id`),
KEY `index_bookings_on_per_hour` (`per_hour`),
KEY `index_bookings_on_start_time` (`start_time`),
KEY `index_bookings_on_end_time` (`end_time`),
KEY `index_bookings_on_transaction_start_on_end_on_per_hour` (`transaction_id`,`start_on`,`end_on`,`per_hour`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `categories` (
`id` int NOT NULL AUTO_INCREMENT,
`parent_id` int DEFAULT NULL,
`icon` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`community_id` int DEFAULT NULL,
`sort_priority` int DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_categories_on_parent_id` (`parent_id`),
KEY `index_categories_on_url` (`url`),
KEY `index_categories_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `category_custom_fields`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `category_custom_fields` (
`id` int NOT NULL AUTO_INCREMENT,
`category_id` int DEFAULT NULL,
`custom_field_id` int DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_category_custom_fields_on_category_id_and_custom_field_id` (`category_id`,`custom_field_id`),
KEY `index_category_custom_fields_on_custom_field_id` (`custom_field_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `category_listing_shapes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `category_listing_shapes` (
`category_id` int NOT NULL,
`listing_shape_id` int NOT NULL,
UNIQUE KEY `unique_listing_shape_category_joins` (`listing_shape_id`,`category_id`),
KEY `index_category_listing_shapes_on_category_id` (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `category_translations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `category_translations` (
`id` int NOT NULL AUTO_INCREMENT,
`category_id` int DEFAULT NULL,
`locale` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_category_translations_on_category_id` (`category_id`),
KEY `category_id_with_locale` (`category_id`,`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `checkout_accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `checkout_accounts` (
`id` int NOT NULL AUTO_INCREMENT,
`company_id_or_personal_id` varchar(255) DEFAULT NULL,
`merchant_id` varchar(255) NOT NULL,
`merchant_key` varchar(255) NOT NULL,
`person_id` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `comments` (
`id` int NOT NULL AUTO_INCREMENT,
`author_id` varchar(255) DEFAULT NULL,
`listing_id` int DEFAULT NULL,
`content` text,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`community_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_comments_on_listing_id` (`listing_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `communities`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `communities` (
`id` int NOT NULL AUTO_INCREMENT,
`uuid` binary(16) NOT NULL,
`ident` varchar(255) DEFAULT NULL,
`domain` varchar(255) DEFAULT NULL,
`use_domain` tinyint(1) NOT NULL DEFAULT '0',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`settings` text,
`consent` varchar(255) DEFAULT NULL,
`transaction_agreement_in_use` tinyint(1) DEFAULT '0',
`email_admins_about_new_members` tinyint(1) DEFAULT '0',
`use_fb_like` tinyint(1) DEFAULT '0',
`real_name_required` tinyint(1) DEFAULT '1',
`automatic_newsletters` tinyint(1) DEFAULT '1',
`join_with_invite_only` tinyint(1) DEFAULT '0',
`allowed_emails` mediumtext,
`users_can_invite_new_users` tinyint(1) DEFAULT '1',
`private` tinyint(1) DEFAULT '0',
`label` varchar(255) DEFAULT NULL,
`show_date_in_listings_list` tinyint(1) DEFAULT '0',
`all_users_can_add_news` tinyint(1) DEFAULT '1',
`custom_frontpage_sidebar` tinyint(1) DEFAULT '0',
`event_feed_enabled` tinyint(1) DEFAULT '1',
`slogan` varchar(255) DEFAULT NULL,
`description` text,
`country` varchar(255) DEFAULT NULL,
`members_count` int DEFAULT '0',
`user_limit` int DEFAULT NULL,
`monthly_price_in_euros` float DEFAULT NULL,
`logo_file_name` varchar(255) DEFAULT NULL,
`logo_content_type` varchar(255) DEFAULT NULL,
`logo_file_size` int DEFAULT NULL,
`logo_updated_at` datetime DEFAULT NULL,
`cover_photo_file_name` varchar(255) DEFAULT NULL,
`cover_photo_content_type` varchar(255) DEFAULT NULL,
`cover_photo_file_size` int DEFAULT NULL,
`cover_photo_updated_at` datetime DEFAULT NULL,
`small_cover_photo_file_name` varchar(255) DEFAULT NULL,
`small_cover_photo_content_type` varchar(255) DEFAULT NULL,
`small_cover_photo_file_size` int DEFAULT NULL,
`small_cover_photo_updated_at` datetime DEFAULT NULL,
`custom_color1` varchar(255) DEFAULT NULL,
`custom_color2` varchar(255) DEFAULT NULL,
`slogan_color` varchar(6) DEFAULT NULL,
`description_color` varchar(6) DEFAULT NULL,
`stylesheet_url` varchar(255) DEFAULT NULL,
`stylesheet_needs_recompile` tinyint(1) DEFAULT '0',
`service_logo_style` varchar(255) DEFAULT 'full-logo',
`currency` varchar(3) NOT NULL,
`facebook_connect_enabled` tinyint(1) DEFAULT '1',
`minimum_price_cents` int DEFAULT NULL,
`hide_expiration_date` tinyint(1) DEFAULT '1',
`facebook_connect_id` varchar(255) DEFAULT NULL,
`facebook_connect_secret` varchar(255) DEFAULT NULL,
`google_analytics_key` varchar(255) DEFAULT NULL,
`google_maps_key` varchar(64) DEFAULT NULL,
`name_display_type` varchar(255) DEFAULT 'first_name_with_initial',
`twitter_handle` varchar(255) DEFAULT NULL,
`use_community_location_as_default` tinyint(1) DEFAULT '0',
`preproduction_stylesheet_url` varchar(255) DEFAULT NULL,
`show_category_in_listing_list` tinyint(1) DEFAULT '0',
`default_browse_view` varchar(255) DEFAULT 'grid',
`wide_logo_file_name` varchar(255) DEFAULT NULL,
`wide_logo_content_type` varchar(255) DEFAULT NULL,
`wide_logo_file_size` int DEFAULT NULL,
`wide_logo_updated_at` datetime DEFAULT NULL,
`listing_comments_in_use` tinyint(1) DEFAULT '0',
`show_listing_publishing_date` tinyint(1) DEFAULT '0',
`require_verification_to_post_listings` tinyint(1) DEFAULT '0',
`show_price_filter` tinyint(1) DEFAULT '0',
`price_filter_min` int DEFAULT '0',
`price_filter_max` int DEFAULT '100000',
`automatic_confirmation_after_days` int DEFAULT '14',
`favicon_file_name` varchar(255) DEFAULT NULL,
`favicon_content_type` varchar(255) DEFAULT NULL,
`favicon_file_size` int DEFAULT NULL,
`favicon_updated_at` datetime DEFAULT NULL,
`default_min_days_between_community_updates` int DEFAULT '7',
`listing_location_required` tinyint(1) DEFAULT '0',
`custom_head_script` text,
`follow_in_use` tinyint(1) NOT NULL DEFAULT '1',
`logo_processing` tinyint(1) DEFAULT NULL,
`wide_logo_processing` tinyint(1) DEFAULT NULL,
`cover_photo_processing` tinyint(1) DEFAULT NULL,
`small_cover_photo_processing` tinyint(1) DEFAULT NULL,
`favicon_processing` tinyint(1) DEFAULT NULL,
`deleted` tinyint(1) DEFAULT NULL,
`end_user_analytics` tinyint(1) DEFAULT '1',
`show_slogan` tinyint(1) DEFAULT '1',
`show_description` tinyint(1) DEFAULT '1',
`footer_theme` int DEFAULT '0',
`footer_copyright` text,
`footer_enabled` tinyint(1) DEFAULT '0',
`hsts_max_age` int DEFAULT NULL,
`logo_link` varchar(255) DEFAULT NULL,
`google_connect_enabled` tinyint(1) DEFAULT NULL,
`google_connect_id` varchar(255) DEFAULT NULL,
`google_connect_secret` varchar(255) DEFAULT NULL,
`linkedin_connect_enabled` tinyint(1) DEFAULT NULL,
`linkedin_connect_id` varchar(255) DEFAULT NULL,
`linkedin_connect_secret` varchar(255) DEFAULT NULL,
`pre_approved_listings` tinyint(1) DEFAULT '0',
`allow_free_conversations` tinyint(1) DEFAULT '1',
`email_admins_about_new_transactions` tinyint(1) DEFAULT '0',
`show_location` tinyint(1) DEFAULT '1',
`fuzzy_location` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `index_communities_on_uuid` (`uuid`),
KEY `index_communities_on_domain` (`domain`),
KEY `index_communities_on_ident` (`ident`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `community_customizations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `community_customizations` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int DEFAULT NULL,
`locale` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`slogan` varchar(255) DEFAULT NULL,
`description` text,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`blank_slate` text,
`welcome_email_content` text,
`how_to_use_page_content` mediumtext,
`about_page_content` mediumtext,
`terms_page_content` mediumtext,
`privacy_page_content` mediumtext,
`signup_info_content` text,
`private_community_homepage_content` mediumtext,
`verification_to_post_listings_info_content` mediumtext,
`search_placeholder` varchar(255) DEFAULT NULL,
`transaction_agreement_label` varchar(255) DEFAULT NULL,
`transaction_agreement_content` mediumtext,
`social_media_title` varchar(255) DEFAULT NULL,
`social_media_description` text,
`meta_title` varchar(255) DEFAULT NULL,
`meta_description` text,
`search_meta_title` varchar(255) DEFAULT NULL,
`search_meta_description` text,
`listing_meta_title` varchar(255) DEFAULT NULL,
`listing_meta_description` text,
`category_meta_title` varchar(255) DEFAULT NULL,
`category_meta_description` text,
`profile_meta_title` varchar(255) DEFAULT NULL,
`profile_meta_description` text,
PRIMARY KEY (`id`),
KEY `index_community_customizations_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `community_memberships`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `community_memberships` (
`id` int NOT NULL AUTO_INCREMENT,
`person_id` varchar(255) NOT NULL,
`community_id` int NOT NULL,
`admin` tinyint(1) DEFAULT '0',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`consent` varchar(255) DEFAULT NULL,
`invitation_id` int DEFAULT NULL,
`last_page_load_date` datetime DEFAULT NULL,
`status` varchar(255) NOT NULL DEFAULT 'accepted',
`can_post_listings` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `index_community_memberships_on_person_id` (`person_id`),
KEY `index_community_memberships_on_community_id` (`community_id`),
KEY `community_person_status` (`community_id`,`person_id`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `community_social_logos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `community_social_logos` (
`id` bigint NOT NULL AUTO_INCREMENT,
`community_id` bigint DEFAULT NULL,
`image_file_name` varchar(255) DEFAULT NULL,
`image_content_type` varchar(255) DEFAULT NULL,
`image_file_size` int DEFAULT NULL,
`image_updated_at` datetime DEFAULT NULL,
`image_processing` tinyint(1) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_community_social_logos_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `community_translations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `community_translations` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`locale` varchar(16) NOT NULL,
`translation_key` varchar(255) NOT NULL,
`translation` text,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_community_translations_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `contact_requests`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `contact_requests` (
`id` int NOT NULL AUTO_INCREMENT,
`email` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`plan_type` varchar(255) DEFAULT NULL,
`marketplace_type` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `conversations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `conversations` (
`id` int NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`listing_id` int DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`last_message_at` datetime DEFAULT NULL,
`community_id` int DEFAULT NULL,
`starting_page` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_conversations_on_listing_id` (`listing_id`),
KEY `index_conversations_on_community_id` (`community_id`),
KEY `index_conversations_on_last_message_at` (`last_message_at`),
KEY `index_conversations_on_starting_page` (`starting_page`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `custom_field_names`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `custom_field_names` (
`id` int NOT NULL AUTO_INCREMENT,
`value` varchar(255) DEFAULT NULL,
`locale` varchar(255) DEFAULT NULL,
`custom_field_id` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_custom_field_names_on_custom_field_id` (`custom_field_id`),
KEY `locale_index` (`custom_field_id`,`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `custom_field_option_selections`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `custom_field_option_selections` (
`id` int NOT NULL AUTO_INCREMENT,
`custom_field_value_id` int DEFAULT NULL,
`custom_field_option_id` int DEFAULT NULL,
`listing_id` int DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_selected_options_on_custom_field_value_id` (`custom_field_value_id`),
KEY `index_custom_field_option_selections_on_custom_field_option_id` (`custom_field_option_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `custom_field_option_titles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `custom_field_option_titles` (
`id` int NOT NULL AUTO_INCREMENT,
`value` varchar(255) DEFAULT NULL,
`locale` varchar(255) DEFAULT NULL,
`custom_field_option_id` int DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_custom_field_option_titles_on_custom_field_option_id` (`custom_field_option_id`),
KEY `locale_index` (`custom_field_option_id`,`locale`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `custom_field_options`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `custom_field_options` (
`id` int NOT NULL AUTO_INCREMENT,
`custom_field_id` int DEFAULT NULL,
`sort_priority` int DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_custom_field_options_on_custom_field_id` (`custom_field_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `custom_field_values`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `custom_field_values` (
`id` int NOT NULL AUTO_INCREMENT,
`custom_field_id` int DEFAULT NULL,
`listing_id` int DEFAULT NULL,
`text_value` text,
`numeric_value` float DEFAULT NULL,
`date_value` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`type` varchar(255) DEFAULT NULL,
`delta` tinyint(1) NOT NULL DEFAULT '1',
`person_id` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_custom_field_values_on_listing_id` (`listing_id`),
KEY `index_custom_field_values_on_type` (`type`),
KEY `index_custom_field_values_on_person_id` (`person_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `custom_fields`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `custom_fields` (
`id` int NOT NULL AUTO_INCREMENT,
`type` varchar(255) DEFAULT NULL,
`sort_priority` int DEFAULT NULL,
`search_filter` tinyint(1) NOT NULL DEFAULT '1',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`community_id` int DEFAULT NULL,
`required` tinyint(1) DEFAULT '1',
`min` float DEFAULT NULL,
`max` float DEFAULT NULL,
`allow_decimals` tinyint(1) DEFAULT '0',
`entity_type` int DEFAULT '0',
`public` tinyint(1) DEFAULT '0',
`assignment` int DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_custom_fields_on_community_id` (`community_id`),
KEY `index_custom_fields_on_search_filter` (`search_filter`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `delayed_jobs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `delayed_jobs` (
`id` int NOT NULL AUTO_INCREMENT,
`priority` int DEFAULT '0',
`attempts` int DEFAULT '0',
`handler` text,
`last_error` text,
`run_at` datetime DEFAULT NULL,
`locked_at` datetime DEFAULT NULL,
`failed_at` datetime DEFAULT NULL,
`locked_by` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`queue` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `delayed_jobs_priority` (`priority`,`run_at`),
KEY `index_delayed_jobs_on_locked_created` (`locked_at`,`created_at`),
KEY `index_delayed_jobs_on_attempts_and_run_at_and_priority` (`attempts`,`run_at`,`priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `domain_setups`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `domain_setups` (
`id` bigint NOT NULL AUTO_INCREMENT,
`community_id` bigint DEFAULT NULL,
`domain` varchar(255) NOT NULL,
`state` varchar(255) NOT NULL,
`error` varchar(255) DEFAULT NULL,
`critical_error` tinyint(1) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_domain_setups_on_domain` (`domain`),
UNIQUE KEY `index_domain_setups_on_community_id` (`community_id`),
KEY `index_domain_setups_on_state_and_updated_at` (`state`,`updated_at`),
KEY `index_domain_setups_on_critical_error` (`critical_error`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `emails`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `emails` (
`id` int NOT NULL AUTO_INCREMENT,
`person_id` varchar(255) DEFAULT NULL,
`community_id` int NOT NULL,
`address` varchar(255) NOT NULL,
`confirmed_at` datetime DEFAULT NULL,
`confirmation_sent_at` datetime DEFAULT NULL,
`confirmation_token` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`send_notifications` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_emails_on_address_and_community_id` (`address`,`community_id`),
KEY `index_emails_on_person_id` (`person_id`),
KEY `index_emails_on_address` (`address`),
KEY `index_emails_on_community_id` (`community_id`),
KEY `index_emails_on_confirmation_token` (`confirmation_token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `export_task_results`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `export_task_results` (
`id` int NOT NULL AUTO_INCREMENT,
`status` varchar(255) DEFAULT NULL,
`token` varchar(255) DEFAULT NULL,
`file_file_name` varchar(255) DEFAULT NULL,
`file_content_type` varchar(255) DEFAULT NULL,
`file_file_size` int DEFAULT NULL,
`file_updated_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `feature_flags`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `feature_flags` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`person_id` varchar(255) DEFAULT NULL,
`feature` varchar(255) NOT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '1',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_feature_flags_on_community_id_and_person_id` (`community_id`,`person_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `feedbacks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `feedbacks` (
`id` int NOT NULL AUTO_INCREMENT,
`content` text,
`author_id` varchar(255) DEFAULT NULL,
`url` varchar(2048) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`is_handled` int DEFAULT '0',
`email` varchar(255) DEFAULT NULL,
`community_id` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `follower_relationships`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `follower_relationships` (
`id` int NOT NULL AUTO_INCREMENT,
`person_id` varchar(255) NOT NULL,
`follower_id` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_follower_relationships_on_person_id_and_follower_id` (`person_id`,`follower_id`),
KEY `index_follower_relationships_on_person_id` (`person_id`),
KEY `index_follower_relationships_on_follower_id` (`follower_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `invitation_unsubscribes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invitation_unsubscribes` (
`id` bigint NOT NULL AUTO_INCREMENT,
`community_id` int DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_invitation_unsubscribes_on_community_id` (`community_id`),
KEY `index_invitation_unsubscribes_on_email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `invitations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invitations` (
`id` int NOT NULL AUTO_INCREMENT,
`code` varchar(255) DEFAULT NULL,
`community_id` int DEFAULT NULL,
`usages_left` int DEFAULT NULL,
`valid_until` datetime DEFAULT NULL,
`information` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`inviter_id` varchar(255) DEFAULT NULL,
`message` text,
`email` varchar(255) DEFAULT NULL,
`deleted` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_invitations_on_inviter_id` (`inviter_id`),
KEY `index_invitations_on_code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `landing_page_versions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `landing_page_versions` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`version` int NOT NULL,
`released` datetime DEFAULT NULL,
`content` mediumtext NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_landing_page_versions_on_community_id_and_version` (`community_id`,`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `landing_pages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `landing_pages` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '0',
`released_version` int DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_landing_pages_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `listing_blocked_dates`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `listing_blocked_dates` (
`id` bigint NOT NULL AUTO_INCREMENT,
`listing_id` bigint DEFAULT NULL,
`blocked_at` date DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_listing_blocked_dates_on_listing_id_and_blocked_at` (`listing_id`,`blocked_at`),
KEY `index_listing_blocked_dates_on_listing_id` (`listing_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `listing_followers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `listing_followers` (
`person_id` varchar(255) DEFAULT NULL,
`listing_id` int DEFAULT NULL,
KEY `index_listing_followers_on_listing_id` (`listing_id`),
KEY `index_listing_followers_on_person_id` (`person_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `listing_images`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `listing_images` (
`id` int NOT NULL AUTO_INCREMENT,
`listing_id` int DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`image_file_name` varchar(255) DEFAULT NULL,
`image_content_type` varchar(255) DEFAULT NULL,
`image_file_size` int DEFAULT NULL,
`image_updated_at` datetime DEFAULT NULL,
`image_processing` tinyint(1) DEFAULT NULL,
`image_downloaded` tinyint(1) DEFAULT '0',
`error` varchar(255) DEFAULT NULL,
`width` int DEFAULT NULL,
`height` int DEFAULT NULL,
`author_id` varchar(255) DEFAULT NULL,
`position` int DEFAULT '0',
`email_image_file_name` varchar(255) DEFAULT NULL,
`email_image_content_type` varchar(255) DEFAULT NULL,
`email_image_file_size` int DEFAULT NULL,
`email_image_updated_at` datetime DEFAULT NULL,
`email_hash` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_listing_images_on_listing_id` (`listing_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `listing_shapes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `listing_shapes` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`transaction_process_id` int NOT NULL,
`price_enabled` tinyint(1) NOT NULL,
`shipping_enabled` tinyint(1) NOT NULL,
`availability` varchar(32) DEFAULT 'none',
`name` varchar(255) NOT NULL,
`name_tr_key` varchar(255) NOT NULL,
`action_button_tr_key` varchar(255) NOT NULL,
`sort_priority` int NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`deleted` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_listing_shapes_on_community_id` (`community_id`),
KEY `index_listing_shapes_on_name` (`name`),
KEY `multicol_index` (`community_id`,`deleted`,`sort_priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `listing_units`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `listing_units` (
`id` int NOT NULL AUTO_INCREMENT,
`unit_type` varchar(32) NOT NULL,
`quantity_selector` varchar(32) NOT NULL,
`kind` varchar(32) NOT NULL,
`name_tr_key` varchar(64) DEFAULT NULL,
`selector_tr_key` varchar(64) DEFAULT NULL,
`listing_shape_id` int DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_listing_units_on_listing_shape_id` (`listing_shape_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `listing_working_time_slots`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `listing_working_time_slots` (
`id` bigint NOT NULL AUTO_INCREMENT,
`listing_id` int DEFAULT NULL,
`week_day` int DEFAULT NULL,
`from` varchar(255) DEFAULT NULL,
`till` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_listing_working_time_slots_on_listing_id` (`listing_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `listings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `listings` (
`id` int NOT NULL AUTO_INCREMENT,
`uuid` binary(16) NOT NULL,
`community_id` int NOT NULL,
`author_id` varchar(255) DEFAULT NULL,
`category_old` varchar(255) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`times_viewed` int DEFAULT '0',
`language` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updates_email_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`last_modified` datetime DEFAULT NULL,
`sort_date` datetime DEFAULT NULL,
`listing_type_old` varchar(255) DEFAULT NULL,
`description` text,
`origin` varchar(255) DEFAULT NULL,
`destination` varchar(255) DEFAULT NULL,
`valid_until` datetime DEFAULT NULL,
`delta` tinyint(1) NOT NULL DEFAULT '1',
`open` tinyint(1) DEFAULT '1',
`share_type_old` varchar(255) DEFAULT NULL,
`privacy` varchar(255) DEFAULT 'private',
`comments_count` int DEFAULT '0',
`subcategory_old` varchar(255) DEFAULT NULL,
`old_category_id` int DEFAULT NULL,
`category_id` int DEFAULT NULL,
`share_type_id` int DEFAULT NULL,
`listing_shape_id` int DEFAULT NULL,
`transaction_process_id` int DEFAULT NULL,
`shape_name_tr_key` varchar(255) DEFAULT NULL,
`action_button_tr_key` varchar(255) DEFAULT NULL,
`price_cents` int DEFAULT NULL,
`currency` varchar(255) DEFAULT NULL,
`quantity` varchar(255) DEFAULT NULL,
`unit_type` varchar(32) DEFAULT NULL,
`quantity_selector` varchar(32) DEFAULT NULL,
`unit_tr_key` varchar(64) DEFAULT NULL,
`unit_selector_tr_key` varchar(64) DEFAULT NULL,
`deleted` tinyint(1) DEFAULT '0',
`require_shipping_address` tinyint(1) DEFAULT '0',
`pickup_enabled` tinyint(1) DEFAULT '0',
`shipping_price_cents` int DEFAULT NULL,
`shipping_price_additional_cents` int DEFAULT NULL,
`availability` varchar(32) DEFAULT 'none',
`per_hour_ready` tinyint(1) DEFAULT '0',
`state` varchar(255) DEFAULT 'approved',
`approval_count` int DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `index_listings_on_uuid` (`uuid`),
KEY `index_listings_on_open` (`open`),
KEY `index_listings_on_category_id` (`old_category_id`),
KEY `index_listings_on_listing_shape_id` (`listing_shape_id`),
KEY `index_listings_on_new_category_id` (`category_id`),
KEY `index_listings_on_community_id` (`community_id`),
KEY `person_listings` (`community_id`,`author_id`),
KEY `index_on_author_id_and_deleted` (`author_id`,`deleted`),
KEY `community_author_deleted` (`community_id`,`author_id`,`deleted`),
KEY `index_listings_on_state` (`state`),
KEY `listings_homepage_query` (`community_id`,`open`,`state`,`deleted`,`valid_until`,`sort_date`),
KEY `listings_updates_email` (`community_id`,`open`,`state`,`deleted`,`valid_until`,`updates_email_at`,`created_at`),
KEY `tmp_homepage_query` (`community_id`,`open`,`valid_until`,`sort_date`,`deleted`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `locations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `locations` (
`id` int NOT NULL AUTO_INCREMENT,
`latitude` float DEFAULT NULL,
`longitude` float DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`google_address` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`listing_id` int DEFAULT NULL,
`person_id` varchar(255) DEFAULT NULL,
`location_type` varchar(255) DEFAULT NULL,
`community_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_locations_on_person_id` (`person_id`),
KEY `index_locations_on_listing_id` (`listing_id`),
KEY `index_locations_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `marketplace_configurations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `marketplace_configurations` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`main_search` varchar(255) NOT NULL DEFAULT 'keyword',
`distance_unit` varchar(255) NOT NULL DEFAULT 'metric',
`limit_priority_links` int DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`limit_search_distance` tinyint(1) NOT NULL DEFAULT '1',
`display_about_menu` tinyint(1) DEFAULT '1',
`display_contact_menu` tinyint(1) DEFAULT '1',
`display_invite_menu` tinyint(1) DEFAULT '1',
PRIMARY KEY (`id`),
KEY `index_marketplace_configurations_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `marketplace_plans`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `marketplace_plans` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`status` varchar(22) DEFAULT NULL,
`features` text,
`member_limit` int DEFAULT NULL,
`expires_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_marketplace_plans_on_community_id` (`community_id`),
KEY `index_marketplace_plans_on_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `marketplace_sender_emails`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `marketplace_sender_emails` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`name` varchar(255) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`verification_status` varchar(32) NOT NULL,
`verification_requested_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_marketplace_sender_emails_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `marketplace_setup_steps`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `marketplace_setup_steps` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`slogan_and_description` tinyint(1) NOT NULL DEFAULT '0',
`cover_photo` tinyint(1) NOT NULL DEFAULT '0',
`filter` tinyint(1) NOT NULL DEFAULT '0',
`paypal` tinyint(1) NOT NULL DEFAULT '0',
`listing` tinyint(1) NOT NULL DEFAULT '0',
`invitation` tinyint(1) NOT NULL DEFAULT '0',
`payment` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `index_marketplace_setup_steps_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `marketplace_trials`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `marketplace_trials` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`expires_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_marketplace_trials_on_community_id` (`community_id`),
KEY `index_marketplace_trials_on_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `menu_link_translations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `menu_link_translations` (
`id` int NOT NULL AUTO_INCREMENT,
`menu_link_id` int DEFAULT NULL,
`locale` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_menu_link_translations_on_menu_link_id` (`menu_link_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `menu_links`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `menu_links` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`sort_priority` int DEFAULT '0',
`entity_type` int DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_menu_links_on_community_and_sort` (`community_id`,`sort_priority`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `mercury_images`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `mercury_images` (
`id` int NOT NULL AUTO_INCREMENT,
`image_file_name` varchar(255) DEFAULT NULL,
`image_content_type` varchar(255) DEFAULT NULL,
`image_file_size` int DEFAULT NULL,
`image_updated_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `messages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `messages` (
`id` int NOT NULL AUTO_INCREMENT,
`sender_id` varchar(255) DEFAULT NULL,
`content` text,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`conversation_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_messages_on_conversation_id` (`conversation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `order_permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `order_permissions` (
`id` int NOT NULL AUTO_INCREMENT,
`paypal_account_id` int NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`request_token` varchar(255) DEFAULT NULL,
`paypal_username_to` varchar(255) NOT NULL,
`scope` varchar(255) DEFAULT NULL,
`verification_code` varchar(255) DEFAULT NULL,
`onboarding_id` varchar(36) DEFAULT NULL,
`permissions_granted` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_order_permissions_on_paypal_account_id` (`paypal_account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `participations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `participations` (
`id` int NOT NULL AUTO_INCREMENT,
`person_id` varchar(255) DEFAULT NULL,
`conversation_id` int DEFAULT NULL,
`is_read` tinyint(1) DEFAULT '0',
`is_starter` tinyint(1) DEFAULT '0',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`last_sent_at` datetime DEFAULT NULL,
`last_received_at` datetime DEFAULT NULL,
`feedback_skipped` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_participations_on_person_id` (`person_id`),
KEY `index_participations_on_conversation_id` (`conversation_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `payment_settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `payment_settings` (
`id` int NOT NULL AUTO_INCREMENT,
`active` tinyint(1) NOT NULL,
`community_id` int NOT NULL,
`payment_gateway` varchar(64) DEFAULT NULL,
`payment_process` varchar(64) DEFAULT NULL,
`commission_from_seller` int DEFAULT NULL,
`minimum_price_cents` int DEFAULT NULL,
`minimum_price_currency` varchar(3) DEFAULT NULL,
`minimum_transaction_fee_cents` int DEFAULT NULL,
`minimum_transaction_fee_currency` varchar(3) DEFAULT NULL,
`confirmation_after_days` int NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`api_client_id` varchar(255) DEFAULT NULL,
`api_private_key` varchar(255) DEFAULT NULL,
`api_publishable_key` varchar(255) DEFAULT NULL,
`api_verified` tinyint(1) DEFAULT NULL,
`api_visible_private_key` varchar(255) DEFAULT NULL,
`api_country` varchar(255) DEFAULT NULL,
`commission_from_buyer` int DEFAULT NULL,
`minimum_buyer_transaction_fee_cents` int DEFAULT NULL,
`minimum_buyer_transaction_fee_currency` varchar(3) DEFAULT NULL,
`key_encryption_padding` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_payment_settings_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `paypal_accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `paypal_accounts` (
`id` int NOT NULL AUTO_INCREMENT,
`person_id` varchar(255) DEFAULT NULL,
`community_id` int DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`payer_id` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`active` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_paypal_accounts_on_community_id` (`community_id`),
KEY `index_paypal_accounts_on_payer_id` (`payer_id`),
KEY `index_paypal_accounts_on_person_id` (`person_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `paypal_ipn_messages`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `paypal_ipn_messages` (
`id` int NOT NULL AUTO_INCREMENT,
`body` text,
`status` varchar(64) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `paypal_payments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `paypal_payments` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`transaction_id` int NOT NULL,
`payer_id` varchar(64) NOT NULL,
`receiver_id` varchar(64) NOT NULL,
`merchant_id` varchar(255) NOT NULL,
`order_id` varchar(64) DEFAULT NULL,
`order_date` datetime DEFAULT NULL,
`currency` varchar(8) NOT NULL,
`order_total_cents` int DEFAULT NULL,
`authorization_id` varchar(64) DEFAULT NULL,
`authorization_date` datetime DEFAULT NULL,
`authorization_expires_date` datetime DEFAULT NULL,
`authorization_total_cents` int DEFAULT NULL,
`payment_id` varchar(64) DEFAULT NULL,
`payment_date` datetime DEFAULT NULL,
`payment_total_cents` int DEFAULT NULL,
`fee_total_cents` int DEFAULT NULL,
`payment_status` varchar(64) NOT NULL,
`pending_reason` varchar(64) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`commission_payment_id` varchar(64) DEFAULT NULL,
`commission_payment_date` datetime DEFAULT NULL,
`commission_status` varchar(64) NOT NULL DEFAULT 'not_charged',
`commission_pending_reason` varchar(64) DEFAULT NULL,
`commission_total_cents` int DEFAULT NULL,
`commission_fee_total_cents` int DEFAULT NULL,
`commission_retry_count` int DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `index_paypal_payments_on_transaction_id` (`transaction_id`),
UNIQUE KEY `index_paypal_payments_on_order_id` (`order_id`),
UNIQUE KEY `index_paypal_payments_on_authorization_id` (`authorization_id`),
KEY `index_paypal_payments_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `paypal_process_tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `paypal_process_tokens` (
`id` int NOT NULL AUTO_INCREMENT,
`process_token` varchar(64) NOT NULL,
`community_id` int NOT NULL,
`transaction_id` int NOT NULL,
`op_completed` tinyint(1) NOT NULL DEFAULT '0',
`op_name` varchar(64) NOT NULL,
`op_input` text,
`op_output` text,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_paypal_process_tokens_on_process_token` (`process_token`),
UNIQUE KEY `index_paypal_process_tokens_on_transaction` (`transaction_id`,`community_id`,`op_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `paypal_refunds`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `paypal_refunds` (
`id` int NOT NULL AUTO_INCREMENT,
`paypal_payment_id` int DEFAULT NULL,
`currency` varchar(8) DEFAULT NULL,
`payment_total_cents` int DEFAULT NULL,
`fee_total_cents` int DEFAULT NULL,
`refunding_id` varchar(64) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_paypal_refunds_on_refunding_id` (`refunding_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `paypal_tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `paypal_tokens` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int NOT NULL,
`token` varchar(64) DEFAULT NULL,
`transaction_id` int DEFAULT NULL,
`payment_action` varchar(32) DEFAULT NULL,
`merchant_id` varchar(255) NOT NULL,
`receiver_id` varchar(255) NOT NULL,
`created_at` datetime DEFAULT NULL,
`item_name` varchar(255) DEFAULT NULL,
`item_quantity` int DEFAULT NULL,
`item_price_cents` int DEFAULT NULL,
`currency` varchar(8) DEFAULT NULL,
`express_checkout_url` varchar(255) DEFAULT NULL,
`shipping_total_cents` int DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_paypal_tokens_on_token` (`token`),
KEY `index_paypal_tokens_on_community_id` (`community_id`),
KEY `index_paypal_tokens_on_transaction_id` (`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `people`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `people` (
`id` varchar(22) NOT NULL,
`uuid` binary(16) NOT NULL,
`community_id` int NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`is_admin` int DEFAULT '0',
`locale` varchar(255) DEFAULT 'fi',
`preferences` text,
`active_days_count` int DEFAULT '0',
`last_page_load_date` datetime DEFAULT NULL,
`test_group_number` int DEFAULT '1',
`username` varchar(255) NOT NULL,
`email` varchar(255) DEFAULT NULL,
`encrypted_password` varchar(255) NOT NULL DEFAULT '',
`legacy_encrypted_password` varchar(255) DEFAULT NULL,
`reset_password_token` varchar(255) DEFAULT NULL,
`reset_password_sent_at` datetime DEFAULT NULL,
`remember_created_at` datetime DEFAULT NULL,
`sign_in_count` int DEFAULT '0',
`current_sign_in_at` datetime DEFAULT NULL,
`last_sign_in_at` datetime DEFAULT NULL,
`current_sign_in_ip` varchar(255) DEFAULT NULL,
`last_sign_in_ip` varchar(255) DEFAULT NULL,
`password_salt` varchar(255) DEFAULT NULL,
`given_name` varchar(255) DEFAULT NULL,
`family_name` varchar(255) DEFAULT NULL,
`display_name` varchar(255) DEFAULT NULL,
`phone_number` varchar(255) DEFAULT NULL,
`description` text,
`image_file_name` varchar(255) DEFAULT NULL,
`image_content_type` varchar(255) DEFAULT NULL,
`image_file_size` int DEFAULT NULL,
`image_updated_at` datetime DEFAULT NULL,
`image_processing` tinyint(1) DEFAULT NULL,
`facebook_id` varchar(255) DEFAULT NULL,
`authentication_token` varchar(255) DEFAULT NULL,
`community_updates_last_sent_at` datetime DEFAULT NULL,
`min_days_between_community_updates` int DEFAULT '1',
`deleted` tinyint(1) DEFAULT '0',
`cloned_from` varchar(22) DEFAULT NULL,
`google_oauth2_id` varchar(255) DEFAULT NULL,
`linkedin_id` varchar(255) DEFAULT NULL,
UNIQUE KEY `index_people_on_username_and_community_id` (`username`,`community_id`),
UNIQUE KEY `index_people_on_uuid` (`uuid`),
UNIQUE KEY `index_people_on_email` (`email`),
UNIQUE KEY `index_people_on_reset_password_token` (`reset_password_token`),
UNIQUE KEY `index_people_on_facebook_id_and_community_id` (`facebook_id`,`community_id`),
KEY `index_people_on_id` (`id`),
KEY `index_people_on_authentication_token` (`authentication_token`),
KEY `index_people_on_username` (`username`),
KEY `index_people_on_community_id` (`community_id`),
KEY `index_people_on_facebook_id` (`facebook_id`),
KEY `index_people_on_google_oauth2_id` (`google_oauth2_id`),
KEY `index_people_on_community_id_and_google_oauth2_id` (`community_id`,`google_oauth2_id`),
KEY `index_people_on_linkedin_id` (`linkedin_id`),
KEY `index_people_on_community_id_and_linkedin_id` (`community_id`,`linkedin_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `schema_migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `schema_migrations` (
`version` varchar(255) NOT NULL,
UNIQUE KEY `unique_schema_migrations` (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `sessions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sessions` (
`id` int NOT NULL AUTO_INCREMENT,
`session_id` varchar(255) NOT NULL,
`data` text,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_sessions_on_session_id` (`session_id`),
KEY `index_sessions_on_updated_at` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `shipping_addresses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `shipping_addresses` (
`id` int NOT NULL AUTO_INCREMENT,
`transaction_id` int NOT NULL,
`status` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
`postal_code` varchar(255) DEFAULT NULL,
`city` varchar(255) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`state_or_province` varchar(255) DEFAULT NULL,
`street1` varchar(255) DEFAULT NULL,
`street2` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`country_code` varchar(8) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_shipping_addresses_on_transaction_id` (`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `social_links`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `social_links` (
`id` bigint NOT NULL AUTO_INCREMENT,
`community_id` int DEFAULT NULL,
`provider` int DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`sort_priority` int DEFAULT '0',
`enabled` tinyint(1) DEFAULT '0',
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_social_links_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `stripe_accounts`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `stripe_accounts` (
`id` bigint NOT NULL AUTO_INCREMENT,
`person_id` varchar(255) DEFAULT NULL,
`community_id` int DEFAULT NULL,
`stripe_seller_id` varchar(255) DEFAULT NULL,
`stripe_bank_id` varchar(255) DEFAULT NULL,
`stripe_customer_id` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`api_version` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_stripe_accounts_on_community_id` (`community_id`),
KEY `index_stripe_accounts_on_person_id` (`person_id`),
KEY `index_stripe_accounts_on_api_version` (`api_version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `stripe_payments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `stripe_payments` (
`id` bigint NOT NULL AUTO_INCREMENT,
`community_id` int DEFAULT NULL,
`transaction_id` int DEFAULT NULL,
`payer_id` varchar(255) DEFAULT NULL,
`receiver_id` varchar(255) DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`sum_cents` int DEFAULT NULL,
`commission_cents` int DEFAULT NULL,
`currency` varchar(255) DEFAULT NULL,
`stripe_charge_id` varchar(255) DEFAULT NULL,
`stripe_transfer_id` varchar(255) DEFAULT NULL,
`fee_cents` int DEFAULT NULL,
`real_fee_cents` int DEFAULT NULL,
`subtotal_cents` int DEFAULT NULL,
`transfered_at` datetime DEFAULT NULL,
`available_on` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`buyer_commission_cents` int DEFAULT '0',
`stripe_payment_intent_id` varchar(255) DEFAULT NULL,
`stripe_payment_intent_status` varchar(255) DEFAULT NULL,
`stripe_payment_intent_client_secret` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `testimonials`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `testimonials` (
`id` int NOT NULL AUTO_INCREMENT,
`grade` float DEFAULT NULL,
`text` text,
`author_id` varchar(255) DEFAULT NULL,
`participation_id` int DEFAULT NULL,
`transaction_id` int DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`receiver_id` varchar(255) DEFAULT NULL,
`blocked` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `index_testimonials_on_receiver_id` (`receiver_id`),
KEY `index_testimonials_on_transaction_id` (`transaction_id`),
KEY `index_testimonials_on_author_id` (`author_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `transaction_process_tokens`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transaction_process_tokens` (
`id` int NOT NULL AUTO_INCREMENT,
`process_token` binary(16) DEFAULT NULL,
`community_id` int NOT NULL,
`transaction_id` int NOT NULL,
`op_completed` tinyint(1) NOT NULL DEFAULT '0',
`op_name` varchar(64) NOT NULL,
`op_input` text,
`op_output` text,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_paypal_process_tokens_on_transaction` (`transaction_id`,`community_id`,`op_name`),
UNIQUE KEY `index_transaction_process_tokens_on_process_token` (`process_token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `transaction_processes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transaction_processes` (
`id` int NOT NULL AUTO_INCREMENT,
`community_id` int DEFAULT NULL,
`process` varchar(32) NOT NULL,
`author_is_seller` tinyint(1) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
KEY `index_transaction_process_on_community_id` (`community_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `transaction_transitions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transaction_transitions` (
`id` int NOT NULL AUTO_INCREMENT,
`to_state` varchar(255) DEFAULT NULL,
`metadata` text,
`sort_key` int DEFAULT '0',
`transaction_id` int DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`most_recent` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_transaction_transitions_on_sort_key_and_conversation_id` (`sort_key`,`transaction_id`),
KEY `index_transaction_transitions_on_conversation_id` (`transaction_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `transactions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transactions` (
`id` int NOT NULL AUTO_INCREMENT,
`starter_id` varchar(255) NOT NULL,
`starter_uuid` binary(16) NOT NULL,
`listing_id` int NOT NULL,
`listing_uuid` binary(16) NOT NULL,
`conversation_id` int DEFAULT NULL,
`automatic_confirmation_after_days` int NOT NULL,
`community_id` int NOT NULL,
`community_uuid` binary(16) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`starter_skipped_feedback` tinyint(1) DEFAULT '0',
`author_skipped_feedback` tinyint(1) DEFAULT '0',
`last_transition_at` datetime DEFAULT NULL,
`current_state` varchar(255) DEFAULT NULL,
`commission_from_seller` int DEFAULT NULL,
`minimum_commission_cents` int DEFAULT '0',
`minimum_commission_currency` varchar(255) DEFAULT NULL,
`payment_gateway` varchar(255) NOT NULL DEFAULT 'none',
`listing_quantity` int DEFAULT '1',
`listing_author_id` varchar(255) NOT NULL,
`listing_author_uuid` binary(16) NOT NULL,
`listing_title` varchar(255) DEFAULT NULL,
`unit_type` varchar(32) DEFAULT NULL,
`unit_price_cents` int DEFAULT NULL,
`unit_price_currency` varchar(8) DEFAULT NULL,
`unit_tr_key` varchar(64) DEFAULT NULL,
`unit_selector_tr_key` varchar(64) DEFAULT NULL,
`payment_process` varchar(31) DEFAULT 'none',
`delivery_method` varchar(31) DEFAULT 'none',
`shipping_price_cents` int DEFAULT NULL,
`availability` varchar(32) DEFAULT 'none',
`booking_uuid` binary(16) DEFAULT NULL,
`deleted` tinyint(1) DEFAULT '0',
`commission_from_buyer` int DEFAULT NULL,
`minimum_buyer_fee_cents` int DEFAULT '0',
`minimum_buyer_fee_currency` varchar(3) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_transactions_on_listing_id` (`listing_id`),
KEY `index_transactions_on_conversation_id` (`conversation_id`),
KEY `index_transactions_on_community_id` (`community_id`),
KEY `index_transactions_on_last_transition_at` (`last_transition_at`),
KEY `transactions_on_cid_and_deleted` (`community_id`,`deleted`),
KEY `index_transactions_on_deleted` (`deleted`),
KEY `index_transactions_on_starter_id` (`starter_id`),
KEY `index_transactions_on_listing_author_id` (`listing_author_id`),
KEY `community_starter_state` (`community_id`,`starter_id`,`current_state`),
KEY `index_transactions_on_listing_id_and_current_state` (`listing_id`,`current_state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
INSERT INTO `schema_migrations` (version) VALUES
('20080806070738'),
('20080807071903'),
('20080807080513'),
('20080808095031'),
('20080815075550'),
('20080818091109'),
('20080818092139'),
('20080821103835'),
('20080825064927'),
('20080825114546'),
('20080828104013'),
('20080828104239'),
('20080919122825'),
('20080925100643'),
('20080925100743'),
('20080925103547'),
('20080925103759'),
('20080925112423'),
('20080925114309'),
('20080929102121'),
('20081008115110'),
('20081009160751'),
('20081010114150'),
('20081024154431'),
('20081024182346'),
('20081024183444'),
('20081103092143'),
('20081104070403'),
('20081118145857'),
('20081121084337'),
('20081202140109'),
('20081205142238'),
('20081215145238'),
('20081216060503'),
('20090119114525'),
('20090218112317'),
('20090219094209'),
('20090225073742'),
('20090323121824'),
('20090330064443'),
('20090330070210'),
('20090330072036'),
('20090401181848'),
('20090401184511'),
('20090401185039'),
('20090402144456'),
('20090403093157'),
('20090406081353'),
('20090414142556'),
('20090415085812'),
('20090415130553'),
('20090415131023'),
('20090424093506'),
('20090424100145'),
('20090618112730'),
('20090629113838'),
('20090629131727'),
('20090701065350'),
('20090701110931'),
('20090713130351'),
('20090729124418'),
('20090730093917'),
('20090730094216'),
('20090731134028'),
('20090821075949'),
('20090904120242'),
('20090907155717'),
('20091006112446'),
('20091028095545'),
('20091028131201'),
('20091109161516'),
('20100322132547'),
('20100505110646'),
('20100707105549'),
('20100721120037'),
('20100721123825'),
('20100721124444'),
('20100726071811'),
('20100727102551'),
('20100727103659'),
('20100729112458'),
('20100729124210'),
('20100729141955'),
('20100729142416'),
('20100730120601'),
('20100730132825'),
('20100809090550'),
('20100809120502'),
('20100813161213'),
('20100817115816'),
('20100818102743'),
('20100819114104'),
('20100820122449'),
('20100902135234'),
('20100902142325'),
('20100908112841'),
('20100909105810'),
('20100909114132'),
('20100920075651'),
('20100921155612'),
('20100922081110'),
('20100922102321'),
('20100922122740'),
('20100923074241'),
('20100927150547'),
('20101007131610'),
('20101007131827'),
('20101013115208'),
('20101013124056'),
('20101026082126'),
('20101027103753'),
('20101028151541'),
('20101103154108'),
('20101103161641'),
('20101103163019'),
('20101109131431'),
('20101116105410'),
('20101124104905'),
('20101125150638'),
('20101126093026'),
('20101201105920'),
('20101201133429'),
('20101203115308'),
('20101203115634'),
('20101213152125'),
('20101216150725'),
('20101216151447'),
('20101216152952'),
('20110308172759'),
('20110308192757'),
('20110321103604'),
('20110322141439'),
('20110322151957'),
('20110325120932'),
('20110412075940'),
('20110414105702'),
('20110414124938'),
('20110421075758'),
('20110428134543'),
('20110529110417'),
('20110629135331'),
('20110704123058'),
('20110704144650'),
('20110707163036'),
('20110728110124'),
('20110808110217'),
('20110808161514'),
('20110817123457'),
('20110819111416'),
('20110819123636'),
('20110909072646'),
('20110912061834'),
('20110912064526'),
('20110912065222'),
('20110913080622'),
('20110914080549'),
('20110914115824'),
('20110915084232'),
('20110915101535'),
('20111111140246'),
('20111111154416'),
('20111111162432'),
('20111114122125'),
('20111114122315'),
('20111116144337'),
('20111116164728'),
('20111116182825'),
('20111123071116'),
('20111123071850'),
('20111124174508'),
('20111210165312'),
('20111210165854'),
('20111210170231'),
('20111211175403'),
('20111228153911'),
('20120104224115'),
('20120105162140'),
('20120113091548'),
('20120121091558'),
('20120206052931'),
('20120208145336'),
('20120210171827'),
('20120303113202'),
('20120303125412'),
('20120303152837'),
('20120303172713'),
('20120510094327'),
('20120510175152'),
('20120514001557'),
('20120514050302'),
('20120516204538'),
('20120518203511'),
('20120522162329'),
('20120522183329'),
('20120526021050'),
('20120614052244'),
('20120625211426'),
('20120628121713'),
('20120704072606'),
('20120705135703'),
('20120705140109'),
('20120710084323'),
('20120711140918'),
('20120718031225'),
('20120730024756'),
('20120907010347'),
('20120907023525'),
('20120908052908'),
('20120909143322'),
('20120929084903'),
('20120929091629'),
('20121023050946'),
('20121105115053'),
('20121203142830'),
('20121212145626'),
('20121214083430'),
('20121218125831'),
('20121220133808'),
('20121229224803'),
('20130103081705'),
('20130103125240'),
('20130103145816'),
('20130104071929'),
('20130104122958'),
('20130105153450'),
('20130107095027'),
('20130110222425'),
('20130123163722'),
('20130123164653'),
('20130124150000'),
('20130208085827'),
('20130212104852'),
('20130213150133'),
('20130213160145'),
('20130217121320'),
('20130218070405'),
('20130305095824'),
('20130306172327'),
('20130309142322'),
('20130317162509'),
('20130318083721'),
('20130318084043'),
('20130318085152'),
('20130319162158'),
('20130319163113'),
('20130320093549'),
('20130322171458'),
('20130323143126'),
('20130325143038'),
('20130325153817'),
('20130325161150'),
('20130325165508'),
('20130325174608'),
('20130325181741'),
('20130326160252'),
('20130328124654'),
('20130328155825'),
('20130329080756'),
('20130329081612'),
('20130331095134'),
('20130331144047'),
('20130331200801'),
('20130405114540'),
('20130418172231'),
('20130418173835'),
('20130423173017'),
('20130424180017'),
('20130424183653'),
('20130425140120'),
('20130514214222'),
('20130517133311'),
('20130520092054'),
('20130520092357'),
('20130520103753'),
('20130520125924'),
('20130520140756'),
('20130520172713'),
('20130521122031'),
('20130521124342'),
('20130521171401'),
('20130521225614'),
('20130531072349'),
('20130605074725'),
('20130607165451'),
('20130710084408'),
('20130718104939'),
('20130719093816'),
('20130719113330'),
('20130724065048'),
('20130724070139'),
('20130729081847'),
('20130807083847'),
('20130815072527'),
('20130815073546'),
('20130815075659'),
('20130815101112'),
('20130823110113'),
('20130902140027'),
('20130910133213'),
('20130917094727'),
('20130920121927'),
('20130925071631'),
('20130925081815'),
('20130926070322'),
('20130926121237'),
('20130930080143'),
('20131024081428'),
('20131028110133'),
('20131028154626'),
('20131028183014'),
('20131030130320'),
('20131031072301'),
('20131031093809'),
('20131101183938'),
('20131104090808'),
('20131107124835'),
('20131107125413'),
('20131108091824'),
('20131108113632'),
('20131108113650'),
('20131111140902'),
('20131112115307'),
('20131112115308'),
('20131112115435'),
('20131114112955'),
('20131119085439'),
('20131119085625'),
('20131122175753'),
('20131126113141'),
('20131126131750'),
('20131126134024'),
('20131126184439'),
('20131128074254'),
('20131128074910'),
('20131128094614'),
('20131128094758'),
('20131128094839'),
('20131128103251'),
('20131128143205'),
('20131129095727'),
('20131202140547'),
('20131203072124'),
('20131204091623'),
('20131204103910'),
('20131206163837'),
('20131209073416'),
('20131209133946'),
('20131210155502'),
('20131212065037'),
('20131214142413'),
('20131214143004'),
('20131214143005'),
('20131220084742'),
('20131220104804'),
('20131220104805'),
('20131227080454'),
('20131227081256'),
('20140102125702'),
('20140102141643'),
('20140102144755'),
('20140102145633'),
('20140102150134'),
('20140102153949'),
('20140103084331'),
('20140103131350'),
('20140106114557'),
('20140109091819'),
('20140109093432'),
('20140109143257'),
('20140109190928'),
('20140116131654'),
('20140123141906'),
('20140124095930'),
('20140124141214'),
('20140128094422'),
('20140128094642'),
('20140128095047'),
('20140129081030'),
('20140204082210'),
('20140205092212'),
('20140205101011'),
('20140205121010'),
('20140206103152'),
('20140207133412'),
('20140219160247'),
('20140219162023'),
('20140222080916'),
('20140223190922'),
('20140223202734'),
('20140223210213'),
('20140224150322'),
('20140224151953'),
('20140225143012'),
('20140226074348'),
('20140226074445'),
('20140226074710'),
('20140226074751'),
('20140226121423'),
('20140227102627'),
('20140228164206'),
('20140228164428'),
('20140228165024'),
('20140301074143'),
('20140303131213'),
('20140304135448'),
('20140306083247'),
('20140312145533'),
('20140312150455'),
('20140314132659'),
('20140318131351'),
('20140319182117'),
('20140324073247'),
('20140328124957'),
('20140328133415'),
('20140402070713'),
('20140402070714'),
('20140411121926'),
('20140415092507'),
('20140415093234'),
('20140417084647'),
('20140417085905'),
('20140417162548'),
('20140417235732'),
('20140422120515'),
('20140425080207'),
('20140425080603'),
('20140425080731'),
('20140425081001'),
('20140425111235'),
('20140428132517'),
('20140428134415'),
('20140507104933'),
('20140507105154'),
('20140509115747'),
('20140512062911'),
('20140516095154'),
('20140519102507'),
('20140519123344'),
('20140519132638'),
('20140519164823'),
('20140523082452'),
('20140526064017'),
('20140530105841'),
('20140530115044'),
('20140530115433'),
('20140604075725'),
('20140604135743'),
('20140610115132'),
('20140610115217'),
('20140611094552'),
('20140611094703'),
('20140612084036'),
('20140613132734'),
('20140623112935'),
('20140701081453'),
('20140701135724'),
('20140701140655'),
('20140703074142'),
('20140703075424'),
('20140710125950'),
('20140710131146'),
('20140711094414'),
('20140724084559'),
('20140724093459'),
('20140724123125'),
('20140805102757'),
('20140811133602'),
('20140811133603'),
('20140811133605'),
('20140811133606'),
('20140811144528'),
('20140812065415'),
('20140815055023'),
('20140815085018'),
('20140819054528'),
('20140819134039'),
('20140819134055'),
('20140820132249'),
('20140829075839'),
('20140829113807'),
('20140901082541'),
('20140901130206'),
('20140902095905'),
('20140903111344'),
('20140903112203'),
('20140903120109'),
('20140909074331'),
('20140912084032'),
('20140912115758'),
('20140925093828'),
('20140925095608'),
('20140925111706'),
('20140925112419'),
('20140929090537'),
('20140930064120'),
('20140930064130'),
('20140930064140'),
('20140930064150'),
('20140930064160'),
('20140930064170'),
('20140930064180'),
('20140930064185'),
('20140930064190'),
('20140930064200'),
('20140930074731'),
('20140930083026'),
('20141001065955'),
('20141001070716'),
('20141001113744'),
('20141003113756'),
('20141006100239'),
('20141006114330'),
('20141007144442'),
('20141009083833'),
('20141015062240'),
('20141015071419'),
('20141015080454'),
('20141015135248'),
('20141015135601'),
('20141015150328'),
('20141017080930'),
('20141020113323'),
('20141020225349'),
('20141022084419'),
('20141022190428'),
('20141023120743'),
('20141023141235'),
('20141023150700'),
('20141028080346'),
('20141028104522'),
('20141028104537'),
('20141029090632'),
('20141029121848'),
('20141029121945'),
('20141030140809'),
('20141102192640'),
('20141104213501'),
('20141111183125'),
('20141112131736'),
('20141113204444'),
('20141117165348'),
('20141203095726'),
('20141204084648'),
('20141205094929'),
('20141216132850'),
('20141216132851'),
('20141217152335'),
('20141218082446'),
('20141219205556'),
('20141222130455'),
('20150103143459'),
('20150107155205'),
('20150116125629'),
('20150121124432'),
('20150121130521'),
('20150128113129'),
('20150202112254'),
('20150204124735'),
('20150204124802'),
('20150205155400'),
('20150205155519'),
('20150206125017'),
('20150206151234'),
('20150212125111'),
('20150213091223'),
('20150213092629'),
('20150213094110'),
('20150224140913'),
('20150225081656'),
('20150225082144'),
('20150225122608'),
('20150226124214'),
('20150226130928'),
('20150226131628'),
('20150303134630'),
('20150303140556'),
('20150304074313'),
('20150304084451'),
('20150311073502'),
('20150311100232'),
('20150311111824'),
('20150311113118'),
('20150316084339'),
('20150316135852'),
('20150316140016'),
('20150316140637'),
('20150316151552'),
('20150316173800'),
('20150317080017'),
('20150317122824'),
('20150317142931'),
('20150319121616'),
('20150320091305'),
('20150320144657'),
('20150323085034'),
('20150323152147'),
('20150324072928'),
('20150324112018'),
('20150324112042'),
('20150324112053'),
('20150324112658'),
('20150324114726'),
('20150325164209'),
('20150327075649'),
('20150330072934'),
('20150330093441'),
('20150330094735'),
('20150331103317'),
('20150331105616'),
('20150331112417'),
('20150401071256'),
('20150401072129'),
('20150401140830'),
('20150402090934'),
('20150402111115'),
('20150403101215'),
('20150407123639'),
('20150407124816'),
('20150407130810'),
('20150407131139'),
('20150413104519'),
('20150413134627'),
('20150415092447'),
('20150416112541'),
('20150416134422'),
('20150420072530'),
('20150420083201'),
('20150426113955'),
('20150429155804'),
('20150507082447'),
('20150507084754'),
('20150507165715'),
('20150508141500'),
('20150512082544'),
('20150512083212'),
('20150512083411'),
('20150512083842'),
('20150518120830'),
('20150518123758'),
('20150519124846'),
('20150520104604'),
('20150520130243'),
('20150520131057'),
('20150527091815'),
('20150527133928'),
('20150528120338'),
('20150528120717'),
('20150608135024'),
('20150608140024'),
('20150608144130'),
('20150609084012'),
('20150612104320'),
('20150622080657'),
('20150630082932'),
('20150630122552'),
('20150729062045'),
('20150729062215'),
('20150731115141'),
('20150731115426'),
('20150731115742'),
('20150804113139'),
('20150804114651'),
('20150805084232'),
('20150806114405'),
('20150806114717'),
('20150807141947'),
('20150821131310'),
('20150821131616'),
('20150825120916'),
('20150825121715'),
('20150825122606'),
('20150828094836'),
('20150902090425'),
('20150902103231'),
('20151008090106'),
('20151008130725'),
('20151022180225'),
('20151022180242'),
('20151022183133'),
('20151102084029'),
('20151202062609'),
('20151204083028'),
('20151209102951'),
('20151215071150'),
('20151230071554'),
('20151230095128'),
('20151231083524'),
('20160119092239'),
('20160119092534'),
('20160120112839'),
('20160126134509'),
('20160126141249'),
('20160209172619'),
('20160209183917'),
('20160216084624'),
('20160223083004'),
('20160223084741'),
('20160229114242'),
('20160311070106'),
('20160322103154'),
('20160322103155'),
('20160322103156'),
('20160407103437'),
('20160407132641'),
('20160408061218'),
('20160408070000'),
('20160408070005'),
('20160420100304'),
('20160420200020'),
('20160420200030'),
('20160420200040'),
('20160420200050'),
('20160420200060'),
('20160420200065'),
('20160420200066'),
('20160420200080'),
('20160420200090'),
('20160420200100'),
('20160420200110'),
('20160422074608'),
('20160422075215'),
('20160422094212'),
('20160422094431'),
('20160422094536'),
('20160422114240'),
('20160422114747'),
('20160422123125'),
('20160422123211'),
('20160425144703'),
('20160427113446'),
('20160509111922'),
('20160511130006'),
('20160518060235'),
('20160608130531'),
('20160609070256'),
('20160609080700'),
('20160609081158'),
('20160614071055'),
('20160615145518'),
('20160627063918'),
('20160708084933'),
('20160728102918'),
('20160728130503'),
('20160816083020'),
('20160816083028'),
('20160816083349'),
('20160816083607'),
('20160816123633'),
('20160817130729'),
('20160817140558'),
('20160818090814'),
('20160818110351'),
('20160818111044'),
('20160818111724'),
('20160823073938'),
('20160823115429'),
('20160823120425'),
('20160823120704'),
('20160823120845'),
('20160831054404'),
('20160831054544'),
('20160831054909'),
('20160831054910'),
('20160902103712'),
('20160902104733'),
('20160907095103'),
('20160908091353'),
('20160913110411'),
('20160913112734'),
('20160914070509'),
('20160914071634'),
('20160914072428'),
('20160914072601'),
('20160920081409'),
('20160920102506'),
('20160920102507'),
('20160920103321'),
('20160921130544'),
('20160926111847'),
('20160928080048'),
('20160928080819'),
('20160929114326'),
('20160929124124'),
('20160930070122'),
('20161004141208'),
('20161006074506'),
('20161012132850'),
('20161018090313'),
('20161018090314'),
('20161018090517'),
('20161018093208'),
('20161018100657'),
('20161018105036'),
('20161018105521'),
('20161019125057'),
('20161023074355'),
('20161101104218'),
('20161101124317'),
('20161101124829'),
('20161102101418'),
('20161102101419'),
('20161102193340'),
('20161103063652'),
('20161107092030'),
('20161107105050'),
('20161107112025'),
('20161107131859'),
('20161107132513'),
('20161107141257'),
('20161109094513'),
('20170216134444'),
('20170220123526'),
('20170309104456'),
('20170313201104'),
('20170314075755'),
('20170613153959'),
('20170613153960'),
('20170613153961'),
('20170613153965'),
('20170616114938'),
('20170626065542'),
('20170801125553'),
('20170814125622'),
('20170817035830'),
('20171023070523'),
('20171107063241'),
('20171117062422'),
('20171128122539'),
('20171129152027'),
('20171207073027'),
('20171207075640'),
('20180108061342'),
('20180108093607'),
('20180514083133'),
('20180518073348'),
('20180523121344'),
('20180524075239'),
('20180524081429'),
('20180717122957'),
('20180720044534'),
('20180720065907'),
('20180723115548'),
('20180904075653'),
('20181012065625'),
('20181024094615'),
('20181029064728'),
('20181029132748'),
('20181031072643'),
('20181106212306'),
('20181211125306'),
('20181219090801'),
('20181221120927'),
('20190104083132'),
('20190108075512'),
('20190111072711'),
('20190111122204'),
('20190114141250'),
('20190115083941'),
('20190121064002'),
('20190208032229'),
('20190213073532'),
('20190213082646'),
('20190227111355'),
('20190228084827'),
('20190305112030'),
('20190319114719'),
('20190319122745'),
('20190627055931'),
('20190705083608'),
('20190705100256'),
('20190717105844'),
('20190718081745'),
('20190904115045'),
('20190920113245'),
('20191016061908'),
('20191016064022'),
('20200109145736'),
('20200127120611'),
('20200131111643'),
('20200213130051'),
('20200224080321'),
('20200303075727'),
('20200312062151'),
('20200312112018'),
('20201012091009');
|
-- cena1 = (cena-rab+z_tro) * prep_proc)
select
sd.proizvod, p.naziv, sd.porez
, sd.Kolicina*sd.faktor*sd.K_Robe kol
, sd.cena
, round(nvl(sd.Kolicina*sd.faktor*sd.K_Robe*sd.Cena*(1-sd.Rabat/100) + round(nvl(Z_TROSKOVI,0),2),0),2) nab_vred
, round(
(
nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.Cena*(1-sd.Rabat/100),0)
+ round(nvl(sd.Z_Troskovi,0),2)
)
/ sd.kolicina*sd.faktor*sd.K_Robe
,2) nab_cena
, round(sd.kolicina*sd.faktor*sd.K_Robe*sd.Cena,2) iznos
, round(nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.Cena*(sd.Rabat/100),0),2) iznos_rab
, round(nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.Cena*(1-sd.Rabat/100),0),2) neto_fakt
, round(nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.Cena*(1-sd.Rabat/100)*(sd.porez/100),0),2) fakt_PDV
, round(nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.Cena*(1-sd.Rabat/100),0),2)
+
round(nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.Cena*(1-sd.Rabat/100)*(sd.porez/100),0),2) fakt_vred
, round(nvl(sd.Z_Troskovi,0),2) zav_tro_stavke
, round(nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.cena1,0),2)
-
round(nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.Cena*(1-sd.Rabat/100),0),2)
-
round(nvl(sd.Z_Troskovi,0),2) razlika_u_ceni
, round(nvl(sd.kolicina*sd.faktor*sd.K_Robe*sd.cena1,0),2) vp_vrednost
, sd.cena1
From stavka_dok sd, dokument d , PROIZVOD P , GRUPA_PR GPR
Where
-- veza tabela
d.godina = sd.godina and d.vrsta_dok = sd.vrsta_dok and d.broj_dok = sd.broj_dok
AND SD.PROIZVOD = P.SIFRA AND P.GRUPA_PROIZVODA= GPR.ID
-----------------------------
-- ostali uslovi
and '2011' = d.godina
and d.vrsta_dok in ('3')
and d.broj_dok = 1994
order by sd.stavka
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `estoque`
--
-- Estrutura da tabela `clientes`
--
CREATE TABLE `clientes` (
`id` int(11) NOT NULL,
`cpf` char(11) DEFAULT NULL,
`nome` char(45) NOT NULL,
`credito_liberado` char(1) NOT NULL,
`data_nasc` date DEFAULT NULL,
`email` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `clientes`
--
INSERT INTO `clientes` (`id`, `cpf`, `nome`, `credito_liberado`, `data_nasc`, `email`) VALUES
(1, '11111111111', 'Joao Pereira Brito', 's', '0000-00-00', 'joao@brito.com'),
(2, '11111111112', 'Roberto Pereira Brito', 'n', '0000-00-00', 'roberto@brito.com'),
(3, '11111111113', 'Antônio Pereira Brito', 'n', '0000-00-00', 'antonio@brito.com'),
(4, '11111111114', 'Carlos Pereira Brito', 's', '0000-00-00', 'carlos@brito.com'),
(5, '11111111115', 'Otoniel Pereira Brito', 's', '0000-00-00', 'otoniel@brito.com'),
(6, '11111111116', 'Helena Pereira Brito', 's', '0000-00-00', 'helena@brito.com'),
(7, '11111111117', 'Flávio Pereira Brito', 's', '0000-00-00', 'flavio@brito.com'),
(8, '11111111118', 'Joana Pereira Brito', 'n', '0000-00-00', 'joana@brito.com'),
(9, '11111111119', 'Francisco Pereira Brito', 'n', '0000-00-00', 'francisco@brito.com'),
(10, '11111111110', 'Jorge Pereira Brito', 's', '0000-00-00', 'jorje@brito.com'),
(11, '11111111121', 'Pedro Pereira Brito', 's', '0000-00-00', 'pedro@brito.com'),
(12, '11111111131', 'Ribamar Pereira Brito', 's', '0000-00-00', 'ribamar@brito.com'),
(13, '11111111141', 'Tiago Pereira Brito', 's', '0000-00-00', 'tiago@brito.com'),
(14, '11111111151', 'Elias Pereira Brito', 'n', '0000-00-00', 'elias@brito.com'),
(15, '11111111161', 'Marcos Pereira Brito', 's', '0000-00-00', 'marcos@brito.com'),
(16, '11111111171', 'Ricardo Pereira Brito', 's', '0000-00-00', 'ricardo@brito.com'),
(17, '11111111181', 'Rômulo Pereira Brito', 's', '0000-00-00', 'romulo@brito.com'),
(18, '11111111191', 'Henrique Pereira Brito', 'n', '0000-00-00', 'henrique@brito.com'),
(19, '11111111101', 'Francis Pereira Brito', 's', '0000-00-00', 'francis@brito.com'),
(20, '11111111211', 'Otávio Pereira Brito', 's', '1947-12-02', 'otavio@brito.com'),
(21, '11111111311', 'Rogério Pereira Brito', 's', '0000-00-00', 'rogerio@brito.com'),
(22, '11111111411', 'Jurandir Pereira Brito', 's', '0000-00-00', 'jurandir@brito.com'),
(24, '12106826345', 'Ribamar Sousa', 's', '1956-08-03', 'ribafs@gmail.com');
-- --------------------------------------------------------
--
-- Estrutura da tabela `funcionarios`
--
CREATE TABLE `funcionarios` (
`id` int(11) NOT NULL,
`cpf` char(11) DEFAULT NULL,
`nome` char(45) NOT NULL,
`senha` char(32) NOT NULL,
`email` varchar(50) DEFAULT NULL,
`data_nasc` date NOT NULL,
`empresa` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `funcionarios`
--
INSERT INTO `funcionarios` (`id`, `cpf`, `nome`, `senha`, `email`, `data_nasc`, `empresa`) VALUES
(1, '11111111111', 'Joao Pereira Brito', '12345678', 'joao@brito.com', '0000-00-00', 1),
(2, '11111111112', 'Roberto Pereira Brito', '33345678', 'roberto@brito.com', '0000-00-00', 1),
(3, '11111111113', 'Antônio Pereira Brito', 'gg345678', 'antonio@brito.com', '0000-00-00', 1),
(4, '11111111114', 'Carlos Pereira Brito', 's345678', 'carlos@brito.com', '0000-00-00', 1),
(5, '11111111115', 'Otoniel Pereira Brito', 's34567844', 'otoniel@brito.com', '0000-00-00', 1),
(6, '11111111116', 'Helena Pereira Brito', '345678s', 'helena@brito.com', '0000-00-00', 1),
(7, '11111111117', 'Flávio Pereira Brito', '66345678s', 'flavio@brito.com', '0000-00-00', 1),
(8, '11111111118', 'Joana Pereira Brito', 'jjj345678n', 'joana@brito.com', '0000-00-00', 1),
(9, '11111111119', 'Francisco Pereira Brito', 'nn345678n', 'francisco@brito.com', '0000-00-00', 1),
(10, '11111111110', 'Jorge Pereira Brito', '88345678s', 'jorje@brito.com', '0000-00-00', 1),
(11, '11111111121', 'Pedro Pereira Brito', '99345678s', 'pedro@brito.com', '0000-00-00', 1),
(12, '11111111131', 'Ribamar Pereira Brito', '44345678s', 'ribamar@brito.com', '0000-00-00', 1),
(13, '11111111141', 'Tiago Pereira Brito', 's66345678', 'tiago@brito.com', '0000-00-00', 1),
(14, '11111111151', 'Elias Pereira Brito', 'n77345678', 'elias@brito.com', '0000-00-00', 1),
(15, '11111111161', 'Marcos Pereira Brito', 's44345678', 'marcos@brito.com', '0000-00-00', 1),
(16, '11111111171', 'Ricardo Pereira Brito', 's33345678', 'ricardo@brito.com', '0000-00-00', 1),
(17, '11111111181', 'Rômulo Pereira Brito', 's22345678', 'romulo@brito.com', '0000-00-00', 1),
(18, '11111111191', 'Henrique Pereira Brito', '44345678n', 'henrique@brito.com', '0000-00-00', 1),
(19, '11111111101', 'Francis Pereira Brito', '34567888', 'francis@brito.com', '0000-00-00', 1),
(20, '11111111211', 'Otávio Pereira Brito', 's34567899', 'otavio@brito.com', '1947-12-02', 1),
(21, '11111111311', 'Rogério Pereira Brito', 's345678666', 'rogerio@brito.com', '1983-04-04', 1),
(23, '11111111511', 'Raquél Pereira Brito', '345678676', 'raquel@brito.com', '1956-08-03', 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `clientes`
--
ALTER TABLE `clientes`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `funcionarios`
--
ALTER TABLE `funcionarios`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `clientes`
--
ALTER TABLE `clientes`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- AUTO_INCREMENT for table `funcionarios`
--
ALTER TABLE `funcionarios`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
|
-- fts2c.test
--
-- execsql {
-- SELECT rowid FROM email WHERE email MATCH '"mark susan"'
-- }
SELECT rowid FROM email WHERE email MATCH '"mark susan"'
|
#sql("findByUserNameAndStatusUsed")
SELECT
DISTINCT a.*
FROM
sys_res a,
sys_role b,
sys_role_res c,
sys_user d,
sys_user_role e
WHERE
a.id = c.res_id
AND b.id = c.role_id
AND d.id = e.user_id
and e.role_id = b.id
AND a.`status` = ?
AND b.`status` = ?
and d.`username` = ?
#end
#sql("findTopMenuByUserName")
SELECT
a.*
FROM
sys_res a,
sys_role b,
sys_role_res c,
sys_user d,
sys_user_role e
WHERE
a.id = c.res_id
AND b.id = c.role_id
AND d.id = e.user_id
and e.role_id = b.id
AND a.`status` = ?
AND b.`status` = ?
and a.pid = ?
and d.`username` = ?
ORDER BY a.pid asc, a.seq asc
#end
#sql("findLeftMenuByUserNameAndPid")
SELECT
a.*
FROM
sys_res a,
sys_role b,
sys_role_res c,
sys_user d,
sys_user_role e
WHERE
a.id = c.res_id
AND b.id = c.role_id
AND d.id = e.user_id
and e.role_id = b.id
AND a.`status` = ?
AND b.`status` = ?
AND FIND_IN_SET(a.id, querySysRes(?))
AND d.`username` = ?
ORDER BY a.pid asc, a.seq asc
#end
#sql("findByRoleIdAndStatusUsed")
SELECT
res.*
FROM
sys_res res,
sys_role_res role_res,
sys_role role
WHERE
role_res.res_id = res.id
AND role.id = role_res.role_id
AND res. STATUS = ?
AND role. STATUS = ?
AND ROLE.id = ?
AND res.url IS NOT NULL
ORDER BY res.pid asc, res.seq asc
#end
#sql("findMenuByUserId")
SELECT
a.*
FROM
sys_res a,
sys_user_res b
WHERE
b.res_id=a.id
AND b.user_id=?
AND a.status=1
ORDER BY a.pid asc,a.seq asc
#end
#sql("findMenuByUserName")
SELECT
a.*
FROM
sys_res a,
sys_user_res b,
sys_user u
WHERE
b.res_id=a.id
AND u.id=b.user_id
AND u.username=?
AND a.status=1
ORDER BY a.pid asc,a.seq asc
#end
|
SET ROLE tinkerbell;
CREATE TABLE IF NOT EXISTS hardware (
id UUID UNIQUE
, inserted_at TIMESTAMPTZ
, deleted_at TIMESTAMPTZ
, data JSONB
);
CREATE INDEX IF NOT EXISTS idx_id ON hardware (id);
CREATE INDEX IF NOT EXISTS idx_deleted_at ON hardware (deleted_at NULLS FIRST);
CREATE INDEX IF NOT EXISTS idxgin_type ON hardware USING GIN (data JSONB_PATH_OPS);
CREATE TABLE IF NOT EXISTS template (
id UUID UNIQUE NOT NULL
, name VARCHAR(200) UNIQUE NOT NULL
, created_at TIMESTAMPTZ
, updated_at TIMESTAMPTZ
, deleted_at TIMESTAMPTZ
, data BYTEA
CONSTRAINT CK_name CHECK (name ~ '^[a-zA-Z0-9_-]*$')
);
CREATE INDEX IF NOT EXISTS idx_tid ON template (id);
CREATE INDEX IF NOT EXISTS idx_tdeleted_at ON template (deleted_at NULLS FIRST);
CREATE TABLE IF NOT EXISTS workflow (
id UUID UNIQUE NOT NULL
, template UUID NOT NULL
, devices JSONB NOT NULL
, created_at TIMESTAMPTZ
, updated_at TIMESTAMPTZ
, deleted_at TIMESTAMPTZ
);
CREATE INDEX IF NOT EXISTS idx_wid ON workflow (id);
CREATE INDEX IF NOT EXISTS idx_wdeleted_at ON workflow (deleted_at NULLS FIRST);
CREATE TABLE IF NOT EXISTS workflow_state (
workflow_id UUID UNIQUE NOT NULL
, current_task_name VARCHAR(200)
, current_action_name VARCHAR(200)
, current_action_state SMALLINT
, current_worker VARCHAR(200)
, action_list JSONB
, current_action_index int
, total_number_of_actions INT
);
CREATE INDEX IF NOT EXISTS idx_wfid ON workflow_state (workflow_id);
CREATE TABLE IF NOT EXISTS workflow_event (
workflow_id UUID NOT NULL
, worker_id UUID NOT NULL
, task_name VARCHAR(200)
, action_name VARCHAR(200)
, execution_time int
, message VARCHAR(200)
, status SMALLINT
, created_at TIMESTAMPTZ
);
CREATE INDEX IF NOT EXISTS idx_event ON workflow_event (created_at);
CREATE TABLE IF NOT EXISTS workflow_worker_map (
workflow_id UUID NOT NULL
, worker_id UUID NOT NULL
);
CREATE TABLE IF NOT EXISTS workflow_data (
workflow_id UUID NOT NULL
, version INT
, metadata JSONB
, data JSONB
);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.