text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
--------------------------------------------------------------------------------
-- Private functions
--------------------------------------------------------------------------------
--
-- Checks if a column is of integer type
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Column_Is_Integer(input_table REGCLASS, colname NAME)
RETURNS boolean
AS $$
BEGIN
PERFORM atttypid FROM pg_catalog.pg_attribute
WHERE attrelid = input_table
AND attname = colname
AND atttypid IN (SELECT oid FROM pg_type
WHERE typname IN
('smallint', 'integer', 'bigint', 'int2', 'int4', 'int8'));
RETURN FOUND;
END
$$
LANGUAGE PLPGSQL STABLE PARALLEL UNSAFE;
--
-- Checks if a column is of geometry type
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Column_Is_Geometry(input_table REGCLASS, colname NAME)
RETURNS boolean
AS $$
BEGIN
PERFORM atttypid FROM pg_catalog.pg_attribute
WHERE attrelid = input_table
AND attname = colname
AND atttypid = '@postgisschema@.geometry'::regtype;
RETURN FOUND;
END
$$
LANGUAGE PLPGSQL STABLE PARALLEL UNSAFE;
--
-- Returns the name of all the columns from a table
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_GetColumns(input_table REGCLASS)
RETURNS SETOF NAME
AS $$
SELECT
a.attname as "colname"
FROM pg_catalog.pg_attribute a
WHERE
a.attnum > 0
AND NOT a.attisdropped
AND a.attrelid = (
SELECT c.oid
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.oid = input_table::oid
)
ORDER BY a.attnum;
$$ LANGUAGE SQL STABLE PARALLEL UNSAFE;
--
-- Returns the id column from a view definition
-- Note: The id is always of one of this forms:
-- SELECT t.cartodb_id,
-- SELECT t.my_id as cartodb_id,
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Get_View_id_column(view_def TEXT)
RETURNS TEXT
AS $$
WITH column_definitions AS
(
SELECT regexp_split_to_array(trim(leading from regexp_split_to_table(view_def, '\n')), ' ') AS col_def
)
SELECT trim(trailing ',' FROM split_part(col_def[2], '.', 2))
FROM column_definitions
WHERE trim(trailing ',' FROM col_def[array_length(col_def, 1)]) IN ('t.cartodb_id', 'cartodb_id')
LIMIT 1;
$$ LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
--
-- Returns the geom column from a view definition
--
-- Note: The the_geom is always of one of this forms:
-- t.the_geom,
-- t.my_geom as the_geom,
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Get_View_geom_column(view_def TEXT)
RETURNS TEXT
AS $$
WITH column_definitions AS
(
SELECT regexp_split_to_array(trim(leading from regexp_split_to_table(view_def, '\n')), ' ') AS col_def
)
SELECT trim(trailing ',' FROM split_part(col_def[1], '.', 2))
FROM column_definitions
WHERE trim(trailing ',' FROM col_def[array_length(col_def, 1)]) IN ('t.the_geom', 'the_geom')
LIMIT 1;
$$ LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
--
-- Returns the webmercatorcolumn from a view definition
-- Note: The the_geom_webmercator is always of one of this forms:
-- t.the_geom_webmercator,
-- t.my_geom as the_geom_webmercator,
-- Or without the trailing comma:
-- t.the_geom_webmercator
-- t.my_geom as the_geom_webmercator
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_Get_View_webmercator_column(view_def TEXT)
RETURNS TEXT
AS $$
WITH column_definitions AS
(
SELECT regexp_split_to_array(trim(leading from regexp_split_to_table(view_def, '\n')), ' ') AS col_def
)
SELECT trim(trailing ',' FROM split_part(col_def[1], '.', 2))
FROM column_definitions
WHERE trim(trailing ',' FROM col_def[array_length(col_def, 1)]) IN ('t.the_geom_webmercator', 'the_geom_webmercator')
LIMIT 1;
$$ LANGUAGE SQL IMMUTABLE PARALLEL SAFE;
--
-- List all registered tables in a server + schema
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_List_Registered_Tables(
server_internal NAME,
remote_schema TEXT
)
RETURNS TABLE(
registered boolean,
remote_table TEXT,
local_qualified_name TEXT,
id_column_name TEXT,
geom_column_name TEXT,
webmercator_column_name TEXT
)
AS $$
DECLARE
local_schema name := @extschema@.__CDB_FS_Create_Schema(server_internal, remote_schema);
BEGIN
RETURN QUERY SELECT
true as registered,
source_table::text as remote_table,
format('%I.%I', dependent_schema, dependent_view)::text as local_qualified_name,
@extschema@.__CDB_FS_Get_View_id_column(view_definition) as id_column_name,
@extschema@.__CDB_FS_Get_View_geom_column(view_definition) as geom_column_name,
@extschema@.__CDB_FS_Get_View_webmercator_column(view_definition) as webmercator_column_name
FROM
(
SELECT DISTINCT
dependent_ns.nspname as dependent_schema,
dependent_view.relname as dependent_view,
source_table.relname as source_table,
pg_get_viewdef(dependent_view.oid) as view_definition
FROM pg_depend
JOIN pg_rewrite ON pg_depend.objid = pg_rewrite.oid
JOIN pg_class as dependent_view ON pg_rewrite.ev_class = dependent_view.oid
JOIN pg_class as source_table ON pg_depend.refobjid = source_table.oid
JOIN pg_namespace dependent_ns ON dependent_ns.oid = dependent_view.relnamespace
JOIN pg_namespace source_ns ON source_ns.oid = source_table.relnamespace
WHERE
source_ns.nspname = local_schema
ORDER BY 1,2
) _aux;
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
--------------------------------------------------------------------------------
-- Public functions
--------------------------------------------------------------------------------
--
-- Sets up a Federated Table
--
-- Precondition: the federated server has to be set up via
-- CDB_Federated_Server_Register_PG
--
-- Postcondition: it generates a view in the schema of the user that
-- can be used through SQL and Maps API's.
-- If the table was already exported, it will be dropped and re-imported
--
-- The view is placed under the server's view schema (cdb_fs_$(server_name))
--
-- E.g:
-- SELECT cartodb.CDB_SetUp_PG_Federated_Table(
-- 'amazon', -- mandatory, name of the federated server
-- 'my_remote_schema', -- mandatory, schema name
-- 'my_remote_table', -- mandatory, table name
-- 'id', -- mandatory, name of the id column
-- 'geom', -- optional, name of the geom column, preferably in 4326
-- 'webmercator' -- optional, should be in 3857 if present
-- 'local_name' -- optional, name of the local view (uses the remote_name if not declared)
-- );
--
CREATE OR REPLACE FUNCTION @extschema@.CDB_Federated_Table_Register(
server TEXT,
remote_schema TEXT,
remote_table TEXT,
id_column TEXT,
geom_column TEXT DEFAULT NULL,
webmercator_column TEXT DEFAULT NULL,
local_name NAME DEFAULT NULL
)
RETURNS void
AS $$
DECLARE
server_internal name := @extschema@.__CDB_FS_Generate_Server_Name(input_name => server, check_existence => false);
local_schema name := @extschema@.__CDB_FS_Create_Schema(server_internal, remote_schema);
role_name name := @extschema@.__CDB_FS_Generate_Server_Role_Name(server_internal);
src_table REGCLASS; -- import_schema.remote_table - import_schema is local_schema
local_view text; -- view_schema.local_name - view_schema is server_internal
rest_of_cols TEXT[];
geom_expression TEXT;
webmercator_expression TEXT;
carto_columns_expression TEXT[];
BEGIN
IF remote_table IS NULL THEN
RAISE EXCEPTION 'Remote table name cannot be NULL';
END IF;
-- Make do with whatever columns are provided
IF webmercator_column IS NULL THEN
webmercator_column := geom_column;
ELSIF geom_column IS NULL THEN
geom_column := webmercator_column;
END IF;
IF local_name IS NULL THEN
local_name := remote_table;
END IF;
-- Import the foreign table
-- Drop the old view / table if there was one
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = local_schema AND table_name = remote_table) THEN
EXECUTE @extschema@.CDB_Federated_Table_Unregister(server, remote_schema, remote_table);
END IF;
BEGIN
EXECUTE FORMAT('IMPORT FOREIGN SCHEMA %I LIMIT TO (%I) FROM SERVER %I INTO %I;',
remote_schema, remote_table, server_internal, local_schema);
EXCEPTION WHEN OTHERS THEN
RAISE EXCEPTION 'Could not import schema "%" of server "%": %', remote_schema, server, SQLERRM;
END;
BEGIN
src_table := format('%I.%I', local_schema, remote_table);
EXCEPTION WHEN OTHERS THEN
RAISE EXCEPTION 'Could not import table "%.%" of server "%"', remote_schema, remote_table, server;
END;
-- Check id_column is numeric
IF NOT @extschema@.__CDB_FS_Column_Is_Integer(src_table, id_column) THEN
RAISE EXCEPTION 'non integer id_column "%"', id_column;
END IF;
-- Check if the geom and mercator columns have a geometry type (if provided)
IF geom_column IS NOT NULL AND NOT @extschema@.__CDB_FS_Column_Is_Geometry(src_table, geom_column) THEN
RAISE EXCEPTION 'non geometry column "%"', geom_column;
END IF;
IF webmercator_column IS NOT NULL AND NOT @extschema@.__CDB_FS_Column_Is_Geometry(src_table, webmercator_column) THEN
RAISE EXCEPTION 'non geometry column "%"', webmercator_column;
END IF;
-- Get a list of columns excluding the id, geom and the_geom_webmercator
SELECT ARRAY(
SELECT quote_ident(c) FROM @extschema@.__CDB_FS_GetColumns(src_table) AS c
WHERE c NOT IN (SELECT * FROM (SELECT unnest(ARRAY[id_column, geom_column, webmercator_column, 'cartodb_id', 'the_geom', 'the_geom_webmercator']) col) carto WHERE carto.col IS NOT NULL)
) INTO rest_of_cols;
IF geom_column IS NULL
THEN
geom_expression := 'NULL AS the_geom';
ELSIF @postgisschema@.Find_SRID(local_schema::varchar, remote_table::varchar, geom_column::varchar) = 4326
THEN
geom_expression := format('t.%I AS the_geom', geom_column);
ELSE
-- It needs an ST_Transform to 4326
geom_expression := format('@postgisschema@.ST_Transform(t.%I,4326) AS the_geom', geom_column);
END IF;
IF webmercator_column IS NULL
THEN
webmercator_expression := 'NULL AS the_geom_webmercator';
ELSIF @postgisschema@.Find_SRID(local_schema::varchar, remote_table::varchar, webmercator_column::varchar) = 3857
THEN
webmercator_expression := format('t.%I AS the_geom_webmercator', webmercator_column);
ELSE
-- It needs an ST_Transform to 3857
webmercator_expression := format('@postgisschema@.ST_Transform(t.%I,3857) AS the_geom_webmercator', webmercator_column);
END IF;
-- CARTO columns expressions
carto_columns_expression := ARRAY[
format('t.%1$I AS cartodb_id', id_column),
geom_expression,
webmercator_expression
];
-- Create view schema if it doesn't exist
IF NOT EXISTS (SELECT oid FROM pg_namespace WHERE nspname = server_internal) THEN
EXECUTE 'CREATE SCHEMA ' || quote_ident(server_internal) || ' AUTHORIZATION ' || quote_ident(role_name);
END IF;
-- Create a view with homogeneous CDB fields
BEGIN
EXECUTE format(
'CREATE OR REPLACE VIEW %1$I.%2$I AS
SELECT %3s
FROM %4$s t',
server_internal, local_name,
array_to_string(carto_columns_expression || rest_of_cols, ','),
src_table
);
EXCEPTION WHEN OTHERS THEN
IF EXISTS (SELECT to_regclass(format('%1$I.%2$I', server_internal, local_name))) THEN
RAISE EXCEPTION 'Could not import table "%" as "%.%" already exists', remote_table, server_internal, local_name;
ELSE
RAISE EXCEPTION 'Could not import table "%" as "%": %', remote_table, local_name, SQLERRM;
END IF;
END;
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
--
-- Unregisters a remote table. Any dependent object will be dropped
--
CREATE OR REPLACE FUNCTION @extschema@.CDB_Federated_Table_Unregister(
server TEXT,
remote_schema TEXT,
remote_table TEXT
)
RETURNS void
AS $$
DECLARE
server_internal name := @extschema@.__CDB_FS_Generate_Server_Name(input_name => server, check_existence => false);
local_schema name := @extschema@.__CDB_FS_Create_Schema(server_internal, remote_schema);
BEGIN
EXECUTE FORMAT ('DROP FOREIGN TABLE %I.%I CASCADE;', local_schema, remote_table);
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE; | the_stack |
use labelsystem;
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for alg_warehouse_alginstance
-- ----------------------------
DROP TABLE IF EXISTS `alg_warehouse_alginstance`;
CREATE TABLE `alg_warehouse_alginstance` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alg_name` varchar(128) NOT NULL,
`add_time` datetime(6) NOT NULL,
`alg_type_name` varchar(128) NOT NULL,
`alg_root_dir` varchar(256) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for alg_warehouse_algmodel
-- ----------------------------
DROP TABLE IF EXISTS `alg_warehouse_algmodel`;
CREATE TABLE `alg_warehouse_algmodel` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`conf_path` varchar(255) DEFAULT NULL,
`model_name` varchar(128) NOT NULL,
`local_path` varchar(128) DEFAULT NULL,
`model_url` varchar(128) DEFAULT NULL,
`alg_instance_id` int(11) NOT NULL,
`exec_script` varchar(512) DEFAULT NULL,
`train_script` varchar(512) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `alg_warehouse_algmod_alg_instance_id_d8709646_fk_alg_wareh` (`alg_instance_id`),
CONSTRAINT `alg_warehouse_algmod_alg_instance_id_d8709646_fk_alg_wareh` FOREIGN KEY (`alg_instance_id`) REFERENCES `alg_warehouse_alginstance` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for authtoken_token
-- ----------------------------
DROP TABLE IF EXISTS `authtoken_token`;
CREATE TABLE `authtoken_token` (
`token` varchar(40) NOT NULL,
`created` datetime(6) NOT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`token`),
UNIQUE KEY `user_id` (`user_id`),
CONSTRAINT `authtoken_token_user_id_35299eff_fk_users_userprofile_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for auth_group
-- ----------------------------
DROP TABLE IF EXISTS `auth_group`;
CREATE TABLE `auth_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(80) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for auth_group_permissions
-- ----------------------------
DROP TABLE IF EXISTS `auth_group_permissions`;
CREATE TABLE `auth_group_permissions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id`,`permission_id`),
KEY `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id`),
CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for auth_permission
-- ----------------------------
DROP TABLE IF EXISTS `auth_permission`;
CREATE TABLE `auth_permission` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`content_type_id` int(11) NOT NULL,
`codename` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`),
CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=89 DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for samples_manager_sampleclass
-- ----------------------------
DROP TABLE IF EXISTS `class_manage`;
CREATE TABLE `class_manage` (
`id` int(11) NOT NULL,
`class_name` varchar(200) NOT NULL,
`super_class_name` varchar(200) NULL,
`class_desc` varchar(1000) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for tasks_labeltask
-- ----------------------------
DROP TABLE IF EXISTS `tasks_labeltask`;
CREATE TABLE `tasks_labeltask` (
`id` varchar(32) NOT NULL,
`task_name` varchar(64) NOT NULL,
`task_add_time` datetime(6) NOT NULL,
`relate_task_id` varchar(128) DEFAULT NULL,
`relate_task_name` varchar(400) DEFAULT NULL,
`finished_picture` int(11) DEFAULT NULL,
`total_picture` int(11) DEFAULT NULL,
`task_type` int(11) DEFAULT NULL,
`zip_object_name` varchar(255) DEFAULT NULL,
`zip_bucket_name` varchar(255) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`assign_user_id` int(11) DEFAULT NULL,
`relate_other_label_task` varchar(400) DEFAULT NULL,
`task_flow_type` int(11) DEFAULT NULL,
`task_label_type_info` VARCHAR(4000) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tasks_labeltask_user_id_97415fea_fk_users_userprofile_id` (`user_id`),
CONSTRAINT `tasks_labeltask_user_id_97415fea_fk_users_userprofile_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for tasks_labeltaskitem
-- ----------------------------
DROP TABLE IF EXISTS `tasks_labeltaskitem`;
CREATE TABLE `tasks_labeltaskitem` (
`id` varchar(32) NOT NULL,
`pic_url` varchar(256) DEFAULT NULL,
`pic_object_name` varchar(128) DEFAULT NULL,
`label_info` TEXT(65535) NULL,
`label_task_id` varchar(32) NOT NULL,
`item_add_time` datetime(6) NOT NULL,
`pic_image_field` varchar(400) DEFAULT NULL,
`label_status` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
ALTER TABLE `labelsystem`.`tasks_labeltaskitem`
ADD COLUMN `display_order1` INT(11) NULL AFTER `label_status`,
ADD COLUMN `display_order2` INT(11) NULL AFTER `display_order1`;
DROP TABLE IF EXISTS `tasks_labeldcmtaskitem`;
CREATE TABLE `tasks_labeldcmtaskitem` (
`id` varchar(32) NOT NULL,
`pic_url` varchar(256) DEFAULT NULL,
`pic_object_name` varchar(128) DEFAULT NULL,
`label_info` TEXT(65535) NULL,
`label_task_id` varchar(32) NOT NULL,
`item_add_time` datetime(6) NOT NULL,
`pic_image_field` varchar(400) DEFAULT NULL,
`label_status` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
ALTER TABLE `labelsystem`.`tasks_labeldcmtaskitem`
ADD COLUMN `display_order1` INT(11) NULL AFTER `label_status`,
ADD COLUMN `display_order2` INT(11) NULL AFTER `display_order1`;
-- ----------------------------
-- Table structure for tasks_prepredictresult
-- ----------------------------
DROP TABLE IF EXISTS `tasks_prepredictresult`;
CREATE TABLE `tasks_prepredictresult` (
`id` varchar(32) NOT NULL,
`pic_url` varchar(256) DEFAULT NULL,
`pic_object_name` varchar(128) DEFAULT NULL,
`label_info` TEXT(65535) NULL,
`item_add_time` datetime(6) NOT NULL,
`pre_predict_task_id` varchar(32) NOT NULL,
`pic_image_field` varchar(400) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tasks_prepredictresu_pre_predict_task_id_74edf8fc_fk_tasks_pre` (`pre_predict_task_id`),
CONSTRAINT `tasks_prepredictresu_pre_predict_task_id_74edf8fc_fk_tasks_pre` FOREIGN KEY (`pre_predict_task_id`) REFERENCES `tasks_prepredicttasks` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for tasks_prepredicttasks
-- ----------------------------
DROP TABLE IF EXISTS `tasks_prepredicttasks`;
CREATE TABLE `tasks_prepredicttasks` (
`id` varchar(32) NOT NULL,
`task_name` varchar(400) NOT NULL,
`zip_object_name` varchar(128) NULL,
`task_start_time` datetime(6) NOT NULL,
`task_finish_time` datetime(6) DEFAULT NULL,
`task_status` int(11) NOT NULL,
`alg_model_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`zip_bucket_name` varchar(64) NULL,
`task_status_desc` varchar(2000) CHARACTER SET utf8mb4 DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tasks_prepredicttask_alg_model_id_99ab292d_fk_alg_wareh` (`alg_model_id`),
KEY `tasks_prepredicttasks_user_id_c531c6a7_fk_users_userprofile_id` (`user_id`),
CONSTRAINT `tasks_prepredicttask_alg_model_id_99ab292d_fk_alg_wareh` FOREIGN KEY (`alg_model_id`) REFERENCES `alg_warehouse_algmodel` (`id`),
CONSTRAINT `tasks_prepredicttasks_user_id_c531c6a7_fk_users_userprofile_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
ALTER TABLE `labelsystem`.`tasks_prepredicttasks`
ADD COLUMN `dataset_id` VARCHAR(64) NULL AFTER `task_status_desc`;
DROP TABLE IF EXISTS `tasks_reidtask`;
CREATE TABLE `tasks_reidtask` (
`id` varchar(32) NOT NULL,
`task_name` varchar(400) NOT NULL,
`src_predict_taskid` varchar(128) NULL,
`dest_predict_taskid` varchar(4000) NULL,
`task_start_time` datetime(6) NOT NULL,
`task_finish_time` datetime(6) DEFAULT NULL,
`task_status` int(11) NOT NULL,
`alg_model_id` int(11) NULL,
`user_id` int(11) NOT NULL,
`src_bucket_name` varchar(64) NULL,
`dest_bucket_name` varchar(64) NULL,
`task_status_desc` varchar(1000) CHARACTER SET utf8mb4 DEFAULT NULL,
`assign_user_id` int(11) DEFAULT NULL,
`relate_other_label_task` varchar(400) DEFAULT NULL,
`task_flow_type` int(11) DEFAULT NULL,
`task_type` int(11) DEFAULT NULL,
`task_label_type_info` VARCHAR(4000) DEFAULT NULL,
`finished_picture` int(11) DEFAULT NULL,
`total_picture` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tasks_reidtask_user_id` (`user_id`),
CONSTRAINT `tasks_reidtask_user_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
ALTER TABLE `labelsystem`.`tasks_reidtask`
ADD COLUMN `reid_obj_type` INT(11) NULL DEFAULT NULL AFTER `total_picture`;
DROP TABLE IF EXISTS `tasks_reidtaskitem`;
CREATE TABLE `tasks_reidtaskitem` (
`id` varchar(32) NOT NULL,
`pic_url` varchar(256) DEFAULT NULL,
`pic_object_name` varchar(128) DEFAULT NULL,
`label_info` TEXT(65535) NULL,
`label_task_id` varchar(32) NOT NULL,
`item_add_time` datetime(6) NOT NULL,
`pic_image_field` varchar(400) DEFAULT NULL,
`label_status` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
ALTER TABLE `labelsystem`.`tasks_reidtaskitem`
ADD COLUMN `display_order1` INT(11) NULL AFTER `label_status`,
ADD COLUMN `display_order2` INT(11) NULL AFTER `display_order1`;
DROP TABLE IF EXISTS `tasks_reidtask_show_result`;
CREATE TABLE `tasks_reidtask_show_result` (
`label_task_id` varchar(32) NOT NULL,
`reid_name` varchar(500) NOT NULL,
`related_info` TEXT(65535) NULL,
PRIMARY KEY (`label_task_id`,`reid_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
DROP TABLE IF EXISTS `tasks_reidtask_result`;
CREATE TABLE `tasks_reidtask_result` (
`id` varchar(64) NOT NULL,
`src_image_info` varchar(500) NOT NULL,
`label_task_id` varchar(32) NOT NULL,
`label_task_name` varchar(400) NULL,
`related_info` TEXT(65535) NULL,
PRIMARY KEY (`id`, `src_image_info`, `label_task_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for tasks_retrainresult
-- ----------------------------
DROP TABLE IF EXISTS `tasks_retrainresult`;
CREATE TABLE `tasks_retrainresult` (
`id` varchar(32) NOT NULL,
`loss_train` varchar(128) DEFAULT NULL,
`lr` varchar(128) DEFAULT NULL,
`epoch_num` varchar(128) DEFAULT NULL,
`epoch_total` varchar(128) DEFAULT NULL,
`step_num` varchar(128) DEFAULT NULL,
`step_total` varchar(128) DEFAULT NULL,
`learning_rate` varchar(128) DEFAULT NULL,
`accuracy_rate_train` varchar(128) DEFAULT NULL,
`item_add_time` datetime(6) DEFAULT NULL,
`item_cur_time` datetime(6) DEFAULT NULL,
`alg_model_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `tasks_retrainresult_alg_model_id_906f1909_fk_alg_wareh` (`alg_model_id`),
CONSTRAINT `tasks_retrainresult_alg_model_id_906f1909_fk_alg_wareh` FOREIGN KEY (`alg_model_id`) REFERENCES `alg_warehouse_algmodel` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for tasks_retraintasks
-- ----------------------------
DROP TABLE IF EXISTS `tasks_retraintasks`;
CREATE TABLE `tasks_retraintasks` (
`id` varchar(32) NOT NULL,
`task_name` varchar(400) NOT NULL,
`task_start_time` datetime(6) DEFAULT NULL,
`task_finish_time` datetime(6) DEFAULT NULL,
`task_status` int(11) NOT NULL,
`task_status_desc` varchar(2000) DEFAULT NULL,
`alg_model_id` int(11) NOT NULL,
`pre_predict_task_id` varchar(32) NOT NULL,
`user_id` int(11) NOT NULL,
`pid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `tasks_retraintasks_alg_model_id_e097d239_fk_alg_wareh` (`alg_model_id`),
KEY `tasks_retraintasks_pre_predict_task_id_650daa6d_fk_tasks_pre` (`pre_predict_task_id`),
KEY `tasks_retraintasks_user_id_2fde571d_fk_users_userprofile_id` (`user_id`),
CONSTRAINT `tasks_retraintasks_alg_model_id_e097d239_fk_alg_wareh` FOREIGN KEY (`alg_model_id`) REFERENCES `alg_warehouse_algmodel` (`id`),
CONSTRAINT `tasks_retraintasks_pre_predict_task_id_650daa6d_fk_tasks_pre` FOREIGN KEY (`pre_predict_task_id`) REFERENCES `tasks_prepredicttasks` (`id`),
CONSTRAINT `tasks_retraintasks_user_id_2fde571d_fk_users_userprofile_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------
-- Table structure for users_userprofile
-- ----------------------------
DROP TABLE IF EXISTS `users_userprofile`;
CREATE TABLE `users_userprofile` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`password` varchar(128) NOT NULL,
`last_login` datetime(6) DEFAULT NULL,
`is_superuser` tinyint(1) NOT NULL,
`username` varchar(150) NOT NULL,
`first_name` varchar(30) CHARACTER SET utf8mb4 DEFAULT NULL,
`last_name` varchar(30) CHARACTER SET utf8mb4 DEFAULT NULL,
`email` varchar(254) NOT NULL,
`is_staff` tinyint(1) NOT NULL,
`is_active` tinyint(1) NOT NULL,
`date_joined` datetime(6) NOT NULL,
`nick_name` varchar(50) DEFAULT NULL,
`address` varchar(100) DEFAULT NULL,
`mobile` varchar(100) DEFAULT NULL,
`company` varchar(128) DEFAULT NULL,
`parent_invite_code` varchar(64) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 ;
DROP TABLE IF EXISTS `tasks_dataset`;
CREATE TABLE `tasks_dataset` (
`id` varchar(32) NOT NULL,
`task_name` varchar(400) NOT NULL,
`task_desc` varchar(1000) DEFAULT NULL,
`task_add_time` datetime(6) NOT NULL,
`dataset_type` int(11) DEFAULT NULL,
`total` int(11) DEFAULT NULL,
`zip_object_name` varchar(255) DEFAULT NULL,
`zip_bucket_name` varchar(255) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`assign_user_id` int(11) DEFAULT NULL,
`task_status` int(11) DEFAULT NULL,
`file_bucket_name` VARCHAR(255) NULL,
`camera_number` VARCHAR(256) NULL,
`camera_gps` VARCHAR(64) NULL,
`camera_date` VARCHAR(64) NULL,
PRIMARY KEY (`id`),
KEY `tasks_dataset_user_id_97415fea_fk_users_userprofile_id` (`user_id`),
CONSTRAINT `tasks_dataset_user_id_97415fea_fk_users_userprofile_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `tasks_videocounttask`;
CREATE TABLE `tasks_videocounttask` (
`id` varchar(32) NOT NULL,
`task_name` varchar(400) NOT NULL,
`dataset_id` varchar(128) NULL,
`task_add_time` datetime(6) NOT NULL,
`task_finish_time` datetime(6) DEFAULT NULL,
`task_status` int(11) NOT NULL,
`zip_object_name` varchar(255) DEFAULT NULL,
`zip_bucket_name` varchar(255) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`task_status_desc` varchar(1000) CHARACTER SET utf8mb4 DEFAULT NULL,
`assign_user_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tasks_videocounttask_user_id` (`user_id`),
CONSTRAINT `tasks_videocounttask_user_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
DROP TABLE IF EXISTS `tasks_videocounttaskitem`;
CREATE TABLE `tasks_videocounttaskitem` (
`id` varchar(32) NOT NULL,
`pic_url` varchar(256) DEFAULT NULL,
`pic_object_name` varchar(128) DEFAULT NULL,
`label_info` TEXT(65535) NULL,
`label_task_id` varchar(32) NOT NULL,
`item_add_time` datetime(6) NOT NULL,
`pic_image_field` varchar(400) DEFAULT NULL,
`label_status` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
ALTER TABLE `labelsystem`.`tasks_videocounttaskitem`
ADD COLUMN `display_order1` INT(11) NULL AFTER `label_status`,
ADD COLUMN `display_order2` INT(11) NULL AFTER `display_order1`;
DROP TABLE IF EXISTS `log_info`;
CREATE TABLE `log_info` (
`id` varchar(32) NOT NULL,
`oper_type` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`oper_name` varchar(200) NULL,
`oper_id` varchar(200) NULL,
`oper_json_content_old` TEXT(65535) NULL,
`oper_json_content_new` TEXT(65535) NULL,
`oper_time_start` datetime(6) NOT NULL,
`oper_time_end` datetime(6) NOT NULL,
`record_id` varchar(64) NULL,
`extend1` varchar(400) NULL,
`extend2` varchar(400) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
DROP TABLE IF EXISTS `report_label_task`;
CREATE TABLE `report_label_task` (
`user_id` int(11) NOT NULL,
`oper_time` datetime(6) NOT NULL,
`rectUpdate` int(11) NULL,
`rectAdd` int(11) NULL,
`properties` int(11) NULL,
`pictureUpdate` int(11) NULL,
PRIMARY KEY (`user_id`,`oper_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- -------------------------------------------
-- 0424---------
-- -------------------------------------------
ALTER TABLE `labelsystem`.`tasks_prepredicttasks`
ADD COLUMN `delete_no_label_picture` TINYINT NULL DEFAULT NULL AFTER `dataset_id`;
-- --------------------------------------------
-- 0427---------
-- --------------------------------------------
ALTER TABLE `labelsystem`.`tasks_dataset`
ADD COLUMN `videoSet` VARCHAR(4000) NULL AFTER `camera_date`;
DROP TABLE IF EXISTS `tasks_dataset_videoinfo`;
CREATE TABLE `tasks_dataset_videoinfo` (
`id` varchar(32) NOT NULL,
`dataset_id` varchar(400) NOT NULL,
`minio_url` varchar(1000) DEFAULT NULL,
`video_info` MediumText DEFAULT NULL,
`camera_number` VARCHAR(256) NULL,
`camera_gps` VARCHAR(64) NULL,
`camera_date` VARCHAR(64) NULL,
`duration` VARCHAR(64) NULL,
`bitrate` VARCHAR(64) NULL,
`startTime` VARCHAR(64) NULL,
`videoCode` VARCHAR(400) NULL,
`videoFormat` VARCHAR(400) NULL,
`resolutionRatio` VARCHAR(64) NULL,
`audioCode` VARCHAR(64) NULL,
`audioFrequncy` VARCHAR(64) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------
-- 0429---------
-- --------------------------------------------
ALTER TABLE `labelsystem`.`tasks_dataset_videoinfo`
ADD COLUMN `fps` VARCHAR(45) NULL DEFAULT NULL AFTER `audioFrequncy`;
ALTER TABLE `labelsystem`.`tasks_dataset`
ADD COLUMN `mainVideoInfo` VARCHAR(2000) NULL DEFAULT NULL AFTER `videoSet`;
-- ---------------------------------------------
-- 0430---------
-- ---------------------------------------------
DROP TABLE IF EXISTS `tasks_videolabeltask`;
CREATE TABLE `tasks_videolabeltask` (
`id` varchar(32) NOT NULL,
`task_name` varchar(400) NOT NULL,
`dataset_id` varchar(128) NULL,
`task_add_time` datetime(6) NOT NULL,
`task_finish_time` datetime(6) DEFAULT NULL,
`task_status` int(11) NOT NULL,
`zip_object_name` varchar(255) DEFAULT NULL,
`zip_bucket_name` varchar(255) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`task_status_desc` varchar(1000) CHARACTER SET utf8mb4 DEFAULT NULL,
`assign_user_id` int(11) DEFAULT NULL,
`mainVideoInfo` VARCHAR(2000) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tasks_videolabeltask_user_id` (`user_id`),
CONSTRAINT `tasks_videolabeltask_user_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
DROP TABLE IF EXISTS `tasks_videolabeltaskitem`;
CREATE TABLE `tasks_videolabeltaskitem` (
`id` varchar(32) NOT NULL,
`pic_url` varchar(256) DEFAULT NULL,
`pic_object_name` varchar(128) DEFAULT NULL,
`label_info` TEXT(65535) NULL,
`label_task_id` varchar(32) NOT NULL,
`item_add_time` datetime(6) NOT NULL,
`pic_image_field` varchar(400) DEFAULT NULL,
`label_status` int(11) NOT NULL,
`display_order1` INT(11) NULL,
`display_order2` INT(11) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- -----------------------------------------
-- 0508
-- -----------------------------------------
ALTER TABLE `labelsystem`.`tasks_videolabeltask`
ADD COLUMN `task_label_type_info` VARCHAR(4000) NULL DEFAULT NULL AFTER `mainVideoInfo`;
-- ---------------------------
-- 0616
-- ---------------------------
ALTER TABLE `labelsystem`.`tasks_retraintasks`
ADD COLUMN `confPath` VARCHAR(200) NULL DEFAULT NULL AFTER `pid`,
ADD COLUMN `modelPath` VARCHAR(200) NULL DEFAULT 'NULl' AFTER `confPath`;
-- ---------------------------
-- 0617
-- ---------------------------
ALTER TABLE `labelsystem`.`alg_warehouse_algmodel`
ADD COLUMN `type_list` VARCHAR(2000) NULL DEFAULT NULL AFTER `train_script`;
-- ---------------------------
-- 0618
-- ---------------------------
ALTER TABLE `labelsystem`.`alg_warehouse_algmodel`
ADD COLUMN `threshold` DOUBLE NULL DEFAULT NULL AFTER `type_list`;
-- --------------------------
-- 0628
-- --------------------------
ALTER TABLE `labelsystem`.`tasks_labeltask`
ADD COLUMN `verify_user_id` INT(11) NULL DEFAULT NULL AFTER `task_flow_type`,
ADD COLUMN `task_status` INT(11) NULL DEFAULT NULL AFTER `verify_user_id`,
ADD COLUMN `task_status_desc` VARCHAR(400) NULL DEFAULT NULL AFTER `task_status`;
ALTER TABLE `labelsystem`.`tasks_labeldcmtaskitem`
ADD COLUMN `verify_status` INT(11) NULL DEFAULT NULL AFTER `display_order2`,
ADD COLUMN `verify_desc` VARCHAR(400) NULL DEFAULT NULL AFTER `verify_status`;
ALTER TABLE `labelsystem`.`tasks_labeltaskitem`
ADD COLUMN `verify_status` INT(11) NULL DEFAULT NULL AFTER `display_order2`,
ADD COLUMN `verify_desc` VARCHAR(400) NULL DEFAULT NULL AFTER `verify_status`;
ALTER TABLE `labelsystem`.`tasks_reidtask`
ADD COLUMN `verify_user_id` INT(11) NULL DEFAULT NULL AFTER `reid_obj_type`;
ALTER TABLE `labelsystem`.`tasks_reidtaskitem`
ADD COLUMN `verify_status` INT(11) NULL DEFAULT NULL AFTER `display_order2`,
ADD COLUMN `verify_desc` VARCHAR(400) NULL DEFAULT NULL AFTER `verify_status`;
ALTER TABLE `labelsystem`.`tasks_videolabeltask`
ADD COLUMN `verify_user_id` INT(11) NULL DEFAULT NULL AFTER `task_label_type_info`;
ALTER TABLE `labelsystem`.`tasks_videolabeltaskitem`
ADD COLUMN `verify_status` INT(11) NULL DEFAULT NULL AFTER `display_order2`,
ADD COLUMN `verify_desc` VARCHAR(400) NULL DEFAULT NULL AFTER `verify_status`;
ALTER TABLE `labelsystem`.`tasks_videocounttask`
ADD COLUMN `verify_user_id` INT(11) NULL DEFAULT NULL AFTER `assign_user_id`;
ALTER TABLE `labelsystem`.`tasks_videocounttaskitem`
ADD COLUMN `verify_status` INT(11) NULL DEFAULT NULL AFTER `display_order2`,
ADD COLUMN `verify_desc` VARCHAR(400) NULL DEFAULT NULL AFTER `verify_status`;
-- -------------------------
-- 0630
-- -------------------------
ALTER TABLE `labelsystem`.`report_label_task`
ADD COLUMN `notValide` INT(11) NULL DEFAULT NULL AFTER `pictureUpdate`;
-- --------------------------
-- 0715
-- --------------------------
DROP TABLE IF EXISTS `log_info_history`;
CREATE TABLE `log_info_history` (
`id` varchar(32) NOT NULL,
`oper_type` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`oper_name` varchar(200) NULL,
`oper_id` varchar(200) NULL,
`oper_json_content_old` TEXT(65535) NULL,
`oper_json_content_new` TEXT(65535) NULL,
`oper_time_start` datetime(6) NOT NULL,
`oper_time_end` datetime(6) NOT NULL,
`record_id` varchar(64) NULL,
`extend1` varchar(400) NULL,
`extend2` varchar(400) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- --------------------------------
-- 0720
-- --------------------------------
ALTER TABLE `labelsystem`.`tasks_retraintasks`
DROP FOREIGN KEY `tasks_retraintasks_pre_predict_task_id_650daa6d_fk_tasks_pre`;
ALTER TABLE `labelsystem`.`tasks_retraintasks`
DROP INDEX `tasks_retraintasks_pre_predict_task_id_650daa6d_fk_tasks_pre` ;
ALTER TABLE `labelsystem`.`tasks_retraintasks`
CHANGE COLUMN `pre_predict_task_id` `pre_predict_task_id` VARCHAR(32) NULL ,
CHANGE COLUMN `pid` `pid` INT(11) NULL ;
INSERT INTO alg_warehouse_alginstance(id, alg_name, add_time, alg_type_name, alg_root_dir) VALUES ('4', 'FreeAnchor', '2020-01-08 17:44:24.000000', '目标检测', '/mmdetection/');
INSERT INTO alg_warehouse_alginstance(id, alg_name, add_time, alg_type_name, alg_root_dir) VALUES ('5', 'Retinanet', '2020-01-08 17:44:24.000000', '目标检测', '/mmdetection/');
INSERT INTO alg_warehouse_alginstance(`id`, `alg_name`, `add_time`, `alg_type_name`, `alg_root_dir`) VALUES ('10', 'Tracking_pyECO', '2020-08-19 17:44:24.000000', '目标跟踪', '/pyECO/');
INSERT INTO alg_warehouse_alginstance(`id`, `alg_name`, `add_time`, `alg_type_name`, `alg_root_dir`) VALUES ('11', 'FastReID', '2020-08-19 17:44:24.000000', '目标重识别', '/fastreid/');
INSERT INTO alg_warehouse_algmodel (id, conf_path, model_name, local_path, model_url, alg_instance_id, exec_script, train_script, type_list, threshold) VALUES ('4', 'configs/free_anchor/retinanet_free_anchor_r50_fpn_1x.py', 'FreeAnchor', '', 'model/retinanet_free_anchor_r50_fpn_1x/epoch_12.pth', '4', 'python3 demoForJava.py --cfg {configPath} --checkpoint {modelPath}', 'python3 tools/train.py {configPath}',NULL,NULL);
INSERT INTO alg_warehouse_algmodel(id, conf_path, model_name, local_path, model_url, alg_instance_id, exec_script, train_script, type_list, threshold) VALUES ('7', 'configs/retinanet/retinanet_x101_64x4d_fpn_1x_car.py', 'Retinanet(all car)', NULL, 'model/retinanet_x101_64x4d_fpn_1x/epoch_9_car_new.pth', '5', 'python3 demoForJava.py --cfg {configPath} --checkpoint {modelPath}', 'python3 tools/train.py {configPath}',NULL,NULL);
INSERT INTO `alg_warehouse_algmodel` (`id`, `model_name`, `alg_instance_id`, `exec_script`) VALUES ('16', 'Tracking_pyECO', '10', 'python3 bin/demo_ECO_hc.py --video_dir {data_dir} --custom_dataset_name {data_name}');
INSERT INTO `alg_warehouse_algmodel` (`id`, `model_name`, `alg_instance_id`, `exec_script`, `type_list`) VALUES ('17', 'FastReID(Person)', '11', 'python3 tools/test_net.py --config-file ./configs/Person/sbs_R101-ibn-test.yml --datadir {data_dir} --json_path {data_dir}/test.json', '[\"person\"]');
INSERT INTO `users_userprofile`(id,password,last_login,is_superuser,username,first_name,last_name,email,is_staff,is_active,date_joined,nick_name,address,mobile,company,parent_invite_code) VALUES ('5', '�R�\'�~2~�f#Vd`8�7V����;}�t\\h�', NULL, '0', 'LabelSystem01', null, null, 'zouap@pcl.com.cn', '0', '0', '2019-12-24 16:02:52.000000', 'admin', '鹏城实验室', '1235698755', '实验室', null);
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"car\",\"person\"]' WHERE (`id` = '5');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"person\"]' WHERE (`id` = '3');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"person\"]' WHERE (`id` = '4');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"car\"]' WHERE (`id` = '6');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"car\"]' WHERE (`id` = '7');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"car\"]' WHERE (`id` = '9');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"person\"]' WHERE (`id` = '8');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"person\"]' WHERE (`id` = '13');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `type_list` = '[\"cell\"]' WHERE (`id` = '10');
-- -------------------------------
-- 0721
-- --------------------------------
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `train_script` = './tools/dist_train.sh {configPath} {gpunum} --validate' WHERE (`id` = '3');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `train_script` = './tools/dist_train.sh {configPath} {gpunum} --validate' WHERE (`id` = '4');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `train_script` = './tools/dist_train.sh {configPath} {gpunum} --validate' WHERE (`id` = '5');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `train_script` = './tools/dist_train.sh {configPath} {gpunum} --validate' WHERE (`id` = '6');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `train_script` = './tools/dist_train.sh {configPath} {gpunum} --validate' WHERE (`id` = '7');
-- -------------------------------
-- 0730
-- -------------------------------
ALTER TABLE `labelsystem`.`tasks_videocounttask`
ADD COLUMN `mainVideoInfo` VARCHAR(2000) NULL DEFAULT NULL AFTER `verify_user_id`;
-- -------------------------------
-- 0803
-- -------------------------------
ALTER TABLE `labelsystem`.`tasks_prepredicttasks`
ADD COLUMN `score_threshold` DOUBLE NULL DEFAULT NULL AFTER `delete_no_label_picture`;
-- --------------------------------
-- 0810
-- --------------------------------
DROP TABLE IF EXISTS `tasks_largepicturelabeltask`;
CREATE TABLE `tasks_largepicturelabeltask` (
`id` varchar(32) NOT NULL,
`task_name` varchar(400) NOT NULL,
`dataset_id` varchar(128) NULL,
`task_add_time` datetime(6) NOT NULL,
`task_finish_time` datetime(6) DEFAULT NULL,
`task_status` int(11) NOT NULL,
`zip_object_name` varchar(255) DEFAULT NULL,
`zip_bucket_name` varchar(255) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`task_status_desc` varchar(1000) CHARACTER SET utf8mb4 DEFAULT NULL,
`assign_user_id` int(11) DEFAULT NULL,
`verify_user_id` INT(11) NULL,
`mainVideoInfo` VARCHAR(2000) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tasks_largepicturelabeltask_user_id` (`user_id`),
CONSTRAINT `tasks_largepicturelabeltask_user_id` FOREIGN KEY (`user_id`) REFERENCES `users_userprofile` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
DROP TABLE IF EXISTS `tasks_largepicturetaskitem`;
CREATE TABLE `tasks_largepicturetaskitem` (
`id` varchar(32) NOT NULL,
`pic_url` varchar(256) DEFAULT NULL,
`pic_object_name` varchar(128) DEFAULT NULL,
`label_info` MediumText NULL,
`label_task_id` varchar(32) NOT NULL,
`item_add_time` datetime(6) NOT NULL,
`pic_image_field` varchar(400) DEFAULT NULL,
`label_status` int(11) NOT NULL,
`verify_status` INT(11) NULL,
`verify_desc` VARCHAR(400) NULL,
`display_order1` INT(11) NULL,
`display_order2` INT(11) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- --------------------------------
-- 0817
-- --------------------------------
ALTER TABLE `labelsystem`.`tasks_retraintasks`
ADD COLUMN `retrain_type` VARCHAR(45) NULL DEFAULT NULL AFTER `modelPath`,
ADD COLUMN `retrain_data` VARCHAR(4000) NULL AFTER `retrain_type`,
ADD COLUMN `detection_type` VARCHAR(45) NULL AFTER `retrain_data`,
ADD COLUMN `detection_type_input` VARCHAR(45) NULL AFTER `detection_type`,
ADD COLUMN `retrain_model_name` VARCHAR(128) NULL AFTER `detection_type_input`,
ADD COLUMN `testTrainRatio` DOUBLE NULL AFTER `retrain_model_name`,
CHANGE COLUMN `modelPath` `modelPath` VARCHAR(200) NULL DEFAULT NULL ;
-- --------------------------------
-- 0902
-- --------------------------------
-- add progress table
DROP TABLE IF EXISTS `tasks_progress`;
CREATE TABLE `tasks_progress` (
`id` varchar(500) NOT NULL,
`taskId` varchar(256) DEFAULT NULL,
`progress` INT(11) NULL,
`status` INT(11) NULL,
`startTime` INT(11) NULL,
`totalTime` INT(11) NULL,
`exceedTime` INT(11) NULL,
`relatedFileName` varchar(2000) DEFAULT NULL,
`info` varchar(2000) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ----------------------------------
-- 0904
-- ----------------------------------
ALTER TABLE `labelsystem`.`authtoken_token`
ADD COLUMN `loginTime` BIGINT(20) NULL AFTER `user_id`;
-- ---------------------------------
-- 0907 add secure log info.
-- ---------------------------------
DROP TABLE IF EXISTS `log_sec_info`;
CREATE TABLE `log_sec_info` (
`id` varchar(32) NOT NULL,
`oper_type` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`oper_name` varchar(200) NULL,
`oper_id` varchar(200) NULL,
`log_info` varchar(2000) NULL,
`oper_time_start` datetime(6) NOT NULL,
`oper_time_end` datetime(6) NOT NULL,
`record_id` varchar(64) NULL,
`extend1` varchar(400) NULL,
`extend2` varchar(400) NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
-- ---------------------------------
-- 0910 add login error info.
-- ---------------------------------
DROP TABLE IF EXISTS `login_info`;
CREATE TABLE `login_info` (
`user_id` int(11) NOT NULL,
`login_error_time` int(11) NULL,
`last_login_time` datetime(6) NOT NULL,
`extend1` varchar(400) NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
DROP TABLE IF EXISTS `user_extend`;
CREATE TABLE `user_extend` (
`user_id` int(11) NOT NULL,
`func_table_name` varchar(4000) NULL,
`properties` varchar(4000) NULL,
`oper_time` datetime(6) NOT NULL,
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ;
ALTER TABLE `labelsystem`.`alg_warehouse_algmodel`
ADD COLUMN `model_type` INT(11) NULL DEFAULT NULL AFTER `threshold`;
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `model_type` = '1' WHERE (`id` = '21');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `model_type` = '1' WHERE (`id` = '16');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `model_type` = '1' WHERE (`id` = '12');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `model_type` = '1' WHERE (`id` = '20');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `model_name` = 'Multiple Target FairMOT Tracking(person)' WHERE (`id` = '20');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `model_name` = 'Multiple Target CenterTrack Tracking(car+person)' WHERE (`id` = '21');
ALTER TABLE `labelsystem`.`alg_warehouse_algmodel`
ADD COLUMN `auto_used` INT(11) NULL DEFAULT NULL AFTER `model_type`;
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '3');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '4');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '5');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '6');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '7');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '11');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '18');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '20');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `auto_used` = '1' WHERE (`id` = '21');
ALTER TABLE `labelsystem`.`alg_warehouse_algmodel`
ADD COLUMN `hand_label_used` INT(11) NULL DEFAULT NULL AFTER `auto_used`;
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '3');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '4');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '5');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '6');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '7');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '10');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '11');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '12');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '16');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '18');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '20');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `hand_label_used` = '1' WHERE (`id` = '21');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `model_name` = 'Tracking_pyECO (Single Target)' WHERE (`id` = '16');
UPDATE `labelsystem`.`alg_warehouse_algmodel` SET `model_name` = 'Tracking (Single Target)' WHERE (`id` = '12');
-- 1015
ALTER TABLE `labelsystem`.`tasks_labeltask`
ADD COLUMN `total_label` INT(11) NULL AFTER `task_status_desc`;
ALTER TABLE `labelsystem`.`tasks_prepredicttasks`
ADD COLUMN `delete_similar_picture` INT(11) NULL AFTER `score_threshold`;
ALTER TABLE `labelsystem`.`tasks_prepredicttasks`
CHANGE COLUMN `score_threshold` `score_threshhold` DOUBLE NULL DEFAULT NULL ;
-- 20201216
ALTER TABLE `labelsystem`.`tasks_largepicturelabeltask`
ADD COLUMN `appid` VARCHAR(300) NULL DEFAULT NULL AFTER `mainVideoInfo`;
-- 20210421
INSERT INTO `labelsystem`.`alg_warehouse_alginstance` (`id`, `alg_name`, `add_time`, `alg_type_name`, `alg_root_dir`) VALUES ('17', 'Segmentation', '2021-04-21 15:08:24.000000', '自动分割', '/deeplabv3/');
INSERT INTO `labelsystem`.`alg_warehouse_algmodel` (`id`, `model_name`, `alg_instance_id`, `exec_script`, `type_list`, `auto_used`) VALUES ('100', 'Auto Segmentation', '17', 'python3 tools_forlabel.py', '[\"road\",\"sidewalk\",\"building\",\"wall\",\"fence\",\"pole\",\"trafficlight\",\"trafficsign\",\"vegetation\",\"terrain\",\"sky\",\"person\",\"rider\",\"car\",\"truck\",\"bus\",\"train\",\"motorcycle\",\"bicycle\",\"other\"]', '1');
-- 20210422
ALTER TABLE `labelsystem`.`alg_warehouse_algmodel`
ADD COLUMN `a_picture_cost_time` INT NULL AFTER `hand_label_used`;
-- 20210609
INSERT INTO `labelsystem`.`alg_warehouse_alginstance` (`id`, `alg_name`, `add_time`, `alg_type_name`, `alg_root_dir`) VALUES ('19', 'MIAOD', '2021-06-09 15:08:24.000000', '主动分类', '/MIAL/');
INSERT INTO `labelsystem`.`alg_warehouse_algmodel` (`id`, `model_name`, `alg_instance_id`, `train_script`) VALUES ('60', 'MIAOD', '19', 'python tools/train.py configs/MIAOD.py --work_directory {work_directory} --num_classes {num_classes}'); | the_stack |
-- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64)
--
-- Host: localhost Database: IoT_platform
-- ------------------------------------------------------
-- Server version 5.7.17-1
/*!401t_data_typeid01 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 */;
/*!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 `t_data`
--
DROP TABLE IF EXISTS `t_data`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_data` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '数据信息id pk',
`device_id` int(11) NOT NULL COMMENT '设备id fk',
`data_value` varchar(1024) COLLATE utf8_unicode_ci NOT NULL COMMENT '数据信息(json)',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `t_data_t_device_info_id_fk` (`device_id`),
CONSTRAINT `t_data_t_device_info_id_fk` FOREIGN KEY (`device_id`) REFERENCES `t_device_info` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='设备上传信息表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_data`
--
LOCK TABLES `t_data` WRITE;
/*!40000 ALTER TABLE `t_data` DISABLE KEYS */;
INSERT INTO `t_data` VALUES (1,1,'100','2017-10-27 20:23:31'),(2,1,'200','2017-10-27 20:23:39'),(3,1,'250','2017-10-27 20:24:01');
/*!40000 ALTER TABLE `t_data` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_data_type`
--
DROP TABLE IF EXISTS `t_data_type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_data_type` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '类型id',
`name` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '类型名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='设备上传的数据类型表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_data_type`
--
LOCK TABLES `t_data_type` WRITE;
/*!40000 ALTER TABLE `t_data_type` DISABLE KEYS */;
INSERT INTO `t_data_type` VALUES (1,'数值型');
/*!40000 ALTER TABLE `t_data_type` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_device_info`
--
DROP TABLE IF EXISTS `t_device_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_device_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '设备id pk',
`project_id` int(11) NOT NULL COMMENT '所属项目id fk',
`protocol_id` int(11) NOT NULL COMMENT '协议id fk',
`data_type` int(11) NOT NULL COMMENT '设备数据键(json)',
`name` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '设备名称',
`number` varchar(512) COLLATE utf8_unicode_ci NOT NULL COMMENT '设备编号',
`privacy` int(1) NOT NULL COMMENT '设备保密性\n0=公开\n1=保密',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `t_device_info_number_uindex` (`number`),
KEY `t_device_info_t_project_info_id_fk` (`project_id`),
KEY `t_device_info_t_protocol_info_id_fk` (`protocol_id`),
KEY `t_device_info_t_data_type_id_fk` (`data_type`),
CONSTRAINT `t_device_info_t_data_type_id_fk` FOREIGN KEY (`data_type`) REFERENCES `t_data_type` (`id`),
CONSTRAINT `t_device_info_t_project_info_id_fk` FOREIGN KEY (`project_id`) REFERENCES `t_project_info` (`id`),
CONSTRAINT `t_device_info_t_protocol_info_id_fk` FOREIGN KEY (`protocol_id`) REFERENCES `t_protocol_info` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_device_info`
--
LOCK TABLES `t_device_info` WRITE;
/*!40000 ALTER TABLE `t_device_info` DISABLE KEYS */;
INSERT INTO `t_device_info` VALUES (1,1,1,1,'传感器1','32fse',0,'2017-10-26 15:48:19');
/*!40000 ALTER TABLE `t_device_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_project_industry`
--
DROP TABLE IF EXISTS `t_project_industry`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_project_industry` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '行业id pk',
`name` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '行业名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='项目行业表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_project_industry`
--
LOCK TABLES `t_project_industry` WRITE;
/*!40000 ALTER TABLE `t_project_industry` DISABLE KEYS */;
INSERT INTO `t_project_industry` VALUES (1,'智能家具'),(2,'车载设备'),(3,'可穿戴设备'),(4,'医疗保健'),(5,'智能玩具'),(6,'新能源'),(7,'运动监控'),(8,'智能教育'),(9,'环境监控'),(10,'办公设备');
/*!40000 ALTER TABLE `t_project_industry` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_project_info`
--
DROP TABLE IF EXISTS `t_project_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_project_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '项目id',
`name` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '项目名称',
`industry_id` int(11) NOT NULL COMMENT '行业id fk',
`profile` varchar(500) COLLATE utf8_unicode_ci NOT NULL COMMENT '项目简介',
`api_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL COMMENT 'APIKey',
`create_time` datetime NOT NULL COMMENT '创建时间',
`user_id` int(11) NOT NULL COMMENT '用户id fk',
PRIMARY KEY (`id`),
KEY `t_project_info_t_project_industry_id_fk` (`industry_id`),
KEY `t_project_info_t_user_info_id_fk` (`user_id`),
CONSTRAINT `t_project_info_t_project_industry_id_fk` FOREIGN KEY (`industry_id`) REFERENCES `t_project_industry` (`id`),
CONSTRAINT `t_project_info_t_user_info_id_fk` FOREIGN KEY (`user_id`) REFERENCES `t_user_info` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='项目信息表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_project_info`
--
LOCK TABLES `t_project_info` WRITE;
/*!40000 ALTER TABLE `t_project_info` DISABLE KEYS */;
INSERT INTO `t_project_info` VALUES (1,'项目1',1,'测试产品2','sdakasyri','2017-10-26 15:47:49',1),(2,'项目2',2,'测试项目2','sadkhjf324ysabd','2017-11-04 08:58:43',1);
/*!40000 ALTER TABLE `t_project_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_protocol_info`
--
DROP TABLE IF EXISTS `t_protocol_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_protocol_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '协议id pk',
`name` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '协议名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='传输协议表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_protocol_info`
--
LOCK TABLES `t_protocol_info` WRITE;
/*!40000 ALTER TABLE `t_protocol_info` DISABLE KEYS */;
INSERT INTO `t_protocol_info` VALUES (1,'HTTP'),(2,'MQTT');
/*!40000 ALTER TABLE `t_protocol_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_record_info`
--
DROP TABLE IF EXISTS `t_record_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_record_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '行为id pk',
`name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '行为名称',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='行为信息表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_record_info`
--
LOCK TABLES `t_record_info` WRITE;
/*!40000 ALTER TABLE `t_record_info` DISABLE KEYS */;
INSERT INTO `t_record_info` VALUES (1,'添加新项目'),(2,'添加新设备'),(3,'删除一个项目'),(4,'删除一个设备');
/*!40000 ALTER TABLE `t_record_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_user_info`
--
DROP TABLE IF EXISTS `t_user_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_user_info` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户唯一标识 pk',
`username` varchar(12) COLLATE utf8_unicode_ci NOT NULL COMMENT '用户名',
`password` varchar(20) COLLATE utf8_unicode_ci NOT NULL COMMENT '密码',
`bind_phone` varchar(11) COLLATE utf8_unicode_ci NOT NULL COMMENT '绑定手机',
`bind_email` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '绑定手机',
`real_name` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '真实姓名',
`birthday` date DEFAULT NULL COMMENT '生日',
`location` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '工作单位或者所在学校',
`work_place` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '所在地',
`personal_profile` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '个人简介',
`head_image` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '头像',
`phone` varchar(11) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '联系电话',
`qq` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'QQ',
PRIMARY KEY (`id`),
UNIQUE KEY `t_user_info_username_uindex` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='用户信息表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_user_info`
--
LOCK TABLES `t_user_info` WRITE;
/*!40000 ALTER TABLE `t_user_info` DISABLE KEYS */;
INSERT INTO `t_user_info` VALUES (1,'admin','admin','10086','1@qq.com','张三','2017-10-27',NULL,NULL,NULL,NULL,NULL,NULL),(2,'user','user','10086','2@qq.com','李四','2017-10-27',NULL,NULL,NULL,NULL,NULL,NULL),(3,'test','test','789540','3@qq.com','老王',NULL,NULL,'wust 508',NULL,NULL,NULL,'12345');
/*!40000 ALTER TABLE `t_user_info` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `t_user_record`
--
DROP TABLE IF EXISTS `t_user_record`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_user_record` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '记录id pk',
`user_id` int(11) NOT NULL COMMENT '用户id fk',
`record_id` int(11) NOT NULL COMMENT '行为id',
`data` varchar(100) COLLATE utf8_unicode_ci NOT NULL COMMENT '用户操作数据',
`create_time` datetime NOT NULL COMMENT '操作时间',
PRIMARY KEY (`id`),
KEY `t_user_record_t_record_info_id_fk` (`record_id`),
KEY `t_user_record_t_user_info_id_fk` (`user_id`),
CONSTRAINT `t_user_record_t_record_info_id_fk` FOREIGN KEY (`record_id`) REFERENCES `t_record_info` (`id`),
CONSTRAINT `t_user_record_t_user_info_id_fk` FOREIGN KEY (`user_id`) REFERENCES `t_user_info` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='用户行为记录表';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `t_user_record`
--
LOCK TABLES `t_user_record` WRITE;
/*!40000 ALTER TABLE `t_user_record` DISABLE KEYS */;
INSERT INTO `t_user_record` VALUES (1,1,1,'1','2017-10-27 16:14:05'),(2,1,2,'1','2017-10-27 16:14:17'),(3,2,1,'2','2017-10-27 16:23:32');
/*!40000 ALTER TABLE `t_user_record` 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 2017-11-08 10:14:18 | the_stack |
CREATE FUNCTION Integration.GenerateDateDimensionColumns(@Date date)
RETURNS TABLE
AS
RETURN
SELECT @Date AS [Date] -- 2013-01-01
, YEAR(@Date) * 10000
+ MONTH(@Date) * 100 + DAY(@Date) AS [DateKey] -- 20130101 (to 20131231)
, DAY(@Date) AS [Day Number] -- 1 (to last day of month)
, DATENAME(day, @Date) AS [Day] -- 1 (to last day of month)
, CAST(DATEPART(dy, @Date) AS NVARCHAR(5)) AS [Day of Year] -- 1 (to 365)
, DATEPART(day, @Date) AS [Day of Year Number] -- 1 (to 365)
, DATENAME(weekday, @Date) AS [Day of Week] -- Tuesday
, DATEPART(weekday, @Date) AS [Day of Week Number] -- 3
, DATENAME(week, @Date) AS [Week of Year] -- 1
, DATENAME(month, @Date) AS [Month] -- January
, SUBSTRING(DATENAME(month, @Date), 1, 3) AS [Short Month] -- Jan
, N'Q' + DATENAME(quarter, @Date) AS [Quarter] -- Q1 (to Q4)
, N'H' + CASE WHEN DATEPART(month, @Date) < 7
THEN N'1'
ELSE N'2'
END AS [Half of Year] -- H1 (or H2)
, CAST(DATENAME(year, @Date) + N'-'
+ DATENAME(month, @Date) + N'-01'
AS DATE
) AS [Beginning of Month] -- 2013-01-01
, CASE WHEN MONTH(@Date) BETWEEN 1 AND 3
THEN CAST(DATENAME(year, @Date)
+ '-01-01' AS DATE
)
WHEN MONTH(@Date) BETWEEN 4 AND 6
THEN CAST(DATENAME(year, @Date)
+ '-04-01' AS DATE
)
WHEN MONTH(@Date) BETWEEN 7 AND 9
THEN CAST(DATENAME(year, @Date)
+ '-07-01' AS DATE
)
WHEN MONTH(@Date) BETWEEN 10 AND 12
THEN CAST(DATENAME(year, @Date)
+ '-10-01' AS DATE
)
END AS [Beginning of Quarter] -- 2013-01-01
, CASE WHEN DATEPART(month, @Date) < 7
THEN CAST(DATENAME(year, @Date)
+ '-01-01' AS DATE
)
ELSE CAST(DATENAME(year, @Date)
+ '-07-01' AS DATE
)
END AS [Beginning of Half of Year] -- 2013-01-01
, CAST(DATENAME(year, @Date) + N'-01-01' AS DATE) AS [Beginning of Year] -- 2013-01-01
, N'Beginning of Month ' + DATENAME(month, @Date) + N'-'
+ DATENAME(year, @Date) AS [Beginning of Month Label]
, N'BOM ' + SUBSTRING(DATENAME(month, @Date), 1, 3) + N'-'
+ DATENAME(year, @Date) AS [Beginning of Month Label Short]
, CASE WHEN MONTH(@Date) BETWEEN 1 AND 3
THEN N'Beginning Of Quarter ' + DATENAME(year, @Date) + N'-Q1'
WHEN MONTH(@Date) BETWEEN 4 AND 6
THEN N'Beginning Of Quarter ' + DATENAME(year, @Date) + N'-Q2'
WHEN MONTH(@Date) BETWEEN 7 AND 9
THEN N'Beginning Of Quarter ' + DATENAME(year, @Date) + N'-Q3'
WHEN MONTH(@Date) BETWEEN 10 AND 12
THEN N'Beginning Of Quarter ' + DATENAME(year, @Date) + N'-Q4'
END AS [Beginning of Quarter Label]
, CASE WHEN MONTH(@Date) BETWEEN 1 AND 3
THEN N'BOQ ' + DATENAME(year, @Date) + N'-Q1'
WHEN MONTH(@Date) BETWEEN 4 AND 6
THEN N'BOQ ' + DATENAME(year, @Date) + N'-Q2'
WHEN MONTH(@Date) BETWEEN 7 AND 9
THEN N'BOQ ' + DATENAME(year, @Date) + N'-Q3'
WHEN MONTH(@Date) BETWEEN 10 AND 12
THEN N'BOQ ' + DATENAME(year, @Date) + N'-Q4'
END AS [Beginning of Quarter Label Short]
, CASE WHEN DATEPART(month, @Date) < 7
THEN N'Beginning of Half Year ' + DATENAME(year, @Date) + N'-H1'
ELSE N'Beginning of Half Year ' + DATENAME(year, @Date) + N'-H2'
END AS [Beginning of Half Year Label] -- Beginning of Half Year 2013-H1
, CASE WHEN DATEPART(month, @Date) < 7
THEN N'BOH ' + DATENAME(year, @Date) + N'-H1'
ELSE N'BOH ' + DATENAME(year, @Date) + N'-H2'
END AS [Beginning of Half Year Label Short] -- BOH 2013-H1
, N'Beginning of Year ' + DATENAME(year, @Date) AS [Beginning of Year Label] -- Beginning of Year 2013
, N'BOY ' + DATENAME(year, @Date) AS [Beginning of Year Label Short] -- BOY 2013
, DATENAME(month, @Date) + N' '
+ DATENAME(day, @Date) + N', '
+ DATENAME(year, @Date) AS [Calendar Day Label] -- January 1, 2013
, SUBSTRING(DATENAME(month, @Date), 1, 3) + N' '
+ DATENAME(day, @Date) + N', '
+ DATENAME(year, @Date) AS [Calendar Day Label Short] -- Jan 1, 2013
, DATEPART(week, @Date) AS [Calendar Week Number] -- 1
, N'CY' + DATENAME(year, @Date)
+ '-W' + RIGHT(N'00' + DATENAME(week, @Date), 2) AS [Calendar Week Label] -- CY2013-W1
, MONTH(@Date) AS [Calendar Month Number] -- 1 (to 12)
, N'CY' + DATENAME(year, @Date)
+ N'-' + SUBSTRING(DATENAME(month, @Date), 1, 3) AS [Calendar Month Label] -- CY2013-Jan
, SUBSTRING(DATENAME(month, @Date), 1, 3)
+ N'-' + DATENAME(year, @Date) AS [Calendar Month Year Label] -- Jan-2013
, DATEPART(quarter, @Date) AS [Calendar Quarter Number] -- 1 (to 4)
, N'CY' + DATENAME(year, @Date)
+ N'-Q' + DATENAME(quarter, @Date) AS [Calendar Quarter Label] -- CY2013-Q1
, N'Q' + DATENAME(quarter, @Date)
+ N'-' + DATENAME(year, @Date) AS [Calendar Quarter Year Label] -- CY2013-Q1
, CASE WHEN DATEPART(month, @Date) < 7
THEN 1
ELSE 2
END AS [Calendar Half of Year Number] -- 1 (to 2)
, N'CY' + DATENAME(year, @Date)
+ N'-H' + CASE WHEN DATEPART(month, @Date) < 7
THEN N'1'
ELSE N'2'
END AS [Calendar Half of Year Label] -- CY2013-H1
, N'H' + CASE WHEN DATEPART(month, @Date) < 7
THEN N'1'
ELSE N'2'
END
+ N'-' + DATENAME(year, @Date) AS [Calendar Year Half of Year Label] -- H1-2013
, YEAR(@Date) AS [Calendar Year] -- 2013
, N'CY' + DATENAME(year, @Date) AS [Calendar Year Label] -- CY2013
, CASE WHEN MONTH(@Date) > 6
THEN MONTH(@Date) - 6
ELSE MONTH(@Date) + 6
END AS [Fiscal Month Number] -- 7
, CAST(N'FY' + CAST(CASE WHEN MONTH(@Date) > 6
THEN YEAR(@Date) + 1
ELSE YEAR(@Date)
END AS NVARCHAR(4)
)
+ N'-'
+ SUBSTRING(DATENAME(month, @Date), 1, 3)
AS NVARCHAR(20)
) AS [Fiscal Month Label] -- FY2013-Jan
, CASE WHEN MONTH(@Date) > 6
THEN DATEPART(quarter, @Date) - 2
ELSE DATEPART(quarter, @Date) + 2
END AS [Fiscal Quarter Number] -- 2
, N'FY' + CAST(CASE WHEN MONTH(@Date) > 6
THEN YEAR(@Date) + 1
ELSE YEAR(@Date)
END AS NVARCHAR(4))
+ N'-Q'
+ CASE WHEN MONTH(@Date) > 6
THEN CAST(DATEPART(quarter, @Date) - 2
AS NVARCHAR(2)
)
ELSE CAST(DATEPART(quarter, @Date) + 2
AS NVARCHAR(2)
)
END AS [Fiscal Quarter Label] -- FY2013-Q2
, CASE WHEN MONTH(@Date) > 6 THEN 1 ELSE 2 END AS [Fiscal Half of Year Number] -- 1 (to 2)
, N'FY' + CAST(CASE WHEN MONTH(@Date) > 6
THEN YEAR(@Date) + 1
ELSE YEAR(@Date)
END AS NVARCHAR(4))
+ N'-H'
+ CASE WHEN MONTH(@Date) > 6
THEN N'1'
ELSE N'2'
END AS [Fiscal Half of Year Label] -- FY2013-H2
, CASE WHEN MONTH(@Date) > 6
THEN YEAR(@Date) + 1
ELSE YEAR(@Date)
END AS [Fiscal Year] -- 2013
, N'FY' + CAST(CASE WHEN MONTH(@Date) > 6
THEN YEAR(@Date) + 1
ELSE YEAR(@Date)
END AS NVARCHAR(4)) AS [Fiscal Year Label] -- FY2013
, YEAR(@Date) * 10000
+ MONTH(@Date) * 100 + DAY(@Date) AS [Date Key] -- 20130101 (to 20131231)
, YEAR(@Date) * 100 + DATEPART(week, @Date) AS [Year Week Key] -- 201301 (to 201353)
, YEAR(@Date) * 100
+ MONTH(@Date) AS [Year Month Key] -- 201301 (to 201312)
, YEAR(@Date) * 10
+ DATEPART(quarter, @Date) AS [Year Quarter Key] -- 20131 (to 20134)
, YEAR(@Date) * 10
+ CASE WHEN DATEPART(month, @Date) < 7
THEN 1
ELSE 2
END AS [Year Half of Year Key] -- 20131 (to 20132)
, YEAR(@Date) AS [Year Key] -- 2013
, CASE WHEN MONTH(@Date) > 6
THEN (YEAR(@Date) + 1) * 100
+ MONTH(@Date)
ELSE YEAR(@Date) * 100
+ MONTH(@Date)
END AS [Fiscal Year Month Key] -- 201301 (to 201312)
, (YEAR(@Date) * 10000) + (MONTH(@Date) * 100) + 1 AS [Beginning of Month Key] -- 20130101
, CASE WHEN MONTH(@Date) BETWEEN 1 AND 3
THEN (YEAR(@Date) * 10000) + 0101
WHEN MONTH(@Date) BETWEEN 4 AND 6
THEN (YEAR(@Date) * 10000) + 0401
WHEN MONTH(@Date) BETWEEN 7 AND 9
THEN (YEAR(@Date) * 10000) + 0701
WHEN MONTH(@Date) BETWEEN 10 AND 12
THEN (YEAR(@Date) * 10000) + 1001
END AS [Beginning of Quarter Key] -- 20130101
, CASE WHEN DATEPART(month, @Date) < 7
THEN (YEAR(@Date) * 10000) + 0101
ELSE (YEAR(@Date) * 10000) + 0701
END AS [Beginning of Half of Year Key]
, (YEAR(@Date) * 10000) + 0101 AS [Beginning of Year Key] -- 20130101
, CASE WHEN MONTH(@Date) > 6
THEN ((YEAR(@Date) + 1 ) * 10)
+ DATEPART(quarter, @Date) - 2
ELSE (YEAR(@Date) * 10)
+ DATEPART(quarter, @Date) + 2
END AS [Fiscal Year Quarter Key] -- 20131
, CASE WHEN MONTH(@Date) > 6
THEN ((YEAR(@Date) + 1 ) * 10) + 1
ELSE (YEAR(@Date) * 10) + 2
END AS [Fiscal Year Half of Year Key] -- 20131
, DATEPART(ISO_WEEK, @Date) AS [ISO Week Number] -- 1
; | the_stack |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- 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';
--
-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
--
-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: data_dumps; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE data_dumps (
id integer NOT NULL,
data text,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: data_dumps_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE data_dumps_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: data_dumps_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE data_dumps_id_seq OWNED BY data_dumps.id;
--
-- Name: issue_assignments; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE issue_assignments (
id integer NOT NULL,
issue_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
repo_subscription_id integer,
clicked boolean DEFAULT false,
delivered boolean DEFAULT false
);
--
-- Name: issue_assignments_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE issue_assignments_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: issue_assignments_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE issue_assignments_id_seq OWNED BY issue_assignments.id;
--
-- Name: issues; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE issues (
id integer NOT NULL,
comment_count integer,
url character varying(255),
repo_name character varying(255),
user_name character varying(255),
last_touched_at timestamp without time zone,
number integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
repo_id integer,
title character varying(255),
html_url character varying(255),
state character varying(255),
pr_attached boolean DEFAULT false
);
--
-- Name: issues_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE issues_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: issues_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE issues_id_seq OWNED BY issues.id;
--
-- Name: opro_auth_grants; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE opro_auth_grants (
id integer NOT NULL,
code character varying(255),
access_token character varying(255),
refresh_token character varying(255),
permissions text,
access_token_expires_at timestamp without time zone,
user_id integer,
application_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: opro_auth_grants_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE opro_auth_grants_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: opro_auth_grants_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE opro_auth_grants_id_seq OWNED BY opro_auth_grants.id;
--
-- Name: opro_client_apps; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE opro_client_apps (
id integer NOT NULL,
name character varying(255),
app_id character varying(255),
app_secret character varying(255),
permissions text,
user_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: opro_client_apps_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE opro_client_apps_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: opro_client_apps_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE opro_client_apps_id_seq OWNED BY opro_client_apps.id;
--
-- Name: repo_subscriptions; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE repo_subscriptions (
id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
user_id integer,
repo_id integer,
last_sent_at timestamp without time zone,
email_limit integer DEFAULT 1
);
--
-- Name: repo_subscriptions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE repo_subscriptions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: repo_subscriptions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE repo_subscriptions_id_seq OWNED BY repo_subscriptions.id;
--
-- Name: repos; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE repos (
id integer NOT NULL,
name character varying(255),
user_name character varying(255),
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
issues_count integer DEFAULT 0 NOT NULL,
language character varying(255),
description character varying(255),
full_name character varying(255),
notes text,
github_error_msg text
);
--
-- Name: repos_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE repos_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: repos_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE repos_id_seq OWNED BY repos.id;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE schema_migrations (
version character varying NOT NULL
);
--
-- Name: users; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
CREATE TABLE users (
id integer NOT NULL,
email character varying(255) DEFAULT ''::character varying NOT NULL,
encrypted_password character varying(255) DEFAULT ''::character varying NOT NULL,
reset_password_token character varying(255),
reset_password_sent_at timestamp without time zone,
remember_created_at timestamp without time zone,
sign_in_count integer DEFAULT 0,
current_sign_in_at timestamp without time zone,
last_sign_in_at timestamp without time zone,
current_sign_in_ip character varying(255),
last_sign_in_ip character varying(255),
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
zip character varying(255),
phone_number character varying(255),
twitter boolean,
github character varying(255),
github_access_token character varying(255),
admin boolean,
name character varying(255),
avatar_url character varying(255) DEFAULT 'http://gravatar.com/avatar/default'::character varying,
private boolean DEFAULT false,
favorite_languages character varying[],
daily_issue_limit integer,
skip_issues_with_pr boolean DEFAULT false,
account_delete_token character varying(255),
last_clicked_at timestamp without time zone
);
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE users_id_seq OWNED BY users.id;
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY data_dumps ALTER COLUMN id SET DEFAULT nextval('data_dumps_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY issue_assignments ALTER COLUMN id SET DEFAULT nextval('issue_assignments_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY opro_auth_grants ALTER COLUMN id SET DEFAULT nextval('opro_auth_grants_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY opro_client_apps ALTER COLUMN id SET DEFAULT nextval('opro_client_apps_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY repo_subscriptions ALTER COLUMN id SET DEFAULT nextval('repo_subscriptions_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY repos ALTER COLUMN id SET DEFAULT nextval('repos_id_seq'::regclass);
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
--
-- Name: data_dumps_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY data_dumps
ADD CONSTRAINT data_dumps_pkey PRIMARY KEY (id);
--
-- Name: issue_assignments_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY issue_assignments
ADD CONSTRAINT issue_assignments_pkey PRIMARY KEY (id);
--
-- Name: issues_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY issues
ADD CONSTRAINT issues_pkey PRIMARY KEY (id);
--
-- Name: opro_auth_grants_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY opro_auth_grants
ADD CONSTRAINT opro_auth_grants_pkey PRIMARY KEY (id);
--
-- Name: opro_client_apps_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY opro_client_apps
ADD CONSTRAINT opro_client_apps_pkey PRIMARY KEY (id);
--
-- Name: repo_subscriptions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY repo_subscriptions
ADD CONSTRAINT repo_subscriptions_pkey PRIMARY KEY (id);
--
-- Name: repos_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY repos
ADD CONSTRAINT repos_pkey PRIMARY KEY (id);
--
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: index_issue_assignments_on_delivered; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX index_issue_assignments_on_delivered ON issue_assignments USING btree (delivered);
--
-- Name: index_issues_on_number; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX index_issues_on_number ON issues USING btree (number);
--
-- Name: index_issues_on_repo_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX index_issues_on_repo_id ON issues USING btree (repo_id);
--
-- Name: index_issues_on_state; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX index_issues_on_state ON issues USING btree (state);
--
-- Name: index_users_on_account_delete_token; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE INDEX index_users_on_account_delete_token ON users USING btree (account_delete_token);
--
-- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE UNIQUE INDEX index_users_on_email ON users USING btree (email);
--
-- Name: index_users_on_github; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE UNIQUE INDEX index_users_on_github ON users USING btree (github);
--
-- Name: index_users_on_reset_password_token; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE UNIQUE INDEX index_users_on_reset_password_token ON users USING btree (reset_password_token);
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
--
-- PostgreSQL database dump complete
--
SET search_path TO "$user",public;
INSERT INTO schema_migrations (version) VALUES ('20120222223509');
INSERT INTO schema_migrations (version) VALUES ('20120222231841');
INSERT INTO schema_migrations (version) VALUES ('20120518083745');
INSERT INTO schema_migrations (version) VALUES ('20120518085406');
INSERT INTO schema_migrations (version) VALUES ('20120518090213');
INSERT INTO schema_migrations (version) VALUES ('20120518091140');
INSERT INTO schema_migrations (version) VALUES ('20120620000230');
INSERT INTO schema_migrations (version) VALUES ('20120622203236');
INSERT INTO schema_migrations (version) VALUES ('20120622233057');
INSERT INTO schema_migrations (version) VALUES ('20120622235822');
INSERT INTO schema_migrations (version) VALUES ('20120624204958');
INSERT INTO schema_migrations (version) VALUES ('20120624212352');
INSERT INTO schema_migrations (version) VALUES ('20120624213335');
INSERT INTO schema_migrations (version) VALUES ('20120627213051');
INSERT INTO schema_migrations (version) VALUES ('20120707182259');
INSERT INTO schema_migrations (version) VALUES ('20121106072214');
INSERT INTO schema_migrations (version) VALUES ('20121110213717');
INSERT INTO schema_migrations (version) VALUES ('20121112100015');
INSERT INTO schema_migrations (version) VALUES ('20121120203919');
INSERT INTO schema_migrations (version) VALUES ('20121127163516');
INSERT INTO schema_migrations (version) VALUES ('20121127171308');
INSERT INTO schema_migrations (version) VALUES ('20121128162942');
INSERT INTO schema_migrations (version) VALUES ('20130222201747');
INSERT INTO schema_migrations (version) VALUES ('20130312023533');
INSERT INTO schema_migrations (version) VALUES ('20130503183402');
INSERT INTO schema_migrations (version) VALUES ('20130803144944');
INSERT INTO schema_migrations (version) VALUES ('20130918055659');
INSERT INTO schema_migrations (version) VALUES ('20130918060600');
INSERT INTO schema_migrations (version) VALUES ('20131107042958');
INSERT INTO schema_migrations (version) VALUES ('20140524120051');
INSERT INTO schema_migrations (version) VALUES ('20140621155109');
INSERT INTO schema_migrations (version) VALUES ('20140710161559');
INSERT INTO schema_migrations (version) VALUES ('20140710164307');
INSERT INTO schema_migrations (version) VALUES ('20150629002651');
INSERT INTO schema_migrations (version) VALUES ('20150629010617');
INSERT INTO schema_migrations (version) VALUES ('20151007212330');
INSERT INTO schema_migrations (version) VALUES ('20151021160718'); | the_stack |
;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`blog` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `blog`;
/*Table structure for table `blog` */
DROP TABLE IF EXISTS `blog`;
CREATE TABLE `blog` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '博文id',
`blogger_id` int(11) unsigned NOT NULL COMMENT '博文所属博主id',
`category_ids` varchar(100) DEFAULT NULL COMMENT '博文所属类别id(用特定字符分隔)',
`label_ids` varchar(100) DEFAULT NULL COMMENT '博文包含的标签(用特定字符分隔)',
`state` int(11) NOT NULL DEFAULT '0' COMMENT '文章状态(公开,私有,审核中,回收站...)',
`title` varchar(80) NOT NULL COMMENT '博文标题',
`content` longtext NOT NULL COMMENT '博文主体内容html格式',
`content_md` longtext NOT NULL COMMENT '博文主题内容md格式',
`summary` varchar(400) NOT NULL COMMENT '博文摘要',
`release_date` datetime NOT NULL COMMENT '首次发布日期',
`nearest_modify_date` datetime NOT NULL COMMENT '最后一次修改时间',
`key_words` varchar(400) DEFAULT NULL COMMENT '博文关键字(空格分隔)',
`word_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '博文字数',
PRIMARY KEY (`id`),
UNIQUE KEY `blogger_id` (`blogger_id`,`title`),
CONSTRAINT `blog_ibfk_1` FOREIGN KEY (`blogger_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=186 DEFAULT CHARSET=utf8;
/*Table structure for table `blog_admire` */
DROP TABLE IF EXISTS `blog_admire`;
CREATE TABLE `blog_admire` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '赞赏记录表id',
`blog_id` int(10) unsigned NOT NULL COMMENT '交易针对的博文id',
`paier_id` int(11) unsigned NOT NULL COMMENT '付钱者id',
`money` float(10,0) unsigned NOT NULL DEFAULT '0' COMMENT '金额',
`tran_date` datetime NOT NULL COMMENT '交易时间',
PRIMARY KEY (`id`),
KEY `blog_id` (`blog_id`),
KEY `paier_id` (`paier_id`),
CONSTRAINT `blog_admire_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_admire_ibfk_2` FOREIGN KEY (`paier_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `blog_category` */
DROP TABLE IF EXISTS `blog_category`;
CREATE TABLE `blog_category` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '博文类别id',
`blogger_id` int(10) unsigned DEFAULT NULL COMMENT '创建该类别的博主',
`icon_id` int(10) unsigned DEFAULT NULL COMMENT '类别图标',
`title` varchar(20) NOT NULL COMMENT '类别名',
`bewrite` text COMMENT '类别描述',
`create_date` datetime NOT NULL COMMENT '类别创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `blogger_id` (`blogger_id`,`title`),
KEY `icon_id` (`icon_id`),
CONSTRAINT `blog_category_ibfk_1` FOREIGN KEY (`blogger_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_category_ibfk_2` FOREIGN KEY (`icon_id`) REFERENCES `blogger_picture` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=57 DEFAULT CHARSET=utf8;
/*Table structure for table `blog_collect` */
DROP TABLE IF EXISTS `blog_collect`;
CREATE TABLE `blog_collect` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '收藏博文表id',
`blog_id` int(11) unsigned NOT NULL COMMENT '收藏的博文id',
`collector_id` int(10) unsigned NOT NULL COMMENT '收藏者id',
`reason` text COMMENT '收藏的理由',
`collect_date` datetime NOT NULL COMMENT '收藏时间',
`category_id` int(10) unsigned DEFAULT '0' COMMENT '收藏到自己的哪一个类别下',
PRIMARY KEY (`id`),
UNIQUE KEY `blog_id` (`blog_id`,`collector_id`),
KEY `blogger_id` (`collector_id`),
KEY `category_id` (`category_id`),
CONSTRAINT `blog_collect_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_collect_ibfk_2` FOREIGN KEY (`collector_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8;
/*Table structure for table `blog_comment` */
DROP TABLE IF EXISTS `blog_comment`;
CREATE TABLE `blog_comment` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '评论id',
`blog_id` int(10) unsigned NOT NULL COMMENT '评论针对的博客id',
`spokesman_id` int(10) unsigned DEFAULT NULL COMMENT '评论者id',
`listener_id` int(10) unsigned DEFAULT NULL COMMENT '被评论者id',
`content` text NOT NULL COMMENT '评论内容',
`release_date` datetime NOT NULL COMMENT '评论时间',
`state` int(11) NOT NULL DEFAULT '0' COMMENT '状态(审核中...)',
PRIMARY KEY (`id`),
KEY `blog_id` (`blog_id`),
KEY `spokesman_id` (`spokesman_id`),
KEY `listener_id` (`listener_id`),
CONSTRAINT `blog_comment_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_comment_ibfk_2` FOREIGN KEY (`spokesman_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_comment_ibfk_3` FOREIGN KEY (`listener_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8;
/*Table structure for table `blog_complain` */
DROP TABLE IF EXISTS `blog_complain`;
CREATE TABLE `blog_complain` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id',
`complainer_id` int(10) unsigned NOT NULL COMMENT '投诉者id',
`blog_id` int(10) unsigned NOT NULL COMMENT '投诉的博文',
`content` varchar(255) NOT NULL COMMENT '投诉理由',
`time` datetime NOT NULL COMMENT '投诉时间',
PRIMARY KEY (`id`),
KEY `blog_id` (`blog_id`),
KEY `complainer_id` (`complainer_id`),
CONSTRAINT `blog_complain_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_complain_ibfk_2` FOREIGN KEY (`complainer_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `blog_label` */
DROP TABLE IF EXISTS `blog_label`;
CREATE TABLE `blog_label` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '标签id',
`blogger_id` int(10) unsigned NOT NULL COMMENT '创建该标签的博主',
`title` varchar(20) NOT NULL COMMENT '标签名',
`create_date` datetime NOT NULL COMMENT '标签创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `blogger_id_2` (`blogger_id`,`title`),
KEY `blogger_id` (`blogger_id`),
CONSTRAINT `blog_label_ibfk_1` FOREIGN KEY (`blogger_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=61 DEFAULT CHARSET=utf8;
/*Table structure for table `blog_like` */
DROP TABLE IF EXISTS `blog_like`;
CREATE TABLE `blog_like` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '博文喜欢表id',
`blog_id` int(10) unsigned NOT NULL COMMENT '被喜欢的文章',
`liker_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '仰慕者(给出like的人)id,未注册读者用0表示',
`like_date` datetime NOT NULL COMMENT '时间',
PRIMARY KEY (`id`),
UNIQUE KEY `admirer_id` (`liker_id`,`blog_id`),
KEY `blog_like_ibfk_1` (`blog_id`),
CONSTRAINT `blog_like_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blog_like_ibfk_2` FOREIGN KEY (`liker_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8;
/*Table structure for table `blog_statistics` */
DROP TABLE IF EXISTS `blog_statistics`;
CREATE TABLE `blog_statistics` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id',
`blog_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '对应博文id',
`comment_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '评论次数',
`view_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '博文浏览次数',
`reply_comment_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '博主回复该博文评论的次数',
`collect_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '收藏次数',
`complain_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '投诉次数',
`share_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '分享次数',
`admire_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '赞赏次数',
`like_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '喜欢次数',
`release_date` date NOT NULL COMMENT '发布时间',
PRIMARY KEY (`id`),
UNIQUE KEY `blog_id` (`blog_id`),
CONSTRAINT `blog_statistics_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blog` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=177 DEFAULT CHARSET=utf8;
/*Table structure for table `blogger_account` */
DROP TABLE IF EXISTS `blogger_account`;
CREATE TABLE `blogger_account` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '博主id',
`username` varchar(50) NOT NULL COMMENT '博主用户名',
`password` varchar(100) NOT NULL COMMENT '博主密码',
`register_date` datetime NOT NULL COMMENT '注册时间',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
/*Table structure for table `blogger_link` */
DROP TABLE IF EXISTS `blogger_link`;
CREATE TABLE `blogger_link` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '博主友情链接id',
`blogger_id` int(10) unsigned NOT NULL COMMENT '链接所属博主id',
`icon_id` int(10) unsigned DEFAULT NULL COMMENT '图标id',
`title` varchar(50) NOT NULL COMMENT '链接标题',
`url` varchar(200) NOT NULL COMMENT '链接url',
`bewrite` varchar(100) DEFAULT NULL COMMENT '链接描述',
PRIMARY KEY (`id`),
UNIQUE KEY `blogger_id` (`blogger_id`,`url`),
KEY `icon_id` (`icon_id`),
CONSTRAINT `blogger_link_ibfk_1` FOREIGN KEY (`blogger_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `blogger_link_ibfk_2` FOREIGN KEY (`icon_id`) REFERENCES `blogger_picture` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=63 DEFAULT CHARSET=utf8;
/*Table structure for table `blogger_picture` */
DROP TABLE IF EXISTS `blogger_picture`;
CREATE TABLE `blogger_picture` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '照片id',
`blogger_id` int(11) unsigned NOT NULL COMMENT '照片所属博主id',
`bewrite` text COMMENT '照片描述',
`category` int(11) NOT NULL DEFAULT '0' COMMENT '照片类别',
`path` varchar(230) NOT NULL COMMENT '照片保存位置',
`title` varchar(200) NOT NULL COMMENT '照片标题',
`upload_date` datetime NOT NULL COMMENT '照片上传日期',
`use_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '图片被引用次数',
PRIMARY KEY (`id`),
KEY `blogger_id` (`blogger_id`),
CONSTRAINT `blogger_picture_ibfk_1` FOREIGN KEY (`blogger_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=187 DEFAULT CHARSET=utf8;
/*Table structure for table `blogger_profile` */
DROP TABLE IF EXISTS `blogger_profile`;
CREATE TABLE `blogger_profile` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '博主资料id',
`blogger_id` int(11) unsigned NOT NULL COMMENT '博主id',
`phone` varchar(20) DEFAULT NULL COMMENT '电话',
`email` varchar(50) DEFAULT NULL COMMENT '邮箱',
`about_me` text COMMENT '关于我',
`intro` text COMMENT '一句话简介',
`avatar_id` int(10) unsigned DEFAULT NULL COMMENT '博主头像',
PRIMARY KEY (`id`),
UNIQUE KEY `blogger_id` (`blogger_id`),
UNIQUE KEY `phone` (`phone`),
KEY `avatar_id` (`avatar_id`),
CONSTRAINT `blogger_profile_ibfk_2` FOREIGN KEY (`avatar_id`) REFERENCES `blogger_picture` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `blogger_profile_ibfk_3` FOREIGN KEY (`blogger_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
/*Table structure for table `blogger_setting` */
DROP TABLE IF EXISTS `blogger_setting`;
CREATE TABLE `blogger_setting` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`blogger_id` int(10) unsigned NOT NULL,
`main_page_nav_pos` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '博主主页个人信息栏位置,0为左,1为右',
PRIMARY KEY (`id`),
KEY `blogger_id` (`blogger_id`),
CONSTRAINT `blogger_setting_ibfk_1` FOREIGN KEY (`blogger_id`) REFERENCES `blogger_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
/*!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 */; | the_stack |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you 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.
--
--
-- BPEL Related SQL Scripts
--
CREATE TABLE ODE_SCHEMA_VERSION (VERSION integer)
/
-- Apache ODE - SimpleScheduler Database Schema
--
-- Oracle Script
--
--
-- DROP TABLE ode_job;
CREATE TABLE ode_job (
jobid VARCHAR(64) NOT NULL,
ts number(37) NOT NULL,
nodeid varchar(64),
scheduled int NOT NULL,
transacted int NOT NULL,
instanceId number(37),
mexId varchar(255),
processId varchar(255),
type varchar(255),
channel varchar(255),
correlatorId varchar(255),
correlationKeySet varchar(255),
retryCount int,
inMem int,
detailsExt blob,
PRIMARY KEY(jobid))
/
CREATE INDEX IDX_ODE_JOB_TS ON ode_job(ts)
/
CREATE INDEX IDX_ODE_JOB_NODEID ON ode_job(nodeid)
/
CREATE TABLE TASK_ATTACHMENT (ATTACHMENT_ID NUMBER NOT NULL, MESSAGE_EXCHANGE_ID VARCHAR2(255), PRIMARY KEY (ATTACHMENT_ID))
/
CREATE TABLE ODE_PROCESS_INSTANCE (ID NUMBER NOT NULL, DATE_CREATED TIMESTAMP, EXECUTION_STATE BLOB, FAULT_ID NUMBER, LAST_ACTIVE_TIME TIMESTAMP, LAST_RECOVERY_DATE TIMESTAMP, PREVIOUS_STATE NUMBER, SEQUENCE NUMBER, INSTANCE_STATE NUMBER, INSTANTIATING_CORRELATOR_ID NUMBER, PROCESS_ID NUMBER, ROOT_SCOPE_ID NUMBER, PRIMARY KEY (ID))
/
CREATE TABLE ODE_SCOPE (SCOPE_ID NUMBER NOT NULL, MODEL_ID NUMBER, SCOPE_NAME VARCHAR2(255), SCOPE_STATE VARCHAR2(255), PROCESS_INSTANCE_ID NUMBER, PARENT_SCOPE_ID NUMBER, PRIMARY KEY (SCOPE_ID))
/
CREATE TABLE ODE_PARTNER_LINK (PARTNER_LINK_ID NUMBER NOT NULL, MY_EPR CLOB, MY_ROLE_NAME VARCHAR2(255), MY_ROLE_SERVICE_NAME VARCHAR2(255), MY_SESSION_ID VARCHAR2(255), PARTNER_EPR CLOB, PARTNER_LINK_MODEL_ID NUMBER, PARTNER_LINK_NAME VARCHAR2(255), PARTNER_ROLE_NAME VARCHAR2(255), PARTNER_SESSION_ID VARCHAR2(255), SCOPE_ID NUMBER, PRIMARY KEY (PARTNER_LINK_ID))
/
CREATE TABLE ODE_PROCESS (ID NUMBER NOT NULL, GUID VARCHAR2(255), PROCESS_ID VARCHAR2(255), PROCESS_TYPE VARCHAR2(255), VERSION NUMBER, PRIMARY KEY (ID))
/
CREATE TABLE ODE_CORRELATOR (CORRELATOR_ID NUMBER NOT NULL, CORRELATOR_KEY VARCHAR2(255), PROC_ID NUMBER, PRIMARY KEY (CORRELATOR_ID))
/
CREATE TABLE ODE_MESSAGE_EXCHANGE (MESSAGE_EXCHANGE_ID VARCHAR2(255) NOT NULL, CALLEE VARCHAR2(255), CHANNEL VARCHAR2(255), CORRELATION_ID VARCHAR2(255), CORRELATION_KEYS VARCHAR2(255), CORRELATION_STATUS VARCHAR2(255), CREATE_TIME TIMESTAMP, DIRECTION NUMBER, EPR CLOB, FAULT VARCHAR2(255), FAULT_EXPLANATION VARCHAR2(255), OPERATION VARCHAR2(255), PARTNER_LINK_MODEL_ID NUMBER, PATTERN VARCHAR2(255), PIPED_ID VARCHAR2(255), PORT_TYPE VARCHAR2(255), PROPAGATE_TRANS NUMBER, STATUS VARCHAR2(255), SUBSCRIBER_COUNT NUMBER, CORR_ID NUMBER, PARTNER_LINK_ID NUMBER, PROCESS_ID NUMBER, PROCESS_INSTANCE_ID NUMBER, REQUEST_MESSAGE_ID NUMBER, RESPONSE_MESSAGE_ID NUMBER, PRIMARY KEY (MESSAGE_EXCHANGE_ID))
/
CREATE TABLE ODE_MESSAGE (MESSAGE_ID NUMBER NOT NULL, DATA CLOB, HEADER CLOB, TYPE VARCHAR2(255), MESSAGE_EXCHANGE_ID VARCHAR2(255), PRIMARY KEY (MESSAGE_ID))
/
CREATE TABLE ODE_ACTIVITY_RECOVERY (ID NUMBER NOT NULL, ACTIONS VARCHAR2(255), ACTIVITY_ID NUMBER, CHANNEL VARCHAR2(255), DATE_TIME TIMESTAMP, DETAILS CLOB, INSTANCE_ID NUMBER, REASON VARCHAR2(255), RETRIES NUMBER, PRIMARY KEY (ID))
/
CREATE TABLE ODE_CORRELATION_SET (CORRELATION_SET_ID NUMBER NOT NULL, CORRELATION_KEY VARCHAR2(255), NAME VARCHAR2(255), SCOPE_ID NUMBER, PRIMARY KEY (CORRELATION_SET_ID))
/
CREATE TABLE ODE_CORSET_PROP (ID NUMBER NOT NULL, CORRSET_ID NUMBER, PROP_KEY VARCHAR2(255), PROP_VALUE VARCHAR2(255), PRIMARY KEY (ID))
/
CREATE TABLE ODE_EVENT (EVENT_ID NUMBER NOT NULL, DETAIL VARCHAR2(255), DATA BLOB, SCOPE_ID NUMBER, TSTAMP TIMESTAMP, TYPE VARCHAR2(255), INSTANCE_ID NUMBER, PROCESS_ID NUMBER, PRIMARY KEY (EVENT_ID))
/
CREATE TABLE ODE_FAULT (FAULT_ID NUMBER NOT NULL, ACTIVITY_ID NUMBER, DATA CLOB, MESSAGE VARCHAR2(4000), LINE_NUMBER NUMBER, NAME VARCHAR2(255), PRIMARY KEY (FAULT_ID))
/
CREATE TABLE ODE_MESSAGE_ROUTE (MESSAGE_ROUTE_ID NUMBER NOT NULL, CORRELATION_KEY VARCHAR2(255), GROUP_ID VARCHAR2(255), ROUTE_INDEX NUMBER, PROCESS_INSTANCE_ID NUMBER, ROUTE_POLICY VARCHAR2(16), CORR_ID NUMBER, PRIMARY KEY (MESSAGE_ROUTE_ID))
/
CREATE TABLE ODE_MEX_PROP (ID NUMBER NOT NULL, MEX_ID VARCHAR2(255), PROP_KEY VARCHAR2(255), PROP_VALUE VARCHAR2(2000), PRIMARY KEY (ID))
/
CREATE TABLE ODE_XML_DATA (XML_DATA_ID NUMBER NOT NULL, DATA CLOB, IS_SIMPLE_TYPE NUMBER, NAME VARCHAR2(255), SCOPE_ID NUMBER, PRIMARY KEY (XML_DATA_ID))
/
CREATE TABLE ODE_XML_DATA_PROP (ID NUMBER NOT NULL, XML_DATA_ID NUMBER, PROP_KEY VARCHAR2(255), PROP_VALUE VARCHAR2(255), PRIMARY KEY (ID))
/
CREATE TABLE OPENJPA_SEQUENCE_TABLE (ID NUMBER NOT NULL, SEQUENCE_VALUE NUMBER, PRIMARY KEY (ID))
/
CREATE TABLE STORE_DU (NAME VARCHAR2(255) NOT NULL, DEPLOYDT TIMESTAMP, DEPLOYER VARCHAR2(255), DIR VARCHAR2(255), PRIMARY KEY (NAME))
/
CREATE TABLE STORE_PROCESS (PID VARCHAR2(255) NOT NULL, STATE VARCHAR2(255), TYPE VARCHAR2(255), VERSION NUMBER, DU VARCHAR2(255), PRIMARY KEY (PID))
/
CREATE TABLE STORE_PROCESS_PROP (id NUMBER NOT NULL, PROP_KEY VARCHAR2(255), PROP_VAL VARCHAR2(255), PRIMARY KEY (id))
/
CREATE TABLE STORE_PROC_TO_PROP (PROCESSCONFDAOIMPL_PID VARCHAR2(255), ELEMENT_ID NUMBER)
/
CREATE TABLE STORE_VERSIONS (id NUMBER NOT NULL, VERSION NUMBER, PRIMARY KEY (id))
/
CREATE INDEX I_D_TASK_ATTACMENT ON TASK_ATTACHMENT (MESSAGE_EXCHANGE_ID)
/
CREATE INDEX I_D_CTVRY_INSTANCE ON ODE_ACTIVITY_RECOVERY (INSTANCE_ID)
/
CREATE INDEX I_D_CR_ST_SCOPE ON ODE_CORRELATION_SET (SCOPE_ID)
/
CREATE INDEX I_D_CRLTR_PROCESS ON ODE_CORRELATOR (PROC_ID)
/
CREATE INDEX I_D_CRPRP_CORRSET ON ODE_CORSET_PROP (CORRSET_ID)
/
CREATE INDEX I_OD_VENT_INSTANCE ON ODE_EVENT (INSTANCE_ID)
/
CREATE INDEX I_OD_VENT_PROCESS ON ODE_EVENT (PROCESS_ID)
/
CREATE INDEX I_OD_MSSG_MESSAGEEXCHANGE ON ODE_MESSAGE (MESSAGE_EXCHANGE_ID)
/
CREATE INDEX I_D_MSHNG_CORRELATOR ON ODE_MESSAGE_EXCHANGE (CORR_ID)
/
CREATE INDEX I_D_MSHNG_PARTNERLINK ON ODE_MESSAGE_EXCHANGE (PARTNER_LINK_ID)
/
CREATE INDEX I_D_MSHNG_PROCESS ON ODE_MESSAGE_EXCHANGE (PROCESS_ID)
/
CREATE INDEX I_D_MSHNG_PROCESSINST ON ODE_MESSAGE_EXCHANGE (PROCESS_INSTANCE_ID)
/
CREATE INDEX I_D_MSHNG_REQUEST ON ODE_MESSAGE_EXCHANGE (REQUEST_MESSAGE_ID)
/
CREATE INDEX I_D_MSHNG_RESPONSE ON ODE_MESSAGE_EXCHANGE (RESPONSE_MESSAGE_ID)
/
CREATE INDEX I_D_MS_RT_CORRELATOR ON ODE_MESSAGE_ROUTE (CORR_ID)
/
CREATE INDEX I_D_MS_RT_PROCESSINST ON ODE_MESSAGE_ROUTE (PROCESS_INSTANCE_ID)
/
CREATE INDEX I_D_MXPRP_MEX ON ODE_MEX_PROP (MEX_ID)
/
CREATE INDEX I_D_PRLNK_SCOPE ON ODE_PARTNER_LINK (SCOPE_ID)
/
CREATE INDEX I_D_PRTNC_FAULT ON ODE_PROCESS_INSTANCE (FAULT_ID)
/
CREATE INDEX I_D_PRTNC_INSTANTIATINGCORRELA ON ODE_PROCESS_INSTANCE (INSTANTIATING_CORRELATOR_ID)
/
CREATE INDEX I_D_PRTNC_PROCESS ON ODE_PROCESS_INSTANCE (PROCESS_ID)
/
CREATE INDEX I_D_PRTNC_ROOTSCOPE ON ODE_PROCESS_INSTANCE (ROOT_SCOPE_ID)
/
CREATE INDEX I_OD_SCOP_PARENTSCOPE ON ODE_SCOPE (PARENT_SCOPE_ID)
/
CREATE INDEX I_OD_SCOP_PROCESSINSTANCE ON ODE_SCOPE (PROCESS_INSTANCE_ID)
/
CREATE INDEX I_D_XM_DT_SCOPE ON ODE_XML_DATA (SCOPE_ID)
/
CREATE INDEX I_D_XMPRP_XMLDATA ON ODE_XML_DATA_PROP (XML_DATA_ID)
/
CREATE INDEX I_STR_CSS_DU ON STORE_PROCESS (DU)
/
CREATE INDEX I_STR_PRP_ELEMENT ON STORE_PROC_TO_PROP (ELEMENT_ID)
/
CREATE INDEX I_STR_PRP_PROCESSCONFDAOIMPL_P ON STORE_PROC_TO_PROP (PROCESSCONFDAOIMPL_PID)
--
-- Human Task Related SQL Scripts
--
/
CREATE TABLE HT_DEADLINE (id NUMBER NOT NULL, DEADLINE_DATE TIMESTAMP NOT NULL, DEADLINE_NAME VARCHAR2(255) NOT NULL, STATUS_TOBE_ACHIEVED VARCHAR2(255) NOT NULL, TASK_ID NUMBER, PRIMARY KEY (id))
/
CREATE TABLE HT_DEPLOYMENT_UNIT (id NUMBER NOT NULL, CHECKSUM VARCHAR2(255) NOT NULL, DEPLOYED_ON TIMESTAMP, DEPLOY_DIR VARCHAR2(255) NOT NULL, NAME VARCHAR2(255) NOT NULL, PACKAGE_NAME VARCHAR2(255) NOT NULL, STATUS VARCHAR2(255) NOT NULL, TENANT_ID NUMBER NOT NULL, VERSION NUMBER NOT NULL, PRIMARY KEY (id))
/
CREATE TABLE HT_EVENT (id NUMBER NOT NULL, EVENT_DETAILS VARCHAR2(255), NEW_STATE VARCHAR2(255), OLD_STATE VARCHAR2(255), EVENT_TIMESTAMP TIMESTAMP NOT NULL, EVENT_TYPE VARCHAR2(255) NOT NULL, EVENT_USER VARCHAR2(255) NOT NULL, TASK_ID NUMBER, PRIMARY KEY (id))
/
CREATE TABLE HT_GENERIC_HUMAN_ROLE (GHR_ID NUMBER NOT NULL, GHR_TYPE VARCHAR2(255), TASK_ID NUMBER, PRIMARY KEY (GHR_ID))
/
CREATE TABLE HT_HUMANROLE_ORGENTITY (HUMANROLE_ID NUMBER, ORGENTITY_ID NUMBER)
/
CREATE TABLE HT_JOB (id NUMBER NOT NULL, JOB_DETAILS VARCHAR2(4000), JOB_NAME VARCHAR2(255), NODEID VARCHAR2(255), SCHEDULED VARCHAR(1) NOT NULL, TASKID NUMBER NOT NULL, JOB_TIME NUMBER NOT NULL, TRANSACTED VARCHAR(1) NOT NULL, JOB_TYPE VARCHAR2(255) NOT NULL, PRIMARY KEY (id))
/
CREATE TABLE HT_MESSAGE (MESSAGE_ID NUMBER NOT NULL, MESSAGE_DATA CLOB, MESSAGE_HEADER CLOB, MESSAGE_TYPE VARCHAR2(255), MESSAGE_NAME VARCHAR2(512), TASK_ID NUMBER, PRIMARY KEY (MESSAGE_ID))
/
CREATE TABLE HT_ORG_ENTITY (ORG_ENTITY_ID NUMBER NOT NULL, ORG_ENTITY_NAME VARCHAR2(255), ORG_ENTITY_TYPE VARCHAR2(255), PRIMARY KEY (ORG_ENTITY_ID))
/
CREATE TABLE HT_PRESENTATION_ELEMENT (id NUMBER NOT NULL, PE_CONTENT VARCHAR2(2000), XML_LANG VARCHAR2(255), PE_TYPE VARCHAR2(31), CONTENT_TYPE VARCHAR2(255), TASK_ID NUMBER, PRIMARY KEY (id))
/
CREATE TABLE HT_PRESENTATION_PARAM (id NUMBER NOT NULL, PARAM_NAME VARCHAR2(255), PARAM_TYPE VARCHAR2(255), PARAM_VALUE VARCHAR2(2000), TASK_ID NUMBER, PRIMARY KEY (id))
/
CREATE TABLE HT_TASK (id NUMBER NOT NULL, ACTIVATION_TIME TIMESTAMP, COMPLETE_BY_TIME TIMESTAMP, CREATED_ON TIMESTAMP, ESCALATED VARCHAR2(1), EXPIRATION_TIME TIMESTAMP, TASK_NAME VARCHAR2(255) NOT NULL, PACKAGE_NAME VARCHAR2(255) NOT NULL, PRIORITY NUMBER NOT NULL, SKIPABLE VARCHAR2(1), START_BY_TIME TIMESTAMP, STATUS VARCHAR2(255) NOT NULL, STATUS_BEFORE_SUSPENSION VARCHAR2(255), TASK_DEF_NAME VARCHAR2(255) NOT NULL, TASK_VERSION NUMBER NOT NULL, TENANT_ID NUMBER NOT NULL, TASK_TYPE VARCHAR2(255) NOT NULL, UPDATED_ON TIMESTAMP, FAILURE_MESSAGE NUMBER, INPUT_MESSAGE NUMBER, OUTPUT_MESSAGE NUMBER, PARENTTASK_ID NUMBER, PRIMARY KEY (id))
/
CREATE TABLE HT_TASK_ATTACHMENT (id NUMBER NOT NULL, ACCESS_TYPE VARCHAR2(255), ATTACHED_AT TIMESTAMP, CONTENT_TYPE VARCHAR2(255), ATTACHMENT_NAME VARCHAR2(255), ATTACHMENT_VALUE VARCHAR2(255), TASK_ID NUMBER, ATTACHED_BY NUMBER, PRIMARY KEY (id))
/
CREATE TABLE HT_TASK_COMMENT (id NUMBER NOT NULL, COMMENT_TEXT VARCHAR2(4000), COMMENTED_BY VARCHAR2(100), COMMENTED_ON TIMESTAMP, MODIFIED_BY VARCHAR2(100), MODIFIED_ON TIMESTAMP, TASK_ID NUMBER, PRIMARY KEY (id))
/
CREATE TABLE HT_VERSIONS (id NUMBER NOT NULL, TASK_VERSION NUMBER NOT NULL, PRIMARY KEY (id))
/
CREATE INDEX I_HT_DDLN_TASK ON HT_DEADLINE (TASK_ID)
/
CREATE INDEX I_HT_VENT_TASK ON HT_EVENT (TASK_ID)
/
CREATE INDEX I_HT_G_RL_TASK ON HT_GENERIC_HUMAN_ROLE (TASK_ID)
/
CREATE INDEX I_HT_HTTY_ELEMENT ON HT_HUMANROLE_ORGENTITY (ORGENTITY_ID)
/
CREATE INDEX I_HT_HTTY_HUMANROLE_ID ON HT_HUMANROLE_ORGENTITY (HUMANROLE_ID)
/
CREATE INDEX I_HT_MSSG_TASK ON HT_MESSAGE (TASK_ID)
/
CREATE INDEX I_HT_PMNT_DTYPE ON HT_PRESENTATION_ELEMENT (PE_TYPE)
/
CREATE INDEX I_HT_PMNT_TASK ON HT_PRESENTATION_ELEMENT (TASK_ID)
/
CREATE INDEX I_HT_PPRM_TASK ON HT_PRESENTATION_PARAM (TASK_ID)
/
CREATE INDEX I_HT_TASK_FAILUREMESSAGE ON HT_TASK (FAILURE_MESSAGE)
/
CREATE INDEX I_HT_TASK_INPUTMESSAGE ON HT_TASK (INPUT_MESSAGE)
/
CREATE INDEX I_HT_TASK_OUTPUTMESSAGE ON HT_TASK (OUTPUT_MESSAGE)
/
CREATE INDEX I_HT_TASK_PARENTTASK ON HT_TASK (PARENTTASK_ID)
/
CREATE INDEX I_HT_TMNT_ATTACHEDBY ON HT_TASK_ATTACHMENT (ATTACHED_BY)
/
CREATE INDEX I_HT_TMNT_TASK ON HT_TASK_ATTACHMENT (TASK_ID)
/
CREATE INDEX I_HT_TMNT_TASK1 ON HT_TASK_COMMENT (TASK_ID)
/
--
-- Attachment Management Related SQL Scripts
--
CREATE TABLE ATTACHMENT (
id NUMBER NOT NULL,
ATTACHMENT_CONTENT BLOB,
CONTENT_TYPE VARCHAR2(255) NOT NULL,
CREATED_BY VARCHAR2(255) NOT NULL,
CREATED_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ATTACHMENT_NAME VARCHAR2(255) NOT NULL,
ATTACHMENT_URL VARCHAR2(2048) NOT NULL,
PRIMARY KEY (id)
)
/
CREATE INDEX I_ATTACHMENT_URL ON ATTACHMENT (ATTACHMENT_URL)
/
--
-- B4P Related SQL Scripts
--
CREATE TABLE HT_COORDINATION_DATA (MESSAGE_ID VARCHAR2(255) NOT NULL, PROCESS_INSTANCE_ID VARCHAR2(255), PROTOCOL_HANDlER_URL VARCHAR2(255) NOT NULL, TASK_ID VARCHAR2(255), PRIMARY KEY (MESSAGE_ID))
/
INSERT INTO ODE_SCHEMA_VERSION values (6) | the_stack |
-- 2017-07-13T14:45:11.698
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543299
;
-- 2017-07-13T14:45:11.708
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541749
;
-- 2017-07-13T14:45:11.711
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541753
;
-- 2017-07-13T14:45:11.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541738
;
-- 2017-07-13T14:45:11.714
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542059
;
-- 2017-07-13T14:45:11.716
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543301
;
-- 2017-07-13T14:45:11.717
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541745
;
-- 2017-07-13T14:45:11.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541747
;
-- 2017-07-13T14:45:11.721
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-07-13 14:45:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541746
;
-- 2017-07-13T14:45:45.725
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='L',Updated=TO_TIMESTAMP('2017-07-13 14:45:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541738
;
-- 2017-07-13T14:46:18.360
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2017-07-13 14:46:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541753
;
-- 2017-07-13T14:46:34.306
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-07-13 14:46:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541746
;
-- 2017-07-13T14:46:37.419
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-07-13 14:46:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541747
;
-- 2017-07-13T14:53:55.234
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-07-13 14:53:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543302
;
-- 2017-07-13T14:53:55.239
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-07-13 14:53:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541754
;
-- 2017-07-13T14:53:55.244
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-07-13 14:53:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541761
;
-- 2017-07-13T14:53:55.248
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-07-13 14:53:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546040
;
-- 2017-07-13T14:53:55.252
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-07-13 14:53:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546041
;
-- 2017-07-13T14:54:06.459
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-07-13 14:54:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543301
;
-- 2017-07-13T14:54:06.465
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-07-13 14:54:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541749
;
-- 2017-07-13T14:54:06.470
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-07-13 14:54:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541753
;
-- 2017-07-13T14:54:06.473
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-07-13 14:54:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541738
;
-- 2017-07-13T14:54:06.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-07-13 14:54:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542059
;
-- 2017-07-13T14:54:35.223
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-07-13 14:54:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541753
;
-- 2017-07-13T14:54:35.227
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-07-13 14:54:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541749
;
-- 2017-07-13T14:55:24.351
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-07-13 14:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543304
;
-- 2017-07-13T14:55:24.359
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-07-13 14:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541757
;
-- 2017-07-13T14:55:24.363
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-07-13 14:55:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541754
;
-- 2017-07-13T14:57:15.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,557729,0,540782,540110,546572,TO_TIMESTAMP('2017-07-13 14:57:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','N','N','Belegstatus',420,0,0,TO_TIMESTAMP('2017-07-13 14:57:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-07-13T14:57:28.256
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-07-13 14:57:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546572
;
-- 2017-07-13T14:59:54.148
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-07-13 14:59:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546572
;
-- 2017-07-13T14:59:54.152
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-07-13 14:59:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541754
;
-- 2017-07-13T14:59:54.155
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-07-13 14:59:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546039
;
-- 2017-07-13T14:59:54.162
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-07-13 14:59:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541761
;
-- 2017-07-13T14:59:54.166
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-07-13 14:59:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546040
;
-- 2017-07-13T14:59:54.173
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-07-13 14:59:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546041
;
-- 2017-07-13T15:00:52.364
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='S',Updated=TO_TIMESTAMP('2017-07-13 15:00:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541757
;
-- 2017-07-13T15:01:17.150
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='L',Updated=TO_TIMESTAMP('2017-07-13 15:01:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541754
; | the_stack |
-- 2013-04-13 Pedro Lopes (Microsoft) pedro.lopes@microsoft.com (http://aka.ms/sqlserverteam/)
--
-- Plan cache xqueries
--
-- 2013-07-16 - Optimized xQueries performance and usability
--
-- 2014-03-16 - Added details to several snippets
--
-- Querying the plan cache for missing indexes
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
PlanMissingIndexes AS (SELECT query_plan, cp.usecounts, cp.refcounts, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) tp
WHERE cp.cacheobjtype = 'Compiled Plan'
AND tp.query_plan.exist('//MissingIndex')=1
)
SELECT c1.value('(//MissingIndex/@Database)[1]', 'sysname') AS database_name,
c1.value('(//MissingIndex/@Schema)[1]', 'sysname') AS [schema_name],
c1.value('(//MissingIndex/@Table)[1]', 'sysname') AS [table_name],
c1.value('@StatementText', 'VARCHAR(4000)') AS sql_text,
c1.value('@StatementId', 'int') AS StatementId,
pmi.usecounts,
pmi.refcounts,
c1.value('(//MissingIndexGroup/@Impact)[1]', 'FLOAT') AS impact,
REPLACE(c1.query('for $group in //ColumnGroup for $column in $group/Column where $group/@Usage="EQUALITY" return string($column/@Name)').value('.', 'varchar(max)'),'] [', '],[') AS equality_columns,
REPLACE(c1.query('for $group in //ColumnGroup for $column in $group/Column where $group/@Usage="INEQUALITY" return string($column/@Name)').value('.', 'varchar(max)'),'] [', '],[') AS inequality_columns,
REPLACE(c1.query('for $group in //ColumnGroup for $column in $group/Column where $group/@Usage="INCLUDE" return string($column/@Name)').value('.', 'varchar(max)'),'] [', '],[') AS include_columns,
pmi.query_plan,
pmi.plan_handle
FROM PlanMissingIndexes pmi
CROSS APPLY pmi.query_plan.nodes('//StmtSimple') AS q1(c1)
WHERE pmi.usecounts > 1
ORDER BY c1.value('(//MissingIndexGroup/@Impact)[1]', 'FLOAT') DESC
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for plans that have warnings
-- Note that SpillToTempDb warnings are only found in actual execution plans
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
WarningSearch AS (SELECT qp.query_plan, cp.usecounts, cp.objtype, wn.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(wn)
WHERE wn.exist('//Warnings') = 1
AND wn.exist('@QueryHash') = 1
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
StmtSimple.value('StmtSimple[1]/@StatementId', 'int') AS StatementId,
c1.value('@NodeId','int') AS node_id,
c1.value('@PhysicalOp','sysname') AS physical_op,
c1.value('@LogicalOp','sysname') AS logical_op,
CASE WHEN c2.exist('@NoJoinPredicate[. = "1"]') = 1 THEN 'NoJoinPredicate'
WHEN c3.exist('@Database') = 1 THEN 'ColumnsWithNoStatistics' END AS warning,
ws.objtype,
ws.usecounts,
ws.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ws.plan_handle
FROM WarningSearch ws
CROSS APPLY StmtSimple.nodes('//RelOp') AS q1(c1)
CROSS APPLY c1.nodes('./Warnings') AS q2(c2)
OUTER APPLY c2.nodes('./ColumnsWithNoStatistics/ColumnReference') AS q3(c3)
UNION ALL
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
StmtSimple.value('StmtSimple[1]/@StatementId', 'int') AS StatementId,
c3.value('@NodeId','int') AS node_id,
c3.value('@PhysicalOp','sysname') AS physical_op,
c3.value('@LogicalOp','sysname') AS logical_op,
CASE WHEN c2.exist('@UnmatchedIndexes[. = "1"]') = 1 THEN 'UnmatchedIndexes'
WHEN (c4.exist('@ConvertIssue[. = "Cardinality Estimate"]') = 1 OR c4.exist('@ConvertIssue[. = "Seek Plan"]') = 1)
THEN 'ConvertIssue_' + c4.value('@ConvertIssue','sysname') END AS warning,
ws.objtype,
ws.usecounts,
ws.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ws.plan_handle
FROM WarningSearch ws
CROSS APPLY StmtSimple.nodes('//QueryPlan') AS q1(c1)
CROSS APPLY c1.nodes('./Warnings') AS q2(c2)
CROSS APPLY c1.nodes('./RelOp') AS q3(c3)
OUTER APPLY c2.nodes('./PlanAffectingConvert') AS q4(c4)
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for batch sorts
-- Do we need TF2340 or USE HINT 'DISABLE_OPTIMIZED_NESTED_LOOP' query hint?
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
Scansearch AS (SELECT qp.query_plan, cp.usecounts, ss.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(ss)
WHERE ss.exist('//RelOp[@PhysicalOp = "Nested Loops"]') = 1
AND ss.exist('@QueryHash') = 1
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
StmtSimple.value('StmtSimple[1]/@StatementId', 'int') AS StatementId,
c1.value('@NodeId','int') AS node_id,
c3.value('@Database','sysname') AS database_name,
c3.value('@Schema','sysname') AS [schema_name],
c3.value('@Table','sysname') AS table_name,
c1.value('@PhysicalOp','sysname') AS physical_operator,
c1.value('@LogicalOp','sysname') AS logical_operator,
c2.value('@Optimized','sysname') AS Batch_Sort_Optimized,
--c2.value('@WithUnorderedPrefetch','sysname') AS WithUnorderedPrefetch,
c4.value('@SerialDesiredMemory', 'int') AS MemGrant_SerialDesiredMemory,
c5.value('@EstimatedAvailableMemoryGrant', 'int') AS EstimatedAvailableMemoryGrant,
--c5.value('@EstimatedPagesCached', 'int') AS EstimatedPagesCached,
--c5.value('@EstimatedAvailableDegreeOfParallelism', 'int') AS EstimatedAvailableDegreeOfParallelism,
ss.usecounts,
ss.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@TableCardinality','sysname') AS TableCardinality,
c1.value('@EstimateRows','sysname') AS EstimateRows,
--c1.value('@EstimateIO','sysname') AS EstimateIO,
--c1.value('@EstimateCPU','sysname') AS EstimateCPU,
c1.value('@AvgRowSize','int') AS AvgRowSize,
--c1.value('@Parallel','bit') AS Parallel,
c1.value('@EstimateRebinds','int') AS EstimateRebinds,
c1.value('@EstimateRewinds','int') AS EstimateRewinds,
c1.value('@EstimatedExecutionMode','sysname') AS EstimatedExecutionMode,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ss.plan_handle
FROM Scansearch ss
CROSS APPLY query_plan.nodes('//RelOp') AS q1(c1)
CROSS APPLY c1.nodes('./NestedLoops') AS q2(c2)
CROSS APPLY c1.nodes('./OutputList/ColumnReference[1]') AS q3(c3)
OUTER APPLY query_plan.nodes('//MemoryGrantInfo') AS q4(c4)
OUTER APPLY query_plan.nodes('//OptimizerHardwareDependentProperties') AS q5(c5)
WHERE c1.exist('@PhysicalOp[. = "Nested Loops"]') = 1
AND c3.value('@Schema','sysname') <> '[sys]'
AND c2.value('@Optimized','sysname') = 1
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for index scans
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
Scansearch AS (SELECT qp.query_plan, cp.usecounts, ss.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(ss)
WHERE cp.cacheobjtype = 'Compiled Plan'
AND (ss.exist('//RelOp[@PhysicalOp = "Index Scan"]') = 1
OR ss.exist('//RelOp[@PhysicalOp = "Clustered Index Scan"]') = 1)
AND ss.exist('@QueryHash') = 1
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
StmtSimple.value('StmtSimple[1]/@StatementId', 'int') AS StatementId,
c1.value('@NodeId','int') AS node_id,
c2.value('@Database','sysname') AS database_name,
c2.value('@Schema','sysname') AS [schema_name],
c2.value('@Table','sysname') AS table_name,
c1.value('@PhysicalOp','sysname') AS physical_operator,
c2.value('@Index','sysname') AS index_name,
c3.value('@ScalarString[1]','VARCHAR(4000)') AS [predicate],
c1.value('@TableCardinality','sysname') AS TableCardinality,
c1.value('@EstimateRows','sysname') AS EstimateRows,
--c1.value('@EstimateIO','sysname') AS EstimateIO,
--c1.value('@EstimateCPU','sysname') AS EstimateCPU,
c1.value('@AvgRowSize','int') AS AvgRowSize,
--c1.value('@Parallel','bit') AS Parallel,
c1.value('@EstimateRebinds','int') AS EstimateRebinds,
c1.value('@EstimateRewinds','int') AS EstimateRewinds,
c1.value('@EstimatedExecutionMode','sysname') AS EstimatedExecutionMode,
c4.value('@Lookup','bit') AS Lookup,
c4.value('@Ordered','bit') AS Ordered,
c4.value('@ScanDirection','sysname') AS ScanDirection,
c4.value('@ForceSeek','bit') AS ForceSeek,
c4.value('@ForceScan','bit') AS ForceScan,
c4.value('@NoExpandHint','bit') AS NoExpandHint,
c4.value('@Storage','sysname') AS Storage,
ss.usecounts,
ss.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ss.plan_handle
FROM Scansearch ss
CROSS APPLY query_plan.nodes('//RelOp') AS q1(c1)
CROSS APPLY c1.nodes('./IndexScan') AS q4(c4)
CROSS APPLY c1.nodes('./IndexScan/Object') AS q2(c2)
OUTER APPLY c1.nodes('./IndexScan/Predicate/ScalarOperator[1]') AS q3(c3)
WHERE (c1.exist('@PhysicalOp[. = "Index Scan"]') = 1
OR c1.exist('@PhysicalOp[. = "Clustered Index Scan"]') = 1)
AND c2.value('@Schema','sysname') <> '[sys]'
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for Lookups
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
Lookupsearch AS (SELECT qp.query_plan, cp.usecounts, ls.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(ls)
WHERE cp.cacheobjtype = 'Compiled Plan'
AND ls.exist('//IndexScan[@Lookup = "1"]') = 1
AND ls.exist('@QueryHash') = 1
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
StmtSimple.value('StmtSimple[1]/@StatementId', 'int') AS StatementId,
c1.value('@NodeId','int') AS node_id,
c2.value('@Database','sysname') AS database_name,
c2.value('@Schema','sysname') AS [schema_name],
c2.value('@Table','sysname') AS table_name,
'Lookup - ' + c1.value('@PhysicalOp','sysname') AS physical_operator,
c2.value('@Index','sysname') AS index_name,
c3.value('@ScalarString','VARCHAR(4000)') AS predicate,
c1.value('@TableCardinality','sysname') AS table_cardinality,
c1.value('@EstimateRows','sysname') AS estimate_rows,
c1.value('@AvgRowSize','sysname') AS avg_row_size,
ls.usecounts,
ls.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ls.plan_handle
FROM Lookupsearch ls
CROSS APPLY query_plan.nodes('//RelOp') AS q1(c1)
CROSS APPLY c1.nodes('./IndexScan/Object') AS q2(c2)
OUTER APPLY c1.nodes('./IndexScan//ScalarOperator[1]') AS q3(c3)
-- Below attribute is present either in Index Seeks or RID Lookups so it can reveal a Lookup is executed
WHERE c1.exist('./IndexScan[@Lookup = "1"]') = 1
AND c2.value('@Schema','sysname') <> '[sys]'
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for specific Implicit type conversions
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
Convertsearch AS (SELECT qp.query_plan, cp.usecounts, cp.objtype, cp.plan_handle, cs.query('.') AS StmtSimple
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(cs)
WHERE cp.cacheobjtype = 'Compiled Plan'
AND cs.exist('@QueryHash') = 1
AND cs.exist('.//ScalarOperator[contains(@ScalarString, "CONVERT_IMPLICIT")]') = 1
AND cs.exist('.[contains(@StatementText, "Convertsearch")]') = 0
)
SELECT c2.value('@StatementText', 'VARCHAR(4000)') AS sql_text,
c2.value('@StatementId', 'int') AS StatementId,
c3.value('@ScalarString[1]','VARCHAR(4000)') AS expression,
ss.usecounts,
ss.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c2.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ss.plan_handle
FROM Convertsearch ss
CROSS APPLY query_plan.nodes('//StmtSimple') AS q2(c2)
CROSS APPLY c2.nodes('.//ScalarOperator[contains(@ScalarString, "CONVERT_IMPLICIT")]') AS q3(c3)
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for index usage (change @IndexName below)
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
DECLARE @IndexName sysname = '<ix_name>';
SET @IndexName = QUOTENAME(@IndexName,'[');
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
IndexSearch AS (SELECT qp.query_plan, cp.usecounts, ix.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(ix)
WHERE cp.cacheobjtype = 'Compiled Plan'
AND ix.exist('//Object[@Index = sql:variable("@IndexName")]') = 1
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
c2.value('@Database','sysname') AS database_name,
c2.value('@Schema','sysname') AS [schema_name],
c2.value('@Table','sysname') AS table_name,
c2.value('@Index','sysname') AS index_name,
c1.value('@PhysicalOp','NVARCHAR(50)') as physical_operator,
c3.value('@ScalarString[1]','VARCHAR(4000)') AS predicate,
c4.value('@Column[1]','VARCHAR(256)') AS seek_columns,
c1.value('@EstimateRows','sysname') AS estimate_rows,
c1.value('@AvgRowSize','sysname') AS avg_row_size,
ixs.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ixs.plan_handle
FROM IndexSearch ixs
CROSS APPLY StmtSimple.nodes('//RelOp') AS q1(c1)
CROSS APPLY c1.nodes('IndexScan/Object[@Index = sql:variable("@IndexName")]') AS q2(c2)
OUTER APPLY c1.nodes('IndexScan/Predicate/ScalarOperator') AS q3(c3)
OUTER APPLY c1.nodes('IndexScan/SeekPredicates/SeekPredicateNew//ColumnReference') AS q4(c4)
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for parametrization
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
PlanParameters AS (SELECT cp.plan_handle, qp.query_plan, qp.dbid, qp.objectid
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
WHERE qp.query_plan.exist('//ParameterList')=1
AND cp.cacheobjtype = 'Compiled Plan'
)
SELECT QUOTENAME(DB_NAME(pp.dbid)) AS database_name,
ISNULL(OBJECT_NAME(pp.objectid, pp.dbid), 'No_Associated_Object') AS [object_name],
c2.value('(@Column)[1]','sysname') AS parameter_name,
c2.value('(@ParameterCompiledValue)[1]','VARCHAR(max)') AS parameter_compiled_value,
pp.query_plan,
pp.plan_handle
FROM PlanParameters pp
CROSS APPLY query_plan.nodes('//ParameterList') AS q1(c1)
CROSS APPLY c1.nodes('ColumnReference') as q2(c2)
WHERE pp.dbid > 4 AND pp.dbid < 32767
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for plans that use parallelism and their cost (useful for tuning Cost Threshold for Parallelism)
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
ParallelSearch AS (SELECT qp.query_plan, cp.usecounts, cp.objtype, ix.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(ix)
WHERE ix.exist('//RelOp[@Parallel = "1"]') = 1
AND ix.exist('@QueryHash') = 1
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
ps.plan_handle,
ps.objtype,
ps.usecounts,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
ps.query_plan,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
c1.value('@CachedPlanSize','sysname') AS CachedPlanSize,
c2.value('@SerialRequiredMemory','sysname') AS SerialRequiredMemory,
c2.value('@SerialDesiredMemory','sysname') AS SerialDesiredMemory,
c3.value('@EstimatedAvailableMemoryGrant','sysname') AS EstimatedAvailableMemoryGrant,
c3.value('@EstimatedPagesCached','sysname') AS EstimatedPagesCached,
c3.value('@EstimatedAvailableDegreeOfParallelism','sysname') AS EstimatedAvailableDegreeOfParallelism,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash
FROM ParallelSearch ps
CROSS APPLY StmtSimple.nodes('//QueryPlan') AS q1(c1)
CROSS APPLY c1.nodes('.//MemoryGrantInfo') AS q2(c2)
CROSS APPLY c1.nodes('.//OptimizerHardwareDependentProperties') AS q3(c3)
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for plans that use parallelism, with more details
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
ParallelSearch AS (SELECT qp.query_plan, cp.usecounts, cp.objtype, ix.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(ix)
WHERE cp.cacheobjtype = 'Compiled Plan'
AND ix.exist('//RelOp[@Parallel = "1"]') = 1
AND ix.exist('@QueryHash') = 1
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
StmtSimple.value('StmtSimple[1]/@StatementId', 'int') AS StatementId,
c1.value('@NodeId','int') AS node_id,
c2.value('@Database','sysname') AS database_name,
c2.value('@Schema','sysname') AS [schema_name],
c2.value('@Table','sysname') AS table_name,
c2.value('@Index','sysname') AS [index],
c2.value('@IndexKind','sysname') AS index_type,
c1.value('@PhysicalOp','sysname') AS physical_op,
c1.value('@LogicalOp','sysname') AS logical_op,
c1.value('@TableCardinality','sysname') AS table_cardinality,
c1.value('@EstimateRows','sysname') AS estimate_rows,
c1.value('@AvgRowSize','sysname') AS avg_row_size,
ps.objtype,
ps.usecounts,
ps.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ps.plan_handle
FROM ParallelSearch ps
CROSS APPLY StmtSimple.nodes('//Parallelism//RelOp') AS q1(c1)
CROSS APPLY c1.nodes('.//IndexScan/Object') AS q2(c2)
WHERE c1.value('@Parallel','int') = 1
AND (c1.exist('@PhysicalOp[. = "Index Scan"]') = 1
OR c1.exist('@PhysicalOp[. = "Clustered Index Scan"]') = 1
OR c1.exist('@PhysicalOp[. = "Index Seek"]') = 1
OR c1.exist('@PhysicalOp[. = "Clustered Index Seek"]') = 1
OR c1.exist('@PhysicalOp[. = "Table Scan"]') = 1)
AND c2.value('@Schema','sysname') <> '[sys]'
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for plans that use parallelism, and scheduler time < elapsed time
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
ParallelSearch AS (SELECT qp.query_plan, cp.usecounts, cp.objtype, qs.[total_worker_time], qs.[total_elapsed_time], qs.[execution_count],
ix.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
INNER JOIN sys.dm_exec_query_stats qs (NOLOCK) ON cp.plan_handle = qs.plan_handle
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(ix)
WHERE cp.cacheobjtype = 'Compiled Plan'
AND ix.exist('//RelOp[@Parallel = "1"]') = 1
AND ix.exist('@QueryHash') = 1
AND (qs.[total_worker_time]/qs.[execution_count]) < (qs.[total_elapsed_time]/qs.[execution_count])
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
ps.objtype,
ps.usecounts,
ps.[total_worker_time]/ps.[execution_count] AS avg_worker_time,
ps.[total_elapsed_time]/ps.[execution_count] As avg_elapsed_time,
ps.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ps.plan_handle
FROM ParallelSearch ps
CROSS APPLY StmtSimple.nodes('//RelOp[1]') AS q1(c1)
WHERE c1.value('@Parallel','int') = 1 AND c1.value('@NodeId','int') = 0
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for plans that use parallelism, and scheduler time < elapsed time and more detailed output
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
ParallelSearch AS (SELECT qp.query_plan, cp.usecounts, cp.objtype, qs.[total_worker_time], qs.[total_elapsed_time], qs.[execution_count],
ix.query('.') AS StmtSimple, cp.plan_handle
FROM sys.dm_exec_cached_plans cp (NOLOCK)
INNER JOIN sys.dm_exec_query_stats qs (NOLOCK) ON cp.plan_handle = qs.plan_handle
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY qp.query_plan.nodes('//StmtSimple') AS p(ix)
WHERE cp.cacheobjtype = 'Compiled Plan'
AND ix.exist('//RelOp[@Parallel = "1"]') = 1
AND ix.exist('@QueryHash') = 1
AND (qs.[total_worker_time]/qs.[execution_count]) < (qs.[total_elapsed_time]/qs.[execution_count])
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
StmtSimple.value('StmtSimple[1]/@StatementId', 'int') AS StatementId,
c1.value('@NodeId','int') AS node_id,
c2.value('@Database','sysname') AS database_name,
c2.value('@Schema','sysname') AS [schema_name],
c2.value('@Table','sysname') AS table_name,
c2.value('@Index','sysname') AS [index],
c2.value('@IndexKind','sysname') AS index_type,
c1.value('@PhysicalOp','sysname') AS physical_op,
c1.value('@LogicalOp','sysname') AS logical_op,
c1.value('@TableCardinality','sysname') AS table_cardinality,
c1.value('@EstimateRows','sysname') AS estimate_rows,
c1.value('@AvgRowSize','sysname') AS avg_row_size,
ps.objtype,
ps.usecounts,
ps.[total_worker_time]/ps.[execution_count] AS avg_worker_time,
ps.[total_elapsed_time]/ps.[execution_count] As avg_elapsed_time,
ps.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ps.plan_handle
FROM ParallelSearch ps
CROSS APPLY StmtSimple.nodes('//Parallelism//RelOp') AS q1(c1)
OUTER APPLY c1.nodes('.//IndexScan/Object') AS q2(c2)
WHERE c1.value('@Parallel','int') = 1
AND (c1.exist('@PhysicalOp[. = "Index Scan"]') = 1
OR c1.exist('@PhysicalOp[. = "Clustered Index Scan"]') = 1
OR c1.exist('@PhysicalOp[. = "Index Seek"]') = 1
OR c1.exist('@PhysicalOp[. = "Clustered Index Seek"]') = 1
OR c1.exist('@PhysicalOp[. = "Table Scan"]') = 1)
AND c2.value('@Schema','sysname') <> '[sys]'
OPTION(RECOMPILE, MAXDOP 1);
GO
-- Querying the plan cache for specific statements (change @Statement below)
DECLARE @Statement VARCHAR(4000) = 'Sales.SalesOrderDetail';
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/sqlserver/2004/07/showplan'),
StatementSearch AS (SELECT qp.query_plan, cp.usecounts, cp.objtype, cp.plan_handle, ss.query('.') AS StmtSimple
FROM sys.dm_exec_cached_plans cp
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) qp
CROSS APPLY query_plan.nodes('//StmtSimple[contains(@StatementText, sql:variable("@Statement"))]') AS p(ss)
WHERE cp.cacheobjtype = 'Compiled Plan'
AND ss.exist('@QueryHash') = 1
)
SELECT StmtSimple.value('StmtSimple[1]/@StatementText', 'VARCHAR(4000)') AS sql_text,
ss.objtype,
ss.usecounts,
ss.query_plan,
StmtSimple.value('StmtSimple[1]/@QueryHash', 'VARCHAR(100)') AS query_hash,
StmtSimple.value('StmtSimple[1]/@QueryPlanHash', 'VARCHAR(100)') AS query_plan_hash,
StmtSimple.value('StmtSimple[1]/@StatementSubTreeCost', 'sysname') AS StatementSubTreeCost,
c1.value('@EstimatedTotalSubtreeCost','sysname') AS EstimatedTotalSubtreeCost,
StmtSimple.value('StmtSimple[1]/@StatementOptmEarlyAbortReason', 'sysname') AS StatementOptmEarlyAbortReason,
StmtSimple.value('StmtSimple[1]/@StatementOptmLevel', 'sysname') AS StatementOptmLevel,
ss.plan_handle
FROM StatementSearch ss
CROSS APPLY StmtSimple.nodes('//Parallelism//RelOp') AS q1(c1)
OPTION(RECOMPILE, MAXDOP 1);
GO | the_stack |
--
-- Copyright 2020 The Android Open Source Project
--
-- 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
--
-- https://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.
--
-- TOP processes that have a RenderThread, sorted by CPU time on RT
DROP VIEW IF EXISTS hwui_processes;
CREATE VIEW hwui_processes AS
SELECT
process.name as process_name,
process.upid as process_upid,
CAST(SUM(sched.dur) / 1e6 as INT64) as rt_cpu_time_ms,
thread.utid as render_thread_id
FROM sched
INNER JOIN thread ON (thread.utid = sched.utid AND thread.name='RenderThread')
INNER JOIN process ON (process.upid = thread.upid)
GROUP BY process.name
ORDER BY rt_cpu_time_ms DESC;
DROP VIEW IF EXISTS hwui_draw_frame;
CREATE VIEW hwui_draw_frame AS
SELECT
count(*) as draw_frame_count,
max(dur) as draw_frame_max,
min(dur) as draw_frame_min,
avg(dur) as draw_frame_avg,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
WHERE slice.name LIKE 'DrawFrame%' AND slice.dur >= 0
GROUP BY thread_track.utid;
DROP VIEW IF EXISTS hwui_flush_commands;
CREATE VIEW hwui_flush_commands AS
SELECT
count(*) as flush_count,
max(dur) as flush_max,
min(dur) as flush_min,
avg(dur) as flush_avg,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
WHERE slice.name='flush commands' AND slice.dur >= 0
GROUP BY thread_track.utid;
DROP VIEW IF EXISTS hwui_prepare_tree;
CREATE VIEW hwui_prepare_tree AS
SELECT
count(*) as prepare_tree_count,
max(dur) as prepare_tree_max,
min(dur) as prepare_tree_min,
avg(dur) as prepare_tree_avg,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
WHERE slice.name='prepareTree' AND slice.dur >= 0
GROUP BY thread_track.utid;
DROP VIEW IF EXISTS hwui_gpu_completion;
CREATE VIEW hwui_gpu_completion AS
SELECT
count(*) as gpu_completion_count,
max(dur) as gpu_completion_max,
min(dur) as gpu_completion_min,
avg(dur) as gpu_completion_avg,
thread.upid as process_upid
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
INNER JOIN thread ON (thread.name='GPU completion' AND thread.utid = thread_track.utid)
WHERE slice.name LIKE 'waiting for GPU completion%' AND slice.dur >= 0
GROUP BY thread_track.utid;
DROP VIEW IF EXISTS hwui_ui_record;
CREATE VIEW hwui_ui_record AS
SELECT
count(*) as ui_record_count,
max(dur) as ui_record_max,
min(dur) as ui_record_min,
avg(dur) as ui_record_avg,
thread.upid as process_upid
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
INNER JOIN thread ON (thread.name=substr(process.name,-15) AND thread.utid = thread_track.utid)
INNER JOIN process ON (process.upid = thread.upid)
WHERE slice.name='Record View#draw()' AND slice.dur >= 0
GROUP BY thread_track.utid;
DROP VIEW IF EXISTS hwui_shader_compile;
CREATE VIEW hwui_shader_compile AS
SELECT
count(*) as shader_compile_count,
sum(dur) as shader_compile_time,
avg(dur) as shader_compile_avg,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
WHERE slice.name='shader_compile' AND slice.dur >= 0
GROUP BY thread_track.utid;
DROP VIEW IF EXISTS hwui_cache_hit;
CREATE VIEW hwui_cache_hit AS
SELECT
count(*) as cache_hit_count,
sum(dur) as cache_hit_time,
avg(dur) as cache_hit_avg,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
WHERE slice.name='cache_hit' AND slice.dur >= 0
GROUP BY thread_track.utid;
DROP VIEW IF EXISTS hwui_cache_miss;
CREATE VIEW hwui_cache_miss AS
SELECT
count(*) as cache_miss_count,
sum(dur) as cache_miss_time,
avg(dur) as cache_miss_avg,
thread_track.utid as render_thread_id
FROM slice
INNER JOIN thread_track ON (thread_track.id = slice.track_id)
WHERE slice.name='cache_miss' AND slice.dur >= 0
GROUP BY thread_track.utid;
DROP VIEW IF EXISTS hwui_graphics_cpu_mem;
CREATE VIEW hwui_graphics_cpu_mem AS
SELECT
max(value) as graphics_cpu_mem_max,
min(value) as graphics_cpu_mem_min,
avg(value) as graphics_cpu_mem_avg,
process_counter_track.upid as process_upid
FROM counter
INNER JOIN process_counter_track ON (counter.track_id = process_counter_track.id)
WHERE name='HWUI CPU Memory' AND counter.value >= 0
GROUP BY process_counter_track.upid;
DROP VIEW IF EXISTS hwui_graphics_gpu_mem;
CREATE VIEW hwui_graphics_gpu_mem AS
SELECT
max(value) as graphics_gpu_mem_max,
min(value) as graphics_gpu_mem_min,
avg(value) as graphics_gpu_mem_avg,
process_counter_track.upid as process_upid
FROM counter
INNER JOIN process_counter_track ON (counter.track_id = process_counter_track.id)
WHERE name='HWUI Misc Memory' AND counter.value >= 0
GROUP BY process_counter_track.upid;
DROP VIEW IF EXISTS hwui_texture_mem;
CREATE VIEW hwui_texture_mem AS
SELECT
max(value) as texture_mem_max,
min(value) as texture_mem_min,
avg(value) as texture_mem_avg,
process_counter_track.upid as process_upid
FROM counter
INNER JOIN process_counter_track ON (counter.track_id = process_counter_track.id)
WHERE name='HWUI Texture Memory' AND counter.value >= 0
GROUP BY process_counter_track.upid;
DROP VIEW IF EXISTS hwui_all_mem;
CREATE VIEW hwui_all_mem AS
SELECT
max(value) as all_mem_max,
min(value) as all_mem_min,
avg(value) as all_mem_avg,
process_counter_track.upid as process_upid
FROM counter
INNER JOIN process_counter_track ON (counter.track_id = process_counter_track.id)
WHERE name='HWUI All Memory' AND counter.value >= 0
GROUP BY process_counter_track.upid;
DROP VIEW IF EXISTS android_hwui_metric_output;
CREATE VIEW android_hwui_metric_output AS
SELECT AndroidHwuiMetric(
'process_info', (
SELECT RepeatedField(
ProcessRenderInfo(
'process_name', process_name,
'rt_cpu_time_ms', rt_cpu_time_ms,
'draw_frame_count', hwui_draw_frame.draw_frame_count,
'draw_frame_max', hwui_draw_frame.draw_frame_max,
'draw_frame_min', hwui_draw_frame.draw_frame_min,
'draw_frame_avg', hwui_draw_frame.draw_frame_avg,
'flush_count', hwui_flush_commands.flush_count,
'flush_max', hwui_flush_commands.flush_max,
'flush_min', hwui_flush_commands.flush_min,
'flush_avg', hwui_flush_commands.flush_avg,
'prepare_tree_count', hwui_prepare_tree.prepare_tree_count,
'prepare_tree_max', hwui_prepare_tree.prepare_tree_max,
'prepare_tree_min', hwui_prepare_tree.prepare_tree_min,
'prepare_tree_avg', hwui_prepare_tree.prepare_tree_avg,
'gpu_completion_count', hwui_gpu_completion.gpu_completion_count,
'gpu_completion_max', hwui_gpu_completion.gpu_completion_max,
'gpu_completion_min', hwui_gpu_completion.gpu_completion_min,
'gpu_completion_avg', hwui_gpu_completion.gpu_completion_avg,
'ui_record_count', hwui_ui_record.ui_record_count,
'ui_record_max', hwui_ui_record.ui_record_max,
'ui_record_min', hwui_ui_record.ui_record_min,
'ui_record_avg', hwui_ui_record.ui_record_avg,
'shader_compile_count', hwui_shader_compile.shader_compile_count,
'shader_compile_time', hwui_shader_compile.shader_compile_time,
'shader_compile_avg', hwui_shader_compile.shader_compile_avg,
'cache_hit_count', hwui_cache_hit.cache_hit_count,
'cache_hit_time', hwui_cache_hit.cache_hit_time,
'cache_hit_avg', hwui_cache_hit.cache_hit_avg,
'cache_miss_count', hwui_cache_miss.cache_miss_count,
'cache_miss_time', hwui_cache_miss.cache_miss_time,
'cache_miss_avg', hwui_cache_miss.cache_miss_avg,
'graphics_cpu_mem_max', CAST(hwui_graphics_cpu_mem.graphics_cpu_mem_max as INT64),
'graphics_cpu_mem_min', CAST(hwui_graphics_cpu_mem.graphics_cpu_mem_min as INT64),
'graphics_cpu_mem_avg', hwui_graphics_cpu_mem.graphics_cpu_mem_avg,
'graphics_gpu_mem_max', CAST(hwui_graphics_gpu_mem.graphics_gpu_mem_max as INT64),
'graphics_gpu_mem_min', CAST(hwui_graphics_gpu_mem.graphics_gpu_mem_min as INT64),
'graphics_gpu_mem_avg', hwui_graphics_gpu_mem.graphics_gpu_mem_avg,
'texture_mem_max', CAST(hwui_texture_mem.texture_mem_max as INT64),
'texture_mem_min', CAST(hwui_texture_mem.texture_mem_min as INT64),
'texture_mem_avg', hwui_texture_mem.texture_mem_avg,
'all_mem_max', CAST(hwui_all_mem.all_mem_max as INT64),
'all_mem_min', CAST(hwui_all_mem.all_mem_min as INT64),
'all_mem_avg', hwui_all_mem.all_mem_avg
)
)
FROM hwui_processes
LEFT JOIN hwui_draw_frame ON (hwui_draw_frame.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_flush_commands ON (hwui_flush_commands.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_prepare_tree ON (hwui_prepare_tree.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_gpu_completion ON (hwui_gpu_completion.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_ui_record ON (hwui_ui_record.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_shader_compile ON (hwui_shader_compile.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_cache_hit ON (hwui_cache_hit.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_cache_miss ON (hwui_cache_miss.render_thread_id = hwui_processes.render_thread_id)
LEFT JOIN hwui_graphics_cpu_mem ON (hwui_graphics_cpu_mem.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_graphics_gpu_mem ON (hwui_graphics_gpu_mem.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_texture_mem ON (hwui_texture_mem.process_upid = hwui_processes.process_upid)
LEFT JOIN hwui_all_mem ON (hwui_all_mem.process_upid = hwui_processes.process_upid)
)
); | the_stack |
CREATE OR REPLACE PACKAGE json_dyn
AUTHID CURRENT_USER
AS
/*
Copyright (c) 2010 Jonas Krogsboell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
null_as_empty_string BOOLEAN NOT NULL := TRUE; --varchar2
include_dates BOOLEAN NOT NULL := TRUE; --date
include_clobs BOOLEAN NOT NULL := TRUE;
include_blobs BOOLEAN NOT NULL := FALSE;
/* usage example:
* declare
* res json_list;
* begin
* res := json_dyn.executeList(
* 'select :bindme as one, :lala as two from dual where dummy in :arraybind',
* json('{bindme:"4", lala:123, arraybind:[1,2,3,"X"]}')
* );
* res.print;
* end;
*/
/* list with objects */
FUNCTION executelist (stmt VARCHAR2,
bindvar json DEFAULT NULL,
cur_num NUMBER DEFAULT NULL)
RETURN json_list;
/* object with lists */
FUNCTION executeobject (stmt VARCHAR2,
bindvar json DEFAULT NULL,
cur_num NUMBER DEFAULT NULL)
RETURN json;
FUNCTION executelist (stmt IN OUT SYS_REFCURSOR)
RETURN json_list;
FUNCTION executeobject (stmt IN OUT SYS_REFCURSOR)
RETURN json;
END json_dyn;
/
CREATE OR REPLACE PACKAGE BODY json_dyn
AS
/*
Copyright (c) 2010 Jonas Krogsboell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-- 11gR2
FUNCTION executelist (stmt IN OUT SYS_REFCURSOR)
RETURN json_list
AS
l_cur NUMBER;
BEGIN
l_cur := DBMS_SQL.to_cursor_number (stmt);
RETURN json_dyn.executelist (NULL, NULL, l_cur);
END;
-- 11gR2
FUNCTION executeobject (stmt IN OUT SYS_REFCURSOR)
RETURN json
AS
l_cur NUMBER;
BEGIN
l_cur := DBMS_SQL.to_cursor_number (stmt);
RETURN json_dyn.executeobject (NULL, NULL, l_cur);
END;
PROCEDURE bind_json (l_cur NUMBER, bindvar json)
AS
keylist json_list := bindvar.get_keys ();
BEGIN
FOR i IN 1 .. keylist.COUNT
LOOP
IF (bindvar.get (i).get_type = 'number') THEN
DBMS_SQL.bind_variable (l_cur,
':' || keylist.get (i).get_string,
bindvar.get (i).get_number);
ELSIF (bindvar.get (i).get_type = 'array') THEN
DECLARE
v_bind DBMS_SQL.varchar2_table;
v_arr json_list := json_list (bindvar.get (i));
BEGIN
FOR j IN 1 .. v_arr.COUNT
LOOP
v_bind (j) := v_arr.get (j).value_of;
END LOOP;
DBMS_SQL.bind_array (l_cur,
':' || keylist.get (i).get_string,
v_bind);
END;
ELSE
DBMS_SQL.bind_variable (l_cur,
':' || keylist.get (i).get_string,
bindvar.get (i).value_of ());
END IF;
END LOOP;
END bind_json;
/* list with objects */
FUNCTION executelist (stmt VARCHAR2, bindvar json, cur_num NUMBER)
RETURN json_list
AS
l_cur NUMBER;
l_dtbl DBMS_SQL.desc_tab;
l_cnt NUMBER;
l_status NUMBER;
l_val VARCHAR2 (4000);
outer_list json_list := json_list ();
inner_obj json;
conv NUMBER;
read_date DATE;
read_clob CLOB;
read_blob BLOB;
col_type NUMBER;
BEGIN
IF (cur_num IS NOT NULL) THEN
l_cur := cur_num;
ELSE
l_cur := DBMS_SQL.open_cursor;
DBMS_SQL.parse (l_cur, stmt, DBMS_SQL.native);
IF (bindvar IS NOT NULL) THEN
bind_json (l_cur, bindvar);
END IF;
END IF;
DBMS_SQL.describe_columns (l_cur, l_cnt, l_dtbl);
FOR i IN 1 .. l_cnt
LOOP
col_type := l_dtbl (i).col_type;
--dbms_output.put_line(col_type);
IF (col_type = 12) THEN
DBMS_SQL.define_column (l_cur, i, read_date);
ELSIF (col_type = 112) THEN
DBMS_SQL.define_column (l_cur, i, read_clob);
ELSIF (col_type = 113) THEN
DBMS_SQL.define_column (l_cur, i, read_blob);
ELSIF (col_type IN (1, 2, 96)) THEN
DBMS_SQL.define_column (l_cur,
i,
l_val,
4000);
END IF;
END LOOP;
IF (cur_num IS NULL) THEN
l_status := DBMS_SQL.execute (l_cur);
END IF;
--loop through rows
WHILE (DBMS_SQL.fetch_rows (l_cur) > 0)
LOOP
inner_obj := json (); --init for each row
--loop through columns
FOR i IN 1 .. l_cnt
LOOP
CASE TRUE
--handling string types
WHEN l_dtbl (i).col_type IN (1, 96) THEN -- varchar2
DBMS_SQL.COLUMN_VALUE (l_cur, i, l_val);
IF (l_val IS NULL) THEN
IF (null_as_empty_string) THEN
inner_obj.put (l_dtbl (i).col_name, ''); --treatet as emptystring?
ELSE
inner_obj.put (l_dtbl (i).col_name,
json_value.makenull); --null
END IF;
ELSE
inner_obj.put (l_dtbl (i).col_name, json_value (l_val)); --null
END IF;
--dbms_output.put_line(l_dtbl(i).col_name||' --> '||l_val||'varchar2' ||l_dtbl(i).col_type);
--handling number types
WHEN l_dtbl (i).col_type = 2 THEN -- number
DBMS_SQL.COLUMN_VALUE (l_cur, i, l_val);
conv := l_val;
inner_obj.put (l_dtbl (i).col_name, conv);
-- dbms_output.put_line(l_dtbl(i).col_name||' --> '||l_val||'number ' ||l_dtbl(i).col_type);
WHEN l_dtbl (i).col_type = 12 THEN -- date
IF (include_dates) THEN
DBMS_SQL.COLUMN_VALUE (l_cur, i, read_date);
inner_obj.put (l_dtbl (i).col_name,
json_ext.to_json_value (read_date));
END IF;
--dbms_output.put_line(l_dtbl(i).col_name||' --> '||l_val||'date ' ||l_dtbl(i).col_type);
WHEN l_dtbl (i).col_type = 112 THEN --clob
IF (include_clobs) THEN
DBMS_SQL.COLUMN_VALUE (l_cur, i, read_clob);
inner_obj.put (l_dtbl (i).col_name,
json_value (read_clob));
END IF;
WHEN l_dtbl (i).col_type = 113 THEN --blob
IF (include_blobs) THEN
DBMS_SQL.COLUMN_VALUE (l_cur, i, read_blob);
IF (DBMS_LOB.getlength (read_blob) > 0) THEN
inner_obj.put (l_dtbl (i).col_name,
json_ext.encode (read_blob));
ELSE
inner_obj.put (l_dtbl (i).col_name,
json_value.makenull);
END IF;
END IF;
ELSE
NULL; --discard other types
END CASE;
END LOOP;
outer_list.append (inner_obj.to_json_value);
END LOOP;
DBMS_SQL.close_cursor (l_cur);
RETURN outer_list;
END executelist;
/* object with lists */
FUNCTION executeobject (stmt VARCHAR2, bindvar json, cur_num NUMBER)
RETURN json
AS
l_cur NUMBER;
l_dtbl DBMS_SQL.desc_tab;
l_cnt NUMBER;
l_status NUMBER;
l_val VARCHAR2 (4000);
inner_list_names json_list := json_list ();
inner_list_data json_list := json_list ();
data_list json_list;
outer_obj json := json ();
conv NUMBER;
read_date DATE;
read_clob CLOB;
read_blob BLOB;
col_type NUMBER;
BEGIN
IF (cur_num IS NOT NULL) THEN
l_cur := cur_num;
ELSE
l_cur := DBMS_SQL.open_cursor;
DBMS_SQL.parse (l_cur, stmt, DBMS_SQL.native);
IF (bindvar IS NOT NULL) THEN
bind_json (l_cur, bindvar);
END IF;
END IF;
DBMS_SQL.describe_columns (l_cur, l_cnt, l_dtbl);
FOR i IN 1 .. l_cnt
LOOP
col_type := l_dtbl (i).col_type;
IF (col_type = 12) THEN
DBMS_SQL.define_column (l_cur, i, read_date);
ELSIF (col_type = 112) THEN
DBMS_SQL.define_column (l_cur, i, read_clob);
ELSIF (col_type = 113) THEN
DBMS_SQL.define_column (l_cur, i, read_blob);
ELSIF (col_type IN (1, 2, 96)) THEN
DBMS_SQL.define_column (l_cur,
i,
l_val,
4000);
END IF;
END LOOP;
IF (cur_num IS NULL) THEN
l_status := DBMS_SQL.execute (l_cur);
END IF;
--build up name_list
FOR i IN 1 .. l_cnt
LOOP
CASE l_dtbl (i).col_type
WHEN 1 THEN
inner_list_names.append (l_dtbl (i).col_name);
WHEN 96 THEN
inner_list_names.append (l_dtbl (i).col_name);
WHEN 2 THEN
inner_list_names.append (l_dtbl (i).col_name);
WHEN 12 THEN
IF (include_dates) THEN
inner_list_names.append (l_dtbl (i).col_name);
END IF;
WHEN 112 THEN
IF (include_clobs) THEN
inner_list_names.append (l_dtbl (i).col_name);
END IF;
WHEN 113 THEN
IF (include_blobs) THEN
inner_list_names.append (l_dtbl (i).col_name);
END IF;
ELSE
NULL;
END CASE;
END LOOP;
--loop through rows
WHILE (DBMS_SQL.fetch_rows (l_cur) > 0)
LOOP
data_list := json_list ();
--loop through columns
FOR i IN 1 .. l_cnt
LOOP
CASE TRUE
--handling string types
WHEN l_dtbl (i).col_type IN (1, 96) THEN -- varchar2
DBMS_SQL.COLUMN_VALUE (l_cur, i, l_val);
IF (l_val IS NULL) THEN
IF (null_as_empty_string) THEN
data_list.append (''); --treatet as emptystring?
ELSE
data_list.append (json_value.makenull); --null
END IF;
ELSE
data_list.append (json_value (l_val)); --null
END IF;
--dbms_output.put_line(l_dtbl(i).col_name||' --> '||l_val||'varchar2' ||l_dtbl(i).col_type);
--handling number types
WHEN l_dtbl (i).col_type = 2 THEN -- number
DBMS_SQL.COLUMN_VALUE (l_cur, i, l_val);
conv := l_val;
data_list.append (conv);
-- dbms_output.put_line(l_dtbl(i).col_name||' --> '||l_val||'number ' ||l_dtbl(i).col_type);
WHEN l_dtbl (i).col_type = 12 THEN -- date
IF (include_dates) THEN
DBMS_SQL.COLUMN_VALUE (l_cur, i, read_date);
data_list.append (json_ext.to_json_value (read_date));
END IF;
--dbms_output.put_line(l_dtbl(i).col_name||' --> '||l_val||'date ' ||l_dtbl(i).col_type);
WHEN l_dtbl (i).col_type = 112 THEN --clob
IF (include_clobs) THEN
DBMS_SQL.COLUMN_VALUE (l_cur, i, read_clob);
data_list.append (json_value (read_clob));
END IF;
WHEN l_dtbl (i).col_type = 113 THEN --blob
IF (include_blobs) THEN
DBMS_SQL.COLUMN_VALUE (l_cur, i, read_blob);
IF (DBMS_LOB.getlength (read_blob) > 0) THEN
data_list.append (json_ext.encode (read_blob));
ELSE
data_list.append (json_value.makenull);
END IF;
END IF;
ELSE
NULL; --discard other types
END CASE;
END LOOP;
inner_list_data.append (data_list);
END LOOP;
outer_obj.put ('names', inner_list_names.to_json_value);
outer_obj.put ('data', inner_list_data.to_json_value);
DBMS_SQL.close_cursor (l_cur);
RETURN outer_obj;
END executeobject;
END json_dyn;
/ | the_stack |
-- migrate:up
-- Learning endpoints:
-- - Choose subject
-- - Choose card
-- - Get card
-- - Create response
create view sg_public.card as
select distinct on (entity_id) *
from sg_public.card_version
where status = 'accepted'
order by entity_id, created desc;
comment on view sg_public.card
is 'The latest accepted version of each card.';
grant select on sg_public.card to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.card_by_entity_id(entity_id uuid)
returns sg_public.card as $$
select c.*
from sg_public.card c
where c.entity_id = $1
limit 1;
$$ language sql stable;
comment on function sg_public.card_by_entity_id(uuid)
is 'Get the latest version of the card.';
grant execute on function sg_public.card_by_entity_id(uuid)
to sg_anonymous, sg_user, sg_admin;
grant select on table sg_public.subject_version_before_after
to sg_anonymous, sg_user, sg_admin;
grant select on table sg_public.subject_version_parent_child
to sg_anonymous, sg_user, sg_admin;
grant select on table sg_public.card_version
to sg_anonymous, sg_user, sg_admin;
create table sg_public.response (
id uuid primary key default uuid_generate_v4(),
created timestamp not null default current_timestamp,
modified timestamp not null default current_timestamp,
user_id uuid null references sg_public.user (id),
session_id uuid null,
card_id uuid not null references sg_public.card_entity (entity_id),
subject_id uuid not null references sg_public.subject_entity (entity_id),
response text not null,
score real not null check (score >= 0 and score <= 1),
learned real not null check (score >= 0 and score <= 1),
constraint user_or_session check (user_id is not null or session_id is not null)
);
comment on table sg_public.response
is 'When a learner responds to a card, we record the result.';
comment on column sg_public.response.id
is 'The ID of the response.';
comment on column sg_public.response.created
is 'When the user created the response.';
comment on column sg_public.response.modified
is 'When the system last modified the response.';
comment on column sg_public.response.user_id
is 'The user the response belongs to.';
comment on column sg_public.response.session_id
is 'If not user, the session_id the response belongs to.';
comment on column sg_public.response.card_id
is 'The card (entity id) that the response belongs to.';
comment on column sg_public.response.subject_id
is 'The subject (entity id) that the response belongs to... '
'at the time of the response';
comment on column sg_public.response.response
is 'How the user responded.';
comment on column sg_public.response.score
is 'The score, 0->1, of the response.';
comment on column sg_public.response.learned
is 'The estimated probability the learner has learned the subject, '
'after this response.';
comment on constraint user_or_session on sg_public.response
is 'Ensure only the user or session has data.';
create index on "sg_public"."response"("user_id");
create index on "sg_public"."response"("card_id");
create index on "sg_public"."response"("subject_id");
create trigger insert_response_user_or_session
before insert on sg_public.response
for each row execute procedure sg_private.insert_user_or_session();
comment on trigger insert_response_user_or_session
on sg_public.response
is 'Whenever I make a new response, auto fill the `user_id` column';
create trigger update_response_modified
before update on sg_public.response
for each row execute procedure sg_private.update_modified_column();
comment on trigger update_response_modified on sg_public.response
is 'Whenever a response changes, update the `modified` column.';
create or replace function sg_public.select_latest_response(subject_id uuid)
returns sg_public.response as $$
select r.*
from sg_public.response r
where r.subject_id = $1 and (
user_id = nullif(current_setting('jwt.claims.user_id', true), '')::uuid
or session_id = nullif(current_setting('jwt.claims.session_id', true), '')::uuid
)
order by r.created desc
limit 1;
$$ language sql stable;
comment on function sg_public.select_latest_response(uuid)
is 'Get the latest response from the user on the given subject.';
grant execute on function sg_public.select_latest_response(uuid)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.select_subject_learned(subject_id uuid)
returns real as $$
select case when learned is not null then learned else 0.4 end
from sg_public.select_latest_response($1);
$$ language sql stable;
comment on function sg_public.select_subject_learned(uuid)
is 'Get the latest learned value for the user on the given subject.';
grant execute on function sg_public.select_subject_learned(uuid)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_private.score_response()
returns trigger as $$
declare
card sg_public.card;
prior sg_public.response;
prior_learned real;
option jsonb;
score real;
learned real;
slip constant real := 0.1;
guess constant real := 0.3;
transit constant real := 0.05;
begin
-- Overall: Fill in (subject_id, score, learned)
-- Validate if the response to the card is valid.
select c.* into card
from sg_public.card c
where c.entity_id = new.card_id
limit 1;
if (card.kind is null) then
raise exception 'No card found.' using errcode = 'EE05C989';
end if;
if (card.kind <> 'choice') then -- scored kinds only
raise exception 'You may only respond to a scored card.'
using errcode = '1306BF1C';
end if;
option := card.data->'options'->new.response;
if (option is null) then
raise exception 'You must submit an available response `id`.'
using errcode = '681942FD';
end if;
-- Set default values
new.subject_id := card.subject_id;
-- Score the response
new.score := (option->>'correct')::boolean::int::real;
-- Calculate p(learned)
prior_learned := (select sg_public.select_subject_learned(card.subject_id));
learned := (
new.score * (
(prior_learned * (1 - slip)) /
(prior_learned * (1 - slip) + (1 - prior_learned) * guess)
) +
(1 - new.score) * (
(prior_learned * slip) /
(prior_learned * slip + (1 - prior_learned) * (1 - guess))
)
);
new.learned := learned + (1 - learned) * transit;
return new;
end;
$$ language plpgsql strict security definer;
comment on function sg_private.score_response()
is 'After I respond to a card, score the result and update model.';
create trigger insert_response_score
before insert on sg_public.response
for each row execute procedure sg_private.score_response();
comment on trigger insert_response_score on sg_public.response
is 'After I respond to a card, score the result and update model.';
-- Enable RLS.
alter table sg_public.response enable row level security;
-- Select response: any self.
grant select on table sg_public.response to sg_anonymous, sg_user, sg_admin;
create policy select_response on sg_public.response
for select to sg_anonymous, sg_user, sg_admin
using (
user_id = nullif(current_setting('jwt.claims.user_id', true), '')::uuid
or session_id = nullif(current_setting('jwt.claims.session_id', true), '')::uuid
);
comment on policy select_response on sg_public.response
is 'Anyone may select their own responses.';
-- Insert response: any.
grant insert (card_id, response)
on table sg_public.response to sg_anonymous, sg_user, sg_admin;
create policy insert_response on sg_public.response
for insert to sg_anonymous, sg_user, sg_admin
with check (true);
comment on policy insert_response on sg_public.response
is 'Anyone may insert `card_id` and `response` into responses.';
-- Update & delete response: none.
create or replace function sg_public.select_card_to_learn(subject_id uuid)
returns sg_public.card as $$
with prior as (select * from sg_public.select_latest_response($1)),
k (kinds) as (
select case
when random() < (0.5 + 0.5 * sg_public.select_subject_learned($1))
then array[
'choice'
]::sg_public.card_kind[]
else array[
'video',
'page',
'unscored_embed'
]::sg_public.card_kind[]
end
)
select c.*
from sg_public.card c, prior, k
where c.subject_id = $1
and c.kind = any(k.kinds)
and (prior.card_id is null or c.entity_id <> prior.card_id)
order by random()
limit 1;
-- Future version: When estimating parameters and the card kind is scored,
-- prefer 0.25 < correct < 0.75
$$ language sql volatile;
comment on function sg_public.select_card_to_learn(uuid)
is 'After I select a subject, search for a suitable card.';
grant execute on function sg_public.select_card_to_learn(uuid)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_child_subjects(subject sg_public.subject)
returns setof sg_public.subject as $$
select s.*
from
sg_public.subject s,
sg_public.subject_version_parent_child svpc
where
svpc.parent_entity_id = $1.entity_id
and s.version_id = svpc.child_version_id;
$$ language sql stable;
comment on function sg_public.subject_child_subjects(sg_public.subject)
is 'Collects the direct children of the parent subject.';
grant execute on function sg_public.subject_child_subjects(sg_public.subject)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_all_child_subjects(subject sg_public.subject)
returns setof sg_public.subject as $$
with recursive all_children as (
select scs.*
from sg_public.subject_child_subjects(subject) scs
union all
select scs.*
from
all_children,
lateral sg_public.subject_child_subjects(all_children) scs
)
select *
from all_children;
$$ language sql stable;
comment on function sg_public.subject_all_child_subjects(sg_public.subject)
is 'Collects all the children of the parent subject.';
grant execute on function sg_public.subject_all_child_subjects(sg_public.subject)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_child_count(subject sg_public.subject)
returns bigint as $$
select count(*)
from sg_public.subject_child_subjects(subject);
$$ language sql stable;
comment on function sg_public.subject_child_count(sg_public.subject)
is 'Count the number of children directly on the subject.';
grant execute on function sg_public.subject_child_count(sg_public.subject)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_card_count(subject sg_public.subject)
returns bigint as $$
select count(c.*)
from sg_public.card c
where c.subject_id = $1.entity_id;
$$ language sql stable;
comment on function sg_public.subject_card_count(sg_public.subject)
is 'Count the number of cards directly on the subject.';
grant execute on function sg_public.subject_card_count(sg_public.subject)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_before_subjects(subject sg_public.subject)
returns setof sg_public.subject as $$
select s.*
from
sg_public.subject s,
sg_public.subject_version_before_after svba
where
svba.after_version_id = $1.version_id
and s.entity_id = svba.before_entity_id;
$$ language sql stable;
comment on function sg_public.subject_before_subjects(sg_public.subject)
is 'Get all the direct befores for a subject.';
grant execute on function sg_public.subject_before_subjects(sg_public.subject)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_has_needed_before(sg_public.subject, uuid[])
returns boolean as $$
select exists(
select x.entity_id
from sg_public.subject_before_subjects($1) x
where sg_public.select_subject_learned(x.entity_id) < 0.99
and x.entity_id = any($2)
);
$$ language sql stable;
comment on function sg_public.subject_has_needed_before(sg_public.subject, uuid[])
is 'Does the learner/subject have a needed before?';
grant execute on function sg_public.subject_has_needed_before(sg_public.subject, uuid[])
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_after_subjects(subject sg_public.subject)
returns setof sg_public.subject as $$
select s.*
from
sg_public.subject s,
sg_public.subject_version_before_after svba
where
svba.before_entity_id = $1.entity_id
and s.version_id = svba.after_version_id;
$$ language sql stable;
comment on function sg_public.subject_after_subjects(sg_public.subject)
is 'Get all the direct afters for a subject.';
grant execute on function sg_public.subject_after_subjects(sg_public.subject)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_all_after_subjects(subject sg_public.subject)
returns setof sg_public.subject as $$
with recursive all_afters as (
select scs.*
from sg_public.subject_after_subjects(subject) scs
union all
select scs.*
from
all_afters,
lateral sg_public.subject_after_subjects(all_afters) scs
)
select *
from all_afters;
$$ language sql stable;
comment on function sg_public.subject_all_after_subjects(sg_public.subject)
is 'Collects all the afters of the before subject.';
grant execute on function sg_public.subject_all_after_subjects(sg_public.subject)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.subject_all_after_count(subject sg_public.subject)
returns bigint as $$
select count(*)
from sg_public.subject_all_after_subjects($1);
$$ language sql stable;
comment on function sg_public.subject_all_after_count(sg_public.subject)
is 'Count the number of subjects after the subject.';
grant execute on function sg_public.subject_all_after_count(sg_public.subject)
to sg_anonymous, sg_user, sg_admin;
create or replace function sg_public.select_subject_to_learn(subject_id uuid)
returns setof sg_public.subject as $$
with subject as (
select *
from sg_public.subject
where entity_id = $1
limit 1
),
all_subjects as (
select a.*
from subject, sg_public.subject_all_child_subjects(subject) a
union
select * from subject
),
e (all_subjects) as (select array(select entity_id from all_subjects))
select s.*
from all_subjects s, e
where
sg_public.subject_child_count(s) = 0
and sg_public.select_subject_learned(s.entity_id) < 0.99
and not sg_public.subject_has_needed_before(s, e.all_subjects)
-- TODO support "rewind"... going into out of goals befores
-- when performance is low.
order by
sg_public.subject_all_after_count(s) desc,
sg_public.subject_card_count(s) desc
limit 5;
$$ language sql stable;
comment on function sg_public.select_subject_to_learn(uuid)
is 'After I select a main subject, search for suitable child subjects.';
grant execute on function sg_public.select_subject_to_learn(uuid)
to sg_anonymous, sg_user, sg_admin;
create index on "sg_public"."subject_version_parent_child"("child_version_id");
create index on "sg_public"."subject_version_before_after"("after_version_id");
-- migrate:down | the_stack |
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2017 年 08 月 19 日 10:27
-- 服务器版本: 5.6.12-log
-- PHP 版本: 5.4.16
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 */;
--
-- 数据库: `qq`
--
CREATE DATABASE IF NOT EXISTS `qq` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci;
USE `qq`;
-- --------------------------------------------------------
--
-- 表的结构 `chat`
--
CREATE TABLE IF NOT EXISTS `chat` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`user_id` mediumint(9) NOT NULL COMMENT '一个用户的id',
`other_user_id` mediumint(9) NOT NULL COMMENT '另一个用户的id',
`is_enter_chat` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否进入了对方的聊天页面(0不是 1是)',
`is_pingbi` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否屏蔽了对方的聊天(1是 0不是)',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`,`other_user_id`,`is_pingbi`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_mysql500_ci COMMENT='聊天设置表' AUTO_INCREMENT=13 ;
--
-- 转存表中的数据 `chat`
--
INSERT INTO `chat` (`id`, `user_id`, `other_user_id`, `is_enter_chat`, `is_pingbi`) VALUES
(1, 1, 2, 1, 0),
(2, 1, 3, 0, 0),
(3, 1, 4, 0, 0),
(4, 1, 5, 0, 0),
(5, 1, 6, 0, 0),
(6, 1, 7, 0, 0),
(7, 1, 8, 0, 0),
(8, 1, 9, 0, 0),
(9, 2, 1, 0, 0),
(10, 2, 3, 0, 0),
(12, 3, 2, 0, 0),
(11, 3, 1, 0, 0);
-- --------------------------------------------------------
--
-- 表的结构 `fenzu`
--
CREATE TABLE IF NOT EXISTS `fenzu` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '分组id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`zu_name` char(30) NOT NULL COMMENT '分组名称',
`zu_member` varchar(400) NOT NULL COMMENT '分组内的成员的id',
`is_default` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否是默认分组(1是 0不是)',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `is_defaul` (`is_default`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='好友分组表' AUTO_INCREMENT=10 ;
--
-- 转存表中的数据 `fenzu`
--
INSERT INTO `fenzu` (`id`, `user_id`, `zu_name`, `zu_member`, `is_default`) VALUES
(1, 1, '晓风残月', '6,7,8,9', 1),
(2, 2, '江南烟雨', '3', 1),
(3, 3, '柳岸花名', '2', 1),
(4, 4, '我的好友', '', 0),
(5, 1, '特别关心', '3,4,5,2', 0),
(6, 2, '特别关心', '1', 0),
(7, 3, '特别关心', '1', 0),
(8, 10, '特别关心', '', 0),
(9, 10, '我的好友', '', 1);
-- --------------------------------------------------------
--
-- 表的结构 `friend`
--
CREATE TABLE IF NOT EXISTS `friend` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` mediumint(9) NOT NULL COMMENT '用户甲的id',
`other_user_id` mediumint(9) NOT NULL COMMENT '用户乙的id',
`beizhu` char(10) NOT NULL COMMENT '甲对乙的备注',
`time` int(11) NOT NULL COMMENT '成为好友的时间',
`is_friend` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已经成为了好友,1 是 0 不是',
`special` tinyint(1) NOT NULL DEFAULT '0' COMMENT '乙是否是甲的特别关心',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `other_user_id` (`other_user_id`),
KEY `is_friend` (`is_friend`),
KEY `special` (`special`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='好友关系表' AUTO_INCREMENT=19 ;
--
-- 转存表中的数据 `friend`
--
INSERT INTO `friend` (`id`, `user_id`, `other_user_id`, `beizhu`, `time`, `is_friend`, `special`) VALUES
(1, 1, 2, '楚乔', 1500035790, 1, 1),
(2, 1, 3, '马哲涵', 1500000000, 1, 1),
(3, 1, 4, '魏明', 1500000000, 1, 0),
(4, 1, 5, '程文宇', 1500000000, 1, 0),
(5, 1, 6, '许易', 1500000000, 1, 0),
(6, 1, 7, '张扬扬', 1500000000, 1, 0),
(7, 1, 8, '许志荣', 1500000002, 1, 0),
(8, 1, 9, '李萌', 1500000101, 1, 0),
(9, 2, 1, '宇文玥', 1500035790, 1, 0),
(10, 2, 3, '马哲涵', 1500000000, 1, 0),
(11, 3, 1, '宇文玥', 1500050000, 1, 0),
(12, 4, 1, '宇文玥', 1500050000, 1, 0),
(13, 5, 1, '宇文玥', 1500050000, 1, 0),
(14, 6, 1, '宇文玥', 1500050000, 1, 0),
(15, 7, 1, '宇文玥', 1500000000, 1, 0),
(16, 8, 1, '宇文玥', 1500000000, 1, 0),
(17, 9, 1, '宇文玥', 1500000000, 1, 0),
(18, 3, 2, '楚乔', 1500000000, 1, 0);
-- --------------------------------------------------------
--
-- 表的结构 `friend_apply`
--
CREATE TABLE IF NOT EXISTS `friend_apply` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT COMMENT 'id',
`from_user` mediumint(9) NOT NULL COMMENT '申请方用户id',
`to_user` mediumint(9) NOT NULL COMMENT '接受方用户id',
`status` tinyint(1) NOT NULL COMMENT '状态(1 待处理 2 已同意 3 已拒绝)',
`time` int(11) NOT NULL COMMENT '申请时间',
`apply_message` char(20) NOT NULL COMMENT '附加消息',
`reply` char(20) NOT NULL COMMENT '回复消息',
`source` char(20) NOT NULL COMMENT '来源',
PRIMARY KEY (`id`),
KEY `to_user` (`to_user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='好友申请表' AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `friend_apply`
--
INSERT INTO `friend_apply` (`id`, `from_user`, `to_user`, `status`, `time`, `apply_message`, `reply`, `source`) VALUES
(1, 2, 1, 2, 1500022110, '大哥,想请教一个问题', '', 'QQ群-ThinkPHP技术交流中心'),
(2, 3, 1, 2, 1500022120, '大哥,想请教一个问题', '', 'QQ号查找'),
(3, 4, 1, 2, 1500022130, '向大神学习', '', 'QQ群-牛客网IT笔试面试交流群'),
(4, 5, 1, 2, 1500022140, '你是诸葛亮?', '', '临时会话'),
(5, 1, 6, 1, 1500022150, '请求加为好友', '', '临时会话'),
(6, 7, 1, 2, 1500020000, '请求加为好友', '', 'QQ号查找'),
(7, 9, 1, 2, 1500023000, '请求加为好友', '', 'QQ群-心理电影周日8-9W7306');
-- --------------------------------------------------------
--
-- 表的结构 `groups`
--
CREATE TABLE IF NOT EXISTS `groups` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`group_name` char(15) NOT NULL COMMENT '群名称',
`group_intro` char(30) NOT NULL COMMENT '群介绍',
`group_avator` char(40) NOT NULL DEFAULT '/static/icon/4/fac.png' COMMENT '群头像',
`who_created` mediumint(9) NOT NULL COMMENT '群主id',
`time` int(11) NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='群表' AUTO_INCREMENT=10 ;
--
-- 转存表中的数据 `groups`
--
INSERT INTO `groups` (`id`, `group_name`, `group_intro`, `group_avator`, `who_created`, `time`) VALUES
(1, '英语四六级自动查询', '', '/static/user/face/11.jpg', 1, 1500000010),
(2, 'ThinkPHP技术交流中心', '', '/static/user/face/2.jpg', 1, 1500001000),
(3, '工作室招新群', '', '/static/user/face/12.jpg', 2, 1500000010),
(4, '心率手表', '', '/static/user/face/13.jpg', 2, 1500001000),
(5, '心理电影赏析', '', '/static/user/face/14.jpg', 2, 1500000010),
(6, '牛客网IT笔试面试交流群', '', '/static/user/face/1.jpg', 2, 1500001000),
(7, '14级网络工程2班', '', '/static/user/face/3.jpg', 3, 1500000010),
(8, '心理电影周日8-9W7306', '', '/static/user/face/8.jpg', 3, 1500001000),
(9, '计算机网络学习交流', '', '/static/user/face/15.jpg', 3, 1500000010);
-- --------------------------------------------------------
--
-- 表的结构 `group_user`
--
CREATE TABLE IF NOT EXISTS `group_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`group_id` mediumint(9) NOT NULL COMMENT '群id',
`user_id` mediumint(9) NOT NULL COMMENT '用户id',
`role` tinyint(3) NOT NULL DEFAULT '2' COMMENT '角色(0群主,1管理员,2普通成员)',
`add_time` int(11) NOT NULL COMMENT '加入该群的时间',
`unread` tinyint(3) NOT NULL DEFAULT '0' COMMENT '未读消息的条数',
`is_enter` tinyint(1) NOT NULL DEFAULT '0' COMMENT '用户是否进入了该群的聊天页面(1是 0否)',
`nick_name` varchar(20) NOT NULL COMMENT '群昵称',
PRIMARY KEY (`id`),
KEY `group_id` (`group_id`),
KEY `user_id` (`user_id`),
KEY `role` (`role`),
KEY `unread` (`unread`),
KEY `is_enter` (`is_enter`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='群-用户关系表' AUTO_INCREMENT=14 ;
--
-- 转存表中的数据 `group_user`
--
INSERT INTO `group_user` (`id`, `group_id`, `user_id`, `role`, `add_time`, `unread`, `is_enter`, `nick_name`) VALUES
(1, 1, 1, 0, 1478887710, 0, 0, '宇文玥'),
(2, 2, 1, 0, 1478887720, 0, 0, '宇文玥'),
(3, 3, 1, 1, 1478887730, 0, 0, '宇文玥'),
(4, 4, 1, 1, 1478887740, 0, 0, '宇文玥'),
(5, 5, 1, 1, 1478887750, 0, 0, '宇文玥'),
(6, 6, 1, 2, 1478887760, 0, 0, '宇文玥'),
(7, 7, 1, 2, 1478887770, 0, 0, '宇文玥'),
(8, 8, 1, 2, 1478887780, 0, 0, '宇文玥'),
(9, 9, 1, 2, 1478887790, 0, 0, '宇文玥'),
(10, 6, 2, 0, 1500000000, 0, 0, '楚乔'),
(11, 6, 3, 2, 1500000000, 46, 0, '马哲涵'),
(12, 7, 3, 0, 1500200000, 1, 0, '马哲涵'),
(13, 2, 2, 2, 1500070000, 0, 1, '楚乔');
-- --------------------------------------------------------
--
-- 表的结构 `message_group`
--
CREATE TABLE IF NOT EXISTS `message_group` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`from_user` int(11) NOT NULL COMMENT '谁发的',
`to_group` int(11) NOT NULL COMMENT '发给哪个群,值为群id',
`message` varchar(500) NOT NULL COMMENT '内容',
`time` int(11) NOT NULL COMMENT '发送时间',
PRIMARY KEY (`id`),
KEY `to_group` (`to_group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息表(群聊)' AUTO_INCREMENT=8 ;
--
-- 转存表中的数据 `message_group`
--
INSERT INTO `message_group` (`id`, `from_user`, `to_group`, `message`, `time`) VALUES
(1, 2, 6, '楚乔:电商项目中发模板邮件这种业务有谁了解吗', 1500007000),
(2, 3, 6, '马哲涵:邮件是html格式', 1500008000),
(3, 2, 6, '楚乔:嗯,那个能实现。老板给两张表就不管了,我不太清楚具体的业务流程之类', 1500010000),
(4, 2, 2, '楚乔:有谁会nodejs的吗', 1500122660),
(5, 3, 7, '马哲涵:男生的材料我现在看不到,你们走心...', 1500197438),
(6, 2, 6, '楚乔:还是不太明白啊', 1500902861),
(7, 1, 6, '宇文玥:哪里不明白?', 1501229199);
-- --------------------------------------------------------
--
-- 表的结构 `message_user`
--
CREATE TABLE IF NOT EXISTS `message_user` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`from_user` mediumint(11) NOT NULL COMMENT '谁发的,值为用户id',
`to_user` mediumint(11) NOT NULL COMMENT '发给谁,值为用户id',
`message` varchar(500) NOT NULL COMMENT '消息内容',
`time` int(11) NOT NULL COMMENT '发送时间',
`is_read` tinyint(1) NOT NULL DEFAULT '0' COMMENT '接收者是否已读,0未读,1已读',
PRIMARY KEY (`id`),
KEY `from_user` (`from_user`),
KEY `to_user` (`to_user`),
KEY `is_read` (`is_read`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息表(私聊)' AUTO_INCREMENT=7 ;
--
-- 转存表中的数据 `message_user`
--
INSERT INTO `message_user` (`id`, `from_user`, `to_user`, `message`, `time`, `is_read`) VALUES
(1, 2, 1, '燕洵他遭受得太多了,没有人在他身边,他是需要我的', 1500520300, 1),
(2, 3, 1, '技术栈会更多一点', 1500390000, 1),
(3, 3, 1, '哈哈哈', 1500520313, 1),
(4, 1, 2, '我也需要你', 1500520400, 1),
(5, 2, 1, '别这样,不然待会屏蔽你了', 1500520500, 1),
(6, 1, 2, '你试试', 1501229571, 1);
-- --------------------------------------------------------
--
-- 表的结构 `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`qq` char(15) NOT NULL COMMENT 'qq号',
`pwd` char(30) NOT NULL DEFAULT '53f6ff462b54af4141e76372436663' COMMENT '密码',
`phone` char(11) NOT NULL COMMENT '手机号',
`email` char(50) NOT NULL COMMENT '邮箱',
`time` int(11) NOT NULL COMMENT '注册时间',
`last_login` int(11) NOT NULL COMMENT '最后登陆时间',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '在线状态,0离线,1在线,2隐身',
`device` tinyint(1) NOT NULL DEFAULT '0' COMMENT '设备状态(0离线,1手机在线,2 3G在线,3 4G在线,4 wifi在线,5 电脑在线)',
`socketid` char(20) NOT NULL COMMENT '登陆时的socketid',
PRIMARY KEY (`id`),
UNIQUE KEY `qq` (`qq`),
UNIQUE KEY `phone` (`phone`),
KEY `socketid` (`socketid`),
KEY `email` (`email`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户表' AUTO_INCREMENT=11 ;
--
-- 转存表中的数据 `user`
--
INSERT INTO `user` (`id`, `qq`, `pwd`, `phone`, `email`, `time`, `last_login`, `status`, `device`, `socketid`) VALUES
(1, '986992484', '53f6ff462b54af4141e76372436663', '18296764976', '', 1497695436, 1503135667, 1, 2, 'SnmgCAOavO3EJbz3AAAE'),
(2, '986992483', '53f6ff462b54af4141e76372436663', '18296764975', '', 1499853636, 1503111556, 0, 0, ''),
(3, '986992482', '53f6ff462b54af4141e76372436663', '18296764974', '', 1499978760, 1501561709, 1, 1, ''),
(4, '986992481', '53f6ff462b54af4141e76372436663', '18296764973', '', 1499978760, 1501123985, 1, 3, ''),
(5, '986992480', '53f6ff462b54af4141e76372436663', '18296764972', '', 1499978760, 1501080517, 0, 0, ''),
(6, '986992479', '53f6ff462b54af4141e76372436663', '18296764971', '', 1499978760, 1500000000, 1, 0, ''),
(7, '986992478', '53f6ff462b54af4141e76372436663', '18296764970', '', 1499978760, 1500000000, 1, 5, ''),
(8, '986992477', '53f6ff462b54af4141e76372436663', '18296764969', '', 1499978760, 1500000000, 0, 0, ''),
(9, '986992476', '53f6ff462b54af4141e76372436663', '18296764968', '', 1499978710, 1500000000, 1, 2, ''),
(10, '471848752', '53f6ff462b54af4141e76372436663', '18786766676', '', 1501302351, 1501302385, 0, 0, 'VedhfvJ9a5rptvEwAAAA');
-- --------------------------------------------------------
--
-- 表的结构 `user_detail`
--
CREATE TABLE IF NOT EXISTS `user_detail` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`user_id` mediumint(9) NOT NULL COMMENT '用户id',
`nick_name` char(30) NOT NULL COMMENT '用户昵称',
`signature` char(60) NOT NULL COMMENT '用户签名',
`face` char(100) NOT NULL DEFAULT '/static/user/face/default.png' COMMENT '头像',
`sex` char(2) NOT NULL DEFAULT '男' COMMENT '性别',
`age` smallint(4) NOT NULL DEFAULT '0' COMMENT '年龄',
`xingzuo` char(10) NOT NULL COMMENT '星座',
`place` char(40) NOT NULL DEFAULT '江西' COMMENT '地方',
`favor` char(30) NOT NULL COMMENT '爱好',
`level` smallint(6) NOT NULL DEFAULT '1' COMMENT 'QQ等级',
`profile_bg` char(30) NOT NULL DEFAULT '/static/user/bg/default.jpg' COMMENT '个人名片背景',
`login_day` smallint(10) NOT NULL DEFAULT '0' COMMENT '登陆天数',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户信息详情' AUTO_INCREMENT=11 ;
--
-- 转存表中的数据 `user_detail`
--
INSERT INTO `user_detail` (`id`, `user_id`, `nick_name`, `signature`, `face`, `sex`, `age`, `xingzuo`, `place`, `favor`, `level`, `profile_bg`, `login_day`) VALUES
(1, 1, '莫知我哀', '楚乔传', '/static/user/face/0.jpg', '男', 21, '处女座', '江西', '娱乐/艺术/表演', 50, '/static/user/bg/2.jpeg', 1045),
(2, 2, '浅唱低吟', '路漫漫其修远兮', '/static/user/face/4.jpg', '女', 19, '天蝎座', '江西', '娱乐/艺术/表演', 30, '/static/user/bg/3.jpg', 0),
(3, 3, '一花一世界', '人生路漫漫', '/static/user/face/5.jpg', '男', 0, '巨蟹座', '江西', '', 1, '/static/user/bg/default.jpg', 0),
(4, 4, '云端之上', '最近真的太开心了', '/static/user/face/6.jpg', '男', 20, '白羊座', '江西', '', 1, '/static/user/bg/default.jpg', 0),
(5, 5, '心有芊芊结', '月下问归人东篱黄昏约,是是非非', '/static/user/face/7.jpg', '女', 21, '金牛座', '江西', '', 1, '/static/user/bg/default.jpg', 0),
(6, 6, '缥缈孤鸿影', '西风醉,几度痴人泪', '/static/user/face/8.jpg', '男', 18, '白羊座', '江西', '', 1, '/static/user/bg/default.jpg', 0),
(7, 7, '古今如梦', '孤灯点,青丝雪,只怨情已怯', '/static/user/face/9.jpg', '女', 19, '白羊座', '江西', '', 1, '/static/user/bg/default.jpg', 0),
(8, 8, '羽逸之光', '青春、若有张不老的脸', '/static/user/face/10.jpg', '女', 21, '白羊座', '江西', '', 1, '/static/user/bg/default.jpg', 0),
(9, 9, '斜阳云云美', '掩面叹息、泪落红妆残', '/static/user/face/11.jpg', '男', 20, '白羊座', '江西', '', 1, '/static/user/bg/default.jpg', 0),
(10, 10, '青青子衿', '', '/static/user/face/default.png', '男', 0, '', '江西', '', 1, '/static/user/bg/default.jpg', 0);
-- --------------------------------------------------------
--
-- 表的结构 `vip`
--
CREATE TABLE IF NOT EXISTS `vip` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`user_id` mediumint(9) NOT NULL COMMENT '用户的id',
`vip_type` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'vip类型(0 非VIP,1 VIP,2 SVIP)',
`accert` char(15) NOT NULL DEFAULT '慢速中' COMMENT '加速',
`vip_level` tinyint(2) NOT NULL COMMENT 'vip级别,如VIP1,VIP2',
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='会员表' AUTO_INCREMENT=11 ;
--
-- 转存表中的数据 `vip`
--
INSERT INTO `vip` (`id`, `user_id`, `vip_type`, `accert`, `vip_level`) VALUES
(1, 1, 2, '1.4倍加速中', 2),
(2, 2, 2, '1.4倍加速中', 2),
(3, 3, 1, '1.2倍加速中', 1),
(4, 4, 2, '1.4倍加速中', 2),
(5, 5, 0, '慢速中', 0),
(6, 6, 2, '1.4倍加速中', 2),
(7, 7, 2, '1.4倍加速中', 2),
(8, 8, 1, '1.2倍加速中', 1),
(9, 9, 0, '慢速中', 0),
(10, 10, 0, '慢速中', 0);
/*!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 */; | the_stack |
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.2
-- Dumped by pg_dump version 13.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: audit; Type: SCHEMA; Schema: -; Owner: -
--
CREATE SCHEMA audit;
--
-- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
--
-- Name: postgis; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
--
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION postgis IS 'PostGIS geometry, geography, and raster spatial types and functions';
--
-- Name: audit_table(regclass); Type: FUNCTION; Schema: audit; Owner: -
--
CREATE FUNCTION audit.audit_table(target_table regclass) RETURNS void
LANGUAGE sql
AS $_$
SELECT audit.audit_table($1, BOOLEAN 't', BOOLEAN 't');
$_$;
--
-- Name: audit_table(regclass, boolean, boolean); Type: FUNCTION; Schema: audit; Owner: -
--
CREATE FUNCTION audit.audit_table(target_table regclass, audit_rows boolean, audit_query_text boolean) RETURNS void
LANGUAGE sql
AS $_$
SELECT audit.audit_table($1, $2, $3, ARRAY[]::TEXT[]);
$_$;
--
-- Name: audit_table(regclass, boolean, boolean, text[]); Type: FUNCTION; Schema: audit; Owner: -
--
CREATE FUNCTION audit.audit_table(target_table regclass, audit_rows boolean, audit_query_text boolean, ignored_cols text[]) RETURNS void
LANGUAGE plpgsql
AS $$
DECLARE
stm_targets TEXT = 'INSERT OR UPDATE OR DELETE OR TRUNCATE';
_q_txt TEXT;
_ignored_cols_snip TEXT = '';
BEGIN
EXECUTE 'DROP TRIGGER IF EXISTS audit_trigger_row ON ' || target_table::TEXT;
EXECUTE 'DROP TRIGGER IF EXISTS audit_trigger_stm ON ' || target_table::TEXT;
IF audit_rows THEN
IF array_length(ignored_cols,1) > 0 THEN
_ignored_cols_snip = ', ' || quote_literal(ignored_cols);
END IF;
_q_txt = 'CREATE TRIGGER audit_trigger_row '
'AFTER INSERT OR UPDATE OR DELETE ON ' ||
target_table::TEXT ||
' FOR EACH ROW EXECUTE PROCEDURE audit.if_modified_func(' ||
quote_literal(audit_query_text) ||
_ignored_cols_snip ||
');';
RAISE NOTICE '%', _q_txt;
EXECUTE _q_txt;
stm_targets = 'TRUNCATE';
END IF;
_q_txt = 'CREATE TRIGGER audit_trigger_stm AFTER ' || stm_targets || ' ON ' ||
target_table ||
' FOR EACH STATEMENT EXECUTE PROCEDURE audit.if_modified_func('||
quote_literal(audit_query_text) || ');';
RAISE NOTICE '%', _q_txt;
EXECUTE _q_txt;
END;
$$;
--
-- Name: if_modified_func(); Type: FUNCTION; Schema: audit; Owner: -
--
CREATE FUNCTION audit.if_modified_func() RETURNS trigger
LANGUAGE plpgsql SECURITY DEFINER
SET search_path TO 'pg_catalog', 'public'
AS $$
DECLARE
audit_row audit.log;
include_values BOOLEAN;
log_diffs BOOLEAN;
h_old JSONB;
h_new JSONB;
excluded_cols TEXT[] = ARRAY[]::TEXT[];
BEGIN
IF TG_WHEN <> 'AFTER' THEN
RAISE EXCEPTION 'audit.if_modified_func() may only run as an AFTER trigger';
END IF;
audit_row = ROW(
nextval('audit.log_id_seq'), -- id
TG_TABLE_SCHEMA::TEXT, -- schema_name
TG_TABLE_NAME::TEXT, -- table_name
TG_RELID, -- relation OID for faster searches
session_user::TEXT, -- session_user_name
current_user::TEXT, -- current_user_name
current_timestamp, -- action_tstamp_tx
statement_timestamp(), -- action_tstamp_stm
clock_timestamp(), -- action_tstamp_clk
txid_current(), -- transaction ID
current_setting('audit.application_name', true), -- client application
current_setting('audit.application_user_name', true), -- client user name
inet_client_addr(), -- client_addr
inet_client_port(), -- client_port
current_query(), -- top-level query or queries
substring(TG_OP, 1, 1), -- action
NULL, -- row_data
NULL, -- changed_fields
'f' -- statement_only
);
IF NOT TG_ARGV[0]::BOOLEAN IS DISTINCT FROM 'f'::BOOLEAN THEN
audit_row.client_query = NULL;
END IF;
IF TG_ARGV[1] IS NOT NULL THEN
excluded_cols = TG_ARGV[1]::TEXT[];
END IF;
IF (TG_OP = 'INSERT' AND TG_LEVEL = 'ROW') THEN
audit_row.changed_fields = to_jsonb(NEW.*);
ELSIF (TG_OP = 'UPDATE' AND TG_LEVEL = 'ROW') THEN
audit_row.row_data = to_jsonb(OLD.*);
audit_row.changed_fields =
(to_jsonb(NEW.*) OPERATOR(audit.-) audit_row.row_data) OPERATOR(audit.-) excluded_cols;
IF audit_row.changed_fields = '{}'::JSONB THEN
-- All changed fields are ignored. Skip this update.
RETURN NULL;
END IF;
audit_row.changed_fields =
(to_jsonb(NEW.*) OPERATOR(audit.-) audit_row.row_data);
ELSIF (TG_OP = 'DELETE' AND TG_LEVEL = 'ROW') THEN
audit_row.row_data = to_jsonb(OLD.*);
ELSIF (TG_LEVEL = 'STATEMENT' AND
TG_OP IN ('INSERT','UPDATE','DELETE','TRUNCATE')) THEN
audit_row.statement_only = 't';
ELSE
RAISE EXCEPTION '[audit.if_modified_func] - Trigger func added as trigger '
'for unhandled case: %, %', TG_OP, TG_LEVEL;
RETURN NULL;
END IF;
INSERT INTO audit.log VALUES (audit_row.*);
RETURN NULL;
END;
$$;
--
-- Name: jsonb_minus(jsonb, text[]); Type: FUNCTION; Schema: audit; Owner: -
--
CREATE FUNCTION audit.jsonb_minus("left" jsonb, keys text[]) RETURNS jsonb
LANGUAGE sql IMMUTABLE STRICT
AS $$
SELECT
CASE
WHEN "left" ?| "keys"
THEN COALESCE(
(SELECT ('{' ||
string_agg(to_json("key")::TEXT || ':' || "value", ',') ||
'}')
FROM jsonb_each("left")
WHERE "key" <> ALL ("keys")),
'{}'
)::JSONB
ELSE "left"
END
$$;
--
-- Name: jsonb_minus(jsonb, jsonb); Type: FUNCTION; Schema: audit; Owner: -
--
CREATE FUNCTION audit.jsonb_minus("left" jsonb, "right" jsonb) RETURNS jsonb
LANGUAGE sql IMMUTABLE STRICT
AS $$
SELECT
COALESCE(json_object_agg(
"key",
CASE
-- if the value is an object and the value of the second argument is
-- not null, we do a recursion
WHEN jsonb_typeof("value") = 'object' AND "right" -> "key" IS NOT NULL
THEN audit.jsonb_minus("value", "right" -> "key")
-- for all the other types, we just return the value
ELSE "value"
END
), '{}')::JSONB
FROM
jsonb_each("left")
WHERE
"left" -> "key" <> "right" -> "key"
OR "right" -> "key" IS NULL
$$;
--
-- Name: make_rect_grid(public.geometry, double precision, double precision, boolean); Type: FUNCTION; Schema: public; Owner: -
--
CREATE FUNCTION public.make_rect_grid(geom public.geometry, height_meters double precision, width_meters double precision, use_envelope boolean DEFAULT false, OUT public.geometry) RETURNS SETOF public.geometry
LANGUAGE plpgsql IMMUTABLE STRICT
AS $_$ DECLARE
x_max DECIMAL;
y_max DECIMAL;
x_min DECIMAL;
y_min DECIMAL;
srid INTEGER := 2163;
input_srid INTEGER;
x_series DECIMAL;
y_series DECIMAL;
BEGIN
CASE public.st_srid ( geom ) WHEN 0 THEN
geom := public.ST_SetSRID ( geom, srid );
RAISE NOTICE'SRID Not Found.';
ELSE
RAISE NOTICE'SRID Found.';
END CASE;
input_srid := public.st_srid ( geom );
geom := public.st_transform ( geom, srid );
CASE use_envelope WHEN true THEN
geom := public.st_envelope(geom);
RAISE NOTICE'Using min/max for ST_Envelope on geom';
ELSE
RAISE NOTICE'Using min/max for geom';
END CASE;
x_max := public.ST_XMax ( geom );
y_max := public.ST_YMax ( geom );
x_min := public.ST_XMin ( geom );
y_min := public.ST_YMin ( geom );
x_series := ceil ( @( x_max - x_min ) / height_meters );
y_series := ceil ( @( y_max - y_min ) / width_meters );
RETURN QUERY
WITH res AS (
SELECT
public.st_collect (public.st_setsrid ( public.ST_Translate ( cell, j * $2 + x_min, i * $3 + y_min ), srid )) AS grid
FROM
generate_series ( 0, x_series ) AS j,
generate_series ( 0, y_series ) AS i,
(
SELECT ( 'POLYGON((0 0, 0 ' ||$3 || ', ' ||$2 || ' ' ||$3 || ', ' ||$2 || ' 0,0 0))' ) :: public.geometry AS cell
) AS foo WHERE public.ST_Intersects ( public.st_setsrid ( public.ST_Translate ( cell, j * $2 + x_min, i * $3 + y_min ), srid ), geom )
) SELECT public.st_transform ( grid, input_srid ) FROM res;
END;
$_$;
--
-- Name: update_timestamp(); Type: FUNCTION; Schema: public; Owner: -
--
CREATE FUNCTION public.update_timestamp() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
-- Detect changes using *<> operator which is compatible with "point"
-- types that "DISTINCT FROM" is not:
-- https://www.mail-archive.com/pgsql-general@postgresql.org/msg198866.html
-- https://www.postgresql.org/docs/10/functions-comparisons.html#COMPOSITE-TYPE-COMPARISON
IF NEW *<> OLD THEN
NEW.updated_at := transaction_timestamp();
END IF;
RETURN NEW;
END;
$$;
--
-- Name: -; Type: OPERATOR; Schema: audit; Owner: -
--
CREATE OPERATOR audit.- (
FUNCTION = audit.jsonb_minus,
LEFTARG = jsonb,
RIGHTARG = text[]
);
--
-- Name: -; Type: OPERATOR; Schema: audit; Owner: -
--
CREATE OPERATOR audit.- (
FUNCTION = audit.jsonb_minus,
LEFTARG = jsonb,
RIGHTARG = jsonb
);
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: log; Type: TABLE; Schema: audit; Owner: -
--
CREATE TABLE audit.log (
id bigint NOT NULL,
schema_name text NOT NULL,
table_name text NOT NULL,
relid oid NOT NULL,
session_user_name text NOT NULL,
current_user_name text NOT NULL,
action_tstamp_tx timestamp with time zone NOT NULL,
action_tstamp_stm timestamp with time zone NOT NULL,
action_tstamp_clk timestamp with time zone NOT NULL,
transaction_id bigint NOT NULL,
application_name text,
application_user_name text,
client_addr inet,
client_port integer,
client_query text,
action text NOT NULL,
row_data jsonb,
changed_fields jsonb,
statement_only boolean NOT NULL,
CONSTRAINT log_action_check CHECK ((action = ANY (ARRAY['I'::text, 'D'::text, 'U'::text, 'T'::text])))
);
--
-- Name: log_id_seq; Type: SEQUENCE; Schema: audit; Owner: -
--
CREATE SEQUENCE audit.log_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: log_id_seq; Type: SEQUENCE OWNED BY; Schema: audit; Owner: -
--
ALTER SEQUENCE audit.log_id_seq OWNED BY audit.log.id;
--
-- Name: cache; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.cache (
id character varying(255) NOT NULL,
value jsonb
);
--
-- Name: counties; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.counties (
id integer NOT NULL,
state_code character varying(2) NOT NULL,
fips_code character varying(3) NOT NULL,
name character varying(255) NOT NULL,
boundaries_500k public.geography(MultiPolygon,4326)
);
--
-- Name: counties_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.counties_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: counties_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.counties_id_seq OWNED BY public.counties.id;
--
-- Name: country_grid_110km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.country_grid_110km (
id bigint NOT NULL,
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: country_grid_11km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.country_grid_11km (
id bigint NOT NULL,
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: country_grid_220km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.country_grid_220km (
id bigint NOT NULL,
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: country_grid_22km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.country_grid_22km (
id bigint NOT NULL,
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: country_grid_25km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.country_grid_25km (
id bigint NOT NULL,
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: country_grid_55km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.country_grid_55km (
id bigint NOT NULL,
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: knex_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.knex_migrations (
id integer NOT NULL,
name character varying(255),
batch integer,
migration_time timestamp with time zone
);
--
-- Name: knex_migrations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.knex_migrations_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: knex_migrations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.knex_migrations_id_seq OWNED BY public.knex_migrations.id;
--
-- Name: knex_migrations_lock; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.knex_migrations_lock (
index integer NOT NULL,
is_locked integer
);
--
-- Name: knex_migrations_lock_index_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.knex_migrations_lock_index_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: knex_migrations_lock_index_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.knex_migrations_lock_index_seq OWNED BY public.knex_migrations_lock.index;
--
-- Name: postal_codes; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.postal_codes (
id integer NOT NULL,
state_code character varying(2) NOT NULL,
postal_code character varying(5) NOT NULL,
city character varying(255) NOT NULL,
county_name character varying(255) NOT NULL,
county_code character varying(255),
location public.geography(Point,4326) NOT NULL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
time_zone character varying(255)
);
--
-- Name: postal_codes_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.postal_codes_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: postal_codes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.postal_codes_id_seq OWNED BY public.postal_codes.id;
--
-- Name: provider_brands; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.provider_brands (
id integer NOT NULL,
provider_id character varying(255) NOT NULL,
key character varying(255),
name character varying(255),
url character varying(255)
);
--
-- Name: provider_brands_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.provider_brands_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: provider_brands_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.provider_brands_id_seq OWNED BY public.provider_brands.id;
--
-- Name: providers; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.providers (
id character varying(255) NOT NULL
);
--
-- Name: state_grid_110km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.state_grid_110km (
id bigint NOT NULL,
state_code character varying(2),
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: state_grid_11km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.state_grid_11km (
id bigint NOT NULL,
state_code character varying(2),
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: state_grid_220km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.state_grid_220km (
id bigint NOT NULL,
state_code character varying(2),
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: state_grid_22km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.state_grid_22km (
id bigint NOT NULL,
state_code character varying(2),
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: state_grid_500k_55km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.state_grid_500k_55km (
id bigint NOT NULL,
state_code character varying(2),
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: state_grid_55km; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.state_grid_55km (
id bigint NOT NULL,
state_code character varying(2),
geom public.geometry,
centroid_location public.geography,
centroid_postal_code character varying(5),
centroid_postal_code_state_code character varying(2),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography
);
--
-- Name: states; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.states (
id integer NOT NULL,
country_code character varying(2) NOT NULL,
code character varying(2) NOT NULL,
name character varying(255) NOT NULL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
boundaries public.geography(MultiPolygon,4326),
boundaries_500k public.geography(MultiPolygon,4326),
boundaries_5m public.geography(MultiPolygon,4326),
fips_code character varying(2)
);
--
-- Name: states_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.states_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: states_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.states_id_seq OWNED BY public.states.id;
--
-- Name: stores; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.stores (
id integer NOT NULL,
brand character varying(255) NOT NULL,
brand_id character varying(255) NOT NULL,
name character varying(255),
address character varying(255),
city character varying(255),
state character varying(255),
postal_code character varying(255),
location public.geography(Point,4326),
metadata_raw jsonb,
carries_vaccine boolean,
appointments jsonb,
appointments_available boolean,
appointments_last_fetched timestamp with time zone,
appointments_raw jsonb,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
time_zone character varying(255),
active boolean DEFAULT true NOT NULL,
provider_id character varying(255),
provider_location_id character varying(255),
provider_brand_id integer,
location_source character varying(255),
url character varying(255),
normalized_address_key character varying(255),
appointment_types jsonb,
appointment_vaccine_types jsonb,
appointments_last_modified timestamp with time zone,
location_metadata_last_fetched timestamp with time zone,
county_id integer
);
--
-- Name: stores_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.stores_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: stores_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.stores_id_seq OWNED BY public.stores.id;
--
-- Name: walgreens_grid; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.walgreens_grid (
id integer NOT NULL,
state_code character varying(2),
geom public.geometry(MultiPolygon,4326),
centroid_location public.geography(Point,4326),
centroid_postal_code character varying(255),
centroid_postal_code_state_code character varying(255),
centroid_postal_code_city character varying(255),
centroid_postal_code_county character varying(255),
centroid_postal_code_location public.geography(Point,4326),
centroid_land_location public.geography(Point,4326),
grid_side_length integer,
furthest_point numeric(8,2),
point_count integer
);
--
-- Name: walgreens_grid_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.walgreens_grid_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: walgreens_grid_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.walgreens_grid_id_seq OWNED BY public.walgreens_grid.id;
--
-- Name: log id; Type: DEFAULT; Schema: audit; Owner: -
--
ALTER TABLE ONLY audit.log ALTER COLUMN id SET DEFAULT nextval('audit.log_id_seq'::regclass);
--
-- Name: counties id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.counties ALTER COLUMN id SET DEFAULT nextval('public.counties_id_seq'::regclass);
--
-- Name: knex_migrations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.knex_migrations ALTER COLUMN id SET DEFAULT nextval('public.knex_migrations_id_seq'::regclass);
--
-- Name: knex_migrations_lock index; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.knex_migrations_lock ALTER COLUMN index SET DEFAULT nextval('public.knex_migrations_lock_index_seq'::regclass);
--
-- Name: postal_codes id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.postal_codes ALTER COLUMN id SET DEFAULT nextval('public.postal_codes_id_seq'::regclass);
--
-- Name: provider_brands id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.provider_brands ALTER COLUMN id SET DEFAULT nextval('public.provider_brands_id_seq'::regclass);
--
-- Name: states id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.states ALTER COLUMN id SET DEFAULT nextval('public.states_id_seq'::regclass);
--
-- Name: stores id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores ALTER COLUMN id SET DEFAULT nextval('public.stores_id_seq'::regclass);
--
-- Name: walgreens_grid id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.walgreens_grid ALTER COLUMN id SET DEFAULT nextval('public.walgreens_grid_id_seq'::regclass);
--
-- Name: log log_pkey; Type: CONSTRAINT; Schema: audit; Owner: -
--
ALTER TABLE ONLY audit.log
ADD CONSTRAINT log_pkey PRIMARY KEY (id);
--
-- Name: cache cache_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.cache
ADD CONSTRAINT cache_pkey PRIMARY KEY (id);
--
-- Name: counties counties_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.counties
ADD CONSTRAINT counties_pkey PRIMARY KEY (id);
--
-- Name: counties counties_state_code_fips_code_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.counties
ADD CONSTRAINT counties_state_code_fips_code_unique UNIQUE (state_code, fips_code);
--
-- Name: country_grid_110km country_grid_110km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.country_grid_110km
ADD CONSTRAINT country_grid_110km_pkey PRIMARY KEY (id);
--
-- Name: country_grid_11km country_grid_11km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.country_grid_11km
ADD CONSTRAINT country_grid_11km_pkey PRIMARY KEY (id);
--
-- Name: country_grid_220km country_grid_220km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.country_grid_220km
ADD CONSTRAINT country_grid_220km_pkey PRIMARY KEY (id);
--
-- Name: country_grid_22km country_grid_22km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.country_grid_22km
ADD CONSTRAINT country_grid_22km_pkey PRIMARY KEY (id);
--
-- Name: country_grid_25km country_grid_25km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.country_grid_25km
ADD CONSTRAINT country_grid_25km_pkey PRIMARY KEY (id);
--
-- Name: country_grid_55km country_grid_55km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.country_grid_55km
ADD CONSTRAINT country_grid_55km_pkey PRIMARY KEY (id);
--
-- Name: knex_migrations_lock knex_migrations_lock_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.knex_migrations_lock
ADD CONSTRAINT knex_migrations_lock_pkey PRIMARY KEY (index);
--
-- Name: knex_migrations knex_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.knex_migrations
ADD CONSTRAINT knex_migrations_pkey PRIMARY KEY (id);
--
-- Name: postal_codes postal_codes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.postal_codes
ADD CONSTRAINT postal_codes_pkey PRIMARY KEY (id);
--
-- Name: postal_codes postal_codes_postal_code_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.postal_codes
ADD CONSTRAINT postal_codes_postal_code_unique UNIQUE (postal_code);
--
-- Name: provider_brands provider_brands_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.provider_brands
ADD CONSTRAINT provider_brands_pkey PRIMARY KEY (id);
--
-- Name: provider_brands provider_brands_provider_id_key_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.provider_brands
ADD CONSTRAINT provider_brands_provider_id_key_unique UNIQUE (provider_id, key);
--
-- Name: providers providers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.providers
ADD CONSTRAINT providers_pkey PRIMARY KEY (id);
--
-- Name: state_grid_110km state_grid_110km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.state_grid_110km
ADD CONSTRAINT state_grid_110km_pkey PRIMARY KEY (id);
--
-- Name: state_grid_11km state_grid_11km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.state_grid_11km
ADD CONSTRAINT state_grid_11km_pkey PRIMARY KEY (id);
--
-- Name: state_grid_220km state_grid_220km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.state_grid_220km
ADD CONSTRAINT state_grid_220km_pkey PRIMARY KEY (id);
--
-- Name: state_grid_22km state_grid_22km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.state_grid_22km
ADD CONSTRAINT state_grid_22km_pkey PRIMARY KEY (id);
--
-- Name: state_grid_500k_55km state_grid_500k_55km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.state_grid_500k_55km
ADD CONSTRAINT state_grid_500k_55km_pkey PRIMARY KEY (id);
--
-- Name: state_grid_55km state_grid_55km_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.state_grid_55km
ADD CONSTRAINT state_grid_55km_pkey PRIMARY KEY (id);
--
-- Name: states states_code_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.states
ADD CONSTRAINT states_code_unique UNIQUE (code);
--
-- Name: states states_fips_code_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.states
ADD CONSTRAINT states_fips_code_unique UNIQUE (fips_code);
--
-- Name: states states_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.states
ADD CONSTRAINT states_pkey PRIMARY KEY (id);
--
-- Name: stores stores_brand_brand_id_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_brand_brand_id_unique UNIQUE (brand, brand_id);
--
-- Name: stores stores_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_pkey PRIMARY KEY (id);
--
-- Name: stores stores_provider_id_normalized_address_key_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_provider_id_normalized_address_key_unique UNIQUE (provider_id, normalized_address_key);
--
-- Name: stores stores_provider_id_provider_location_id_unique; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_provider_id_provider_location_id_unique UNIQUE (provider_id, provider_location_id);
--
-- Name: walgreens_grid walgreens_grid_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.walgreens_grid
ADD CONSTRAINT walgreens_grid_pkey PRIMARY KEY (id);
--
-- Name: audit_log_action_tstamp_tx_index; Type: INDEX; Schema: audit; Owner: -
--
CREATE INDEX audit_log_action_tstamp_tx_index ON audit.log USING btree (action_tstamp_tx);
--
-- Name: log_action_idx; Type: INDEX; Schema: audit; Owner: -
--
CREATE INDEX log_action_idx ON audit.log USING btree (action);
--
-- Name: log_action_tstamp_tx_stm_idx; Type: INDEX; Schema: audit; Owner: -
--
CREATE INDEX log_action_tstamp_tx_stm_idx ON audit.log USING btree (action_tstamp_stm);
--
-- Name: log_relid_idx; Type: INDEX; Schema: audit; Owner: -
--
CREATE INDEX log_relid_idx ON audit.log USING btree (relid);
--
-- Name: counties_boundaries_500k_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX counties_boundaries_500k_index ON public.counties USING gist (boundaries_500k);
--
-- Name: counties_state_code_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX counties_state_code_index ON public.counties USING btree (state_code);
--
-- Name: country_grid_110km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_110km_centroid_location_index ON public.country_grid_110km USING gist (centroid_location);
--
-- Name: country_grid_110km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_110km_geom_index ON public.country_grid_110km USING gist (geom);
--
-- Name: country_grid_11km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_11km_centroid_location_index ON public.country_grid_11km USING gist (centroid_location);
--
-- Name: country_grid_11km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_11km_geom_index ON public.country_grid_11km USING gist (geom);
--
-- Name: country_grid_220km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_220km_centroid_location_index ON public.country_grid_220km USING gist (centroid_location);
--
-- Name: country_grid_220km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_220km_geom_index ON public.country_grid_220km USING gist (geom);
--
-- Name: country_grid_22km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_22km_centroid_location_index ON public.country_grid_22km USING gist (centroid_location);
--
-- Name: country_grid_22km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_22km_geom_index ON public.country_grid_22km USING gist (geom);
--
-- Name: country_grid_55km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_55km_centroid_location_index ON public.country_grid_55km USING gist (centroid_location);
--
-- Name: country_grid_55km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX country_grid_55km_geom_index ON public.country_grid_55km USING gist (geom);
--
-- Name: postal_codes_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX postal_codes_location_index ON public.postal_codes USING gist (location);
--
-- Name: postal_codes_postal_code_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX postal_codes_postal_code_index ON public.postal_codes USING btree (postal_code);
--
-- Name: state_grid_110km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_110km_centroid_location_index ON public.state_grid_110km USING gist (centroid_location);
--
-- Name: state_grid_110km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_110km_geom_index ON public.state_grid_110km USING gist (geom);
--
-- Name: state_grid_11km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_11km_centroid_location_index ON public.state_grid_11km USING gist (centroid_location);
--
-- Name: state_grid_11km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_11km_geom_index ON public.state_grid_11km USING gist (geom);
--
-- Name: state_grid_220km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_220km_centroid_location_index ON public.state_grid_220km USING gist (centroid_location);
--
-- Name: state_grid_220km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_220km_geom_index ON public.state_grid_220km USING gist (geom);
--
-- Name: state_grid_22km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_22km_centroid_location_index ON public.state_grid_22km USING gist (centroid_location);
--
-- Name: state_grid_22km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_22km_geom_index ON public.state_grid_22km USING gist (geom);
--
-- Name: state_grid_500k_55km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_500k_55km_centroid_location_index ON public.state_grid_500k_55km USING gist (centroid_location);
--
-- Name: state_grid_500k_55km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_500k_55km_geom_index ON public.state_grid_500k_55km USING gist (geom);
--
-- Name: state_grid_55km_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_55km_centroid_location_index ON public.state_grid_55km USING gist (centroid_location);
--
-- Name: state_grid_55km_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX state_grid_55km_geom_index ON public.state_grid_55km USING gist (geom);
--
-- Name: states_boundaries_500k_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX states_boundaries_500k_index ON public.states USING gist (boundaries_500k);
--
-- Name: states_boundaries_5m_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX states_boundaries_5m_index ON public.states USING gist (boundaries_5m);
--
-- Name: states_boundaries_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX states_boundaries_index ON public.states USING gist (boundaries);
--
-- Name: states_id_name_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX states_id_name_idx ON public.states USING btree (id, name);
--
-- Name: stores_appointments_available_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX stores_appointments_available_index ON public.stores USING btree (appointments_available);
--
-- Name: stores_appointments_last_fetched_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX stores_appointments_last_fetched_index ON public.stores USING btree (appointments_last_fetched);
--
-- Name: stores_carries_vaccine_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX stores_carries_vaccine_index ON public.stores USING btree (carries_vaccine);
--
-- Name: stores_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX stores_location_index ON public.stores USING gist (location);
--
-- Name: stores_provider_id_carries_vaccine_appointments_last_fetche_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX stores_provider_id_carries_vaccine_appointments_last_fetche_idx ON public.stores USING btree (provider_id, carries_vaccine, appointments_last_fetched);
--
-- Name: stores_state_active_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX stores_state_active_idx ON public.stores USING btree (state, active);
--
-- Name: stores_state_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX stores_state_index ON public.stores USING btree (state);
--
-- Name: walgreens_grid_centroid_land_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX walgreens_grid_centroid_land_location_index ON public.walgreens_grid USING gist (centroid_land_location);
--
-- Name: walgreens_grid_centroid_location_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX walgreens_grid_centroid_location_index ON public.walgreens_grid USING gist (centroid_location);
--
-- Name: walgreens_grid_geom_index; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX walgreens_grid_geom_index ON public.walgreens_grid USING gist (geom);
--
-- Name: walgreens_grid_state_code_idx; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX walgreens_grid_state_code_idx ON public.walgreens_grid USING btree (state_code);
--
-- Name: stores audit_trigger_row; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER audit_trigger_row AFTER INSERT OR DELETE OR UPDATE ON public.stores FOR EACH ROW EXECUTE FUNCTION audit.if_modified_func('false', '{created_at,updated_at,metadata_raw,appointments_raw,appointments_last_fetched,appointments_last_modified,location_metadata_last_fetched}');
--
-- Name: stores audit_trigger_stm; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER audit_trigger_stm AFTER TRUNCATE ON public.stores FOR EACH STATEMENT EXECUTE FUNCTION audit.if_modified_func('false');
--
-- Name: postal_codes postal_codes_updated_at; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER postal_codes_updated_at BEFORE UPDATE ON public.postal_codes FOR EACH ROW EXECUTE FUNCTION public.update_timestamp();
--
-- Name: states states_updated_at; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER states_updated_at BEFORE UPDATE ON public.states FOR EACH ROW EXECUTE FUNCTION public.update_timestamp();
--
-- Name: stores stores_updated_at; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER stores_updated_at BEFORE UPDATE ON public.stores FOR EACH ROW EXECUTE FUNCTION public.update_timestamp();
--
-- Name: counties counties_state_code_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.counties
ADD CONSTRAINT counties_state_code_foreign FOREIGN KEY (state_code) REFERENCES public.states(code);
--
-- Name: postal_codes postal_codes_state_code_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.postal_codes
ADD CONSTRAINT postal_codes_state_code_foreign FOREIGN KEY (state_code) REFERENCES public.states(code);
--
-- Name: provider_brands provider_brands_provider_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.provider_brands
ADD CONSTRAINT provider_brands_provider_id_foreign FOREIGN KEY (provider_id) REFERENCES public.providers(id);
--
-- Name: stores stores_county_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_county_id_foreign FOREIGN KEY (county_id) REFERENCES public.counties(id);
--
-- Name: stores stores_postal_code_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_postal_code_foreign FOREIGN KEY (postal_code) REFERENCES public.postal_codes(postal_code);
--
-- Name: stores stores_provider_brand_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_provider_brand_id_foreign FOREIGN KEY (provider_brand_id) REFERENCES public.provider_brands(id);
--
-- Name: stores stores_provider_id_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_provider_id_foreign FOREIGN KEY (provider_id) REFERENCES public.providers(id);
--
-- Name: stores stores_state_foreign; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.stores
ADD CONSTRAINT stores_state_foreign FOREIGN KEY (state) REFERENCES public.states(code);
--
-- PostgreSQL database dump complete
--
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.2
-- Dumped by pg_dump version 13.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Data for Name: knex_migrations; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.knex_migrations (id, name, batch, migration_time) FROM stdin;
16 20210221100547_create_states.js 1 2021-02-21 21:25:21.993+00
17 20210221100553_create_postal_codes.js 1 2021-02-21 21:25:22.33+00
24 20210221143355_create_stores.js 2 2021-02-22 04:41:43.631+00
25 20210222161552_optional_store_location.js 3 2021-02-22 23:20:50.858+00
29 20210223095007_state_boundaries.js 4 2021-02-23 23:58:05.058+00
30 20210223173502_store_time_zone.js 5 2021-02-24 00:38:23.872+00
31 20210223232431_optional_store_city_state.js 6 2021-02-24 06:26:37.028+00
36 20210225081423_country_grids.js 7 2021-02-26 00:19:36.812+00
40 20210226081756_audit.js 8 2021-02-26 15:42:10.901+00
41 20210227104231_postal_code_time_zone.js 9 2021-02-27 18:12:56.473+00
45 20210301091717_smaller_country_grids.js 10 2021-03-03 05:46:46.508+00
46 20210302161153_bigger_country_grid.js 10 2021-03-03 05:46:50.622+00
51 20210304151335_provider_brand.js 11 2021-03-05 02:51:44.143+00
52 20210307114320_geocoding.js 12 2021-03-07 18:46:53.196+00
53 20210307171239_store_url.js 13 2021-03-08 00:20:37.33+00
56 20210315165140_store_normalized_address_key.js 14 2021-03-16 03:50:20.785+00
61 20210322161258_walgreens_grid.js 15 2021-03-23 05:49:27.875+00
63 20210324142039_store_vaccine_appointment_types.js 16 2021-03-24 20:53:32.342+00
65 20210325091544_create_cache.js 17 2021-03-25 15:29:23.505+00
67 20210329150722_states_boundaries_500k.js 18 2021-03-29 21:51:36.984+00
69 20210329160409_create_state_grid_55km_500k.js 19 2021-03-29 22:57:20.879+00
70 20210401101728_appointments_last_modified.js 20 2021-04-01 16:19:52.884+00
73 20210408224048_convert_materialized_views.js 21 2021-04-09 05:07:41.373+00
74 20210409102212_audit_index.js 22 2021-04-09 16:24:10.231+00
77 20210417230632_location_metadata_last_fetched.js 23 2021-04-18 05:37:12.793+00
81 20210418203734_counties.js 24 2021-04-19 03:23:23.823+00
\.
--
-- Name: knex_migrations_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.knex_migrations_id_seq', 81, true);
--
-- PostgreSQL database dump complete
-- | the_stack |
--
--simple query support
--
set enable_opfusion=on;
set enable_bitmapscan=off;
set enable_seqscan=off;
set opfusion_debug_mode = 'log';
set log_min_messages=debug;
set logging_module = 'on(OPFUSION)';
set sql_beta_feature = 'index_cost_with_leaf_pages_only';
-- create table
drop table if exists test_bypass_sq1;
create table test_bypass_sq1(col1 int, col2 int, col3 text);
create index itest_bypass_sq1 on test_bypass_sq1(col1,col2);
-- bypass insert data
explain insert into test_bypass_sq1 values (0,0,'test_insert');
insert into test_bypass_sq1 values (0,0,'test_insert');
explain insert into test_bypass_sq1 values (0,1,'test_insert');
insert into test_bypass_sq1 values (0,1,'test_insert');
explain insert into test_bypass_sq1 values (1,1,'test_insert');
insert into test_bypass_sq1 values (1,1,'test_insert');
explain insert into test_bypass_sq1 values (1,2,'test_insert');
insert into test_bypass_sq1 values (1,2,'test_insert');
explain insert into test_bypass_sq1 values (0,0,'test_insert2');
insert into test_bypass_sq1 values (0,0,'test_insert2');
explain insert into test_bypass_sq1 values (2,2,'test_insert2');
insert into test_bypass_sq1 values (2,2,'test_insert2');
explain insert into test_bypass_sq1 values (0,0,'test_insert3');
insert into test_bypass_sq1 values (0,0,'test_insert3');
explain insert into test_bypass_sq1 values (3,3,'test_insert3');
insert into test_bypass_sq1 values (3,3,'test_insert3');
explain insert into test_bypass_sq1(col1,col2) values (1,1);
insert into test_bypass_sq1(col1,col2) values (1,1);
explain insert into test_bypass_sq1(col1,col2) values (2,2);
insert into test_bypass_sq1(col1,col2) values (2,2);
explain insert into test_bypass_sq1(col1,col2) values (3,3);
insert into test_bypass_sq1(col1,col2) values (3,3);
explain insert into test_bypass_sq1 values (null,null,null);
insert into test_bypass_sq1 values (null,null,null);
--bypass
set enable_indexonlyscan=off;
explain select * from test_bypass_sq1 where col1=0 and col2=0;
select * from test_bypass_sq1 where col1=0 and col2=0;
explain select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2;
select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2;
explain select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 limit 1;
select col1,col2 from test_bypass_sq1 where col1>0 and col2>0 order by col1,col2 limit 1;
explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 1;
select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 1;
explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 limit 0;
select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 limit 0;
explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 0;
select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1,col2 for update limit 0;
reset enable_indexonlyscan;
--bypass though index only scan
set enable_indexscan = off;
explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0;
select col1,col2 from test_bypass_sq1 where col1=0 and col2=0;
explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 1;
select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 1;
explain select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 0;
select col1,col2 from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit 0;
reset enable_indexscan;
--error
explain select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 limit -1;
explain select * from test_bypass_sq1 where col1=0 and col2=0 order by col1 for update limit -1;
--bypass
explain update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null;
update test_bypass_sq1 set col3='test_null' where col1 is null and col2 is null;
explain select * from test_bypass_sq1 where col1 is null and col2 is null;
select * from test_bypass_sq1 where col1 is null and col2 is null;
explain select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not null order by col1,col2;
select col1,col2 from test_bypass_sq1 where col1 is not null and col2 is not null order by col1,col2;
explain select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1;
select * from test_bypass_sq1 where col1 is not null and col2 = 0 order by col1;
explain update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=0;
update test_bypass_sq1 set col2=col2-1,col3='test_update' where col1=0 and col2=0;
explain update test_bypass_sq1 set col2=col1 where col1=0 and col2=0;
update test_bypass_sq1 set col2=col1 where col1=0 and col2=0;
explain update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2;
update test_bypass_sq1 set col2=col1-1,col3='test_update' where col1=2 and col2=2;
explain select * from test_bypass_sq1 where col1=0 and col2=-1;
select * from test_bypass_sq1 where col1=0 and col2=-1;
--not bypass
explain insert into test_bypass_sq1 values(0,generate_series(1,100),'test');
explain select * from test_bypass_sq1 where col3 is not null;
--bypass
explain update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1;
update test_bypass_sq1 set col2=mod(5,3) where col1=1 and col2=1;
--bypass / set enable_bitmapscan=off;
explain update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0;
update test_bypass_sq1 set col2=111,col3='test_update2' where col1=0;
explain select * from test_bypass_sq1 where col1=0 order by col1;
select * from test_bypass_sq1 where col1=0 order by col1;
explain select * from test_bypass_sq1 where col2=2 order by col1;
select * from test_bypass_sq1 where col2=2 order by col1;
explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1;
select col1,col2 from test_bypass_sq1 where col1>0 order by col1;
explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 3;
select col1,col2 from test_bypass_sq1 where col1>0 order by col1 limit 3;
explain select * from test_bypass_sq1 where col1=0 order by col1 for update limit 2;
select * from test_bypass_sq1 where col1=0 order by col1 for update limit 2;
explain select col1,col2 from test_bypass_sq1 where col2<5 order by col1;
select col1,col2 from test_bypass_sq1 where col2<5 order by col1;
explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1;
select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1;
explain select * from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3;
select * from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3;
explain select * from test_bypass_sq1 where col1=1 and col2=2 order by col1 for update limit 1;
select * from test_bypass_sq1 where col1=1 and col2=2 order by col1 for update limit 1;
--bypass though index only scan
set enable_indexscan = off;
explain select col1,col2 from test_bypass_sq1 where col1=0 order by col2;
select col1,col2 from test_bypass_sq1 where col1=0 order by col2;
explain select col2,col1 from test_bypass_sq1 where col2=2 order by col1;
select col2,col1 from test_bypass_sq1 where col2=2 order by col1;
explain select col1,col2 from test_bypass_sq1 where col1>0 order by col1;
select col1,col2 from test_bypass_sq1 where col1>0 order by col1;
explain select col1,col2 from test_bypass_sq1 where col1 is null and col2 is null;
select col1,col2 from test_bypass_sq1 where col1 is null and col2 is null;
explain select col2,col1 from test_bypass_sq1 where col1>0 order by col1 limit 3;
select col2,col1 from test_bypass_sq1 where col1>0 order by col1 limit 3;
explain select col1,col2 from test_bypass_sq1 where col2<5 order by col1;
select col1,col2 from test_bypass_sq1 where col2<5 order by col1;
explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1;
select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1;
explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3;
select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit 3;
explain select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit null;
select col1,col2 from test_bypass_sq1 where col1>=0 and col2>0 order by col1 limit null;
reset enable_indexscan;
--not bypass
explain select * from test_bypass_sq1 where col1>col2;
explain select * from test_bypass_sq1 where col1=3 and col2=3 for update;
select * from test_bypass_sq1 where col1=3 and col2=3 for update;
explain select * from test_bypass_sq1 where col3='test_update2';
--bypass
explain select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 3;
select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 limit 3 offset 3;
explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset 3;
explain select * from test_bypass_sq1 where col1>0 order by col1 for update limit 3 offset null;
explain select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3;
select * from test_bypass_sq1 where col1>0 and col2>0 order by col1 offset 3;
explain select * from test_bypass_sq1 where col1>0 order by col1 for update offset 3;
explain update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2;
update test_bypass_sq1 set col2=3*7 where col1=3 and col2=2;
explain delete from test_bypass_sq1 where col1=1 and col2=1;
delete from test_bypass_sq1 where col1=1 and col2=1;
explain delete from test_bypass_sq1 where col1 is null and col2 is null;
delete from test_bypass_sq1 where col1 is null and col2 is null;
explain insert into test_bypass_sq1 values (null,null,null);
insert into test_bypass_sq1 values (null,null,null);
--bypass / set enable_bitmapscan=off;
select * from test_bypass_sq1 where col1=3;
explain select col1,col2 from test_bypass_sq1 order by col1 desc;
select col1,col2 from test_bypass_sq1 order by col1 desc; --order by is supported when ordered col is in index
explain select col1,col2 from test_bypass_sq1 order by col1;
select col1,col2 from test_bypass_sq1 order by col1;
--not bypass
explain select col1,col2 from test_bypass_sq1 order by col1,col2;
select col1,col2 from test_bypass_sq1 order by col1,col2;
explain select * from test_bypass_sq1 where col1 > 0 order by col1,col2 desc;
--bypass
explain select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2;
select col1,col2 from test_bypass_sq1 where col1 > 0 order by col1,col2;
--not bypass
explain select * from test_bypass_sq1 where true;
--bypass
explain select col1, col2 from test_bypass_sq1 where true order by col1;
select col1, col2 from test_bypass_sq1 where true order by col1;
select col2, col1 from test_bypass_sq1 order by col1;
select col1, col2 from test_bypass_sq1 order by col1 desc;
explain insert into test_bypass_sq1 select * from test_bypass_sq1 where col1>0;
insert into test_bypass_sq1 select * from test_bypass_sq1 where col1>0;
--
drop table if exists test_bypass_sq2;
create table test_bypass_sq2(col1 int not null, col2 int);
create index itest_bypass_sq2 on test_bypass_sq2(col1);
--bypass
explain insert into test_bypass_sq2(col1) values (0);
insert into test_bypass_sq2(col1) values (0);
--error
explain insert into test_bypass_sq2(col1) values (null);
--bypass
explain insert into test_bypass_sq2(col1,col2) values (1,1);
insert into test_bypass_sq2(col1,col2) values (1,1);
insert into test_bypass_sq2(col1,col2) values (3,3);
insert into test_bypass_sq2(col1,col2) values (-1,-1);
insert into test_bypass_sq2(col1,col2) values (1,1);
insert into test_bypass_sq2(col1,col2) values (2,2);
insert into test_bypass_sq2(col1,col2) values (3,3);
explain insert into test_bypass_sq2(col1,col2) values (null,null);--error
--bypass
set enable_indexonlyscan=off;
explain update test_bypass_sq2 set col2 = col2+1 where col1 = 0;
update test_bypass_sq2 set col2 = col2+1 where col1 = 0;
explain select * from test_bypass_sq2 where col1 = 0 order by col1;
select * from test_bypass_sq2 where col1 = 0 order by col1;
explain select * from test_bypass_sq2 where col1 >= 0 order by col1;
select * from test_bypass_sq2 where col1 >= 0 order by col1;
explain select * from test_bypass_sq2 where col1 >= 0 order by col1 limit 4;
select * from test_bypass_sq2 where col1 >= 0 order by col1 limit 4;
explain select * from test_bypass_sq2 where col1 = 1 order by col1 for update limit 1;
select * from test_bypass_sq2 where col1 = 1 order by col1 for update limit 1;
explain select col1 from test_bypass_sq2 order by col1 limit 2;
select col1 from test_bypass_sq2 order by col1 limit 2;
explain select * from test_bypass_sq2 where col1 > 0 order by col1 limit 2 offset 2;
select * from test_bypass_sq2 where col1 > 0 order by col1 limit 2 offset 2;
explain select * from test_bypass_sq2 where col1 > 0 order by col1 for update limit 2 offset 2;
reset enable_indexonlyscan;
--not bypass
explain select * from test_bypass_sq2 where col2 is null;
explain select * from test_bypass_sq2 where col1 = 0 and col2 = 0;
explain select t1.col3, t2.col2 from test_bypass_sq1 as t1 join test_bypass_sq2 as t2 on t1.col1=t2.col1;
explain select count(*),col1 from test_bypass_sq1 group by col1;
--bypass (order by is supported when ordered col is in index)
select col1 from test_bypass_sq2 order by col1 desc;
select col1 from test_bypass_sq2 order by col1;
--not bypass
explain select * from test_bypass_sq2 order by col1,col2;
--
drop table if exists test_bypass_sq3;
create table test_bypass_sq3(col1 int default 1, col2 int, col3 timestamp);
create index itest_bypass_sq3 on test_bypass_sq3(col1);
--bypass
insert into test_bypass_sq3(col2,col3) values (3,null);
--bypass (default is null)
insert into test_bypass_sq3(col2,col3) values(1,default);
insert into test_bypass_sq3 values(2,3,null);
insert into test_bypass_sq3 values (3,3,null);
--not bypass
explain insert into test_bypass_sq3 values(3,3,current_timestamp);
explain select * from test_bypass_sq3 where col1 = 1 order by col2;
--bypass
select * from test_bypass_sq3 where col1 = 1 limit 1;
select col2 from test_bypass_sq3 where col1 = 1 for update;
update test_bypass_sq3 set col2 = col2*3 where col1 = 1;
--bypass (col1 is default 1)
insert into test_bypass_sq3 values(default,default,default);
--test random index pos
drop table if exists test_bypass_sq4;
create table test_bypass_sq4(col1 int, col2 int, col3 int);
create index itest_bypass_sq4 on test_bypass_sq4(col3,col2);
insert into test_bypass_sq4 values (11,21,31);
insert into test_bypass_sq4 values (11,22,32);
insert into test_bypass_sq4 values (12,23,32);
insert into test_bypass_sq4 values (12,23,33);
insert into test_bypass_sq4 values (13,24,33);
insert into test_bypass_sq4 values (13,24,34);
insert into test_bypass_sq4 values (14,25,34);
insert into test_bypass_sq4 values (14,25,35);
insert into test_bypass_sq4 values (55,55,55);
insert into test_bypass_sq4 values (55,55,null);
insert into test_bypass_sq4 values (55,null,55);
insert into test_bypass_sq4 values (55,null,null);
insert into test_bypass_sq4 values (null,null,null);
explain select col3, col1, col2 from test_bypass_sq4 where col2 >22 order by 1,3;
select col3, col1, col2 from test_bypass_sq4 where col2 >22 order by 1,3;
explain select * from test_bypass_sq4 where col2 =22 and col3= 32 order by col2;
select * from test_bypass_sq4 where col2 =22 and col3= 32 order by col2;
explain select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3,col2;
select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3,col2;
select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order by col3,col2;
explain select col3,col2,col3 from test_bypass_sq4 where col3 >= 33 and col2 >= 22 order by col3 for update;
explain select col2,col3,col2 from test_bypass_sq4 where col3 >= 34 and col2 >= 22 order by col3,col2 for update;
select col2,col3,col2 from test_bypass_sq4 where col3 is null and col2 is null order by col3,col2;
explain select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null;
select col2,col3 from test_bypass_sq4 where col3 is null and col2 is not null;
explain select col2,col3 from test_bypass_sq4 where col3 is not null order by col3 desc,col2 desc;
select col2,col3 from test_bypass_sq4 where col3 is not null order by col3 desc,col2 desc;
drop table if exists test_bypass_sq5;
create table test_bypass_sq5(col1 int, col2 int, col3 int default 1);
create index itest_bypass_sq5 on test_bypass_sq5(col2);
insert into test_bypass_sq5 values (1,2,3);
insert into test_bypass_sq5 values (2,3,4);
-- permission
DROP ROLE IF EXISTS bypassuser;
CREATE USER bypassuser PASSWORD 'ttest@123';
GRANT select ON test_bypass_sq5 TO bypassuser;
GRANT update ON test_bypass_sq5 TO bypassuser;
SET SESSION AUTHORIZATION bypassuser PASSWORD 'ttest@123';
SELECT SESSION_USER, CURRENT_USER;
select * from test_bypass_sq5 order by col2;
select * from test_bypass_sq5 where col2>2 for update;
insert into test_bypass_sq5 values (2,3,4); --fail
update test_bypass_sq5 set col3 = col3+1 where col2 > 0;
delete from test_bypass_sq5; --fail
RESET SESSION AUTHORIZATION;
revoke update on test_bypass_sq5 from bypassuser;
revoke select on test_bypass_sq5 from bypassuser;
DROP OWNED BY bypassuser;
DROP ROLE bypassuser;
-- bypass transaction
start transaction;
insert into test_bypass_sq5 values (3,4,5);
select * from test_bypass_sq5 order by col2;
savepoint s1;
update test_bypass_sq5 set col3 = col3+1 where col2 > 0;
select * from test_bypass_sq5 order by col2;
rollback to savepoint s1;
select * from test_bypass_sq5 order by col2;
savepoint s2;
delete from test_bypass_sq5 where col2 < 3;
select * from test_bypass_sq5 order by col2;
rollback to savepoint s2;
select * from test_bypass_sq5 order by col2;
rollback;
start transaction read only;
insert into test_bypass_sq5 values (3,4,5);
rollback;
start transaction read only;
update test_bypass_sq5 set col3 = col3+1 where col2 > 0;
rollback;
start transaction read only;
delete from test_bypass_sq5 where col2 < 3;
rollback;
select * from test_bypass_sq5 order by col2;
-- maybe wrong savepoint and cursor
drop table if exists test_bypass_sq5;
create table test_bypass_sq5(col1 int, col2 int, col3 int default 1);
create index itest_bypass_sq5 on test_bypass_sq5(col2);
insert into test_bypass_sq5 values (1,2,3);
insert into test_bypass_sq5 values (2,3,4);
start transaction;
insert into test_bypass_sq5 values (3,4,5);
select * from test_bypass_sq5 order by col2;
cursor tt for select * from test_bypass_sq5 order by col2;
update test_bypass_sq5 set col3 = col3+1 where col2 > 0;
select * from test_bypass_sq5 order by col2;
fetch 2 from tt;
savepoint s3;
update test_bypass_sq5 set col3 = col3+1 where col2 > 0;
select * from test_bypass_sq5 order by col2;
rollback to savepoint s3;
select * from test_bypass_sq5 order by col2;
fetch 2 from tt;
commit;
select * from test_bypass_sq5 order by col2;
-- test complex type
drop table if exists test_bypass_sq6;
create type complextype AS (f1 int, f2 text);
create table test_bypass_sq6(col1 int, col2 complextype,col3 text);
create index itest_bypass_sq6 on test_bypass_sq6(col1,col3);
--not bypass
explain insert into test_bypass_sq6 values (1,ROW(1, 'Simon1'::text),'test'::text);
-- just insert
reset opfusion_debug_mode;
insert into test_bypass_sq6 values (1,ROW(1, 'Simon1'::text),'test'::text);
set opfusion_debug_mode = 'error';
--bypass
select * from test_bypass_sq6 where col1 is not null;
select * from test_bypass_sq6 where col3 ='test'::text for update;
update test_bypass_sq6 set col3='test_2'::text where col1 = 1;
select * from test_bypass_sq6 where col3 is not null;
select col1 from test_bypass_sq6;
select col3 from test_bypass_sq6 order by col1,col3;
select col1, col3 from test_bypass_sq6 where true;
--notbypass
explain update test_bypass_sq6 set col2=ROW(2,'Ruby2'::text) where col1 = 1;
--bypass
delete from test_bypass_sq6 where col1 = 1;
--test QPS
set opfusion_debug_mode='error';
drop table if exists test_bypass_sq7;
create table test_bypass_sq7(col1 int, col2 int, col3 int);
create index test_bypass_sq7_index on test_bypass_sq7(col1,col2);
insert into test_bypass_sq7 values (11,21,31);
insert into test_bypass_sq7 values (11,22,32);
insert into test_bypass_sq7 values (12,23,32);
SET track_activities=on;
SET track_sql_count=on;
DROP USER IF EXISTS qps CASCADE;
CREATE USER qps PASSWORD 'TTEST@123';
GRANT INSERT on TABLE test_bypass_sq7 to qps;
GRANT SELECT on TABLE test_bypass_sq7 to qps;
GRANT UPDATE on TABLE test_bypass_sq7 to qps;
GRANT DELETE on TABLE test_bypass_sq7 to qps;
SET SESSION SESSION AUTHORIZATION qps PASSWORD 'TTEST@123';
SELECT node_name,select_count, update_count, insert_count, delete_count, ddl_count, dml_count FROM gs_sql_count where user_name='qps';
SELECT * from test_bypass_sq7 where col1 >10 and col2 >10 order by col1,col2;
update test_bypass_sq7 set col2 =1 where col1 =11;
insert into test_bypass_sq7 values (1,2,3);
delete test_bypass_sq7 where col1 =1;
SELECT node_name,select_count, update_count, insert_count, delete_count, ddl_count, dml_count FROM gs_sql_count where user_name='qps';
CREATE OR REPLACE FUNCTION tri_bypass() RETURNS trigger AS $$
BEGIN
NEW.col2 = NEW.col2 + 2;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
set opfusion_debug_mode = 'log';
drop table if exists test_bypass_sq8;
create table test_bypass_sq8(col1 int, col2 int, col3 text);
create index itest_bypass_sq8 on test_bypass_sq8(col1,col2);
create trigger tri_bypass after insert on test_bypass_sq8 for each row execute procedure tri_bypass();
insert into test_bypass_sq8 values(1,1,'test');
explain select * from test_bypass_sq8 where col1 = 1;
explain update test_bypass_sq8 set col2 = 2 where col1 = 1;
explain delete test_bypass_sq8 where col1 = 1;
explain insert into test_bypass_sq8 values(2,2,'testinsert');
set opfusion_debug_mode=off;
RESET SESSION AUTHORIZATION;
SELECT node_name,select_count, update_count, insert_count, delete_count, ddl_count, dml_count FROM pgxc_sql_count where user_name='qps' order by node_name;
revoke insert on test_bypass_sq7 from qps;
revoke delete on test_bypass_sq7 from qps;
revoke update on test_bypass_sq7 from qps;
revoke select on test_bypass_sq7 from qps;
DROP OWNED BY qps;
DROP ROLE qps;
-- end
reset track_activities;
set track_sql_count = off;
reset enable_seqscan;
reset enable_bitmapscan;
reset opfusion_debug_mode;
reset enable_opfusion;
reset enable_indexscan;
reset enable_indexonlyscan;
reset log_min_messages;
reset logging_module;
drop table test_bypass_sq1;
drop table test_bypass_sq2;
drop table test_bypass_sq3;
drop table test_bypass_sq4;
drop table test_bypass_sq5;
drop table test_bypass_sq6;
drop table test_bypass_sq7;
drop table test_bypass_sq8;
drop function tri_bypass;
drop type complextype; | the_stack |
------------------------------------------------------------------------
-- TITLE:
-- scenariodb_ground.sql
--
-- AUTHOR:
-- Will Duquette
--
-- DESCRIPTION:
-- SQL Schema for scenariodb(n): Ground Area
--
-- SECTIONS:
-- Personnel and Related Statistics
-- Situations
-- Attrition
-- Services
--
------------------------------------------------------------------------
------------------------------------------------------------------------
-- PERSONNEL AND RELATED STATISTICS
-- FRC and ORG personnel in playbox.
CREATE TABLE personnel_g (
-- Symbolic group name
g TEXT PRIMARY KEY
REFERENCES groups(g)
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
-- Personnel in playbox
personnel INTEGER DEFAULT 0
);
-- Deployment Table: FRC and ORG personnel deployed into neighborhoods.
CREATE TABLE deploy_ng (
-- Symbolic neighborhood name
n TEXT REFERENCES nbhoods(n)
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
-- Symbolic group name
g TEXT REFERENCES groups(g)
DEFERRABLE INITIALLY DEFERRED,
-- Personnel
personnel INTEGER DEFAULT 0,
-- Unassigned personnel.
unassigned INTEGER DEFAULT 0,
PRIMARY KEY (n,g)
);
-- Deployment Table: FRC and ORG personnel deployed into neighborhoods,
-- by deploying tactic. This table is used to implement non-reinforcing
-- deployments.
CREATE TABLE deploy_tng (
tactic_id INTEGER, -- DEPLOY tactic
n TEXT, -- Neighborhood
g TEXT, -- FRC/ORG group
personnel INTEGER DEFAULT 0, -- Personnel currently deployed
-- A single tactic can deploy one group to one or more neighborhoods.
PRIMARY KEY (tactic_id, n)
);
-- Index so that attrition is efficient.
CREATE INDEX deploy_tng_index ON deploy_tng(n,g);
---------------------------------------------------------------------
-- Attrition Model Tables
-- Battle table for AAM: tracks designated personnel,
-- postures and casualties
CREATE TABLE aam_battle (
-- Nbhood ID
n TEXT,
-- Force group IDs of combatants
f TEXT,
g TEXT,
-- The number of hours of combat remaining in the current week
-- between f and g
hours_left DOUBLE DEFAULT 0.0,
-- ROE of f to g and g to f
roe_f TEXT,
roe_g TEXT,
-- Posture f takes wrt to g and g takes wrt f
posture_f TEXT,
posture_g TEXT,
-- Total personnel and those designated in fight
pers_f INTEGER DEFAULT 0,
pers_g INTEGER DEFAULT 0,
dpers_f INTEGER DEFAULT 0,
dpers_g INTEGER DEFAULT 0,
-- Casualties suffered by f and g
cas_f INTEGER DEFAULT 0,
cas_g INTEGER DEFAULT 0,
PRIMARY KEY (n, f, g)
);
-- General unit data
CREATE TABLE units (
-- Symbolic unit name
u TEXT PRIMARY KEY,
-- Tactic ID, or NULL if this is a base unit.
-- NOTE: There is no FK reference because the unit can outlive the
-- tactic that created it. A unit is associated with at most one
-- tactic.
tactic_id INTEGER UNIQUE,
-- Active flag: 1 if active, 0 otherwise. A unit is active if it
-- is currently scheduled.
active INTEGER,
-- Neighborhood to which unit is deployed
n TEXT,
-- Group to which the unit belongs
g TEXT,
-- Group type
gtype TEXT,
-- Unit activity: eactivity(n) value, or NONE if this is a base unit
a TEXT,
-- Total Personnel
personnel INTEGER DEFAULT 0,
-- Location, in map coordinates, within n
location TEXT,
-- Attrition Flag: 1 if the unit is about to be attrited.
attrit_flag INTEGER DEFAULT 0
);
CREATE INDEX units_ngap_index ON
units(n,g,a,personnel);
-- Units view, for display
CREATE VIEW units_view AS
SELECT U.u AS u,
U.active AS active,
U.g AS g,
u.gtype AS gtype,
U.personnel AS personnel,
U.a AS a,
U.location AS location,
G.color AS color
FROM units AS U JOIN groups AS G USING (g);
------------------------------------------------------------------------
-- STANCE
CREATE TABLE stance_fg (
-- Contains the stance (designated relationship) of force group f
-- toward group g, as specified by a STANCE tactic. Rows exist only
-- when stance has been explicitly set.
f TEXT, -- Force group f
g TEXT, -- Other group g
stance DOUBLE, -- stance.fg
PRIMARY KEY (f,g)
);
CREATE TABLE stance_nfg (
-- Contains neighborhood-specific overrides to stance.fg. This table
-- was used to override stance when group f was directed attack
-- group g in a neighborhood; at present, there are no overrides.
-- However, since the mechanism is known to work it seemed better
-- to retain it for now.
n TEXT, -- Neighborhood n
f TEXT, -- Force group f
g TEXT, -- Other group g
stance DOUBLE, -- stance.nfg
PRIMARY KEY (n,f,g)
);
-- stance_nfg_view: Group f's stance toward g in n. Defaults to
-- hrel.fg. The default can be overridden by an explicit stance, as
-- contained in stance_fg, and that can be overridden by neighborhood,
-- as contained in stance_nfg.
CREATE VIEW stance_nfg_view AS
SELECT N.n AS n,
F.g AS f,
G.g AS g,
coalesce(SN.stance,S.stance,UH.hrel) AS stance,
CASE WHEN SN.stance IS NOT NULL THEN 'OVERRIDE'
WHEN S.stance IS NOT NULL THEN 'ACTOR'
ELSE 'DEFAULT' END AS source
FROM nbhoods AS N
JOIN frcgroups AS F
JOIN groups AS G
LEFT OUTER JOIN stance_nfg AS SN ON (SN.n=N.n AND SN.f=F.g AND SN.g=G.g)
LEFT OUTER JOIN stance_fg AS S ON (S.f=F.g AND S.g=G.g)
LEFT OUTER JOIN uram_hrel AS UH ON (UH.f=F.g AND UH.g=G.g);
------------------------------------------------------------------------
-- FORCE AND SECURITY STATISTICS
-- nbstat Table: Total Force and Volatility in neighborhoods
CREATE TABLE force_n (
-- Symbolic nbhood name
n TEXT PRIMARY KEY,
-- Criminal suppression in neighborhood. This is the fraction of
-- civilian criminal activity that is suppressed by law enforcement
-- activities.
suppression DOUBLE DEFAULT 0.0,
-- Total force in nbhood, including nearby.
total_force INTEGER DEFAULT 0,
-- Gain on volatility, a multiplier >= 0.0
volatility_gain DOUBLE DEFAULT 1.0,
-- Nominal Volatility, excluding gain, 0 to 100
nominal_volatility INTEGER DEFAULT 0,
-- Effective Volatility, including gain, 0 to 100
volatility INTEGER DEFAULT 0,
-- Average Civilian Security
security INTEGER DEFAULT 0
);
-- nbstat Table: Group force in neighborhoods
CREATE TABLE force_ng (
n TEXT, -- Symbolic nbhood name
g TEXT, -- Symbolic group name
personnel INTEGER DEFAULT 0, -- Group's personnel
own_force INTEGER DEFAULT 0, -- Group's own force (Q.ng)
crim_force INTEGER DEFAULT 0, -- Civ group's criminal force.
-- 0.0 for non-civ groups.
noncrim_force INTEGER DEFAULT 0, -- Group's own force, less criminals
local_force INTEGER DEFAULT 0, -- own_force + friends in n
local_enemy INTEGER DEFAULT 0, -- enemies in n
force INTEGER DEFAULT 0, -- own_force + friends nearby
pct_force INTEGER DEFAULT 0, -- 100*force/total_force
enemy INTEGER DEFAULT 0, -- enemies nearby
pct_enemy INTEGER DEFAULT 0, -- 100*enemy/total_force
security INTEGER DEFAULT 0, -- Group's security in n
PRIMARY KEY (n, g)
);
-- nbstat Table: Civilian group statistics
CREATE TABLE force_civg (
g TEXT PRIMARY KEY, -- Symbolic civ group name
nominal_cf DOUBLE DEFAULT 0.0, -- Nominal Criminal Fraction
actual_cf DOUBLE DEFAULT 0.0 -- Actual Criminal Fraction
);
-- Note that "a" is constrained to match g's gtype, as indicated
-- in the temporary activity_gtype table.
CREATE TABLE activity_nga (
n TEXT, -- Symbolic nbhoods name
g TEXT, -- Symbolic groups name
a TEXT, -- Symbolic activity name
-- 1 if there's enough security to conduct the activity,
-- and 0 otherwise.
security_flag INTEGER DEFAULT 0,
-- 1 if the group can do the activity in the neighborhood,
-- and 0 otherwise.
can_do INTEGER DEFAULT 0,
-- Number of personnel in nbhood n belonging to
-- group g which are assigned activity a.
nominal INTEGER DEFAULT 0,
-- Number of the nominal personnel that are effectively performing
-- the activity. This will be 0 if security_flag is 0.
effective INTEGER DEFAULT 0,
-- Coverage fraction, 0.0 to 1.0, for this activity.
coverage DOUBLE DEFAULT 0.0,
PRIMARY KEY (n,g,a)
);
------------------------------------------------------------------------
-- ABSTRACT SITUATIONS
CREATE TABLE absits (
-- Abstract Situations
-- Situation ID
s INTEGER PRIMARY KEY,
-- Situation type (this is also the driver type)
stype TEXT,
-- Neighborhood in which the situation exists
n TEXT REFERENCES nbhoods(n)
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
-- Coverage: fraction of neighborhood affected.
coverage DOUBLE DEFAULT 1.0,
-- Inception Flag: 1 if this is a new situation, and inception
-- effects should be assessed, and 0 otherwise. (This will be set
-- to 0 for situations that are on-going at time 0.)
inception INTEGER,
-- Resolving group: name of the group that resolved/will resolve
-- the situation, or 'NONE'
resolver TEXT DEFAULT 'NONE',
-- Auto-resolution duration: 0 if the situation will not auto-resolve,
-- and a duration in ticks otherwise.
rduration INTEGER DEFAULT 0,
-- State: esitstate
state TEXT DEFAULT 'INITIAL',
-- Start Time, in ticks
ts INTEGER,
-- Resolution time, in ticks; null if unresolved and not auto-resolving.
tr INTEGER,
-- Location, in map coordinates -- for visualization only.
location TEXT
);
------------------------------------------------------------------------
-- SERVICES
-- NOTE: At present, there is only one kind of service,
-- Essential Non-Infrastructure (ENI). When we add other services,
-- these tables may change considerably.
-- Service Group/Actor table: provision of service to a civilian
-- group by an actor.
CREATE TABLE service_ga (
-- Civilian Group ID
g TEXT REFERENCES civgroups(g)
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
-- Actor ID
a TEXT REFERENCES actors(a)
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
-- Funding, $/week (symbol: F.ga)
funding REAL DEFAULT 0.0,
-- Credit, 0.0 to 1.0. The fraction of unsaturated service
-- provided by this actor.
credit REAL DEFAULT 0.0,
PRIMARY KEY (g,a)
);
-- Service Table: level of services s experienced by civilian groups g
CREATE TABLE service_sg (
-- Service ID; eg. ENI, ENERGY...
s TEXT,
-- Civilian Group ID
g TEXT REFERENCES civgroups(g)
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
-- Saturation funding, $/week
saturation_funding REAL DEFAULT 0.0,
-- Required level of service, fraction of saturation
-- (from parmdb)
required REAL DEFAULT 0.0,
-- Funding, $/week
funding REAL DEFAULT 0.0,
-- Actual level of service, fraction of saturation
actual REAL DEFAULT 0.0,
-- New actual level of service, for abstract services
new_actual REAL DEFAULT 0.0,
-- Expected level of service, fraction of saturation
expected REAL DEFAULT 0.0,
-- Expectations Factor: measures degree to which expected exceeds
-- actual (or vice versa) for use in ENI rule set.
expectf REAL DEFAULT 0.0,
-- Needs Factor: measures degree to which actual exceeds required
-- (or vice versa) for use in ENI rule set.
needs REAL DEFAULT 0.0,
PRIMARY KEY (s,g)
);
------------------------------------------------------------------------
-- End of File
------------------------------------------------------------------------ | the_stack |
-- So this is kinda cool, but also kinda horrible. In order to make it
-- easier to reconcile this set of data with the stuff loaded in from
-- our big dump file, we need to re-do the sequence identifiers, but
-- in a way that we can still sanely manage references to them.
--
-- Hopefully I've struck some kind of balance here using psql
-- variables (see all the `\set` calls throughout).
--
-- Down where we deal with stage and phase runs (whose only identity
-- is these ID numbers), I've taken to using some arithmetic, using a
-- variable for the "last ID" encountered in the dump file, and then
-- just adding onto it. This should make it a bit easier if we ever
-- need to update things in the future.
\set bigco_ent_id 2
\set smallco_ent_id 3
\set externalco_ent_id 4
INSERT INTO enterprises(id, name)
VALUES
(:bigco_ent_id, 'BigCo'),
(:smallco_ent_id, 'SmallCo'),
(:externalco_ent_id, 'ExternalCo')
;
-- Set id sequence appropriately
SELECT setval('enterprises_id_seq', (SELECT max(id) FROM enterprises));
\set bigco_eng_org_id 12
\set smallco_eng_org_id 13
INSERT INTO organizations(id, enterprise_id, name)
VALUES
(:bigco_eng_org_id, :bigco_ent_id, 'BigCo Engineering'),
(:smallco_eng_org_id, :smallco_ent_id, 'SmallCo Engineering')
;
SELECT setval('organizations_id_seq', (SELECT max(id) FROM organizations));
\set bigco_eng_skunkworks_proj 34
\set smallco_eng_disruptotron_proj 35
\set bigco_eng_honeybadger_proj 36
INSERT INTO projects(id, organization_id, guid, name)
VALUES
(:bigco_eng_skunkworks_proj, :bigco_eng_org_id, '2a2fab9b-dbe2-4021-a1eb-a1f593642bfc', 'skunkworks'),
(:smallco_eng_disruptotron_proj, :smallco_eng_org_id, '45a1a513-48ca-4361-be7a-1838bd119eda', 'disrupt-o-tron'),
(:bigco_eng_honeybadger_proj, :bigco_eng_org_id, 'f3f8bd73-7bdf-4d78-a7c9-e78197c0438f', 'honeybadger')
;
SELECT setval('projects_id_seq', (SELECT max(id) FROM projects));
\set bigco_eng_skunkworks_master_pipe 24
\set bigco_eng_skunkworks_v1_pipe 25
\set bigco_eng_skunkworks_legacy_pipe 26
\set smallco_eng_disruptotron_master_pipe 27
\set bigco_eng_honeybadger_master_pipe 28
INSERT INTO pipelines(id, project_id, name)
VALUES
(:bigco_eng_skunkworks_master_pipe, :bigco_eng_skunkworks_proj, 'master'),
(:bigco_eng_skunkworks_v1_pipe, :bigco_eng_skunkworks_proj, 'v1'),
(:bigco_eng_skunkworks_legacy_pipe, :bigco_eng_skunkworks_proj, 'legacy'),
(:smallco_eng_disruptotron_master_pipe, :smallco_eng_disruptotron_proj, 'master'),
(:bigco_eng_honeybadger_master_pipe, :bigco_eng_honeybadger_proj, 'master')
;
SELECT setval('pipelines_id_seq', (SELECT max(id) FROM pipelines));
\set bigco_admin 54
\set bigco_user 55
\set bigco_chaos_monkey 56
\set smallco_user 57
\set smallco_chaos_monkey 58
\set externalco_user 59
\set bigco_builder 60
\set smallco_admin 61
\set smallco_builder 62
INSERT INTO users(id, enterprise_id, name, user_type)
VALUES
(:bigco_admin, :bigco_ent_id, 'admin', 'internal'),
(:bigco_user, :bigco_ent_id, 'BigCo User', 'internal'),
(:bigco_chaos_monkey, :bigco_ent_id, 'BigCo Chaos Monkey', 'internal'),
(:smallco_user, :smallco_ent_id, 'SmallCo User', 'internal'),
(:smallco_chaos_monkey, :smallco_ent_id, 'SmallCo Chaos Monkey', 'internal'),
(:externalco_user, :externalco_ent_id, 'external_user_is_external', 'external'),
(:bigco_builder, :bigco_ent_id, 'builder', 'internal'),
(:smallco_admin, :smallco_ent_id, 'admin', 'internal'),
(:smallco_builder, :smallco_ent_id, 'builder', 'internal')
;
SELECT setval('users_id_seq', (SELECT max(id) FROM users));
INSERT INTO user_tokens(id, auth_token)
VALUES
(:bigco_user, 'fake_bigco_token'),
(:bigco_chaos_monkey, 'big_chaos_monkey_token'),
(:bigco_chaos_monkey, 'another_big_chaos_monkey_token'),
(:smallco_user, 'fake_smallco_token'),
(:smallco_chaos_monkey, 'small_chaos_monkey_token')
;
\set patchset_id_last 1813
-- select '(' || concat_ws(', ', quote_literal(id), pipeline_id, quote_literal(feature_branch), quote_nullable(merge_sha)) || ')' FROM changes;
INSERT INTO changes(id, pipeline_id, feature_branch, merge_sha, title, description, approved_by, changeset_id, latest_patchset_status, latest_patchset, submitted_at, submitted_by, pipeline_name_at_creation)
VALUES
('396bd34b-c42a-465e-85bd-a2c49b9908a6', :bigco_eng_skunkworks_master_pipe, 'bcu/feature1', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.33469-07', 'BigCo User', 'master'),
('cb761c42-35e2-4e58-936e-27b381c01aab', :bigco_eng_skunkworks_master_pipe, 'bcu/feature2', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.339788-07', 'BigCo User', 'master'),
('7e1d8f8c-920f-4f6c-a87c-4ee3fea87654', :bigco_eng_skunkworks_master_pipe, 'bcu/feature3', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.339788-07', 'BigCo User', 'master'),
('d83f9edd-66b1-44ac-b617-ffefa07660af', :bigco_eng_skunkworks_master_pipe, 'bcu/feature4', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.34324-07', 'BigCo User', 'master'),
('1ebc2534-4a43-4efc-95d0-f797842c6a6e', :bigco_eng_skunkworks_master_pipe, 'bcu/feature5', NULL, NULL, NULL, NULL, NULL, 'withdrawn', 3, '2014-08-26 19:07:22.344772-07', 'BigCo User', 'master'),
('674802e5-4354-4306-865d-9b7e6c6de2b9', :bigco_eng_skunkworks_master_pipe, 'bcu/feature8', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.34932-07', 'BigCo User', 'master'),
('f211b17b-2ad7-49e6-a899-e59ca3d4d1e3', :bigco_eng_skunkworks_master_pipe, 'bcu/feature9', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.350268-07', 'BigCo User', 'master'),
('7e1d1db0-e313-4107-a07c-8f62eae5d23f', :bigco_eng_skunkworks_master_pipe, 'bcu/feature10', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.351063-07', 'BigCo User', 'master'),
('9e37222a-5159-4754-907d-ead631b9cda2', :bigco_eng_skunkworks_master_pipe, 'bcu/feature11', 'deadbeef111', NULL, NULL, 'admin', NULL, 'merged', 2, '2014-08-26 19:07:22.351843-07', 'BigCo User', 'master'),
('453c64fc-6939-4a59-862e-a31e4178a3c6', :bigco_eng_skunkworks_master_pipe, 'bcu/feature12', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.354288-07', 'BigCo User', 'master'),
('aa3917ef-71b7-4264-8525-16bc46e367dc', :bigco_eng_skunkworks_master_pipe, 'bcu/feature13', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.355038-07', 'BigCo User', 'master'),
('6edcad49-2a53-4db3-9761-fe73f1b72130', :bigco_eng_skunkworks_legacy_pipe, 'bcu/feature13', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.355798-07', 'BigCo User', 'legacy'),
('3a389fc9-fb03-4d86-8323-c0e4cf3b1537', :bigco_eng_skunkworks_legacy_pipe, 'bcu/feature14', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.361497-07', 'BigCo User', 'legacy'),
('296de263-6773-43ba-a002-bdb8def7db4e', :bigco_eng_skunkworks_legacy_pipe, 'bcu/feature15', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.362672-07', 'BigCo User', 'legacy'),
('72f13aef-4469-47dc-83d0-4bd09a98a554', :bigco_eng_skunkworks_v1_pipe, 'bcu/feature16', NULL, NULL, NULL, NULL, NULL, 'open', 1, '2014-08-26 19:07:22.363512-07', 'BigCo User', 'v1'),
('6cd05c0d-dcbf-45aa-b22f-750ae1f971b7', :bigco_eng_honeybadger_master_pipe, 'bcu/monkeys', NULL, NULL, NULL, NULL, NULL, 'open', 2, '2014-08-27 18:27:32.02564-07', 'BigCo User', 'master')
;
-- select '(' || concat_ws(', ', id, quote_literal(change_id), sequence_number, quote_literal(submitted_at), quote_literal(sha), submitter_id, quote_nullable(verified_against_sha), is_verified, quote_nullable(status)) || ')' FROM patchsets;
INSERT INTO patchsets(id, change_id, sequence_number, submitted_at, sha, submitter_id, verified_against_sha, is_verified, status)
VALUES
(:patchset_id_last + 1, '396bd34b-c42a-465e-85bd-a2c49b9908a6', 1, '2014-08-26 19:07:22.33469-07', 'deadbeef1', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 2, 'cb761c42-35e2-4e58-936e-27b381c01aab', 1, '2014-08-26 19:07:22.339788-07', 'deadbeef2', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 3, '7e1d8f8c-920f-4f6c-a87c-4ee3fea87654', 1, '2014-08-26 19:07:22.339788-07', 'deadbeef3', :bigco_user, NULL, FALSE, 'open'), -- PATHOLOGICAL CASE: exact same timestamp as the change above
(:patchset_id_last + 4, 'd83f9edd-66b1-44ac-b617-ffefa07660af', 1, '2014-08-26 19:07:22.34324-07', 'deadbeef4', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 5, '1ebc2534-4a43-4efc-95d0-f797842c6a6e', 1, '2014-08-26 19:07:22.344772-07', 'deadbeef5', :bigco_user, NULL, FALSE, 'superseded'),
(:patchset_id_last + 6, '1ebc2534-4a43-4efc-95d0-f797842c6a6e', 2, '2014-08-26 19:07:22.346248-07', 'deadbeef51', :bigco_user, NULL, FALSE, 'superseded'),
(:patchset_id_last + 7, '1ebc2534-4a43-4efc-95d0-f797842c6a6e', 3, '2014-08-26 19:07:22.348075-07', 'deadbeef52', :bigco_user, NULL, FALSE, 'withdrawn'),
(:patchset_id_last + 8, '674802e5-4354-4306-865d-9b7e6c6de2b9', 1, '2014-08-26 19:07:22.34932-07', 'deadbeef8', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 9, 'f211b17b-2ad7-49e6-a899-e59ca3d4d1e3', 1, '2014-08-26 19:07:22.350268-07', 'deadbeef9', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 10, '7e1d1db0-e313-4107-a07c-8f62eae5d23f', 1, '2014-08-26 19:07:22.351063-07', 'deadbeef10', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 11, '9e37222a-5159-4754-907d-ead631b9cda2', 1, '2014-08-26 19:07:22.351843-07', 'deadbeef11', :bigco_user, NULL, FALSE, 'superseded'),
(:patchset_id_last + 12, '9e37222a-5159-4754-907d-ead631b9cda2', 2, '2014-08-26 19:07:22.352647-07', 'deadbeef111', :bigco_user, NULL, FALSE, 'merged'),
(:patchset_id_last + 13, '453c64fc-6939-4a59-862e-a31e4178a3c6', 1, '2014-08-26 19:07:22.354288-07', 'deadbeef12', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 14, 'aa3917ef-71b7-4264-8525-16bc46e367dc', 1, '2014-08-26 19:07:22.355038-07', 'deadbeef13', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 15, '6edcad49-2a53-4db3-9761-fe73f1b72130', 1, '2014-08-26 19:07:22.355798-07', 'deadbeef13', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 16, '3a389fc9-fb03-4d86-8323-c0e4cf3b1537', 1, '2014-08-26 19:07:22.361497-07', 'deadbeef14', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 17, '296de263-6773-43ba-a002-bdb8def7db4e', 1, '2014-08-26 19:07:22.362672-07', 'deadbeef15', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 18, '72f13aef-4469-47dc-83d0-4bd09a98a554', 1, '2014-08-26 19:07:22.363512-07', 'deadbeef16', :bigco_user, NULL, FALSE, 'open'),
(:patchset_id_last + 19, '6cd05c0d-dcbf-45aa-b22f-750ae1f971b7', 1, '2014-08-27 18:27:32.02564-07', 'beefbeef1', :bigco_user, NULL, FALSE, 'superseded'),
(:patchset_id_last + 20, '6cd05c0d-dcbf-45aa-b22f-750ae1f971b7', 2, '2014-08-27 18:29:32.02564-07', 'beefbeef11', :bigco_user, NULL, FALSE, 'open')
-- Insert a new patchset on the other project's pipeline
;
SELECT setval('patchsets_id_seq', (SELECT max(id) FROM patchsets));
-- Here, we add some dummy data for stage / phase runs for the
-- patchsets. All stages and phases are successful, and each patchset
-- has a corresponding verify run. The one merged change also has a
-- 'build' stage run (though the naming of this may change in the
-- future).
--
-- I didn't actually hand-enter all this information; I used the
-- following queries to populate the tables, based on the patchset
-- information already entered above. I've included them below for
-- posterity
------------------------------------------------------------------------
-- INSERT INTO stage_runs(change_id, stage, status, finished)
-- SELECT change_id, 'verify', 'finished', true
-- FROM patchsets;
--
-- INSERT INTO phase_runs(stage_run_id, phase, status, finished, run_success, run_log, run_status, build_node, search_query, search_description)
-- SELECT sr.id, phases.name, 'finished', TRUE, TRUE, 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1','BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'
-- FROM stage_runs AS sr,
-- (VALUES ('lint'), ('syntax'), ('unit')) AS phases (name);
--
-- INSERT INTO stage_runs(change_id, stage, status, finished)
-- SELECT change_id, 'build', 'finished', true
-- FROM patchsets WHERE status = 'merged';
--
-- INSERT INTO phase_runs(stage_run_id, phase, status, finished, run_success, run_log, run_status, build_node, search_query)
-- SELECT sr.id, phases.name, 'finished', TRUE, TRUE, 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1','BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'
-- FROM stage_runs AS sr,
-- (VALUES ('unit'), ('lint'), ('build'), ('repository')) AS phases (name)
-- WHERE sr.stage = 'build';
------------------------------------------------------------------------
-- select '(' || concat_ws(', ', id, quote_literal(change_id), quote_literal(stage), quote_literal(status), quote_literal(finished)) || '),' FROM stage_runs;
\set stage_runs_id_last 4740
INSERT INTO stage_runs(id, change_id, stage, status, finished)
VALUES
(:stage_runs_id_last + 1, '396bd34b-c42a-465e-85bd-a2c49b9908a6', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 2, 'cb761c42-35e2-4e58-936e-27b381c01aab', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 3, '7e1d8f8c-920f-4f6c-a87c-4ee3fea87654', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 4, 'd83f9edd-66b1-44ac-b617-ffefa07660af', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 5, '1ebc2534-4a43-4efc-95d0-f797842c6a6e', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 6, '1ebc2534-4a43-4efc-95d0-f797842c6a6e', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 7, '1ebc2534-4a43-4efc-95d0-f797842c6a6e', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 8, '674802e5-4354-4306-865d-9b7e6c6de2b9', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 9, 'f211b17b-2ad7-49e6-a899-e59ca3d4d1e3', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 10, '7e1d1db0-e313-4107-a07c-8f62eae5d23f', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 11, '9e37222a-5159-4754-907d-ead631b9cda2', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 12, '9e37222a-5159-4754-907d-ead631b9cda2', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 13, '453c64fc-6939-4a59-862e-a31e4178a3c6', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 14, 'aa3917ef-71b7-4264-8525-16bc46e367dc', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 15, '6edcad49-2a53-4db3-9761-fe73f1b72130', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 16, '3a389fc9-fb03-4d86-8323-c0e4cf3b1537', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 17, '296de263-6773-43ba-a002-bdb8def7db4e', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 18, '72f13aef-4469-47dc-83d0-4bd09a98a554', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 19, '6cd05c0d-dcbf-45aa-b22f-750ae1f971b7', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 20, '6cd05c0d-dcbf-45aa-b22f-750ae1f971b7', 'verify', 'finished', 'true'),
(:stage_runs_id_last + 21, '9e37222a-5159-4754-907d-ead631b9cda2', 'build', 'finished', 'true');
-- select '(' || concat_ws(', ', id, stage_run_id, quote_literal(phase), quote_literal(status), quote_literal(finished), quote_literal(run_success), quote_literal(run_log), quote_literal(run_status), quote_literal(build_node), quote_literal(search_query), quote_literal(search_description)) || '),' FROM phase_runs;
\set phase_runs_id_last 18010
INSERT INTO phase_runs(id, stage_run_id, phase, status, finished, run_success, run_log, run_status, build_node, search_query, search_description, description)
VALUES
(:phase_runs_id_last + 1, :stage_runs_id_last + 1, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 2, :stage_runs_id_last + 1, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 3, :stage_runs_id_last + 1, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 4, :stage_runs_id_last + 2, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOND, A DESC)'),
(:phase_runs_id_last + 5, :stage_runs_id_last + 2, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 6, :stage_runs_id_last + 2, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 7, :stage_runs_id_last + 3, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 8, :stage_runs_id_last + 3, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 9, :stage_runs_id_last + 3, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 10, :stage_runs_id_last + 4, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 11, :stage_runs_id_last + 4, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 12, :stage_runs_id_last + 4, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 13, :stage_runs_id_last + 5, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 14, :stage_runs_id_last + 5, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 15, :stage_runs_id_last + 5, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 16, :stage_runs_id_last + 6, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 17, :stage_runs_id_last + 6, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 18, :stage_runs_id_last + 6, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 19, :stage_runs_id_last + 7, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 20, :stage_runs_id_last + 7, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 21, :stage_runs_id_last + 7, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 22, :stage_runs_id_last + 8, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 23, :stage_runs_id_last + 8, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 24, :stage_runs_id_last + 8, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 25, :stage_runs_id_last + 9, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 26, :stage_runs_id_last + 9, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 27, :stage_runs_id_last + 9, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 28, :stage_runs_id_last + 10, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 29, :stage_runs_id_last + 10, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 30, :stage_runs_id_last + 10, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 31, :stage_runs_id_last + 11, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 32, :stage_runs_id_last + 11, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 33, :stage_runs_id_last + 11, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 34, :stage_runs_id_last + 12, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 35, :stage_runs_id_last + 12, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 36, :stage_runs_id_last + 12, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 37, :stage_runs_id_last + 13, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 38, :stage_runs_id_last + 13, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 39, :stage_runs_id_last + 13, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 40, :stage_runs_id_last + 14, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 41, :stage_runs_id_last + 14, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 42, :stage_runs_id_last + 14, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 43, :stage_runs_id_last + 15, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 44, :stage_runs_id_last + 15, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 45, :stage_runs_id_last + 15, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 46, :stage_runs_id_last + 16, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 47, :stage_runs_id_last + 16, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 48, :stage_runs_id_last + 16, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 49, :stage_runs_id_last + 17, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 50, :stage_runs_id_last + 17, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 51, :stage_runs_id_last + 17, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 52, :stage_runs_id_last + 18, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 53, :stage_runs_id_last + 18, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 54, :stage_runs_id_last + 18, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 55, :stage_runs_id_last + 19, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'honeybadger (BEHOLD, A DESC)'),
(:phase_runs_id_last + 56, :stage_runs_id_last + 19, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'honeybadger (BEHOLD, A DESC)'),
(:phase_runs_id_last + 57, :stage_runs_id_last + 19, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'honeybadger (BEHOLD, A DESC)'),
(:phase_runs_id_last + 58, :stage_runs_id_last + 20, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'honeybadger (BEHOLD, A DESC)'),
(:phase_runs_id_last + 59, :stage_runs_id_last + 20, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'honeybadger (BEHOLD, A DESC)'),
(:phase_runs_id_last + 60, :stage_runs_id_last + 20, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'honeybadger (BEHOLD, A DESC)'),
(:phase_runs_id_last + 61, :stage_runs_id_last + 21, 'unit', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 62, :stage_runs_id_last + 21, 'lint', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 63, :stage_runs_id_last + 21, 'syntax', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 64, :stage_runs_id_last + 21, 'quality', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 65, :stage_runs_id_last + 21, 'security', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)'),
(:phase_runs_id_last + 66, :stage_runs_id_last + 21, 'publish', 'finished', 'true', 'true', 'BEHOLD, A RUN LOG!', 'BEHOLD, A RUN STATUS!', 'buildnode1', 'BEHOLD, A QUERY', 'BEHOLD, A DESC', 'skunkworks (BEHOLD, A DESC)');
SELECT setval('stage_runs_id_seq', (SELECT max(id) FROM stage_runs));
SELECT setval('phase_runs_id_seq', (SELECT max(id) FROM phase_runs)); | the_stack |
-- 2018-07-09T13:29:53.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Trl WHERE AD_Process_ID=215
;
-- 2018-07-09T13:29:53.724
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process WHERE AD_Process_ID=215
;
-- 2018-07-09T13:31:34.915
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=19, IsUpdateable='N', ReadOnlyLogic='',Updated=TO_TIMESTAMP('2018-07-09 13:31:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=8757
;
-- 2018-07-09T13:31:39.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_project','C_ProjectType_ID','NUMERIC(10)',null,null)
;
-- 2018-07-09T13:42:59.537
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Name='Projektart', PrintName='Projektart',Updated=TO_TIMESTAMP('2018-07-09 13:42:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=2033
;
-- 2018-07-09T13:42:59.541
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='C_ProjectType_ID', Name='Projektart', Description='Type of the project', Help='Type of the project with optional phases of the project with standard performance information' WHERE AD_Element_ID=2033
;
-- 2018-07-09T13:42:59.543
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_ProjectType_ID', Name='Projektart', Description='Type of the project', Help='Type of the project with optional phases of the project with standard performance information', AD_Element_ID=2033 WHERE UPPER(ColumnName)='C_PROJECTTYPE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-07-09T13:42:59.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_ProjectType_ID', Name='Projektart', Description='Type of the project', Help='Type of the project with optional phases of the project with standard performance information' WHERE AD_Element_ID=2033 AND IsCentrallyMaintained='Y'
;
-- 2018-07-09T13:42:59.546
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Projektart', Description='Type of the project', Help='Type of the project with optional phases of the project with standard performance information' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=2033) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 2033)
;
-- 2018-07-09T13:42:59.557
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Projektart', Name='Projektart' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=2033)
;
-- 2018-07-09T13:43:09.392
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-07-09 13:43:09','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Projektart',PrintName='Projektart',Description='',Help='' WHERE AD_Element_ID=2033 AND AD_Language='fr_CH'
;
-- 2018-07-09T13:43:09.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(2033,'fr_CH')
;
-- 2018-07-09T13:44:09.037
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsAutocomplete='Y',Updated=TO_TIMESTAMP('2018-07-09 13:44:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=560665
;
-- 2018-07-09T13:44:19.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Name='Projekt-Nummernfolge', PrintName='Projekt-Nummernfolge',Updated=TO_TIMESTAMP('2018-07-09 13:44:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=544174
;
-- 2018-07-09T13:44:19.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='AD_Sequence_ProjectValue_ID', Name='Projekt-Nummernfolge', Description='Nummerfolge für Projekt-Suchschlüssel', Help=NULL WHERE AD_Element_ID=544174
;
-- 2018-07-09T13:44:19.595
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AD_Sequence_ProjectValue_ID', Name='Projekt-Nummernfolge', Description='Nummerfolge für Projekt-Suchschlüssel', Help=NULL, AD_Element_ID=544174 WHERE UPPER(ColumnName)='AD_SEQUENCE_PROJECTVALUE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-07-09T13:44:19.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AD_Sequence_ProjectValue_ID', Name='Projekt-Nummernfolge', Description='Nummerfolge für Projekt-Suchschlüssel', Help=NULL WHERE AD_Element_ID=544174 AND IsCentrallyMaintained='Y'
;
-- 2018-07-09T13:44:19.598
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Projekt-Nummernfolge', Description='Nummerfolge für Projekt-Suchschlüssel', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=544174) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 544174)
;
-- 2018-07-09T13:44:19.609
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Projekt-Nummernfolge', Name='Projekt-Nummernfolge' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=544174)
;
-- 2018-07-09T13:44:22.871
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Description='Nummernfolge für Projekt-Suchschlüssel',Updated=TO_TIMESTAMP('2018-07-09 13:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=544174
;
-- 2018-07-09T13:44:22.872
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='AD_Sequence_ProjectValue_ID', Name='Projekt-Nummernfolge', Description='Nummernfolge für Projekt-Suchschlüssel', Help=NULL WHERE AD_Element_ID=544174
;
-- 2018-07-09T13:44:22.874
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AD_Sequence_ProjectValue_ID', Name='Projekt-Nummernfolge', Description='Nummernfolge für Projekt-Suchschlüssel', Help=NULL, AD_Element_ID=544174 WHERE UPPER(ColumnName)='AD_SEQUENCE_PROJECTVALUE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2018-07-09T13:44:22.875
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='AD_Sequence_ProjectValue_ID', Name='Projekt-Nummernfolge', Description='Nummernfolge für Projekt-Suchschlüssel', Help=NULL WHERE AD_Element_ID=544174 AND IsCentrallyMaintained='Y'
;
-- 2018-07-09T13:44:22.876
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Projekt-Nummernfolge', Description='Nummernfolge für Projekt-Suchschlüssel', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=544174) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 544174)
;
-- 2018-07-09T13:44:32.180
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-07-09 13:44:32','YYYY-MM-DD HH24:MI:SS'),Name='Projekt-Nummernfolge',PrintName='Projekt-Nummernfolge',Description='Nummernfolge für Projekt-Suchschlüssel' WHERE AD_Element_ID=544174 AND AD_Language='de_CH'
;
-- 2018-07-09T13:44:32.183
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(544174,'de_CH')
;
-- 2018-07-09T14:21:28.212
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET SeqNo=10,Updated=TO_TIMESTAMP('2018-07-09 14:21:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=216
;
-- 2018-07-09T14:21:37.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-07-09 14:21:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=427
;
-- 2018-07-09T14:21:46.280
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=30,Updated=TO_TIMESTAMP('2018-07-09 14:21:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=426
;
-- 2018-07-09T14:32:53.536
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,540403,'AD_Sequence.AD_Client_ID>0',TO_TIMESTAMP('2018-07-09 14:32:53','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','AD_Sequence_Client_and_Org','S',TO_TIMESTAMP('2018-07-09 14:32:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-07-09T14:33:05.715
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Val_Rule_ID=540403,Updated=TO_TIMESTAMP('2018-07-09 14:33:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=560665
;
-- 2018-07-09T14:36:54.236
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET Name='Nummernfolgen',Updated=TO_TIMESTAMP('2018-07-09 14:36:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=112
;
-- 2018-07-09T14:36:54.244
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Description='Nummernkreise für System und Dokumente verwalten', IsActive='Y', Name='Nummernfolgen',Updated=TO_TIMESTAMP('2018-07-09 14:36:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=151
;
-- 2018-07-09T14:36:54.247
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Description='Nummernkreise für System und Dokumente verwalten', IsActive='Y', Name='Nummernfolgen',Updated=TO_TIMESTAMP('2018-07-09 14:36:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=540828
;
-- 2018-07-09T14:36:54.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WF_Node SET Description='Nummernkreise für System und Dokumente verwalten', Help='Im Fenster "Nummernkreis" wird definiert, wie die Abfolge von Dokumentennummern ist. Sie können die Art der Nummernerzeugung beeinflussen. Definieren Sie z.B. einen Präfix oder Suffix oder ändern Sie die derzeitige Nummer.', Name='Nummernfolgen',Updated=TO_TIMESTAMP('2018-07-09 14:36:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_WF_Node_ID=130
; | the_stack |
-- 2018-01-31T18:17:07.137
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 18:17:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557858
;
-- 2018-01-31T18:17:32.412
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 18:17:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557859
;
-- 2018-01-31T18:18:15.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=30,Updated=TO_TIMESTAMP('2018-01-31 18:18:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557860
;
-- 2018-01-31T18:20:21.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', IsUpdateable='N',Updated=TO_TIMESTAMP('2018-01-31 18:20:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558807
;
-- 2018-01-31T18:20:27.294
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsUpdateable='N', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 18:20:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558807
;
-- 2018-01-31T18:20:37.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 18:20:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558808
;
-- 2018-01-31T18:21:20.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 18:21:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558801
;
-- 2018-01-31T18:21:20.958
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2018-01-31 18:21:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558808
;
-- 2018-01-31T18:21:23.030
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', IsUpdateable='N',Updated=TO_TIMESTAMP('2018-01-31 18:21:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558807
;
-- 2018-01-31T18:21:41.858
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', IsUpdateable='N',Updated=TO_TIMESTAMP('2018-01-31 18:21:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558658
;
-- 2018-01-31T18:21:43.874
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 18:21:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558652
;
-- 2018-01-31T18:22:25.385
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET SeqNo=30,Updated=TO_TIMESTAMP('2018-01-31 18:22:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558660
;
-- 2018-01-31T18:22:37.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', IsUpdateable='N', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 18:22:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558658
;
-- 2018-01-31T18:23:05.902
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 18:23:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558687
;
-- 2018-01-31T18:23:24.328
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', IsUpdateable='N', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 18:23:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558693
;
-- 2018-01-31T18:23:33.094
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 18:23:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558685
;
-- 2018-01-31T18:24:13.984
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET IsSearchActive='N',Updated=TO_TIMESTAMP('2018-01-31 18:24:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541011
;
-- 2018-01-31T18:55:48.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 18:55:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558755
;
-- 2018-01-31T18:56:02.524
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2018-01-31 18:56:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558762
;
-- 2018-01-31T18:56:05.525
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2018-01-31 18:56:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558843
;
-- 2018-01-31T18:56:11.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsRangeFilter='Y', IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2018-01-31 18:56:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558756
;
-- 2018-01-31T18:56:24.079
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', IsUpdateable='N', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 18:56:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558761
;
-- 2018-01-31T18:56:33.023
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 18:56:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558843
;
-- 2018-01-31T18:56:43.530
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=30,Updated=TO_TIMESTAMP('2018-01-31 18:56:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558762
;
ALTER TABLE MSV3_Verfuegbarkeit_Transaction DROP COLUMN C_OrderSO_ID;
-- 2018-01-31T20:15:32.648
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=561980
;
-- 2018-01-31T20:15:32.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=561980
;
-- 2018-01-31T20:15:42.905
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=558941
;
-- 2018-01-31T20:15:42.907
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Column WHERE AD_Column_ID=558941
;
-- 2018-01-31T20:16:14.435
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AllowZoomTo='Y',Updated=TO_TIMESTAMP('2018-01-31 20:16:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558943
;
-- 2018-01-31T20:16:20.552
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AllowZoomTo='Y',Updated=TO_TIMESTAMP('2018-01-31 20:16:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558942
;
-- 2018-01-31T20:31:58.531
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET TabLevel=1,Updated=TO_TIMESTAMP('2018-01-31 20:31:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541008
;
-- 2018-01-31T20:32:14.112
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Column_ID=558820,Updated=TO_TIMESTAMP('2018-01-31 20:32:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541008
;
-- 2018-01-31T20:52:51.094
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='Nachlieferung',Updated=TO_TIMESTAMP('2018-01-31 20:52:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541547
;
-- 2018-01-31T20:52:56.858
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='Dispo',Updated=TO_TIMESTAMP('2018-01-31 20:52:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541548
;
-- 2018-01-31T20:53:16.012
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='Normal',Updated=TO_TIMESTAMP('2018-01-31 20:53:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541572
;
-- 2018-01-31T20:53:18.117
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='Sonder',Updated=TO_TIMESTAMP('2018-01-31 20:53:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541574
;
-- 2018-01-31T20:53:20.367
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='Stapel',Updated=TO_TIMESTAMP('2018-01-31 20:53:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541573
;
-- 2018-01-31T20:53:24.285
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='Versand',Updated=TO_TIMESTAMP('2018-01-31 20:53:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541575
;
-- 2018-01-31T20:53:58.770
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Reference SET Description='',Updated=TO_TIMESTAMP('2018-01-31 20:53:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540817
;
-- 2018-01-31T21:54:40.809
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Sequence SET IsTableID='Y',Updated=TO_TIMESTAMP('2018-01-31 21:54:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Sequence_ID=554478
;
-- 2018-01-31T22:11:43.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='NORMAL',Updated=TO_TIMESTAMP('2018-01-31 22:11:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541572
;
-- 2018-01-31T22:11:46.959
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='STAPEL',Updated=TO_TIMESTAMP('2018-01-31 22:11:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541574
;
-- 2018-01-31T22:11:59.177
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='SONDER',Updated=TO_TIMESTAMP('2018-01-31 22:11:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541573
;
-- 2018-01-31T22:12:02.184
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_List SET Value='VERSAND',Updated=TO_TIMESTAMP('2018-01-31 22:12:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=541575
;
-- 2018-01-31T22:14:58.641
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Reference SET Help='Unlike the other MSV3 list references, the values of this one need to be all-capital.
See the enum de.metas.vertical.pharma.vendor.gateway.mvs3.schema.Auftragsart',Updated=TO_TIMESTAMP('2018-01-31 22:14:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540825
;
-- 2018-01-31T22:27:47.938
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 22:27:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558766
;
-- 2018-01-31T22:27:50.966
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2018-01-31 22:27:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558773
;
-- 2018-01-31T22:28:51.339
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', IsSelectionColumn='Y', IsUpdateable='N', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 22:28:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558772
;
-- 2018-01-31T22:29:02.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 22:29:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558773
;
-- 2018-01-31T22:29:21.135
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=30,Updated=TO_TIMESTAMP('2018-01-31 22:29:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558774
;
-- 2018-01-31T22:29:27.883
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2018-01-31 22:29:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558774
;
-- 2018-01-31T22:29:36.255
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 22:29:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558709
;
-- 2018-01-31T22:29:43.172
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2018-01-31 22:29:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558717
;
-- 2018-01-31T22:29:44.404
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2018-01-31 22:29:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558716
;
-- 2018-01-31T22:29:49.291
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', IsUpdateable='N',Updated=TO_TIMESTAMP('2018-01-31 22:29:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558715
;
-- 2018-01-31T22:30:01.322
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', IsUpdateable='N', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 22:30:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558715
;
-- 2018-01-31T22:30:11.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 22:30:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558716
;
-- 2018-01-31T22:30:19.641
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=30,Updated=TO_TIMESTAMP('2018-01-31 22:30:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558717
;
-- 2018-01-31T22:43:49.890
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 22:43:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558720
;
-- 2018-01-31T22:44:16.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 22:44:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558850
;
-- 2018-01-31T22:44:26.570
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 22:44:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558846
;
-- 2018-01-31T22:44:43.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 22:44:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558728
;
-- 2018-01-31T22:44:59.167
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 22:44:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558737
;
-- 2018-01-31T22:45:07.432
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 22:45:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558735
;
-- 2018-01-31T22:45:25.308
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=5,Updated=TO_TIMESTAMP('2018-01-31 22:45:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558852
;
-- 2018-01-31T22:45:41.577
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N',Updated=TO_TIMESTAMP('2018-01-31 22:45:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558740
;
-- 2018-01-31T22:45:47.606
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', IsUpdateable='N', SeqNo=10,Updated=TO_TIMESTAMP('2018-01-31 22:45:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558747
;
-- 2018-01-31T22:46:03.552
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=20,Updated=TO_TIMESTAMP('2018-01-31 22:46:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558749
; | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_details`;
CREATE TABLE `oauth_client_details`
(
`client_id` varchar(255) NOT NULL,
`resource_ids` varchar(255) DEFAULT NULL,
`client_secret` varchar(255) NOT NULL,
`scope` varchar(255) NOT NULL,
`authorized_grant_types` varchar(255) NOT NULL,
`web_server_redirect_uri` varchar(255) DEFAULT NULL,
`authorities` varchar(255) DEFAULT NULL,
`access_token_validity` int(11) NOT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`additional_information` varchar(4096) DEFAULT NULL,
`autoapprove` tinyint(4) DEFAULT NULL,
`origin_secret` varchar(255) DEFAULT NULL,
PRIMARY KEY (`client_id`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
ROW_FORMAT = DYNAMIC COMMENT ='客户端配置表';
-- ----------------------------
-- Records of oauth_client_details
-- ----------------------------
BEGIN;
INSERT INTO `oauth_client_details`
VALUES ('app', '', '$2a$10$8Qk/efslEpO1Af1kyw/rp.DdJGsdnET8UCp1vGDzpQEa.1qBklvua', 'all', 'refresh_token,password', '',
NULL, 86400, 864000, NULL, NULL, '123456');
INSERT INTO `oauth_client_details`
VALUES ('febs', ' ', '$2a$10$aSZTvMOtUAYUQ.75z2n3ceJd6dCIk9Vy3J/SKZUE4hBLd6sz7.6ge', 'all', 'password,refresh_token',
NULL, NULL, 86400, 8640000, NULL, 0, '123456');
COMMIT;
-- ----------------------------
-- Table structure for t_data_permission_test
-- ----------------------------
DROP TABLE IF EXISTS `t_data_permission_test`;
CREATE TABLE `t_data_permission_test`
(
`FIELD1` varchar(20) NOT NULL,
`FIELD2` varchar(20) NOT NULL,
`FIELD3` varchar(20) NOT NULL,
`FIELD4` varchar(20) NOT NULL,
`DEPT_ID` int(11) NOT NULL,
`CREATE_TIME` datetime NOT NULL,
`ID` int(11) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8 COMMENT ='用户权限测试';
-- ----------------------------
-- Records of t_data_permission_test
-- ----------------------------
BEGIN;
INSERT INTO `t_data_permission_test`
VALUES ('小米', '小米10Pro', '4999', '珍珠白', 1, '2020-04-14 15:00:38', 1);
INSERT INTO `t_data_permission_test`
VALUES ('腾讯', '黑鲨游戏手机3', '3799', '铠甲灰', 2, '2020-04-14 15:01:36', 2);
INSERT INTO `t_data_permission_test`
VALUES ('华为', '华为P30', '3299', '天空之境', 1, '2020-04-14 15:03:11', 3);
INSERT INTO `t_data_permission_test`
VALUES ('华为', '华为P40Pro', '6488', '亮黑色', 3, '2020-04-14 15:04:31', 4);
INSERT INTO `t_data_permission_test`
VALUES ('vivo', 'Vivo iQOO 3', '3998', '拉力橙', 4, '2020-04-14 15:05:55', 5);
INSERT INTO `t_data_permission_test`
VALUES ('一加', '一加7T', '3199', '冰际蓝', 5, '2020-04-14 15:06:53', 6);
INSERT INTO `t_data_permission_test`
VALUES ('三星', '三星Galaxy S10', '4098', '浩玉白', 6, '2020-04-14 15:08:25', 7);
INSERT INTO `t_data_permission_test`
VALUES ('苹果', 'iPhone 11 pro max', '9198', '暗夜绿', 4, '2020-04-14 15:09:20', 8);
COMMIT;
-- ----------------------------
-- Table structure for t_dept
-- ----------------------------
DROP TABLE IF EXISTS `t_dept`;
CREATE TABLE `t_dept`
(
`DEPT_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '部门ID',
`PARENT_ID` bigint(20) NOT NULL COMMENT '上级部门ID',
`DEPT_NAME` varchar(100) NOT NULL COMMENT '部门名称',
`ORDER_NUM` double(20, 0) DEFAULT NULL COMMENT '排序',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`DEPT_ID`) USING BTREE,
KEY `t_dept_parent_id` (`PARENT_ID`),
KEY `t_dept_dept_name` (`DEPT_NAME`)
) ENGINE = InnoDB
AUTO_INCREMENT = 7
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='部门表';
-- ----------------------------
-- Records of t_dept
-- ----------------------------
BEGIN;
INSERT INTO `t_dept`
VALUES (1, 0, '开发部', 1, '2018-01-04 15:42:26', '2019-01-05 21:08:27');
INSERT INTO `t_dept`
VALUES (2, 1, '开发一部', 1, '2018-01-04 15:42:34', '2019-01-18 00:59:37');
INSERT INTO `t_dept`
VALUES (3, 1, '开发二部', 2, '2018-01-04 15:42:29', '2019-01-05 14:09:39');
INSERT INTO `t_dept`
VALUES (4, 0, '市场部', 2, '2018-01-04 15:42:36', '2019-01-23 06:27:56');
INSERT INTO `t_dept`
VALUES (5, 0, '人事部', 3, '2018-01-04 15:42:32', '2019-01-23 06:27:59');
INSERT INTO `t_dept`
VALUES (6, 0, '测试部', 4, '2018-01-04 15:42:38', '2019-01-17 08:15:47');
COMMIT;
-- ----------------------------
-- Table structure for t_eximport
-- ----------------------------
DROP TABLE IF EXISTS `t_eximport`;
CREATE TABLE `t_eximport`
(
`FIELD1` varchar(20) NOT NULL,
`FIELD2` int(11) NOT NULL,
`FIELD3` varchar(100) NOT NULL,
`CREATE_TIME` datetime NOT NULL
) ENGINE = MyISAM
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='Excel导入导出测试';
-- ----------------------------
-- Records of t_eximport
-- ----------------------------
BEGIN;
INSERT INTO `t_eximport`
VALUES ('字段1', 1, 'mrbird0@gmail.com', '2019-07-25 19:08:01');
INSERT INTO `t_eximport`
VALUES ('字段1', 2, 'mrbird1@gmail.com', '2019-07-25 19:08:01');
INSERT INTO `t_eximport`
VALUES ('字段1', 3, 'mrbird2@gmail.com', '2019-07-25 19:08:01');
INSERT INTO `t_eximport`
VALUES ('字段1', 4, 'mrbird3@gmail.com', '2019-07-25 19:08:01');
INSERT INTO `t_eximport`
VALUES ('字段1', 5, 'mrbird4@gmail.com', '2019-07-25 19:08:01');
INSERT INTO `t_eximport`
VALUES ('字段1', 6, 'mrbird5@gmail.com', '2019-07-25 19:08:01');
INSERT INTO `t_eximport`
VALUES ('字段1', 7, 'mrbird6@gmail.com', '2019-07-25 19:08:01');
INSERT INTO `t_eximport`
VALUES ('字段1', 8, 'mrbird7@gmail.com', '2019-07-25 19:08:01');
COMMIT;
-- ----------------------------
-- Table structure for t_generator_config
-- ----------------------------
DROP TABLE IF EXISTS `t_generator_config`;
CREATE TABLE `t_generator_config`
(
`id` int(11) NOT NULL COMMENT '主键',
`author` varchar(20) NOT NULL COMMENT '作者',
`base_package` varchar(50) NOT NULL COMMENT '基础包名',
`entity_package` varchar(20) NOT NULL COMMENT 'entity文件存放路径',
`mapper_package` varchar(20) NOT NULL COMMENT 'mapper文件存放路径',
`mapper_xml_package` varchar(20) NOT NULL COMMENT 'mapper xml文件存放路径',
`service_package` varchar(20) NOT NULL COMMENT 'servcie文件存放路径',
`service_impl_package` varchar(20) NOT NULL COMMENT 'serviceImpl文件存放路径',
`controller_package` varchar(20) NOT NULL COMMENT 'controller文件存放路径',
`is_trim` char(1) NOT NULL COMMENT '是否去除前缀 1是 0否',
`trim_value` varchar(10) DEFAULT NULL COMMENT '前缀内容',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='代码生成配置表';
-- ----------------------------
-- Records of t_generator_config
-- ----------------------------
BEGIN;
INSERT INTO `t_generator_config`
VALUES (1, 'MrBird', 'cc.mrbird.febs.server.generator.gen', 'entity', 'mapper', 'mapper', 'service', 'service.impl',
'controller', '1', 't_');
COMMIT;
-- ----------------------------
-- Table structure for t_job
-- ----------------------------
DROP TABLE IF EXISTS `t_job`;
CREATE TABLE `t_job`
(
`JOB_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务id',
`BEAN_NAME` varchar(50) NOT NULL COMMENT 'spring bean名称',
`METHOD_NAME` varchar(50) NOT NULL COMMENT '方法名',
`PARAMS` varchar(50) DEFAULT NULL COMMENT '参数',
`CRON_EXPRESSION` varchar(20) NOT NULL COMMENT 'cron表达式',
`STATUS` char(2) NOT NULL COMMENT '任务状态 0:正常 1:暂停',
`REMARK` varchar(50) DEFAULT NULL COMMENT '备注',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`JOB_ID`) USING BTREE,
KEY `t_job_create_time` (`CREATE_TIME`)
) ENGINE = InnoDB
AUTO_INCREMENT = 5
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='定时任务表';
-- ----------------------------
-- Records of t_job
-- ----------------------------
BEGIN;
INSERT INTO `t_job`
VALUES (1, 'taskList', 'test', 'hello', '0/1 * * * * ?', '1', '有参任务调度测试', '2018-02-24 16:26:14');
INSERT INTO `t_job`
VALUES (2, 'taskList', 'test1', NULL, '0/10 * * * * ?', '1', '无参任务调度测试', '2018-02-24 17:06:23');
INSERT INTO `t_job`
VALUES (3, 'taskList', 'test2', '{\"name\":\"mrbird\",\"age\":18}', '0/1 * * * * ?', '1', 'JSON类型参数任务测试',
'2018-02-26 09:28:26');
INSERT INTO `t_job`
VALUES (4, 'taskList', 'test3', '', '0/5 * * * * ?', '1', '测试异常,没有编写test3任务', '2018-02-26 11:15:30');
COMMIT;
-- ----------------------------
-- Table structure for t_job_log
-- ----------------------------
DROP TABLE IF EXISTS `t_job_log`;
CREATE TABLE `t_job_log`
(
`LOG_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '任务日志id',
`JOB_ID` bigint(20) NOT NULL COMMENT '任务id',
`BEAN_NAME` varchar(100) NOT NULL COMMENT 'spring bean名称',
`METHOD_NAME` varchar(100) NOT NULL COMMENT '方法名',
`PARAMS` varchar(200) DEFAULT NULL COMMENT '参数',
`STATUS` char(2) NOT NULL COMMENT '任务状态 0:成功 1:失败',
`ERROR` text COMMENT '失败信息',
`TIMES` decimal(11, 0) DEFAULT NULL COMMENT '耗时(单位:毫秒)',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`LOG_ID`) USING BTREE,
KEY `t_job_log_create_time` (`CREATE_TIME`)
) ENGINE = MyISAM
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='调度日志表';
-- ----------------------------
-- Records of t_job_log
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for t_log
-- ----------------------------
DROP TABLE IF EXISTS `t_log`;
CREATE TABLE `t_log`
(
`ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '日志ID',
`USERNAME` varchar(50) DEFAULT NULL COMMENT '操作用户',
`OPERATION` text COMMENT '操作内容',
`TIME` decimal(11, 0) DEFAULT NULL COMMENT '耗时',
`METHOD` text COMMENT '操作方法',
`PARAMS` text COMMENT '方法参数',
`IP` varchar(64) DEFAULT NULL COMMENT '操作者IP',
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`location` varchar(50) DEFAULT NULL COMMENT '操作地点',
PRIMARY KEY (`ID`) USING BTREE,
KEY `t_log_create_time` (`CREATE_TIME`)
) ENGINE = MyISAM
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='用户操作日志表';
-- ----------------------------
-- Records of t_log
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for t_logger
-- ----------------------------
DROP TABLE IF EXISTS `t_logger`;
CREATE TABLE `t_logger`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`group_id` varchar(64) NOT NULL,
`unit_id` varchar(32) NOT NULL,
`tag` varchar(50) NOT NULL,
`content` varchar(1024) NOT NULL,
`create_time` varchar(30) NOT NULL,
`app_name` varchar(128) NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8 COMMENT ='分布式事务日志';
-- ----------------------------
-- Records of t_logger
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for t_login_log
-- ----------------------------
DROP TABLE IF EXISTS `t_login_log`;
CREATE TABLE `t_login_log`
(
`ID` bigint(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`USERNAME` varchar(50) NOT NULL COMMENT '用户名',
`LOGIN_TIME` datetime NOT NULL COMMENT '登录时间',
`LOCATION` varchar(50) DEFAULT NULL COMMENT '登录地点',
`IP` varchar(50) DEFAULT NULL COMMENT 'IP地址',
`SYSTEM` varchar(50) DEFAULT NULL COMMENT '操作系统',
`BROWSER` varchar(50) DEFAULT NULL COMMENT '浏览器',
PRIMARY KEY (`ID`) USING BTREE,
KEY `t_login_log_login_time` (`LOGIN_TIME`)
) ENGINE = MyISAM
AUTO_INCREMENT = 1
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='登录日志表';
-- ----------------------------
-- Records of t_login_log
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for t_menu
-- ----------------------------
DROP TABLE IF EXISTS `t_menu`;
CREATE TABLE `t_menu`
(
`MENU_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单/按钮ID',
`PARENT_ID` bigint(20) NOT NULL COMMENT '上级菜单ID',
`MENU_NAME` varchar(50) NOT NULL COMMENT '菜单/按钮名称',
`PATH` varchar(255) DEFAULT NULL COMMENT '对应路由path',
`COMPONENT` varchar(255) DEFAULT NULL COMMENT '对应路由组件component',
`PERMS` varchar(50) DEFAULT NULL COMMENT '权限标识',
`ICON` varchar(50) DEFAULT NULL COMMENT '图标',
`TYPE` char(2) NOT NULL COMMENT '类型 0菜单 1按钮',
`ORDER_NUM` double(20, 0) DEFAULT NULL COMMENT '排序',
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
`MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`MENU_ID`) USING BTREE,
KEY `t_menu_parent_id` (`PARENT_ID`),
KEY `t_menu_menu_id` (`MENU_ID`)
) ENGINE = InnoDB
AUTO_INCREMENT = 195
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='菜单表';
-- ----------------------------
-- Records of t_menu
-- ----------------------------
BEGIN;
INSERT INTO `t_menu`
VALUES (1, 0, '系统管理', '/system', 'Layout', NULL, 'el-icon-set-up', '0', 1, '2017-12-27 16:39:07',
'2019-07-20 16:19:04');
INSERT INTO `t_menu`
VALUES (2, 0, '系统监控', '/monitor', 'Layout', NULL, 'el-icon-data-line', '0', 2, '2017-12-27 16:45:51',
'2019-01-23 06:27:12');
INSERT INTO `t_menu`
VALUES (3, 1, '用户管理', '/system/user', 'febs/system/user/Index', 'user:view', '', '0', 1, '2017-12-27 16:47:13',
'2019-01-22 06:45:55');
INSERT INTO `t_menu`
VALUES (4, 1, '角色管理', '/system/role', 'febs/system/role/Index', 'role:view', '', '0', 2, '2017-12-27 16:48:09',
'2018-04-25 09:01:12');
INSERT INTO `t_menu`
VALUES (5, 1, '菜单管理', '/system/menu', 'febs/system/menu/Index', 'menu:view', '', '0', 3, '2017-12-27 16:48:57',
'2018-04-25 09:01:30');
INSERT INTO `t_menu`
VALUES (6, 1, '部门管理', '/system/dept', 'febs/system/dept/Index', 'dept:view', '', '0', 4, '2017-12-27 16:57:33',
'2018-04-25 09:01:40');
INSERT INTO `t_menu`
VALUES (10, 2, '系统日志', '/monitor/systemlog', 'febs/monitor/systemlog/Index', 'log:view', '', '0', 2,
'2017-12-27 17:00:50', '2020-04-13 11:38:04');
INSERT INTO `t_menu`
VALUES (11, 3, '新增用户', '', '', 'user:add', NULL, '1', NULL, '2017-12-27 17:02:58', NULL);
INSERT INTO `t_menu`
VALUES (12, 3, '修改用户', '', '', 'user:update', NULL, '1', NULL, '2017-12-27 17:04:07', NULL);
INSERT INTO `t_menu`
VALUES (13, 3, '删除用户', '', '', 'user:delete', NULL, '1', NULL, '2017-12-27 17:04:58', NULL);
INSERT INTO `t_menu`
VALUES (14, 4, '新增角色', '', '', 'role:add', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
INSERT INTO `t_menu`
VALUES (15, 4, '修改角色', '', '', 'role:update', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
INSERT INTO `t_menu`
VALUES (16, 4, '删除角色', '', '', 'role:delete', NULL, '1', NULL, '2017-12-27 17:06:38', NULL);
INSERT INTO `t_menu`
VALUES (17, 5, '新增菜单', '', '', 'menu:add', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
INSERT INTO `t_menu`
VALUES (18, 5, '修改菜单', '', '', 'menu:update', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
INSERT INTO `t_menu`
VALUES (19, 5, '删除菜单', '', '', 'menu:delete', NULL, '1', NULL, '2017-12-27 17:08:02', NULL);
INSERT INTO `t_menu`
VALUES (20, 6, '新增部门', '', '', 'dept:add', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
INSERT INTO `t_menu`
VALUES (21, 6, '修改部门', '', '', 'dept:update', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
INSERT INTO `t_menu`
VALUES (22, 6, '删除部门', '', '', 'dept:delete', NULL, '1', NULL, '2017-12-27 17:09:24', NULL);
INSERT INTO `t_menu`
VALUES (24, 10, '删除日志', '', '', 'log:delete', NULL, '1', NULL, '2017-12-27 17:11:45', NULL);
INSERT INTO `t_menu`
VALUES (130, 3, '导出Excel', NULL, NULL, 'user:export', NULL, '1', NULL, '2019-01-23 06:35:16', NULL);
INSERT INTO `t_menu`
VALUES (131, 4, '导出Excel', NULL, NULL, 'role:export', NULL, '1', NULL, '2019-01-23 06:35:36', NULL);
INSERT INTO `t_menu`
VALUES (132, 5, '导出Excel', NULL, NULL, 'menu:export', NULL, '1', NULL, '2019-01-23 06:36:05', NULL);
INSERT INTO `t_menu`
VALUES (133, 6, '导出Excel', NULL, NULL, 'dept:export', NULL, '1', NULL, '2019-01-23 06:36:25', NULL);
INSERT INTO `t_menu`
VALUES (135, 3, '密码重置', NULL, NULL, 'user:reset', NULL, '1', NULL, '2019-01-23 06:37:00', NULL);
INSERT INTO `t_menu`
VALUES (136, 10, '导出Excel', NULL, NULL, 'log:export', NULL, '1', NULL, '2019-01-23 06:37:27', NULL);
INSERT INTO `t_menu`
VALUES (150, 2, '登录日志', '/monitor/loginlog', 'febs/monitor/loginlog/Index', 'monitor:loginlog', '', '0', 3,
'2019-07-22 13:41:17', '2020-04-13 11:38:08');
INSERT INTO `t_menu`
VALUES (151, 150, '删除日志', NULL, NULL, 'loginlog:delete', NULL, '1', NULL, '2019-07-22 13:43:04', NULL);
INSERT INTO `t_menu`
VALUES (152, 150, '导出Excel', NULL, NULL, 'loginlog:export', NULL, '1', NULL, '2019-07-22 13:43:30', NULL);
INSERT INTO `t_menu`
VALUES (154, 0, '其他模块', '/others', 'Layout', '', 'el-icon-shopping-bag-1', '0', 6, '2019-07-25 10:16:16',
'2020-04-14 18:38:20');
INSERT INTO `t_menu`
VALUES (155, 154, '导入导出', '/others/eximport', 'febs/others/eximport/Index', 'others:eximport', '', '0', 1,
'2019-07-25 10:19:31', NULL);
INSERT INTO `t_menu`
VALUES (156, 0, '代码生成', '/gen', 'Layout', '', 'el-icon-printer', '0', 4, '2019-07-25 10:24:03', '2020-01-16 13:59:49');
INSERT INTO `t_menu`
VALUES (157, 156, '基础配置', '/gen/config', 'febs/gen/config/Index', 'gen:config', '', '0', 1, '2019-07-25 10:24:55',
'2020-04-09 14:21:54');
INSERT INTO `t_menu`
VALUES (158, 156, '生成代码', '/gen/generate', 'febs/gen/generate/Index', 'gen:generate', '', '0', 2, '2019-07-25 10:25:26',
'2019-07-25 11:13:20');
INSERT INTO `t_menu`
VALUES (159, 157, '修改配置', NULL, NULL, 'gen:config:update', NULL, '1', NULL, '2019-07-26 16:22:56', NULL);
INSERT INTO `t_menu`
VALUES (160, 158, '打包生成', NULL, NULL, 'gen:generate:gen', NULL, '1', NULL, '2019-07-26 16:23:38',
'2019-07-26 16:23:53');
INSERT INTO `t_menu`
VALUES (163, 1, '客户端管理', '/client', 'febs/system/client/Index', 'client:view', '', '0', 5, '2019-09-26 22:58:09', NULL);
INSERT INTO `t_menu`
VALUES (164, 163, '新增', NULL, NULL, 'client:add', NULL, '1', NULL, '2019-09-26 22:58:21', NULL);
INSERT INTO `t_menu`
VALUES (165, 163, '修改', NULL, NULL, 'client:update', NULL, '1', NULL, '2019-09-26 22:58:43', NULL);
INSERT INTO `t_menu`
VALUES (166, 163, '删除', NULL, NULL, 'client:delete', NULL, '1', NULL, '2019-09-26 22:58:55', NULL);
INSERT INTO `t_menu`
VALUES (167, 163, '解密', NULL, NULL, 'client:decrypt', NULL, '1', NULL, '2019-09-26 22:59:08', NULL);
INSERT INTO `t_menu`
VALUES (168, 0, '静态组件', '/components', 'Layout', '', 'el-icon-present', '0', 7, '2019-12-02 16:41:28',
'2020-04-14 18:38:23');
INSERT INTO `t_menu`
VALUES (169, 168, '二级菜单', '/two', 'demos/two/Index', '', '', '0', 1, '2019-12-02 16:41:51', NULL);
INSERT INTO `t_menu`
VALUES (170, 169, '三级菜单', '/three', 'demos/two/three/Index', '', '', '0', 1, '2019-12-02 16:42:09', NULL);
INSERT INTO `t_menu`
VALUES (171, 168, 'MarkDown', '/components/markdown', 'demos/markdown', '', '', '0', 2, '2019-12-02 16:42:34', NULL);
INSERT INTO `t_menu`
VALUES (172, 168, '富文本编辑器', '/components/tinymce', 'demos/tinymce', '', '', '0', 3, '2019-12-02 16:42:50', NULL);
INSERT INTO `t_menu`
VALUES (173, 0, '网关管理', '/route', 'Layout', '', 'el-icon-odometer', '0', 3, '2020-01-16 14:00:15', NULL);
INSERT INTO `t_menu`
VALUES (174, 173, '网关用户', '/route/user', 'febs/route/routeuser/Index', '', '', '0', 1, '2020-01-16 14:00:32', NULL);
INSERT INTO `t_menu`
VALUES (175, 173, '网关日志', '/route/log', 'febs/route/routelog/Index', '', '', '0', 2, '2020-01-16 14:00:47', NULL);
INSERT INTO `t_menu`
VALUES (176, 173, '限流规则', '/route/ratelimitrule', 'febs/route/ratelimitrule/Index', '', '', '0', 3,
'2020-01-16 14:01:01', NULL);
INSERT INTO `t_menu`
VALUES (177, 173, '限流日志', '/route/ratelimitlog', 'febs/route/ratelimitlog/Index', '', '', '0', 4, '2020-01-16 14:01:17',
NULL);
INSERT INTO `t_menu`
VALUES (178, 173, '黑名单管理', '/route/blacklist', 'febs/route/blacklist/Index', '', '', '0', 5, '2020-01-16 14:01:32',
NULL);
INSERT INTO `t_menu`
VALUES (179, 173, '黑名单日志', '/route/blocklog', 'febs/route/blocklog/Index', '', '', '0', 6, '2020-01-16 14:01:49', NULL);
INSERT INTO `t_menu`
VALUES (180, 2, '监控面板', '/monitor/dashboard', 'febs/monitor/dashboard/Index', 'monitor:dashboard', '', '0', 1,
'2020-04-13 09:44:09', '2020-04-13 11:38:00');
INSERT INTO `t_menu`
VALUES (181, 154, '个人博客', '/others/blog', 'febs/others/blog/Index', '', '', '0', 2, '2020-04-13 16:11:48',
'2020-04-13 16:12:26');
INSERT INTO `t_menu`
VALUES (182, 154, '数据权限', '/others/datapermission', 'febs/others/datapermission/Index', 'others:datapermission', '',
'0', 3, '2020-04-14 14:51:35', '2020-04-14 15:37:19');
INSERT INTO `t_menu`
VALUES (183, 0, '任务调度', '/job', 'Layout', '', 'el-icon-alarm-clock', '0', 5, '2020-04-14 18:39:35',
'2020-04-14 18:39:53');
INSERT INTO `t_menu`
VALUES (184, 183, '任务列表', '/job/list', 'febs/job/job/Index', 'job:view', '', '0', 1, '2020-04-14 18:40:37',
'2020-04-14 18:41:36');
INSERT INTO `t_menu`
VALUES (185, 183, '调度日志', '/job/log', 'febs/job/log/Index', 'job:log:view', '', '0', 2, '2020-04-14 18:42:25', NULL);
INSERT INTO `t_menu`
VALUES (186, 184, '新增任务', NULL, NULL, 'job:add', NULL, '1', NULL, '2020-04-14 18:59:55', '2020-04-15 08:56:03');
INSERT INTO `t_menu`
VALUES (187, 184, '修改任务', NULL, NULL, 'job:update', NULL, '1', NULL, '2020-04-14 19:00:13', NULL);
INSERT INTO `t_menu`
VALUES (188, 184, '删除任务', NULL, NULL, 'job:delete', NULL, '1', NULL, '2020-04-14 19:00:26', NULL);
INSERT INTO `t_menu`
VALUES (189, 184, '暂停任务', NULL, NULL, 'job:pause', NULL, '1', NULL, '2020-04-14 19:00:42', NULL);
INSERT INTO `t_menu`
VALUES (190, 184, '恢复任务', NULL, NULL, 'job:resume', NULL, '1', NULL, '2020-04-14 19:00:56', NULL);
INSERT INTO `t_menu`
VALUES (191, 184, '立即执行一次', NULL, NULL, 'job:run', NULL, '1', NULL, '2020-04-14 19:01:42', NULL);
INSERT INTO `t_menu`
VALUES (192, 184, '导出Excel', NULL, NULL, 'job:export', NULL, '1', NULL, '2020-04-14 19:01:59', NULL);
INSERT INTO `t_menu`
VALUES (193, 185, '删除', NULL, NULL, 'job:log:delete', NULL, '1', NULL, '2020-04-15 14:01:33', NULL);
INSERT INTO `t_menu`
VALUES (194, 185, '导出', NULL, NULL, 'job:log:export', NULL, '1', NULL, '2020-04-15 14:01:45', NULL);
COMMIT;
-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role`
(
`ROLE_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '角色ID',
`ROLE_NAME` varchar(10) NOT NULL COMMENT '角色名称',
`REMARK` varchar(100) DEFAULT NULL COMMENT '角色描述',
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
`MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`ROLE_ID`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 5
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='角色表';
-- ----------------------------
-- Records of t_role
-- ----------------------------
BEGIN;
INSERT INTO `t_role`
VALUES (1, '管理员', '管理员', '2017-12-27 16:23:11', '2020-04-15 14:02:27');
INSERT INTO `t_role`
VALUES (2, '注册用户', '可查看,新增,导出', '2019-01-04 14:11:28', '2020-04-15 16:00:16');
INSERT INTO `t_role`
VALUES (3, '系统监控员', '负责系统监控模块', '2019-09-01 10:30:25', '2019-09-01 10:30:37');
INSERT INTO `t_role`
VALUES (4, '测试角色', '测试角色', '2020-03-08 19:16:01', '2020-04-13 11:26:13');
COMMIT;
-- ----------------------------
-- Table structure for t_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `t_role_menu`;
CREATE TABLE `t_role_menu`
(
`ROLE_ID` bigint(20) NOT NULL,
`MENU_ID` bigint(20) NOT NULL,
PRIMARY KEY (`ROLE_ID`, `MENU_ID`),
KEY `t_role_menu_menu_id` (`MENU_ID`),
KEY `t_role_menu_role_id` (`ROLE_ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='角色菜单关联表';
-- ----------------------------
-- Records of t_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `t_role_menu`
VALUES (1, 1);
INSERT INTO `t_role_menu`
VALUES (1, 2);
INSERT INTO `t_role_menu`
VALUES (1, 3);
INSERT INTO `t_role_menu`
VALUES (1, 4);
INSERT INTO `t_role_menu`
VALUES (1, 5);
INSERT INTO `t_role_menu`
VALUES (1, 6);
INSERT INTO `t_role_menu`
VALUES (1, 10);
INSERT INTO `t_role_menu`
VALUES (1, 11);
INSERT INTO `t_role_menu`
VALUES (1, 12);
INSERT INTO `t_role_menu`
VALUES (1, 13);
INSERT INTO `t_role_menu`
VALUES (1, 14);
INSERT INTO `t_role_menu`
VALUES (1, 15);
INSERT INTO `t_role_menu`
VALUES (1, 16);
INSERT INTO `t_role_menu`
VALUES (1, 17);
INSERT INTO `t_role_menu`
VALUES (1, 18);
INSERT INTO `t_role_menu`
VALUES (1, 19);
INSERT INTO `t_role_menu`
VALUES (1, 20);
INSERT INTO `t_role_menu`
VALUES (1, 21);
INSERT INTO `t_role_menu`
VALUES (1, 22);
INSERT INTO `t_role_menu`
VALUES (1, 24);
INSERT INTO `t_role_menu`
VALUES (1, 130);
INSERT INTO `t_role_menu`
VALUES (1, 131);
INSERT INTO `t_role_menu`
VALUES (1, 132);
INSERT INTO `t_role_menu`
VALUES (1, 133);
INSERT INTO `t_role_menu`
VALUES (1, 135);
INSERT INTO `t_role_menu`
VALUES (1, 136);
INSERT INTO `t_role_menu`
VALUES (1, 150);
INSERT INTO `t_role_menu`
VALUES (1, 151);
INSERT INTO `t_role_menu`
VALUES (1, 152);
INSERT INTO `t_role_menu`
VALUES (1, 154);
INSERT INTO `t_role_menu`
VALUES (1, 155);
INSERT INTO `t_role_menu`
VALUES (1, 156);
INSERT INTO `t_role_menu`
VALUES (1, 157);
INSERT INTO `t_role_menu`
VALUES (1, 158);
INSERT INTO `t_role_menu`
VALUES (1, 159);
INSERT INTO `t_role_menu`
VALUES (1, 160);
INSERT INTO `t_role_menu`
VALUES (1, 163);
INSERT INTO `t_role_menu`
VALUES (1, 164);
INSERT INTO `t_role_menu`
VALUES (1, 165);
INSERT INTO `t_role_menu`
VALUES (1, 166);
INSERT INTO `t_role_menu`
VALUES (1, 167);
INSERT INTO `t_role_menu`
VALUES (1, 168);
INSERT INTO `t_role_menu`
VALUES (1, 169);
INSERT INTO `t_role_menu`
VALUES (1, 170);
INSERT INTO `t_role_menu`
VALUES (1, 171);
INSERT INTO `t_role_menu`
VALUES (1, 172);
INSERT INTO `t_role_menu`
VALUES (1, 173);
INSERT INTO `t_role_menu`
VALUES (1, 174);
INSERT INTO `t_role_menu`
VALUES (1, 175);
INSERT INTO `t_role_menu`
VALUES (1, 176);
INSERT INTO `t_role_menu`
VALUES (1, 177);
INSERT INTO `t_role_menu`
VALUES (1, 178);
INSERT INTO `t_role_menu`
VALUES (1, 179);
INSERT INTO `t_role_menu`
VALUES (1, 180);
INSERT INTO `t_role_menu`
VALUES (1, 181);
INSERT INTO `t_role_menu`
VALUES (1, 182);
INSERT INTO `t_role_menu`
VALUES (1, 183);
INSERT INTO `t_role_menu`
VALUES (1, 184);
INSERT INTO `t_role_menu`
VALUES (1, 185);
INSERT INTO `t_role_menu`
VALUES (1, 186);
INSERT INTO `t_role_menu`
VALUES (1, 187);
INSERT INTO `t_role_menu`
VALUES (1, 188);
INSERT INTO `t_role_menu`
VALUES (1, 189);
INSERT INTO `t_role_menu`
VALUES (1, 190);
INSERT INTO `t_role_menu`
VALUES (1, 191);
INSERT INTO `t_role_menu`
VALUES (1, 192);
INSERT INTO `t_role_menu`
VALUES (1, 193);
INSERT INTO `t_role_menu`
VALUES (1, 194);
INSERT INTO `t_role_menu`
VALUES (2, 1);
INSERT INTO `t_role_menu`
VALUES (2, 2);
INSERT INTO `t_role_menu`
VALUES (2, 3);
INSERT INTO `t_role_menu`
VALUES (2, 4);
INSERT INTO `t_role_menu`
VALUES (2, 5);
INSERT INTO `t_role_menu`
VALUES (2, 6);
INSERT INTO `t_role_menu`
VALUES (2, 10);
INSERT INTO `t_role_menu`
VALUES (2, 14);
INSERT INTO `t_role_menu`
VALUES (2, 17);
INSERT INTO `t_role_menu`
VALUES (2, 20);
INSERT INTO `t_role_menu`
VALUES (2, 130);
INSERT INTO `t_role_menu`
VALUES (2, 131);
INSERT INTO `t_role_menu`
VALUES (2, 132);
INSERT INTO `t_role_menu`
VALUES (2, 133);
INSERT INTO `t_role_menu`
VALUES (2, 136);
INSERT INTO `t_role_menu`
VALUES (2, 150);
INSERT INTO `t_role_menu`
VALUES (2, 152);
INSERT INTO `t_role_menu`
VALUES (2, 154);
INSERT INTO `t_role_menu`
VALUES (2, 155);
INSERT INTO `t_role_menu`
VALUES (2, 156);
INSERT INTO `t_role_menu`
VALUES (2, 157);
INSERT INTO `t_role_menu`
VALUES (2, 158);
INSERT INTO `t_role_menu`
VALUES (2, 160);
INSERT INTO `t_role_menu`
VALUES (2, 163);
INSERT INTO `t_role_menu`
VALUES (2, 164);
INSERT INTO `t_role_menu`
VALUES (2, 167);
INSERT INTO `t_role_menu`
VALUES (2, 168);
INSERT INTO `t_role_menu`
VALUES (2, 169);
INSERT INTO `t_role_menu`
VALUES (2, 170);
INSERT INTO `t_role_menu`
VALUES (2, 171);
INSERT INTO `t_role_menu`
VALUES (2, 172);
INSERT INTO `t_role_menu`
VALUES (2, 173);
INSERT INTO `t_role_menu`
VALUES (2, 174);
INSERT INTO `t_role_menu`
VALUES (2, 175);
INSERT INTO `t_role_menu`
VALUES (2, 176);
INSERT INTO `t_role_menu`
VALUES (2, 177);
INSERT INTO `t_role_menu`
VALUES (2, 178);
INSERT INTO `t_role_menu`
VALUES (2, 179);
INSERT INTO `t_role_menu`
VALUES (2, 180);
INSERT INTO `t_role_menu`
VALUES (2, 181);
INSERT INTO `t_role_menu`
VALUES (2, 182);
INSERT INTO `t_role_menu`
VALUES (2, 183);
INSERT INTO `t_role_menu`
VALUES (2, 184);
INSERT INTO `t_role_menu`
VALUES (2, 185);
INSERT INTO `t_role_menu`
VALUES (2, 192);
INSERT INTO `t_role_menu`
VALUES (2, 194);
INSERT INTO `t_role_menu`
VALUES (3, 2);
INSERT INTO `t_role_menu`
VALUES (3, 10);
INSERT INTO `t_role_menu`
VALUES (3, 24);
INSERT INTO `t_role_menu`
VALUES (3, 136);
INSERT INTO `t_role_menu`
VALUES (3, 148);
INSERT INTO `t_role_menu`
VALUES (3, 149);
INSERT INTO `t_role_menu`
VALUES (3, 150);
INSERT INTO `t_role_menu`
VALUES (3, 151);
INSERT INTO `t_role_menu`
VALUES (3, 152);
INSERT INTO `t_role_menu`
VALUES (3, 153);
INSERT INTO `t_role_menu`
VALUES (4, 1);
INSERT INTO `t_role_menu`
VALUES (4, 3);
INSERT INTO `t_role_menu`
VALUES (4, 11);
INSERT INTO `t_role_menu`
VALUES (4, 12);
INSERT INTO `t_role_menu`
VALUES (4, 13);
INSERT INTO `t_role_menu`
VALUES (4, 130);
INSERT INTO `t_role_menu`
VALUES (4, 135);
COMMIT;
-- ----------------------------
-- Table structure for t_trade_log
-- ----------------------------
DROP TABLE IF EXISTS `t_trade_log`;
CREATE TABLE `t_trade_log`
(
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`goods_id` int(11) NOT NULL COMMENT '商品ID',
`goods_name` varchar(50) NOT NULL COMMENT '商品名称',
`status` varchar(50) NOT NULL COMMENT '状态',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='分布式事务测试';
-- ----------------------------
-- Records of t_trade_log
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user`
(
`USER_ID` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`USERNAME` varchar(50) NOT NULL COMMENT '用户名',
`PASSWORD` varchar(128) NOT NULL COMMENT '密码',
`DEPT_ID` bigint(20) DEFAULT NULL COMMENT '部门ID',
`EMAIL` varchar(128) DEFAULT NULL COMMENT '邮箱',
`MOBILE` varchar(20) DEFAULT NULL COMMENT '联系电话',
`STATUS` char(1) NOT NULL COMMENT '状态 0锁定 1有效',
`CREATE_TIME` datetime NOT NULL COMMENT '创建时间',
`MODIFY_TIME` datetime DEFAULT NULL COMMENT '修改时间',
`LAST_LOGIN_TIME` datetime DEFAULT NULL COMMENT '最近访问时间',
`SSEX` char(1) DEFAULT NULL COMMENT '性别 0男 1女 2保密',
`IS_TAB` char(1) DEFAULT NULL COMMENT '是否开启tab,0关闭 1开启',
`THEME` varchar(10) DEFAULT NULL COMMENT '主题',
`AVATAR` varchar(100) DEFAULT NULL COMMENT '头像',
`DESCRIPTION` varchar(100) DEFAULT NULL COMMENT '描述',
PRIMARY KEY (`USER_ID`) USING BTREE,
KEY `t_user_username` (`USERNAME`),
KEY `t_user_mobile` (`MOBILE`)
) ENGINE = InnoDB
AUTO_INCREMENT = 18
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='用户表';
-- ----------------------------
-- Records of t_user
-- ----------------------------
BEGIN;
INSERT INTO `t_user`
VALUES (1, 'MrBird', '$2a$10$gzhiUb1ldc1Rf3lka4k/WOoFKKGPepHSzJxzcPSN5/65SzkMdc.SK', 2, 'mrbird@qq.com', '17788888888',
'1', '2019-06-14 20:39:22', '2020-04-15 16:00:32', '2020-04-15 16:03:13', '0', '1', 'white',
'gaOngJwsRYRaVAuXXcmB.png', '我是帅比作者。');
INSERT INTO `t_user`
VALUES (15, 'scott', '$2a$10$7tATi2STciLHnEgO/RfIxOYf2MQBu/SDVMRDs54rlSYVj2VmwwCHC', 5, 'scott@hotmail.com',
'17720888888', '1', '2019-07-20 19:00:32', '2020-04-15 16:00:42', '2020-04-14 16:49:27', '2', NULL, NULL,
'BiazfanxmamNRoxxVxka.png', NULL);
INSERT INTO `t_user`
VALUES (16, 'Jane', '$2a$10$ECkfipOPY7hORVdlSzIOX.8hnig0shAZQPG8pQ7D5iVP.uVogmmHy', 4, 'Jane@hotmail.com',
'13489898989', '1', '2019-09-01 10:31:21', '2020-04-15 16:00:48', '2019-09-01 10:32:27', '1', NULL, NULL,
'2dd7a2d09fa94bf8b5c52e5318868b4d9.jpg', NULL);
COMMIT;
-- ----------------------------
-- Table structure for t_user_connection
-- ----------------------------
DROP TABLE IF EXISTS `t_user_connection`;
CREATE TABLE `t_user_connection`
(
`USER_NAME` varchar(50) NOT NULL COMMENT 'FEBS系统用户名',
`PROVIDER_NAME` varchar(20) NOT NULL COMMENT '第三方平台名称',
`PROVIDER_USER_ID` varchar(50) NOT NULL COMMENT '第三方平台账户ID',
`PROVIDER_USER_NAME` varchar(50) DEFAULT NULL COMMENT '第三方平台用户名',
`NICK_NAME` varchar(50) DEFAULT NULL COMMENT '第三方平台昵称',
`IMAGE_URL` varchar(512) DEFAULT NULL COMMENT '第三方平台头像',
`LOCATION` varchar(255) DEFAULT NULL COMMENT '地址',
`REMARK` varchar(255) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`USER_NAME`, `PROVIDER_NAME`, `PROVIDER_USER_ID`) USING BTREE,
UNIQUE KEY `UserConnectionRank` (`USER_NAME`, `PROVIDER_NAME`, `PROVIDER_USER_ID`) USING BTREE
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='系统用户社交账户关联表';
-- ----------------------------
-- Records of t_user_connection
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for t_user_data_permission
-- ----------------------------
DROP TABLE IF EXISTS `t_user_data_permission`;
CREATE TABLE `t_user_data_permission`
(
`USER_ID` bigint(20) NOT NULL,
`DEPT_ID` bigint(20) NOT NULL,
PRIMARY KEY (`USER_ID`, `DEPT_ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8 COMMENT ='用户数据权限关联表';
-- ----------------------------
-- Records of t_user_data_permission
-- ----------------------------
BEGIN;
INSERT INTO `t_user_data_permission`
VALUES (1, 1);
INSERT INTO `t_user_data_permission`
VALUES (1, 2);
INSERT INTO `t_user_data_permission`
VALUES (1, 3);
INSERT INTO `t_user_data_permission`
VALUES (1, 4);
INSERT INTO `t_user_data_permission`
VALUES (1, 5);
INSERT INTO `t_user_data_permission`
VALUES (1, 6);
INSERT INTO `t_user_data_permission`
VALUES (15, 1);
INSERT INTO `t_user_data_permission`
VALUES (15, 2);
INSERT INTO `t_user_data_permission`
VALUES (16, 4);
INSERT INTO `t_user_data_permission`
VALUES (16, 5);
COMMIT;
-- ----------------------------
-- Table structure for t_user_role
-- ----------------------------
DROP TABLE IF EXISTS `t_user_role`;
CREATE TABLE `t_user_role`
(
`USER_ID` bigint(20) NOT NULL COMMENT '用户ID',
`ROLE_ID` bigint(20) NOT NULL COMMENT '角色ID',
PRIMARY KEY (`USER_ID`, `ROLE_ID`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8
ROW_FORMAT = DYNAMIC COMMENT ='用户角色关联表';
-- ----------------------------
-- Records of t_user_role
-- ----------------------------
BEGIN;
INSERT INTO `t_user_role`
VALUES (1, 1);
INSERT INTO `t_user_role`
VALUES (15, 2);
INSERT INTO `t_user_role`
VALUES (16, 3);
COMMIT;
CREATE TABLE `t_tx_exception`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`group_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`unit_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`mod_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`transaction_state` tinyint(4) NULL DEFAULT NULL,
`registrar` tinyint(4) NULL DEFAULT NULL,
`ex_state` tinyint(4) NULL DEFAULT NULL COMMENT '0 待处理 1已处理',
`remark` varchar(10240) NULL DEFAULT NULL COMMENT '备注',
`create_time` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_general_ci
ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
IF EXISTS (SELECT * FROM tempdb..sysobjects WHERE id=OBJECT_ID('tempdb..#tmpErrors')) DROP TABLE #tmpErrors
GO
CREATE TABLE #tmpErrors (Error int)
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
GO
PRINT 'Altering Existing Objects'
GO
/* Alter Users Table */
EXEC sp_rename 'BugComment.Date', 'CreatedDate', 'COLUMN'
GO
EXEC sp_rename 'BugHistory.Date', 'CreatedDate', 'COLUMN'
GO
EXEC sp_rename 'BugAttachment.Size', 'FileSize', 'COLUMN'
GO
ALTER TABLE Users ADD [IsSuperUser] [bit] NOT NULL CONSTRAINT [DF_Users_IsSuperUser] DEFAULT (0)
GO
ALTER TABLE Users DROP CONSTRAINT DF_Users_RoleID
GO
ALTER TABLE Users DROP COLUMN RoleID
GO
ALTER TABLE Users ALTER COLUMN UserName nvarchar(50) not null
GO
ALTER TABLE Users DROP CONSTRAINT DF__Users__active__0F975522
GO
ALTER TABLE Users ALTER COLUMN [Active] [bit] NOT NULL
GO
ALTER TABLE Users ADD
CONSTRAINT [DF_Users_Active] DEFAULT (0) FOR Active
GO
ALTER TABLE [dbo].[Hardware] ALTER COLUMN [Name] NVARCHAR(20) NOT NULL
ALTER TABLE [dbo].[Priority] ALTER COLUMN [Name] NVARCHAR(20) NOT NULL
ALTER TABLE [dbo].[Priority] ALTER COLUMN [ImageUrl] NVARCHAR(50) NULL
ALTER TABLE [dbo].[Status] ALTER COLUMN [Name] NVARCHAR(20) NOT NULL
ALTER TABLE [dbo].[Type] ALTER COLUMN [ImageUrl] NVARCHAR(50) NULL
ALTER TABLE [dbo].[Resolution] ALTER COLUMN [Name] NVARCHAR(20) NOT NULL
ALTER TABLE [dbo].[OperatingSystem] ALTER COLUMN [Name] NVARCHAR(20) NOT NULL
ALTER TABLE [dbo].[Environment] ALTER COLUMN [Name] NVARCHAR(50) NOT NULL
ALTER TABLE [dbo].[Version] ALTER COLUMN [Name] NVARCHAR(20) NOT NULL
ALTER TABLE [dbo].[BugHistory] ALTER COLUMN [FieldChanged] NVARCHAR(50) NOT NULL
ALTER TABLE [dbo].[BugHistory] ALTER COLUMN [OldValue] NVARCHAR(50) NOT NULL
ALTER TABLE [dbo].[BugHistory] ALTER COLUMN [NewValue] NVARCHAR(50) NOT NULL
ALTER TABLE [dbo].[Bug] ALTER COLUMN [Summary] NVARCHAR(500) NOT NULL
ALTER TABLE [dbo].[Bug] ALTER COLUMN [Url] NVARCHAR(500) NOT NULL
ALTER TABLE [dbo].[BugAttachment] ALTER COLUMN [FileName] NVARCHAR(100) NOT NULL
ALTER TABLE [dbo].[BugAttachment] ALTER COLUMN [Description] NVARCHAR(80) NOT NULL
ALTER TABLE [dbo].[BugAttachment] ALTER COLUMN [Type] NVARCHAR(50) NOT NULL
ALTER TABLE [dbo].[Roles] ALTER COLUMN [RoleName] NVARCHAR(20) NOT NULL
ALTER TABLE [dbo].[Users] ALTER COLUMN [Password] NVARCHAR(20) NOT NULL
ALTER TABLE [dbo].[Project] ALTER COLUMN [Name] NVARCHAR(30) NOT NULL
ALTER TABLE [dbo].[Project] ALTER COLUMN [Description] NVARCHAR(80) NOT NULL
ALTER TABLE [dbo].[Component] ALTER COLUMN [Name] NVARCHAR(50) NOT NULL
GO
/*
*----------------------------------
* Bug Comment Table
*----------------------------------
*/
ALTER TABLE BugComment ADD Comment1 ntext not null CONSTRAINT DF__Bug__Comment DEFAULT ('')
GO
UPDATE BugComment SET Comment1 = Comment
GO
If exists (select sc.name From sysobjects so join syscolumns sc on so.id = sc.id where so.name = 'BugComment' and sc.name = 'Comment')
BEGIN
Alter table BugComment Drop column Comment
END
GO
EXEC sp_rename 'BugComment.Comment1', 'Comment', 'COLUMN'
GO
ALTER TABLE BugComment DROP CONSTRAINT DF__Bug__Comment
GO
/*
*---------------------------
* Bug Table
*---------------------------
*/
ALTER TABLE Bug ADD Description1 ntext not null CONSTRAINT DF__Bug__Description DEFAULT ('')
GO
UPDATE Bug SET Description1 = Description
GO
If exists (select sc.name From sysobjects so join syscolumns sc on so.id = sc.id where so.name = 'BugComment' and sc.name = 'Comment')
BEGIN
Alter table Bug Drop column Description
END
GO
EXEC sp_rename 'Bug.Description1', 'Description', 'COLUMN'
GO
ALTER TABLE Bug DROP CONSTRAINT DF__Bug__Description
GO
/*
*---------------------------
* Project Table
*---------------------------
*/
ALTER TABLE Project ADD Code nvarchar(3) not null CONSTRAINT DF__Project__Code DEFAULT ('')
GO
ALTER TABLE Project ADD AccessType int not null CONSTRAINT DF__Project__AccessType DEFAULT (2)
GO
/*
*-------------------------------------------------
* CREATE NEW TABLES
*-------------------------------------------------
*/
PRINT 'Creating New Objects'
GO
CREATE TABLE [dbo].[BugTimeEntry] (
[BugTimeEntryId] [int] IDENTITY (1, 1) NOT NULL ,
[BugId] [int] NOT NULL ,
[UserId] [int] NOT NULL ,
[WorkDate] [datetime] NOT NULL ,
[Duration] [decimal](4, 2) NOT NULL ,
[BugCommentId] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[HostSettings] (
[SettingName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[SettingValue] [nvarchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Permission] (
[PermissionId] [int] IDENTITY (1, 1) NOT NULL ,
[PermissionKey] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Name] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[ProjectMailBox] (
[ProjectMailboxId] [int] IDENTITY (1, 1) NOT NULL ,
[MailBox] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[ProjectID] [int] NOT NULL ,
[AssignToUserID] [int] NULL ,
[IssueTypeID] [int] NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[RolePermission] (
[RolePermissionId] [int] IDENTITY (1, 1) NOT NULL ,
[RoleId] [int] NOT NULL ,
[PermissionId] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[UserProjects] (
[UserId] [int] NOT NULL ,
[ProjectId] [int] NOT NULL ,
[UserProjectId] [int] IDENTITY (1, 1) NOT NULL ,
[CreatedDate] [datetime] NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[UserRoles] (
[UserRoleId] [int] IDENTITY (1, 1) NOT NULL ,
[UserId] [int] NOT NULL ,
[RoleId] [int] NOT NULL
) ON [PRIMARY]
GO
/* Drop the Existing Roles Table & Re-Add the new one */
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Roles]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [dbo].[Roles]
GO
CREATE TABLE [dbo].[Roles] (
[RoleID] [int] IDENTITY (1, 1) NOT NULL ,
[ProjectID] [int] NOT NULL ,
[RoleName] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[Description] [nvarchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
/* Add Constraints */
ALTER TABLE [dbo].[BugTimeEntry] ADD
CONSTRAINT [PK_BugTimeEntry] PRIMARY KEY CLUSTERED
(
[BugTimeEntryId]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[HostSettings] ADD
CONSTRAINT [PK_HostSettings] PRIMARY KEY CLUSTERED
(
[SettingName]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Permission] ADD
CONSTRAINT [PK_Permission] PRIMARY KEY CLUSTERED
(
[PermissionId]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ProjectMailBox] ADD
CONSTRAINT [PK_ProjectMailBox] PRIMARY KEY CLUSTERED
(
[ProjectMailboxId]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RolePermission] ADD
CONSTRAINT [PK_RolePermission] PRIMARY KEY CLUSTERED
(
[RolePermissionId]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Roles] ADD
CONSTRAINT [PK__Role__0BC6C43E] PRIMARY KEY CLUSTERED
(
[RoleID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UserProjects] ADD
CONSTRAINT [PK_UserProjects] PRIMARY KEY CLUSTERED
(
[UserId],
[ProjectId]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[UserRoles] ADD
CONSTRAINT [PK_UserRoles] PRIMARY KEY CLUSTERED
(
[UserRoleId]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Bug] ADD
CONSTRAINT [FK_Bug_Environment] FOREIGN KEY
(
[EnvironmentID]
) REFERENCES [dbo].[Environment] (
[EnvironmentID]
),
CONSTRAINT [FK_Bug_Hardware] FOREIGN KEY
(
[HardwareID]
) REFERENCES [dbo].[Hardware] (
[HardwareID]
),
CONSTRAINT [FK_Bug_OperatingSystem] FOREIGN KEY
(
[OperatingSystemID]
) REFERENCES [dbo].[OperatingSystem] (
[OperatingSystemID]
),
CONSTRAINT [FK_Bug_Priority] FOREIGN KEY
(
[PriorityID]
) REFERENCES [dbo].[Priority] (
[PriorityID]
),
CONSTRAINT [FK_Bug_Project] FOREIGN KEY
(
[ProjectID]
) REFERENCES [dbo].[Project] (
[ProjectID]
) ON DELETE CASCADE,
CONSTRAINT [FK_Bug_Resolution] FOREIGN KEY
(
[ResolutionID]
) REFERENCES [dbo].[Resolution] (
[ResolutionID]
),
CONSTRAINT [FK_Bug_Status] FOREIGN KEY
(
[StatusID]
) REFERENCES [dbo].[Status] (
[StatusID]
),
CONSTRAINT [FK_Bug_Type] FOREIGN KEY
(
[TypeID]
) REFERENCES [dbo].[Type] (
[TypeID]
)
GO
ALTER TABLE [dbo].[BugAttachment] ADD
CONSTRAINT [FK_BugAttachment_Bug] FOREIGN KEY
(
[BugID]
) REFERENCES [dbo].[Bug] (
[BugID]
) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugComment] ADD
CONSTRAINT [FK_BugComment_Bug] FOREIGN KEY
(
[BugID]
) REFERENCES [dbo].[Bug] (
[BugID]
) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugHistory] ADD
CONSTRAINT [FK_BugHistory_Bug] FOREIGN KEY
(
[BugID]
) REFERENCES [dbo].[Bug] (
[BugID]
) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugNotification] ADD
CONSTRAINT [FK_BugNotification_Bug] FOREIGN KEY
(
[BugID]
) REFERENCES [dbo].[Bug] (
[BugID]
) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[BugTimeEntry] ADD
CONSTRAINT [FK_BugTimeEntry_Bug] FOREIGN KEY
(
[BugId]
) REFERENCES [dbo].[Bug] (
[BugID]
) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Component] ADD
CONSTRAINT [FK_Component_Project] FOREIGN KEY
(
[ProjectID]
) REFERENCES [dbo].[Project] (
[ProjectID]
) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[ProjectMailBox] ADD
CONSTRAINT [FK_ProjectMailBox_Project] FOREIGN KEY
(
[ProjectID]
) REFERENCES [dbo].[Project] (
[ProjectID]
) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[RelatedBug] ADD
CONSTRAINT [FK_RelatedBug_Bug] FOREIGN KEY
(
[BugID]
) REFERENCES [dbo].[Bug] (
[BugID]
) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[RolePermission] ADD
CONSTRAINT [FK_RolePermission_Permission] FOREIGN KEY
(
[PermissionId]
) REFERENCES [dbo].[Permission] (
[PermissionId]
),
CONSTRAINT [FK_RolePermission_Roles] FOREIGN KEY
(
[RoleId]
) REFERENCES [dbo].[Roles] (
[RoleID]
)
GO
ALTER TABLE [dbo].[UserProjects] ADD
CONSTRAINT [FK_UserProjects_Users] FOREIGN KEY
(
[UserId]
) REFERENCES [dbo].[Users] (
[UserID]
)
GO
ALTER TABLE [dbo].[UserRoles] ADD
CONSTRAINT [FK_UserRoles_Roles] FOREIGN KEY
(
[RoleId]
) REFERENCES [dbo].[Roles] (
[RoleID]
),
CONSTRAINT [FK_UserRoles_Users] FOREIGN KEY
(
[UserId]
) REFERENCES [dbo].[Users] (
[UserID]
)
GO
ALTER TABLE [dbo].[Version] ADD
CONSTRAINT [FK_Version_Project] FOREIGN KEY
(
[ProjectID]
) REFERENCES [dbo].[Project] (
[ProjectID]
) ON DELETE CASCADE
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
/*
*---------------------------------------------------
*
* Stored Procedures
*
*---------------------------------------------------
*/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Attachment_CreateNewAttachment]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Attachment_CreateNewAttachment]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Attachment_GetAttachmentById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Attachment_GetAttachmentById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Attachment_GetAttachmentsByBugId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Attachment_GetAttachmentsByBugId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_BugNotification_CreateNewBugNotification]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_BugNotification_CreateNewBugNotification]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_BugNotification_DeleteBugNotification]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_BugNotification_DeleteBugNotification]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_BugNotification_GetBugNotificationsByBugId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_BugNotification_GetBugNotificationsByBugId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_CreateNewBug]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_CreateNewBug]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugComponentCountByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugComponentCountByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugPriorityCountByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugPriorityCountByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugStatusCountByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugStatusCountByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugTypeCountByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugTypeCountByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugUnassignedCountByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugUnassignedCountByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugUserCountByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugUserCountByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugVersionCountByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugVersionCountByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugsByCriteria]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugsByCriteria]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetBugsByProjectId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetBugsByProjectId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetChangeLog]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetChangeLog]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_GetRecentlyAddedBugsByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_GetRecentlyAddedBugsByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Bug_UpdateBug]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Bug_UpdateBug]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Comment_CreateNewComment]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Comment_CreateNewComment]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Comment_DeleteComment]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Comment_DeleteComment]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Comment_GetCommentById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Comment_GetCommentById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Comment_GetCommentsByBugId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Comment_GetCommentsByBugId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Comment_UpdateComment]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Comment_UpdateComment]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Component_CreateNewComponent]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Component_CreateNewComponent]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Component_DeleteComponent]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Component_DeleteComponent]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Component_GetComponentById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Component_GetComponentById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Component_GetComponentsByProjectId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Component_GetComponentsByProjectId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Environment_GetAllEnvironments]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Environment_GetAllEnvironments]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Environment_GetEnvironmentById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Environment_GetEnvironmentById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Hardware_GetAllHardware]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Hardware_GetAllHardware]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Hardware_GetHardwareById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Hardware_GetHardwareById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_History_CreateNewHistory]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_History_CreateNewHistory]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_History_GetHistoryByBugId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_History_GetHistoryByBugId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_HostSettings_GetHostSettings]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_HostSettings_GetHostSettings]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_HostSettings_UpdateHostSetting]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_HostSettings_UpdateHostSetting]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_OperatingSystem_GetAllOperatingSystems]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_OperatingSystem_GetAllOperatingSystems]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_OperatingSystem_GetOperatingSystemById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_OperatingSystem_GetOperatingSystemById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Permission_AddRolePermission]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Permission_AddRolePermission]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Permission_DeleteRolePermission]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Permission_DeleteRolePermission]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Permission_GetAllPermissions]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Permission_GetAllPermissions]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Permission_GetPermissionsByRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Permission_GetPermissionsByRole]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Permission_GetRolePermission]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Permission_GetRolePermission]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Priority_GetAllPriorities]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Priority_GetAllPriorities]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Priority_GetPriorityById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Priority_GetPriorityById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_AddUserToProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_AddUserToProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_CreateNewProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_CreateNewProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_CreateProjectMailbox]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_CreateProjectMailbox]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_DeleteProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_DeleteProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_DeleteProjectMailbox]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_DeleteProjectMailbox]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_GetAllProjects]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_GetAllProjects]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_GetMailboxByProjectId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_GetMailboxByProjectId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_GetProjectByCode]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_GetProjectByCode]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_GetProjectById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_GetProjectById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_GetProjectsByUserId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_GetProjectsByUserId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_GetPublicProjects]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_GetPublicProjects]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_RemoveUserFromProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_RemoveUserFromProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Project_UpdateProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Project_UpdateProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_RelatedBug_CreateNewRelatedBug]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_RelatedBug_CreateNewRelatedBug]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_RelatedBug_DeleteRelatedBug]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_RelatedBug_DeleteRelatedBug]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_RelatedBug_GetRelatedBugsByBugId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_RelatedBug_GetRelatedBugsByBugId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Resolution_GetAllResolutions]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Resolution_GetAllResolutions]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Resolution_GetResolutionById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Resolution_GetResolutionById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_AddUserToRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_AddUserToRole]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_CreateNewRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_CreateNewRole]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_DeleteRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_DeleteRole]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_GetAllRoles]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_GetAllRoles]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_GetRoleById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_GetRoleById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_GetRolesByProject]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_GetRolesByProject]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_GetRolesByUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_GetRolesByUser]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_GetRolesByUserId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_GetRolesByUserId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_IsUserInRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_IsUserInRole]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_RemoveUserFromRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_RemoveUserFromRole]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_RoleHasPermission]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_RoleHasPermission]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Role_UpdateRole]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Role_UpdateRole]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Status_GetAllStatus]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Status_GetAllStatus]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Status_GetStatusById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Status_GetStatusById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_TimeEntry_CreateNewTimeEntry]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_TimeEntry_CreateNewTimeEntry]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_TimeEntry_DeleteTimeEntry]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_TimeEntry_DeleteTimeEntry]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_TimeEntry_GetProjectWorkerWorkReport]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_TimeEntry_GetProjectWorkerWorkReport]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_TimeEntry_GetWorkReportByBugId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_TimeEntry_GetWorkReportByBugId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_TimeEntry_GetWorkReportByProjectId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_TimeEntry_GetWorkReportByProjectId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_TimeEntry_GetWorkerOverallWorkReportByWorkerId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_TimeEntry_GetWorkerOverallWorkReportByWorkerId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Type_GetAllTypes]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Type_GetAllTypes]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Type_GetTypeById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Type_GetTypeById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_User_Authenticate]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_User_Authenticate]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_User_CreateNewUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_User_CreateNewUser]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_User_GetAllUsers]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_User_GetAllUsers]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_User_GetUserById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_User_GetUserById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_User_GetUserByUsername]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_User_GetUserByUsername]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_User_GetUsersByProjectId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_User_GetUsersByProjectId]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_User_IsProjectMember]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_User_IsProjectMember]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_User_UpdateUser]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_User_UpdateUser]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Version_CreateNewVersion]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Version_CreateNewVersion]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Version_DeleteVersion]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Version_DeleteVersion]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Version_GetVersionById]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Version_GetVersionById]
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[BugNet_Version_GetVersionByProjectId]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[BugNet_Version_GetVersionByProjectId]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Attachment_CreateNewAttachment
@BugId int,
@FileName nvarchar(100),
@Description nvarchar(80),
@FileSize Int,
@ContentType nvarchar(50),
@UploadedUserName nvarchar(100)
AS
-- Get Uploaded UserID
DECLARE @UploadedUserId Int
SELECT @UploadedUserId = UserId FROM Users WHERE Username = @UploadedUserName
INSERT BugAttachment
(
BugID,
FileName,
Description,
FileSize,
Type,
UploadedDate,
UploadedUser
)
VALUES
(
@BugId,
@FileName,
@Description,
@FileSize,
@ContentType,
GetDate(),
@UploadedUserId
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Attachment_GetAttachmentById
@AttachmentId INT
AS
SELECT
BugAttachmentId,
BugId,
FileName,
Description,
FileSize,
Type,
UploadedDate,
UploadedUser,
Creators.UserName CreatorUserName,
Creators.DisplayName CreatorDisplayName
FROM
BugAttachment
INNER JOIN Users Creators ON Creators.UserId = BugAttachment.UploadedUser
WHERE
BugAttachmentId = @AttachmentId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Attachment_GetAttachmentsByBugId
@BugId INT
AS
SELECT
BugAttachmentId,
BugId,
FileName,
Description,
FileSize,
Type,
UploadedDate,
UploadedUser,
Creators.UserName CreatorUserName,
Creators.DisplayName CreatorDisplayName
FROM
BugAttachment
INNER JOIN Users Creators ON Creators.UserId = BugAttachment.UploadedUser
WHERE
BugId = @BugId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_BugNotification_CreateNewBugNotification
@BugId Int,
@NotificationUsername NVarChar(255)
AS
DECLARE @UserId Int
SELECT @UserId = UserId FROM Users WHERE Username = @NotificationUsername
IF NOT EXISTS( SELECT BugNotificationId FROM BugNotification WHERE UserId = @UserId AND BugId = @BugId)
BEGIN
INSERT BugNotification
(
BugId,
UserId
)
VALUES
(
@BugId,
@UserId
)
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_BugNotification_DeleteBugNotification
@BugId Int,
@Username NVarChar(255)
AS
DECLARE @UserId Int
SELECT @UserId = UserId FROM Users WHERE Username = @Username
DELETE
BugNotification
WHERE
BugId = @BugId
AND UserId = @UserId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_BugNotification_GetBugNotificationsByBugId
@BugId Int
AS
SELECT
BugNotificationId,
BugId,
Username NotificationUsername,
DisplayName NotificationDisplayName,
Email NotificationEmail
FROM
BugNotification
INNER JOIN Users ON BugNotification.UserId = Users.UserId
WHERE
BugId = @BugId
ORDER BY
DisplayName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_CreateNewBug
@Summary nvarchar(500),
@Description text,
@Url nvarchar(500),
@ProjectId Int,
@ComponentId Int,
@StatusId Int,
@PriorityId Int,
@VersionId Int,
@HardwareId Int,
@EnvironmentId int,
@TypeId Int,
@OperatingSystemId Int,
@ResolutionId Int,
@AssignedTo Int,
@ReportedUser NVarChar(200)
AS
DECLARE @newIssueId Int
-- Get Reporter UserID
DECLARE @ReporterId Int
SELECT @ReporterId = UserId FROM Users WHERE Username = @ReportedUser
INSERT Bug
(
Summary,
Description,
Url,
ReportedUser,
ReportedDate,
StatusID,
PriorityID,
TypeId,
EnvironmentID,
ComponentID,
AssignedTo,
HardwareId,
OperatingSystemId,
ProjectId,
ResolutionId,
VersionId,
LastUpdateUser,
LastUpdate
)
VALUES
(
@Summary,
@Description,
@Url,
@ReporterId,
GetDate(),
@StatusId,
@PriorityId,
@TypeId,
@EnvironmentId,
@ComponentId,
@AssignedTo,
@HardwareId,
@OperatingSystemId,
@ProjectId,
@ResolutionId,
@VersionId,
@ReporterId,
GetDate()
)
RETURN scope_identity()
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugById
@BugId Int
AS
SELECT
*
FROM
BugsView
WHERE
BugId = @BugId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugComponentCountByProject
@ProjectId int,
@ComponentId int
AS
SELECT Count(BugId) From Bug Where ProjectId = @ProjectId
AND ComponentId = @ComponentId AND StatusId <> 4 AND StatusId <> 5
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugPriorityCountByProject
@ProjectId int
AS
SELECT p.Name, COUNT(nt.PriorityID) AS Number, p.PriorityID
FROM Priority p
LEFT OUTER JOIN (SELECT PriorityID, ProjectID FROM
Bug b WHERE (b.StatusID <> 4) AND (b.StatusID <> 5)) nt
ON p.PriorityID = nt.PriorityID AND nt.ProjectID = @ProjectId
GROUP BY p.Name, p.PriorityID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugStatusCountByProject
@ProjectId int
AS
SELECT s.Name,Count(b.StatusID) as 'Number',s.StatusID
From Status s
LEFT JOIN Bug b on s.StatusID = b.StatusID AND b.ProjectID = @ProjectId
Group BY s.Name,s.StatusID Order By s.StatusID ASC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugTypeCountByProject
@ProjectId int
AS
SELECT t.Name, COUNT(nt.TypeID) AS Number, t.TypeID, t.ImageUrl
FROM Type t
LEFT OUTER JOIN (SELECT TypeID, ProjectID
FROM Bug b WHERE (b.StatusID <> 4)
AND (b.StatusID <> 5)) nt
ON t.TypeID = nt.TypeID
AND nt.ProjectID = @ProjectId
GROUP BY t.Name, t.TypeID,t.ImageUrl
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugUnassignedCountByProject
@ProjectId int
AS
SELECT COUNT(BugID) AS Number
FROM Bug
WHERE (AssignedTo = 0)
AND (ProjectID = @ProjectId)
AND (StatusID <> 4)
AND (StatusID <> 5)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugUserCountByProject
@ProjectId int
AS
SELECT u.UserID,u.DisplayName, COUNT(b.BugID) AS Number FROM UserProjects pm
LEFT OUTER JOIN Users u ON pm.UserID = u.UserID
LEFT OUTER JOIN Bug b ON b.AssignedTo = u.UserID
WHERE (pm.ProjectID = @ProjectId)
AND (b.ProjectID= @ProjectId )
AND (b.StatusID <> 4)
AND (b.StatusID <> 5)
GROUP BY u.DisplayName, u.UserID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugVersionCountByProject
@ProjectId int
AS
SELECT v.Name, COUNT(nt.VersionID) AS Number, v.VersionID
FROM Version v
LEFT OUTER JOIN (SELECT VersionID
FROM Bug b
WHERE (b.StatusID <> 4) AND (b.StatusID <> 5)) nt ON v.VersionID = nt.VersionID
WHERE (v.ProjectID = @ProjectId)
GROUP BY v.Name, v.VersionID
ORDER BY v.VersionID DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.BugNet_Bug_GetBugsByCriteria
(
@ProjectId int = NULL,
@ComponentId int = NULL,
@VersionId int = NULL,
@PriorityId int = NULL,
@TypeId int = NULL,
@ResolutionId int = NULL,
@StatusId int = NULL,
@AssignedTo int = NULL,
@HardwareId int = NULL,
@OperatingSystemId int = NULL,
@Keywords nvarchar(256) = NULL,
@IncludeComments bit = NULL
)
AS
if @StatusId = 0
SELECT
*
FROM
BugsView
WHERE
((@ProjectId IS NULL) OR (ProjectId = @ProjectId)) AND
((@ComponentId IS NULL) OR (ComponentId = @ComponentId)) AND
((@VersionId IS NULL) OR (VersionId = @VersionId)) AND
((@PriorityId IS NULL) OR (PriorityId = @PriorityId))AND
((@TypeId IS NULL) OR (TypeId = @TypeId)) AND
((@ResolutionId IS NULL) OR (ResolutionId = @ResolutionId)) AND
((@StatusId IS NULL) OR (StatusId In (1,2,3))) AND
((@AssignedTo IS NULL) OR (AssignedTo = @AssignedTo)) AND
((@HardwareId IS NULL) OR (HardwareId = @HardwareId)) AND
((@OperatingSystemId IS NULL) OR (OperatingSystemId = @OperatingSystemId)) AND
((@Keywords IS NULL) OR (Description LIKE '%' + @Keywords + '%' ) OR (Summary LIKE '%' + @Keywords + '%' ) )
else
SELECT
*
FROM
BugsView
WHERE
((@ProjectId IS NULL) OR (ProjectId = @ProjectId)) AND
((@ComponentId IS NULL) OR (ComponentId = @ComponentId)) AND
((@VersionId IS NULL) OR (VersionId = @VersionId)) AND
((@PriorityId IS NULL) OR (PriorityId = @PriorityId))AND
((@TypeId IS NULL) OR (TypeId = @TypeId)) AND
((@ResolutionId IS NULL) OR (ResolutionId = @ResolutionId)) AND
((@StatusId IS NULL) OR (StatusId = @StatusId)) AND
((@AssignedTo IS NULL) OR (AssignedTo = @AssignedTo)) AND
((@HardwareId IS NULL) OR (HardwareId = @HardwareId)) AND
((@OperatingSystemId IS NULL) OR (OperatingSystemId = @OperatingSystemId)) AND
((@Keywords IS NULL) OR (Description LIKE '%' + @Keywords + '%' ) OR (Summary LIKE '%' + @Keywords + '%' ))
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetBugsByProjectId
@ProjectId int
As
Select * from BugsView WHERE ProjectId = @ProjectId
Order By StatusId,PriorityName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Bug_GetChangeLog
@ProjectId int
AS
Select * from BugsView WHERE ProjectId = @ProjectId AND StatusID = 5
Order By VersionId DESC,ComponentName ASC, TypeName ASC, AssignedUserDisplayName ASC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_GetRecentlyAddedBugsByProject
@ProjectId int
AS
SELECT TOP 5
*
FROM
BugsView
WHERE
ProjectId = @ProjectId
ORDER BY BugID DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Bug_UpdateBug
@BugId Int,
@Summary nvarchar(500),
@Description text,
@Url nvarchar(500),
@ProjectId Int,
@ComponentId Int,
@StatusId Int,
@PriorityId Int,
@VersionId Int,
@HardwareId Int,
@EnvironmentId int,
@TypeId Int,
@OperatingSystemId Int,
@ResolutionId Int,
@AssignedTo Int,
@LastUpdateUserName NVarChar(200)
AS
DECLARE @newIssueId Int
-- Get Last Update UserID
DECLARE @LastUpdateUserId Int
SELECT @LastUpdateUserId = UserId FROM Users WHERE Username = @LastUpdateUserName
Update Bug Set
Summary = @Summary,
Description =@Description,
Url =@Url,
StatusID =@StatusId,
PriorityID =@PriorityId,
TypeId = @TypeId,
EnvironmentID =@EnvironmentId,
ComponentID = @ComponentId,
AssignedTo=@AssignedTo,
HardwareId =@HardwareId,
OperatingSystemId =@OperatingSystemId,
ProjectId =@ProjectId,
ResolutionId =@ResolutionId,
VersionId =@VersionId,
LastUpdateUser = @LastUpdateUserId,
LastUpdate = GetDate()
WHERE
BugId = @BugId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Comment_CreateNewComment
@BugId int,
@CreatorUserName NVarChar(100),
@Comment text
AS
-- Get Last Update UserID
DECLARE @CreatorUserId Int
SELECT @CreatorUserId = UserId FROM Users WHERE Username = @CreatorUserName
INSERT BugComment
(
BugId,
UserId,
CreatedDate,
Comment
)
VALUES
(
@BugId,
@CreatorUserId,
GetDate(),
@Comment
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Comment_DeleteComment
@BugCommentId Int
AS
DELETE
BugComment
WHERE
BugCommentId = @BugCommentId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Comment_GetCommentById
@BugCommentId INT
AS
SELECT
BugCommentId,
BugId,
BugComment.UserId,
CreatedDate,
Comment,
Creators.UserName CreatorUserName,
Creators.Email CreatorEmail,
Creators.DisplayName CreatorDisplayName
FROM
BugComment
INNER JOIN Users Creators ON Creators.UserId = BugComment.UserId
WHERE
BugCommentId = @BugCommentId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Comment_GetCommentsByBugId
@BugId INT
AS
SELECT
BugCommentId,
BugId,
BugComment.UserId,
CreatedDate,
Comment,
Creators.UserName CreatorUserName,
Creators.Email CreatorEmail,
Creators.DisplayName CreatorDisplayName
FROM
BugComment
INNER JOIN Users Creators ON Creators.UserId = BugComment.UserId
WHERE
BugId = @BugId
ORDER BY
CreatedDate DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Comment_UpdateComment
@BugCommentId int,
@BugId int,
@CreatorId int,
@Comment ntext
AS
UPDATE BugComment SET
BugId = @BugId,
UserId = @CreatorId,
Comment = @Comment
WHERE BugCommentId= @BugCommentId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Component_CreateNewComponent
@ProjectId int,
@Name nvarchar(50),
@ParentComponentId int
AS
INSERT Component
(
ProjectID,
Name,
ParentComponentID
)
VALUES
(
@ProjectId,
@Name,
@ParentComponentId
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Component_DeleteComponent
@ComponentId Int
AS
DELETE
Component
WHERE
ComponentId = @ComponentId
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Component_GetComponentById
@ComponentId int
AS
SELECT
ComponentId,
ProjectId,
Name,
ParentComponentId
FROM Component
WHERE
ComponentId = @ComponentId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Component_GetComponentsByProjectId
@ProjectId int
AS
SELECT
ComponentId,
ProjectId,
Name,
ParentComponentId
FROM Component
WHERE
ProjectId = @ProjectId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Environment_GetAllEnvironments
AS
SELECT
EnvironmentId,
Name
FROM
Environment
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Environment_GetEnvironmentById
@EnvironmentId int
AS
SELECT
EnvironmentId,
Name
FROM
Environment
WHERE
EnvironmentId = @EnvironmentId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Hardware_GetAllHardware
AS
SELECT
HardwareId,
Name
FROM
Hardware
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Hardware_GetHardwareById
@HardwareId int
AS
SELECT
HardwareId,
Name
FROM
Hardware
WHERE
HardwareId = @HardwareId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_History_CreateNewHistory
@BugId int,
@UserId int,
@FieldChanged nvarchar(50),
@OldValue nvarchar(50),
@NewValue nvarchar(50)
AS
INSERT BugHistory
(
BugId,
UserId,
FieldChanged,
OldValue,
NewValue,
CreatedDate
)
VALUES
(
@BugId,
@UserId,
@FieldChanged,
@OldValue,
@NewValue,
GetDate()
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_History_GetHistoryByBugId
@BugId int
AS
SELECT
BugHistoryID,
BugId,
BugHistory.UserId,
FieldChanged,
OldValue,
NewValue,
CreatedDate,
CreateUser.DisplayName
FROM
BugHistory
JOIN
Users CreateUser
ON
BugHistory.UserId = CreateUser.UserId
WHERE
BugId = @BugId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_HostSettings_GetHostSettings AS
SELECT SettingName, SettingValue FROM HostSettings
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_HostSettings_UpdateHostSetting
@SettingName nvarchar(50),
@SettingValue nvarchar(256)
AS
UPDATE HostSettings SET
SettingName = @SettingName,
SettingValue = @SettingValue
WHERE
SettingName = @SettingName
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_OperatingSystem_GetAllOperatingSystems
AS
SELECT
OperatingSystemId,
Name
FROM
OperatingSystem
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_OperatingSystem_GetOperatingSystemById
@OperatingSystemId int
AS
SELECT
OperatingSystemId,
Name
FROM
OperatingSystem
WHERE
OperatingSystemId = @OperatingSystemId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Permission_AddRolePermission
@PermissionId int,
@RoleId int
AS
IF NOT EXISTS (SELECT PermissionId FROM RolePermission WHERE PermissionId = @PermissionId AND RoleId = @RoleId)
BEGIN
INSERT RolePermission
(
PermissionId,
RoleId
)
VALUES
(
@PermissionId,
@RoleId
)
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Permission_DeleteRolePermission
@PermissionId Int,
@RoleId Int
AS
DELETE
RolePermission
WHERE
PermissionId = @PermissionId
AND RoleId = @RoleId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Permission_GetAllPermissions AS
SELECT PermissionId,PermissionKey, Name FROM Permission
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Permission_GetPermissionsByRole
@RoleId int
AS
SELECT Permission.PermissionId,PermissionKey, Name FROM Permission
Inner join RolePermission on RolePermission.PermissionId = Permission.PermissionId
WHERE RoleId = @RoleId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Permission_GetRolePermission AS
Select R.RoleId, R.ProjectId,P.PermissionId,P.PermissionKey,R.RoleName
FROM RolePermission RP
JOIN
Permission P ON RP.PermissionId = P.PermissionId
JOIN
Roles R ON RP.RoleId = R.RoleId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Priority_GetAllPriorities
AS
SELECT
PriorityId,
Name,
ImageUrl
FROM
Priority
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Priority_GetPriorityById
@PriorityId int
AS
SELECT
PriorityId,
Name,
ImageUrl
FROM
Priority
WHERE
PriorityId = @PriorityId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Project_AddUserToProject
@UserId int,
@ProjectId int
AS
IF NOT EXISTS (SELECT UserId FROM UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId)
BEGIN
INSERT UserProjects
(
UserId,
ProjectId,
CreatedDate
)
VALUES
(
@UserId,
@ProjectId,
getdate()
)
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Project_CreateNewProject
@Name nvarchar(50),
@Code nvarchar(3),
@Description nvarchar(80),
@ManagerId Int,
@UploadPath nvarchar(80),
@Active int,
@AccessType int,
@CreatorUserId int
AS
IF NOT EXISTS( SELECT ProjectId FROM Project WHERE LOWER(Name) = LOWER(@Name))
BEGIN
INSERT Project
(
Name,
Code,
Description,
UploadPath,
ManagerId,
CreateDate,
CreatorUserId,
AccessType,
Active
)
VALUES
(
@Name,
@Code,
@Description,
@UploadPath,
@ManagerId,
GetDate(),
@CreatorUserId,
@AccessType,
@Active
)
RETURN @@IDENTITY
END
ELSE
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Project_CreateProjectMailbox
@MailBox nvarchar (100),
@ProjectID int,
@AssignToUserID int,
@IssueTypeID int
AS
INSERT ProjectMailBox
(
MailBox,
ProjectID,
AssignToUserID,
IssueTypeID
)
VALUES
(
@MailBox,
@ProjectID,
@AssignToUserID,
@IssueTypeID
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Project_DeleteProject
@ProjectId int
AS
DELETE FROM Project where ProjectId = @ProjectId
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Project_DeleteProjectMailbox
@ProjectMailboxId int
AS
DELETE ProjectMailBox
WHERE
ProjectMailboxId = @ProjectMailboxId
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Project_GetAllProjects
AS
SELECT
ProjectId,
Name,
Code,
Description,
UploadPath,
ManagerId,
CreatorUserId,
CreateDate,
Project.Active,
AccessType,
Managers.DisplayName ManagerDisplayName,
Creators.DisplayName CreatorDisplayName
FROM
Project
INNER JOIN Users Managers ON Managers.UserId = ManagerId
INNER JOIN Users Creators ON Creators.UserId = CreatorUserId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Project_GetMailboxByProjectId
@ProjectId int
AS
SELECT ProjectMailbox.*,
Users.DisplayName AssignToName,
Type.Name IssueTypeName
FROM
ProjectMailbox
INNER JOIN Users ON Users.UserID = AssignToUserID
INNER JOIN Type ON Type.TypeID = IssueTypeID
WHERE
ProjectId = @ProjectId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Project_GetProjectByCode
@ProjectCode nvarchar(3)
AS
SELECT
ProjectId,
Name,
Code,
Description,
UploadPath,
ManagerId,
CreatorUserId,
CreateDate,
Project.Active,
AccessType,
Managers.DisplayName ManagerDisplayName,
Creators.DisplayName CreatorDisplayName
FROM
Project
INNER JOIN Users Managers ON Managers.UserId = ManagerId
INNER JOIN Users Creators ON Creators.UserId = CreatorUserId
WHERE
Code = @ProjectCode
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Project_GetProjectById
@ProjectId INT
AS
SELECT
ProjectId,
Name,
Code,
Description,
UploadPath,
ManagerId,
CreatorUserId,
CreateDate,
Project.Active,
AccessType,
Managers.DisplayName ManagerDisplayName,
Creators.DisplayName CreatorDisplayName
FROM
Project
INNER JOIN Users Managers ON Managers.UserId = ManagerId
INNER JOIN Users Creators ON Creators.UserId = CreatorUserId
WHERE
ProjectId = @ProjectId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Project_GetProjectsByUserId
@UserId int,
@ActiveOnly bit
AS
SELECT DISTINCT
Project.ProjectId,
Name,
Code,
Description,
UploadPath,
ManagerId,
CreatorUserId,
CreateDate,
Project.Active,
AccessType,
Managers.DisplayName ManagerDisplayName,
Creators.DisplayName CreatorDisplayName
FROM
Project
Left JOIN Users Managers ON Managers.UserId = ManagerId
Left JOIN Users Creators ON Creators.UserId = CreatorUserId
Left JOIN UserProjects ON UserProjects.ProjectId = Project.ProjectId
WHERE
(Project.AccessType = 1 AND Project.Active = @ActiveOnly) OR UserProjects.UserId = @UserId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Project_GetPublicProjects
AS
SELECT
ProjectId,
Name,
Code,
Description,
UploadPath,
ManagerId,
CreatorUserId,
CreateDate,
Project.Active,
AccessType,
Managers.DisplayName ManagerDisplayName,
Creators.DisplayName CreatorDisplayName
FROM
Project
INNER JOIN Users Managers ON Managers.UserId = ManagerId
INNER JOIN Users Creators ON Creators.UserId = CreatorUserId
WHERE AccessType = 1 AND Project.Active = 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Project_RemoveUserFromProject
@UserId Int,
@ProjectId Int
AS
DELETE
UserProjects
WHERE
UserId = @UserId
AND ProjectId = @ProjectId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Project_UpdateProject
@ProjectId int,
@Name nvarchar(50),
@Code nvarchar(3),
@Description nvarchar(80),
@ManagerId int,
@UploadPath nvarchar(80),
@AccessType int,
@Active int
AS
UPDATE Project SET
Name = @Name,
Code = @Code,
Description = @Description,
ManagerID = @ManagerId,
UploadPath = @UploadPath,
AccessType = @AccessType,
Active = @Active
WHERE
ProjectId = @ProjectId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_RelatedBug_CreateNewRelatedBug
@BugId Int,
@LinkedBugId int
AS
IF NOT EXISTS( SELECT RelatedBugId FROM RelatedBug WHERE @BugId = @BugId AND LinkedBugId = @LinkedBugId)
BEGIN
INSERT RelatedBug
(
BugId,
LinkedBugId
)
VALUES
(
@BugId,
@LinkedBugId
)
INSERT RelatedBug
(
BugId,
LinkedBugId
)
VALUES
(
@LinkedBugId,
@BugId
)
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_RelatedBug_DeleteRelatedBug
@BugId Int,
@LinkedBugId int
AS
DELETE
RelatedBug
WHERE
BugId = @BugId AND
LinkedBugId = @LinkedBugId
DELETE
RelatedBug
WHERE
BugId = @LinkedBugId AND
LinkedBugId = @BugId
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_RelatedBug_GetRelatedBugsByBugId
@BugId int
As
Select * from BugsView join RelatedBug on BugsView.BugId = RelatedBug.LinkedBugId
WHERE RelatedBug.BugId = @BugId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Resolution_GetAllResolutions
AS
SELECT
ResolutionId,
Name
FROM
Resolution
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Resolution_GetResolutionById
@ResolutionId int
AS
SELECT
ResolutionId,
Name
FROM
Resolution
WHERE
ResolutionId = @ResolutionId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Role_AddUserToRole
@UserId int,
@RoleId int
AS
IF NOT EXISTS (SELECT UserId FROM UserRoles WHERE UserId = @UserId AND RoleId = @RoleId)
BEGIN
INSERT UserRoles
(
UserId,
RoleId
)
VALUES
(
@UserId,
@RoleId
)
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Role_CreateNewRole
@ProjectId int,
@Name nvarchar(50),
@Description nvarchar(256)
AS
INSERT Roles
(
ProjectID,
RoleName,
Description
)
VALUES
(
@ProjectId,
@Name,
@Description
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Role_DeleteRole
@RoleId Int
AS
DELETE
Roles
WHERE
RoleId = @RoleId
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Role_GetAllRoles
AS
SELECT RoleId, RoleName FROM Roles
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Role_GetRoleById
@RoleId int
AS
SELECT RoleId, ProjectId,RoleName, Description FROM Roles
WHERE RoleId = @RoleId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Role_GetRolesByProject
@ProjectId int
AS
SELECT RoleId,ProjectId, RoleName, Description FROM Roles
WHERE ProjectId = @ProjectId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE procedure BugNet_Role_GetRolesByUser
@UserId int,
@ProjectId int
as
select Roles.RoleName,
Roles.ProjectId,
Roles.Description,
Roles.RoleId
from UserRoles
inner join Users on UserRoles.UserId = Users.UserId
inner join Roles on UserRoles.RoleId = Roles.RoleId
where Users.UserId = @UserId
and Roles.ProjectId = @ProjectId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE procedure BugNet_Role_GetRolesByUserId
@UserId int
as
select Roles.RoleName,
Roles.ProjectId,
Roles.Description,
Roles.RoleId
from UserRoles
inner join Users on UserRoles.UserId = Users.UserId
inner join Roles on UserRoles.RoleId = Roles.RoleId
where Users.UserId = @UserId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
create procedure BugNet_Role_IsUserInRole
@UserId int,
@RoleId int,
@ProjectId int
as
select UserRoles.UserId,
UserRoles.RoleId
from UserRoles
inner join Roles on UserRoles.RoleId = Roles.RoleId
where UserRoles.UserId = @UserId
and UserRoles.RoleId = @RoleId
and Roles.ProjectId = @ProjectId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Role_RemoveUserFromRole
@UserId Int,
@RoleId Int
AS
DELETE
UserRoles
WHERE
UserId = @UserId
AND RoleId = @RoleId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Role_RoleHasPermission
@ProjectID int,
@Role nvarchar(50),
@PermissionKey nvarchar(50)
AS
select count(*) from RolePermission inner join Roles on Roles.RoleId = RolePermission.RoleId inner join
Permission on RolePermission.PermissionId = Permission.PermissionId
WHERE ProjectId = @ProjectID
AND
PermissionKey = @PermissionKey
AND
Roles.RoleName = @Role
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_Role_UpdateRole
@RoleId int,
@Name nvarchar(50),
@Description nvarchar(256)
AS
UPDATE Roles SET
RoleName = @Name,
Description = @Description
WHERE
RoleId = @RoleId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Status_GetAllStatus
AS
SELECT
StatusId,
Name
FROM
Status
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Status_GetStatusById
@StatusId int
AS
SELECT
StatusId,
Name
FROM
Status
WHERE
StatusId = @StatusId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_TimeEntry_CreateNewTimeEntry
@BugId int,
@CreatorUserName varchar(100),
@WorkDate datetime ,
@Duration decimal(4,2),
@BugCommentId int
AS
-- Get Last Update UserID
DECLARE @CreatorUserId Int
SELECT @CreatorUserId = UserId FROM Users WHERE Username = @CreatorUserName
INSERT BugTimeEntry
(
BugId,
UserId,
WorkDate,
Duration,
BugCommentId
)
VALUES
(
@BugId,
@CreatorUserId,
@WorkDate,
@Duration,
@BugCommentID
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_TimeEntry_DeleteTimeEntry
@BugTimeEntryId int
AS
DELETE
BugTimeEntry
WHERE
BugTimeEntryId = @BugTimeEntryId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_TimeEntry_GetProjectWorkerWorkReport
@ProjectId INT,
@ReporterId INT
AS
SELECT Project.ProjectId, Project.Name, Bug.BugId, Bug.Summary, Creators.DisplayName AS ReporterDisplayName, BugTimeEntry.Duration, BugTimeEntry.WorkDate,
ISNULL(BugComment.Comment, '') AS Comment
FROM BugTimeEntry INNER JOIN
Users Creators ON Creators.UserId = BugTimeEntry.UserId INNER JOIN
Bug ON BugTimeEntry.BugId = Bug.BugId INNER JOIN
Project ON Bug.ProjectId = Project.ProjectId LEFT OUTER JOIN
BugComment ON BugComment.BugCommentId = BugTimeEntry.BugCommentId
WHERE
Project.ProjectID = @ProjectId AND
( BugTimeEntry.UserId = @ReporterId OR @ReporterId = -1)
ORDER BY ReporterDisplayName, WorkDate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_TimeEntry_GetWorkReportByBugId
@BugId INT
AS
SELECT BugTimeEntry.*, Creators.UserName AS CreatorUserName, Creators.Email AS CreatorEmail, Creators.DisplayName AS CreatorDisplayName,
ISNULL(BugComment.Comment, '') Comment
FROM BugTimeEntry
INNER JOIN Users Creators ON Creators.UserID = BugTimeEntry.UserId
LEFT OUTER JOIN BugComment ON BugComment.BugCommentId = BugTimeEntry.BugCommentId
WHERE
BugTimeEntry.BugId = @BugId
ORDER BY WorkDate DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_TimeEntry_GetWorkReportByProjectId
@ProjectId INT
AS
SELECT Project.ProjectID, Project.Name, Bug.BugID, Bug.Summary, Creators.DisplayName AS ReporterDisplayName, BugTimeEntry.Duration, BugTimeEntry.WorkDate,
ISNULL(BugComment.Comment, '') AS Comment
FROM BugTimeEntry INNER JOIN
Users Creators ON Creators.UserId = BugTimeEntry.UserId INNER JOIN
Bug ON BugTimeEntry.BugId = Bug.BugId INNER JOIN
Project ON Bug.ProjectId = Project.ProjectId LEFT OUTER JOIN
BugComment ON BugComment.BugCommentId = BugTimeEntry.BugCommentId
WHERE
Project.ProjectId = @ProjectId
ORDER BY WorkDate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_TimeEntry_GetWorkerOverallWorkReportByWorkerId
@ReporterId INT
AS
SELECT Project.ProjectId, Project.Name, Bug.BugId, Bug.Summary, Creators.DisplayName AS CreatorDisplayName, BugTimeEntry.Duration,
ISNULL(BugComment.Comment, '') AS Comment
FROM BugTimeEntry INNER JOIN
Users Creators ON Creators.UserID = BugTimeEntry.UserId INNER JOIN
Bug ON BugTimeEntry.BugId = Bug.BugId INNER JOIN
Project ON Bug.ProjectId = Project.ProjectId LEFT OUTER JOIN
BugComment ON BugComment.BugCommentId = BugTimeEntry.BugCommentId
WHERE
BugTimeEntry.UserId = @ReporterId
ORDER BY WorkDate
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Type_GetAllTypes
AS
SELECT
TypeId,
Name,
ImageUrl
FROM
Type
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Type_GetTypeById
@TypeId int
AS
SELECT
TypeId,
Name,
ImageUrl
FROM
Type
WHERE
TypeId = @TypeId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.BugNet_User_Authenticate
@Username nvarchar(50),
@Password nvarchar(20)
AS
IF EXISTS( SELECT UserId FROM Users WHERE Username = @Username AND Password = @Password)
RETURN 0
ELSE
RETURN -1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_User_CreateNewUser
@Username NVarChar(50),
@Email NVarChar(250),
@DisplayName NVarChar(250),
@Password NVarChar(250),
@Active bit,
@IsSuperUser bit
AS
IF EXISTS(SELECT UserId FROM Users WHERE Username = @Username)
RETURN 0
INSERT Users
(
Username,
Email,
DisplayName,
Password,
Active,
IsSuperUser
)
VALUES
(
@Username,
@Email,
@DisplayName,
@Password,
@Active,
@IsSuperUser
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.BugNet_User_GetAllUsers
AS
SELECT
UserId, Username, Password, Email, DisplayName,Active, IsSuperUser
FROM
Users
ORDER BY DisplayName ASC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_User_GetUserById
@UserId Int
AS
SELECT
UserId, Username, Password, Email, DisplayName,Active, IsSuperUser
FROM
Users
WHERE
UserId = @UserId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_User_GetUserByUsername
@Username nvarchar(50)
AS
SELECT
UserId, Username, Password, Email, DisplayName,Active, IsSuperUser
FROM
Users
WHERE
Username = @Username
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_User_GetUsersByProjectId
@ProjectId Int
AS
SELECT Users.UserId, Username, Password, DisplayName, Email, Active,IsSuperUser
FROM
Users
LEFT OUTER JOIN
UserProjects
ON
Users.UserId = UserProjects.UserId
WHERE
UserProjects.ProjectId = @ProjectId
ORDER BY DisplayName ASC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE BugNet_User_IsProjectMember
@UserId int,
@ProjectId int
AS
IF EXISTS( SELECT UserId FROM UserProjects WHERE UserId = @UserId AND ProjectId = @ProjectId)
RETURN 0
ELSE
RETURN -1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.BugNet_User_UpdateUser
@UserId Int,
@Username NVarChar(250),
@Email NVarChar(250),
@DisplayName NVarChar(250),
@Password NVarChar(250),
@Active bit,
@IsSuperUser bit
AS
IF EXISTS(SELECT UserId FROM Users WHERE Username = @Username AND UserID <> @UserId)
RETURN 1
UPDATE Users SET
Username = @Username,
Email = @Email,
DisplayName = @DisplayName,
Password = @Password,
Active = @Active,
IsSuperUser = @IsSuperUser
WHERE
UserId = @UserId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Version_CreateNewVersion
@ProjectId int,
@Name nvarchar(50)
AS
INSERT Version
(
ProjectID,
Name
)
VALUES
(
@ProjectId,
@Name
)
RETURN @@IDENTITY
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Version_DeleteVersion
@VersionId Int
AS
DELETE
Version
WHERE
VersionId = @VersionId
IF @@ROWCOUNT > 0
RETURN 0
ELSE
RETURN 1
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Version_GetVersionById
@VersionId INT
AS
SELECT
VersionId,
ProjectId,
Name
FROM
Version
WHERE
VersionId = @VersionId
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE BugNet_Version_GetVersionByProjectId
@ProjectId INT
AS
SELECT
VersionId,
ProjectId,
Name
FROM
Version
WHERE
ProjectId = @ProjectId
ORDER BY VersionId DESC
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
/* Drop Uneeded Procedures */
PRINT 'Drop Unused Objects'
GO
DROP PROCEDURE BugNet_User_GetAllUsersByRoleName
GO
DROP PROCEDURE BugNet_Project_GetProjectsByMemberUserId
GO
/* Data Migration */
PRINT 'Data Migration'
GO
INSERT INTO UserProjects (UserId,ProjectId,CreatedDate)
SELECT UserId, ProjectId, GetDate()
FROM ProjectMembers
ORDER BY UserId
GO
DROP TABLE ProjectMembers
GO
ALTER VIEW dbo.BugsView
AS
SELECT dbo.Bug.*, dbo.Status.Name AS StatusName, ISNULL(dbo.Component.Name, 'All Components') AS ComponentName,
dbo.Environment.Name AS EnvironmentName, dbo.Hardware.Name AS HardwareName, dbo.OperatingSystem.Name AS OperatingSystemName,
dbo.Priority.Name AS PriorityName, dbo.Project.Name AS ProjectName, dbo.Project.Code AS ProjectCode, dbo.Resolution.Name AS ResolutionName,
dbo.Type.Name AS TypeName, ISNULL(dbo.Version.Name, 'Unassigned') AS VersionName, ISNULL(AssignedUsers.DisplayName, 'Unassigned')
AS AssignedUserDisplayName, ReportedUsers.DisplayName AS ReporterDisplayName,
LastUpdateUsers.DisplayName AS LastUpdateUserDisplayName, LastUpdateUsers.UserName AS LastUpdateUserName,
ReportedUsers.UserName AS ReporterUserName
FROM dbo.Bug LEFT OUTER JOIN
dbo.Component ON dbo.Bug.ComponentID = dbo.Component.ComponentID LEFT OUTER JOIN
dbo.Environment ON dbo.Bug.EnvironmentID = dbo.Environment.EnvironmentID LEFT OUTER JOIN
dbo.Hardware ON dbo.Bug.HardwareID = dbo.Hardware.HardwareID LEFT OUTER JOIN
dbo.OperatingSystem ON dbo.Bug.OperatingSystemID = dbo.OperatingSystem.OperatingSystemID LEFT OUTER JOIN
dbo.Priority ON dbo.Bug.PriorityID = dbo.Priority.PriorityID LEFT OUTER JOIN
dbo.Project ON dbo.Bug.ProjectID = dbo.Project.ProjectID LEFT OUTER JOIN
dbo.Resolution ON dbo.Bug.ResolutionID = dbo.Resolution.ResolutionID LEFT OUTER JOIN
dbo.Status ON dbo.Bug.StatusID = dbo.Status.StatusID LEFT OUTER JOIN
dbo.Type ON dbo.Bug.TypeID = dbo.Type.TypeID LEFT OUTER JOIN
dbo.Version ON dbo.Bug.VersionID = dbo.Version.VersionID LEFT OUTER JOIN
dbo.Users AssignedUsers ON dbo.Bug.AssignedTo = AssignedUsers.UserID LEFT OUTER JOIN
dbo.Users ReportedUsers ON dbo.Bug.ReportedUser = ReportedUsers.UserID LEFT OUTER JOIN
dbo.Users LastUpdateUsers ON dbo.Bug.LastUpdateUser = LastUpdateUsers.UserID
GO
/* Permissions */
INSERT INTO Permission(PermissionKey,Name) Values ('CLOSE_ISSUE','Close Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('ADD_ISSUE','Add Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('ASSIGN_ISSUE','Assign Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('EDIT_ISSUE','Edit Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('SUBSCRIBE_ISSUE','Subscribe Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('DELETE_ISSUE','Delete Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('ADD_COMMENT','Add Comment')
INSERT INTO Permission(PermissionKey,Name) Values ('EDIT_COMMENT','Edit Comment')
INSERT INTO Permission(PermissionKey,Name) Values ('DELETE_COMMENT','Delete Comment')
INSERT INTO Permission(PermissionKey,Name) Values ('ADD_ATTACHMENT','Add Attachment')
INSERT INTO Permission(PermissionKey,Name) Values ('DELETE_ATTACHMENT','Delete Attachment')
INSERT INTO Permission(PermissionKey,Name) Values ('ADD_RELATED','Add Related Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('DELETE_RELATED','Delete Related Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('REOPEN_ISSUE','Re-Open Issue')
INSERT INTO Permission(PermissionKey,Name) Values ('OWNER_EDIT_COMMENT','Edit Own Comments')
INSERT INTO Permission(PermissionKey,Name) Values ('EDIT_ISSUE_DESCRIPTION','Edit Issue Description')
INSERT INTO Permission(PermissionKey,Name) Values ('EDIT_ISSUE_SUMMARY','Edit Issue Summary')
INSERT INTO Permission(PermissionKey,Name) Values ('ADMIN_EDIT_PROJECT','Admin Edit Project')
INSERT INTO Permission(PermissionKey,Name) Values ('ADD_TIME_ENTRY','Add Time Entry')
INSERT INTO Permission(PermissionKey,Name) Values ('DELETE_TIME_ENTRY','Delete Time Entry')
/* Host Settings */
INSERT INTO HostSettings(SettingName,SettingValue) Values('Version','0.66')
INSERT INTO HostSettings(SettingName,SettingValue) Values('DefaultUrl','http://localhost/BugNet/')
INSERT INTO HostSettings(SettingName,SettingValue) Values('HostEmailAddress','BugNet<noreply@mysmtpserver>')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3BodyTemplate','<div >Sent by:{1} on: {2}<br>{0}</div>')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3DeleteAllMessages','False')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3InlineAttachedPictures','False')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3Interval','10')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3Password','')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3ReaderEnabled','False')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3ReportingUsername','Admin')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3Server','')
INSERT INTO HostSettings(SettingName,SettingValue) Values('Pop3Username','bugnetuser')
INSERT INTO HostSettings(SettingName,SettingValue) Values('SMTPAuthentication','False')
INSERT INTO HostSettings(SettingName,SettingValue) Values('SMTPPassword','')
INSERT INTO HostSettings(SettingName,SettingValue) Values('SMTPServer','localhost')
INSERT INTO HostSettings(SettingName,SettingValue) Values('SMTPUsername','')
INSERT INTO HostSettings(SettingName,SettingValue) Values('UserAccountSource','None')
INSERT INTO HostSettings(SettingName,SettingValue) Values('WelcomeMessage','')
INSERT INTO HostSettings(SettingName,SettingValue) Values('ADUserName','')
INSERT INTO HostSettings(SettingName,SettingValue) Values('ADPassword','')
INSERT INTO HostSettings(SettingName,SettingValue) Values('DisableUserRegistration','False')
INSERT INTO HostSettings(SettingName,SettingValue) Values('DisableAnonymousAccess','False')
/*Create read only & admin roles for each project */
declare @ProjectId int
declare @RowNum int
declare @ProjectCount int
set @RowNum = 0
select @ProjectCount = count(ProjectId) from Project
select top 1 @ProjectId = ProjectId from Project
WHILE @RowNum < @ProjectCount
BEGIN
set @RowNum = @RowNum + 1
INSERT INTO Roles(ProjectId,RoleName, Description) Values(@ProjectId,'Administrators','Project Administration')
INSERT INTO Roles(ProjectId,RoleName, Description) Values(@ProjectId,'Read Only','Read Only Users')
select top 1 @ProjectId=ProjectID from Project where ProjectId > @ProjectID
END
/*Update Admin user with super user privilidges */
UPDATE Users SET IsSuperUser = 1 WHERE Username = 'Admin'
/* END TRANSACTION */
--end of db update code
IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END
GO
IF EXISTS (SELECT * FROM #tmpErrors) ROLLBACK TRANSACTION
GO
IF @@TRANCOUNT>0 BEGIN
PRINT 'The database update was successful'
COMMIT TRANSACTION
END
ELSE PRINT 'The database update failed'
GO
DROP TABLE #tmpErrors
GO | the_stack |
--------------------------------------------------------------------------------
-- Private functions
--------------------------------------------------------------------------------
--
-- List the schemas of a remote PG server
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_List_Foreign_Schemas_PG(server_internal name)
RETURNS TABLE(remote_schema name)
AS $$
DECLARE
-- Import schemata from the information schema
--
-- "The view schemata contains all schemas in the current database
-- that the current user has access to (by way of being the owner
-- or having some privilege)."
-- See https://www.postgresql.org/docs/11/infoschema-schemata.html
--
-- "The information schema is defined in the SQL standard and can
-- therefore be expected to be portable and remain stable"
-- See https://www.postgresql.org/docs/11/information-schema.html
inf_schema name := 'information_schema';
remote_table name := 'schemata';
local_schema name := @extschema@.__CDB_FS_Create_Schema(server_internal, inf_schema);
BEGIN
-- Import the foreign schemata table
IF NOT EXISTS (
SELECT * FROM pg_class
WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = local_schema)
AND relname = remote_table
) THEN
EXECUTE format('IMPORT FOREIGN SCHEMA %I LIMIT TO (%I) FROM SERVER %I INTO %I',
inf_schema, remote_table, server_internal, local_schema);
END IF;
-- Return the result we're interested in. Exclude toast and temp schemas
BEGIN
RETURN QUERY EXECUTE format('
SELECT schema_name::name AS remote_schema FROM %I.%I
WHERE schema_name NOT LIKE %s
ORDER BY remote_schema
', local_schema, remote_table, '''pg_%''');
EXCEPTION WHEN OTHERS THEN
RAISE EXCEPTION 'Not enough permissions to access the server "%"',
@extschema@.__CDB_FS_Extract_Server_Name(server_internal);
END;
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
--
-- List the names of the tables in a remote PG schema
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_List_Foreign_Tables_PG(server_internal name, remote_schema name)
RETURNS TABLE(remote_table name)
AS $func$
DECLARE
-- Import `tables` from the information schema
--
-- "The view tables contains all tables and views defined in the
-- current database. Only those tables and views are shown that
-- the current user has access to (by way of being the owner or
-- having some privilege)."
-- https://www.postgresql.org/docs/11/infoschema-tables.html
-- Create local target schema if it does not exists
inf_schema name := 'information_schema';
remote_table name := 'tables';
local_schema name := @extschema@.__CDB_FS_Create_Schema(server_internal, inf_schema);
BEGIN
-- Import the foreign `tables` if not done
IF NOT EXISTS (
SELECT * FROM pg_class
WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = local_schema)
AND relname = remote_table
) THEN
EXECUTE format('IMPORT FOREIGN SCHEMA %I LIMIT TO (%I) FROM SERVER %I INTO %I',
inf_schema, remote_table, server_internal, local_schema);
END IF;
-- Note: in this context, schema names are not to be quoted
RETURN QUERY EXECUTE format($q$
SELECT table_name::name AS remote_table FROM %I.%I WHERE table_schema = '%s' ORDER BY table_name
$q$, local_schema, remote_table, remote_schema);
END
$func$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
--
-- List the columns in a remote PG schema
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_List_Foreign_Columns_PG(server_internal name, remote_schema name)
RETURNS TABLE(table_name name, column_name name, column_type text)
AS $func$
DECLARE
-- Import `columns` from the information schema
--
-- "The view columns contains information about all table columns (or view columns)
-- in the database. System columns (oid, etc.) are not included. Only those columns
-- are shown that the current user has access to (by way of being the owner or having some privilege)."
-- https://www.postgresql.org/docs/11/infoschema-columns.html
-- Create local target schema if it does not exists
inf_schema name := 'information_schema';
remote_col_table name := 'columns';
local_schema name := @extschema@.__CDB_FS_Create_Schema(server_internal, inf_schema);
BEGIN
-- Import the foreign `columns` if not done
IF NOT EXISTS (
SELECT * FROM pg_class
WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = local_schema)
AND relname = remote_col_table
) THEN
EXECUTE format('IMPORT FOREIGN SCHEMA %I LIMIT TO (%I) FROM SERVER %I INTO %I',
inf_schema, remote_col_table, server_internal, local_schema);
END IF;
-- Note: in this context, schema names are not to be quoted
-- We join with the geometry columns to change the type `USER-DEFINED`
-- by its appropiate geometry and srid
RETURN QUERY EXECUTE format($q$
SELECT
a.table_name::name,
a.column_name::name,
COALESCE(b.column_type, a.data_type)::TEXT as column_type
FROM
%I.%I a
LEFT JOIN
@extschema@.__CDB_FS_List_Foreign_Geometry_Columns_PG('%s', '%s') b
ON a.table_name = b.table_name AND a.column_name = b.column_name
WHERE table_schema = '%s'
ORDER BY a.table_name, a.column_name $q$,
local_schema, remote_col_table,
server_internal, remote_schema,
remote_schema);
END
$func$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
--
-- List the geometry columns in a remote PG schema
--
CREATE OR REPLACE FUNCTION @extschema@.__CDB_FS_List_Foreign_Geometry_Columns_PG(server_internal name, remote_schema name, postgis_schema name DEFAULT 'public')
RETURNS TABLE(table_name name, column_name name, column_type text)
AS $func$
DECLARE
-- Import `geometry_columns` and `geography_columns` from the postgis schema
-- We assume that postgis is installed in the public schema
-- Create local target schema if it does not exists
remote_geometry_view name := 'geometry_columns';
remote_geography_view name := 'geography_columns';
local_schema name := @extschema@.__CDB_FS_Create_Schema(server_internal, postgis_schema);
BEGIN
-- Import the foreign `geometry_columns` and `geography_columns` if not done
IF NOT EXISTS (
SELECT * FROM pg_class
WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = local_schema)
AND relname = remote_geometry_view
) THEN
EXECUTE format('IMPORT FOREIGN SCHEMA %I LIMIT TO (%I, %I) FROM SERVER %I INTO %I',
postgis_schema, remote_geometry_view, remote_geography_view, server_internal, local_schema);
END IF;
BEGIN
-- Note: We return both the type and srid as the type
RETURN QUERY EXECUTE format($q$
SELECT
f_table_name::NAME as table_name,
f_geometry_column::NAME as column_name,
type::TEXT || ',' || srid::TEXT as column_type
FROM
(
SELECT * FROM %I.%I UNION ALL SELECT * FROM %I.%I
) _geo_views
WHERE f_table_schema = '%s'
$q$,
local_schema, remote_geometry_view,
local_schema, remote_geography_view,
remote_schema);
EXCEPTION WHEN OTHERS THEN
RAISE INFO 'Could not find Postgis installation in the remote "%" schema in server "%"',
postgis_schema, @extschema@.__CDB_FS_Extract_Server_Name(server_internal);
RETURN;
END;
END
$func$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
--------------------------------------------------------------------------------
-- Public functions
--------------------------------------------------------------------------------
--
-- List remote schemas in a federated server that the current user has access to.
--
CREATE OR REPLACE FUNCTION @extschema@.CDB_Federated_Server_List_Remote_Schemas(server TEXT)
RETURNS TABLE(remote_schema name)
AS $$
DECLARE
server_internal name := @extschema@.__CDB_FS_Generate_Server_Name(input_name => server, check_existence => true);
server_type name := @extschema@.__CDB_FS_server_type(server_internal);
BEGIN
CASE server_type
WHEN 'postgres_fdw' THEN
RETURN QUERY SELECT @extschema@.__CDB_FS_List_Foreign_Schemas_PG(server_internal);
ELSE
RAISE EXCEPTION 'Not implemented server type % for remote server %', server_type, server;
END CASE;
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
--
-- List remote tables in a federated server that the current user has access to.
-- For registered tables it returns also the associated configuration
--
CREATE OR REPLACE FUNCTION @extschema@.CDB_Federated_Server_List_Remote_Tables(server TEXT, remote_schema TEXT)
RETURNS TABLE(
registered boolean,
remote_table TEXT,
local_qualified_name TEXT,
id_column_name TEXT,
geom_column_name TEXT,
webmercator_column_name TEXT,
columns JSON
)
AS $$
DECLARE
server_internal name := @extschema@.__CDB_FS_Generate_Server_Name(input_name => server, check_existence => true);
server_type name := @extschema@.__CDB_FS_server_type(server_internal);
BEGIN
CASE server_type
WHEN 'postgres_fdw' THEN
RETURN QUERY
SELECT
coalesce(registered_tables.registered, false)::boolean as registered,
foreign_tables.remote_table::text as remote_table,
registered_tables.local_qualified_name as local_qualified_name,
registered_tables.id_column_name as id_column_name,
registered_tables.geom_column_name as geom_column_name,
registered_tables.webmercator_column_name as webmercator_column_name,
remote_columns.columns as columns
FROM
@extschema@.__CDB_FS_List_Foreign_Tables_PG(server_internal, remote_schema) foreign_tables
LEFT JOIN
@extschema@.__CDB_FS_List_Registered_Tables(server_internal, remote_schema) registered_tables
ON foreign_tables.remote_table = registered_tables.remote_table
LEFT JOIN
( -- Extract and group columns with their remote table
SELECT table_name,
json_agg(json_build_object('Name', column_name, 'Type', column_type)) as columns
FROM @extschema@.__CDB_FS_List_Foreign_Columns_PG(server_internal, remote_schema)
GROUP BY table_name
) remote_columns
ON foreign_tables.remote_table = remote_columns.table_name
ORDER BY foreign_tables.remote_table;
ELSE
RAISE EXCEPTION 'Not implemented server type % for remote server %', server_type, remote_server;
END CASE;
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE;
--
-- List the columns of a remote table in a federated server that the current user has access to.
--
CREATE OR REPLACE FUNCTION @extschema@.CDB_Federated_Server_List_Remote_Columns(
server TEXT,
remote_schema TEXT,
remote_table TEXT)
RETURNS TABLE(column_n name, column_t text)
AS $$
DECLARE
server_internal name := @extschema@.__CDB_FS_Generate_Server_Name(input_name => server, check_existence => true);
server_type name := @extschema@.__CDB_FS_server_type(server_internal);
BEGIN
IF remote_table IS NULL THEN
RAISE EXCEPTION 'Remote table name cannot be NULL';
END IF;
CASE server_type
WHEN 'postgres_fdw' THEN
RETURN QUERY
SELECT
column_name,
column_type
FROM @extschema@.__CDB_FS_List_Foreign_Columns_PG(server_internal, remote_schema)
WHERE table_name = remote_table
ORDER BY column_name;
ELSE
RAISE EXCEPTION 'Not implemented server type % for remote server %', server_type, remote_server;
END CASE;
END
$$
LANGUAGE PLPGSQL VOLATILE PARALLEL UNSAFE; | the_stack |
SET SQL_MODE = 'ALLOW_INVALID_DATES';
DROP TABLE IF EXISTS `unit_type`;
CREATE TABLE `unit_type`
(
`unit_type_id` INTEGER NOT NULL AUTO_INCREMENT,
`matcher_id` VARCHAR(32) NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`vendor_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`description` VARCHAR(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`protocol` VARCHAR(16) NOT NULL,
PRIMARY KEY (`unit_type_id`),
UNIQUE INDEX `uq_unit_type_name` (`unit_type_name`(64))
);
DROP TABLE IF EXISTS `unit_type_param`;
CREATE TABLE `unit_type_param`
(
`unit_type_param_id` INTEGER NOT NULL AUTO_INCREMENT,
`unit_type_id` INTEGER NOT NULL,
`name` VARCHAR(255) NOT NULL,
`flags` VARCHAR(32) NOT NULL,
PRIMARY KEY (`unit_type_param_id`),
UNIQUE INDEX `idx_u_t_p_unit_type_id_name` (`unit_type_id`, `name`(255)),
CONSTRAINT `fk_u_t_p_unit_type_id` FOREIGN KEY `fk_u_t_p_unit_type_id` (`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `unit_type_param_value`;
CREATE TABLE `unit_type_param_value`
(
`unit_type_param_id` INTEGER NOT NULL,
`value` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`priority` INTEGER NOT NULL,
`type` VARCHAR(32) NOT NULL DEFAULT 'enum',
PRIMARY KEY (`unit_type_param_id`, `value`),
CONSTRAINT `fk_unit_param_value_utpid` FOREIGN KEY `fk_unit_param_value_utpid` (`unit_type_param_id`)
REFERENCES `unit_type_param` (`unit_type_param_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `profile`;
CREATE TABLE `profile`
(
`profile_id` INTEGER NOT NULL AUTO_INCREMENT,
`unit_type_id` INTEGER NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
PRIMARY KEY (`profile_id`),
UNIQUE INDEX `idx_unit_type_id_profile_name` (`unit_type_id`, `profile_name`(64)),
CONSTRAINT `fk_profile_unit_type_id` FOREIGN KEY `fk_profile_unit_type_id` (`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `profile_param`;
CREATE TABLE `profile_param`
(
`profile_id` INTEGER NOT NULL,
`unit_type_param_id` INTEGER NOT NULL,
`value` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
PRIMARY KEY (`profile_id`, `unit_type_param_id`),
CONSTRAINT `fk_profile_param_profile_id` FOREIGN KEY `fk_profile_param_profile_id` (`profile_id`)
REFERENCES `profile` (`profile_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_profile_param_u_t_p_id` FOREIGN KEY `fk_profile_param_u_t_p_id` (`unit_type_param_id`)
REFERENCES `unit_type_param` (`unit_type_param_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `unit`;
CREATE TABLE `unit`
(
`unit_id` VARCHAR(64) NOT NULL,
`unit_type_id` INTEGER NOT NULL,
`profile_id` INTEGER NOT NULL,
PRIMARY KEY (`unit_id`),
INDEX `idx_unit_unit_type_profile` (`unit_type_id`, `profile_id`, `unit_id`),
INDEX `idx_unit_profile_unit_type` (`profile_id`, `unit_type_id`, `unit_id`),
CONSTRAINT `fk_unit_unit_type_id` FOREIGN KEY `fk_unit_unit_type_id` (`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_unit_profile_id` FOREIGN KEY `fk_unit_profile_id` (`profile_id`)
REFERENCES `profile` (`profile_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `unit_param`;
CREATE TABLE `unit_param`
(
`unit_id` VARCHAR(64) NOT NULL,
`unit_type_param_id` INTEGER NOT NULL,
`value` VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
PRIMARY KEY (`unit_id`, `unit_type_param_id`),
INDEX `idx_unit_param_type_id2` (`unit_type_param_id`, `value`),
INDEX `idx_unit_param_value` (`value`),
CONSTRAINT `fk_unit_param_unit_id` FOREIGN KEY `fk_unit_param_unit_id` (`unit_id`)
REFERENCES `unit` (`unit_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_unit_param_u_t_p_id` FOREIGN KEY `fk_unit_param_u_t_p_id` (`unit_type_param_id`)
REFERENCES `unit_type_param` (`unit_type_param_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `unit_param_session`;
CREATE TABLE `unit_param_session`
(
`unit_id` VARCHAR(64) NOT NULL,
`unit_type_param_id` INTEGER NOT NULL,
`value` VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
PRIMARY KEY (`unit_id`, `unit_type_param_id`),
CONSTRAINT `fk_unit_param_session_unit_id` FOREIGN KEY `fk_unit_param_session_unit_id` (`unit_id`)
REFERENCES `unit` (`unit_id`)
ON DELETE CASCADE
ON UPDATE NO ACTION,
CONSTRAINT `fk_unit_param_session_u_t_p_id` FOREIGN KEY `fk_unit_param_session_u_t_p_id` (`unit_type_param_id`)
REFERENCES `unit_type_param` (`unit_type_param_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `group_`;
CREATE TABLE `group_`
(
`group_id` INTEGER NOT NULL AUTO_INCREMENT,
`unit_type_id` INTEGER NOT NULL,
`group_name` VARCHAR(64) NOT NULL,
`description` VARCHAR(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`parent_group_id` INTEGER NULL,
`profile_id` INTEGER NULL,
`count` INTEGER NULL,
`time_param_id` INTEGER NULL,
`time_rolling_rule` VARCHAR(32) NULL,
PRIMARY KEY (`group_id`),
CONSTRAINT `fk_group__unit_type_id` FOREIGN KEY `fk_group__unit_type_id` (`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_group__group_id` FOREIGN KEY `fk_group__group_id` (`parent_group_id`)
REFERENCES `group_` (`group_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_group__profile_id` FOREIGN KEY `fk_group__profile_id` (`profile_id`)
REFERENCES `profile` (`profile_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_time_param_u_t_p_id` FOREIGN KEY `fk_time_param_u_t_p_id` (`time_param_id`)
REFERENCES `unit_type_param` (`unit_type_param_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `group_param`;
CREATE TABLE `group_param`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`group_id` INTEGER NOT NULL,
`unit_type_param_id` INTEGER NOT NULL,
`operator` VARCHAR(2) NOT NULL DEFAULT '=',
`data_type` VARCHAR(32) NOT NULL DEFAULT 'TEXT',
`value` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
PRIMARY KEY (`id`),
CONSTRAINT `fk_group_param_group_id` FOREIGN KEY `fk_group_param_group_id` (`group_id`)
REFERENCES `group_` (`group_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_group_param_u_t_p_id` FOREIGN KEY `fk_group_param_u_t_p_id` (`unit_type_param_id`)
REFERENCES `unit_type_param` (`unit_type_param_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `user_`;
CREATE TABLE `user_`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`username` VARCHAR(64) NOT NULL,
`secret` VARCHAR(64) NOT NULL,
`fullname` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`accesslist` VARCHAR(256) NOT NULL,
`is_admin` INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE INDEX `idx_username` (`username`(64))
);
DROP TABLE IF EXISTS `permission_`;
CREATE TABLE `permission_`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`user_id` INTEGER NOT NULL,
`unit_type_id` INTEGER NOT NULL,
`profile_id` INTEGER NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `idx_uid_utpid_pid` (`user_id`,`unit_type_id`,`profile_id`),
CONSTRAINT `fk_permission_user_id` FOREIGN KEY
`fk_permission_user_id`
(`user_id`)
REFERENCES `user_` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_permission_unit_type_id` FOREIGN KEY
`fk_permission_unit_type_id`
(`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `filestore`;
CREATE TABLE `filestore`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NOT NULL,
`unit_type_id` INTEGER NOT NULL,
`type` VARCHAR(64) NOT NULL DEFAULT 'SOFTWARE',
`description` VARCHAR(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`version` VARCHAR(64) NOT NULL,
`content` LONGBLOB NOT NULL,
`timestamp_` DATETIME NOT NULL,
`target_name` VARCHAR(128) NULL,
`owner` INTEGER NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `idx_utpid_t_st_v` (`unit_type_id`, `type`(64), `version`(64)),
UNIQUE INDEX `idx_filestore_utpid_name` (`unit_type_id`, `name`(64)),
CONSTRAINT `fk_filestore_unit_type_id` FOREIGN KEY `fk_filestore_unit_type_id` (`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_filestore_owner` FOREIGN KEY `fk_filestore_owner` (`owner`)
REFERENCES `user_` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `syslog_event`;
CREATE TABLE `syslog_event`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`syslog_event_id` INTEGER NOT NULL,
`syslog_event_name` VARCHAR(64) NOT NULL,
`unit_type_id` INTEGER NOT NULL,
`group_id` INTEGER NULL,
`expression` VARCHAR(64) NOT NULL DEFAULT 'Specify an expression',
`store_policy` VARCHAR(16) NOT NULL DEFAULT 'STORE',
`filestore_id` INTEGER,
`description` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci,
`delete_limit` INTEGER,
PRIMARY KEY (`id`),
CONSTRAINT `fk_syslogevent__unit_type_id` FOREIGN KEY `fk_syslogevent__unit_type_id` (`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_syslogevent__group_id` FOREIGN KEY `fk_syslogevent__group_id` (`group_id`)
REFERENCES `group_` (`group_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_syslogevent_filestore_id` FOREIGN KEY `fk_syslogevent_filestore_id` (`filestore_id`)
REFERENCES `filestore` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
UNIQUE INDEX `idx_syslog_event_id_unit_type_name` (`syslog_event_id`, `unit_type_id`)
);
DROP TABLE IF EXISTS `job`;
CREATE TABLE `job`
(
`job_id` INTEGER NOT NULL AUTO_INCREMENT,
`job_name` VARCHAR(64) NOT NULL,
`job_type` VARCHAR(32) NOT NULL,
`description` VARCHAR(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`group_id` INTEGER NOT NULL,
`unconfirmed_timeout` INTEGER NOT NULL,
`stop_rules` VARCHAR(255) NULL,
`status` VARCHAR(32) NOT NULL,
`completed_no_failure` INTEGER NOT NULL,
`completed_had_failure` INTEGER NOT NULL,
`confirmed_failed` INTEGER NOT NULL,
`unconfirmed_failed` INTEGER NOT NULL,
`start_timestamp` DATETIME NULL,
`end_timestamp` DATETIME NULL,
`firmware_id` INTEGER NULL,
`job_id_dependency` INTEGER NULL,
`profile_id` INTEGER NULL,
`repeat_count` INTEGER NULL,
`repeat_interval` INTEGER NULL,
PRIMARY KEY (`job_id`),
CONSTRAINT `fk_job_group_id` FOREIGN KEY `fk_job_group_id` (`group_id`)
REFERENCES `group_` (`group_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_job_firmware_id` FOREIGN KEY `fk_job_filestore_id` (`firmware_id`)
REFERENCES `filestore` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_job_job_id` FOREIGN KEY `fk_job_job_id` (`job_id_dependency`)
REFERENCES `job` (`job_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_job_profile_id` FOREIGN KEY `fk_job_profile_id` (`profile_id`)
REFERENCES `profile` (`profile_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `job_param`;
CREATE TABLE `job_param`
(
`job_id` INTEGER NOT NULL,
`unit_id` VARCHAR(64) NOT NULL,
`unit_type_param_id` INTEGER NOT NULL,
`value` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
PRIMARY KEY (`job_id`, `unit_id`, `unit_type_param_id`),
CONSTRAINT `fk_job_param_job_id` FOREIGN KEY `fk_job_param_job_id` (`job_id`)
REFERENCES `job` (`job_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_job_param_u_t_p_id` FOREIGN KEY `fk_job_param_u_t_p_id` (`unit_type_param_id`)
REFERENCES `unit_type_param` (`unit_type_param_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `unit_job`;
CREATE TABLE `unit_job`
(
`unit_id` VARCHAR(64) NOT NULL,
`job_id` INTEGER NOT NULL,
`start_timestamp` DATETIME NOT NULL,
`end_timestamp` DATETIME NULL,
`status` VARCHAR(32) NOT NULL,
`processed` INTEGER NULL DEFAULT '0',
`confirmed` INTEGER NULL DEFAULT '0',
`unconfirmed` INTEGER NULL DEFAULT '0',
PRIMARY KEY (`unit_id`, `job_id`),
CONSTRAINT `fk_unit_job_unit_id` FOREIGN KEY `fk_unit_job_unit_id` (`unit_id`)
REFERENCES `unit` (`unit_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_unit_job_job_id` FOREIGN KEY `fk_unit_job_job_id` (`job_id`)
REFERENCES `job` (`job_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
INDEX `idx_unit_job_1` (`status`(32), `start_timestamp`),
INDEX `idx_unit_job_2` (`processed`)
);
DROP TABLE IF EXISTS `heartbeat`;
CREATE TABLE `heartbeat`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NOT NULL,
`unit_type_id` INTEGER NOT NULL,
`heartbeat_expression` VARCHAR(64) NOT NULL,
`heartbeat_group_id` INTEGER NOT NULL,
`heartbeat_timeout_hour` INTEGER NOT NULL DEFAULT 1,
PRIMARY KEY (`id`),
CONSTRAINT `fk_hb_group_id` FOREIGN KEY `fk_hb_group_id` (`heartbeat_group_id`)
REFERENCES `group_` (`group_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_hb_unit_type_id` FOREIGN KEY `fk_hb_unit_type_id` (`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `trigger_`;
CREATE TABLE `trigger_`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`description` VARCHAR(1024),
-- BASIC or COMPOSITE (0 or 1)
`trigger_type` INTEGER NOT NULL DEFAULT 0,
-- ALARM, REPORT or SILENT (0-2)
`notify_type` INTEGER NOT NULL DEFAULT 0,
-- 0 or 1
`active` INTEGER NOT NULL DEFAULT 0,
`unit_type_id` INTEGER NOT NULL,
`group_id` INTEGER,
-- 15 to 120 (minutes)
`eval_period_minutes` INTEGER NOT NULL,
-- 1 to 168 (hours)
`notify_interval_hours` INTEGER NULL,
-- REFERS TO FILESTORE.ID
`filestore_id` INTEGER,
-- REFERS TO ID
`parent_trigger_id` INTEGER,
`to_list` VARCHAR(512),
-- JUST FOR BASIC
`syslog_event_id` INTEGER,
`no_events` INTEGER,
`no_events_pr_unit` INTEGER,
`no_units` INTEGER,
PRIMARY KEY (`id`),
UNIQUE INDEX `idx_trigger_unit_type_id_name` (`unit_type_id`, `name`(255)),
CONSTRAINT `fk_trigger_unit_type_id` FOREIGN KEY `fk_trigger_unit_type_id` (`unit_type_id`)
REFERENCES `unit_type` (`unit_type_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_trigger_group_id` FOREIGN KEY `fk_trigger_group_id` (`group_id`)
REFERENCES `group_` (`group_id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_trigger_filestore_id` FOREIGN KEY `fk_trigger_filestore_id` (`filestore_id`)
REFERENCES `filestore` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_trigger_parent_id` FOREIGN KEY `fk_trigger_parent_id` (`parent_trigger_id`)
REFERENCES `trigger_` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_trigger_syslog_event_id` FOREIGN KEY `fk_trigger_syslog_event_id` (`syslog_event_id`)
REFERENCES `syslog_event` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `trigger_event`;
CREATE TABLE `trigger_event`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`timestamp_` DATETIME NOT NULL,
`trigger_id` INTEGER NOT NULL,
`unit_id` VARCHAR(64) NOT NULL, -- We skip foreign key referenec on unit -> increase performance
PRIMARY KEY (`id`),
CONSTRAINT `fk_trigger_event_trigger_id` FOREIGN KEY `fk_trigger_event_trigger_id` (`trigger_id`)
REFERENCES `trigger_` (`id`)
ON DELETE CASCADE
ON UPDATE NO ACTION
);
DROP TABLE IF EXISTS `trigger_release`;
CREATE TABLE `trigger_release`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`trigger_id` INTEGER NOT NULL,
`no_events` INTEGER NULL,
`no_events_pr_unit` INTEGER NULL,
`no_units` INTEGER NULL,
`first_event_timestamp` DATETIME NOT NULL,
`release_timestamp` DATETIME NOT NULL,
`sent_timestamp` DATETIME,
PRIMARY KEY (`id`),
CONSTRAINT `fk_trigger_release_trigger_id` FOREIGN KEY `fk_trigger_release_trigger_id` (`trigger_id`)
REFERENCES `trigger_` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION
);
-- Tables with no or few foreign keys
DROP TABLE IF EXISTS `certificate`;
CREATE TABLE `certificate`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NOT NULL,
`certificate` VARCHAR(256) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `idx_name` (`name`(64))
);
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`type` VARCHAR(64) NOT NULL,
`sender` VARCHAR(64) NOT NULL,
`receiver` VARCHAR(64),
`object_type` VARCHAR(64),
`object_id` VARCHAR(64),
`timestamp_` DATETIME NOT NULL,
`content` VARCHAR(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
PRIMARY KEY (`id`)
);
DROP TABLE IF EXISTS `monitor_event`;
CREATE TABLE `monitor_event`
(
`event_id` BIGINT NOT NULL AUTO_INCREMENT,
`module_name` VARCHAR(32) NOT NULL,
`module_key` VARCHAR(32) NOT NULL,
`module_state` INTEGER NOT NULL,
`message` VARCHAR(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
`starttime` TIMESTAMP NOT NULL,
`endtime` TIMESTAMP NOT NULL,
`lastchecked` TIMESTAMP NOT NULL,
`url` VARCHAR(255),
PRIMARY KEY (`event_id`),
CONSTRAINT NameAndKey UNIQUE (module_name, module_key)
);
DROP TABLE IF EXISTS `script_execution`;
CREATE TABLE `script_execution`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`unit_type_id` INTEGER NOT NULL, -- SET BY REQUEST-CLIENT
`filestore_id` INTEGER NOT NULL, -- SET BY REQUEST-CLIENT
`arguments` VARCHAR(1024), -- SET BY REQUEST-CLIENT
`request_timestamp` DATETIME NOT NULL, -- SET BY REQUEST-CLIENT
`request_id` VARCHAR(32), -- SET BY REQUEST-CLIENT
`start_timestamp` DATETIME, -- SET BY SSD
`end_timestamp` DATETIME, -- SET BY SSD
`exit_status` INTEGER, -- SET BY SSD (0=SUCCESS, 1=ERROR)
`error_message` VARCHAR(1024), -- SET BY SSD IF NECESSARY
PRIMARY KEY (`id`)
);
DROP TABLE IF EXISTS `syslog`;
CREATE TABLE `syslog`
(
`syslog_id` BIGINT NOT NULL AUTO_INCREMENT,
`collector_timestamp` DATETIME NOT NULL,
`syslog_event_id` INTEGER NOT NULL,
`facility` INTEGER NOT NULL,
`facility_version` VARCHAR(48) NULL,
`severity` INTEGER NOT NULL,
`device_timestamp` VARCHAR(32) NULL,
`hostname` VARCHAR(32) NULL,
`tag` VARCHAR(32) NULL,
`content` VARCHAR(1024) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`flags` VARCHAR(32) NULL,
`ipaddress` VARCHAR(32) NULL,
`unit_id` VARCHAR(64) NULL,
`profile_name` VARCHAR(64) NULL,
`unit_type_name` VARCHAR(64) NULL,
`user_id` VARCHAR(32) NULL,
PRIMARY KEY (`syslog_id`),
INDEX `idx_syslog_coll_tms` (`collector_timestamp` ASC, `severity` ASC, `syslog_event_id` ASC),
INDEX `idx_syslog_unit_id_coll_tms` (`unit_id` ASC, `collector_timestamp` ASC)
);
DROP TABLE IF EXISTS `report_unit`;
CREATE TABLE `report_unit`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
`software_version` VARCHAR(64) NOT NULL,
`status` VARCHAR(32) NOT NULL,
`unit_count` INTEGER NOT NULL,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `profile_name`, `software_version`, `status`)
);
DROP TABLE IF EXISTS `report_group`;
CREATE TABLE `report_group`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`group_name` VARCHAR(64) NOT NULL,
`unit_count` INTEGER NOT NULL,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `group_name`)
);
DROP TABLE IF EXISTS `report_job`;
CREATE TABLE `report_job`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`job_name` VARCHAR(64) NOT NULL,
`group_name` VARCHAR(64) NOT NULL,
`group_size` INTEGER NOT NULL,
`completed` INTEGER NOT NULL,
`confirmed_failed` INTEGER NOT NULL,
`unconfirmed_failed` INTEGER NOT NULL,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `job_name`)
);
DROP TABLE IF EXISTS `report_syslog`;
CREATE TABLE `report_syslog`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
`severity` VARCHAR(16) NOT NULL,
`syslog_event_id` INTEGER NOT NULL,
`facility` VARCHAR(32) NOT NULL,
`unit_count` INTEGER NOT NULL,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `profile_name`, `severity`, `syslog_event_id`, `facility`)
);
DROP TABLE IF EXISTS `report_prov`;
CREATE TABLE `report_prov`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
`software_version` VARCHAR(64) NOT NULL,
`prov_output` VARCHAR(16) NOT NULL,
`ok_count` INTEGER,
`rescheduled_count` INTEGER,
`error_count` INTEGER,
`missing_count` INTEGER,
`session_length_avg` INTEGER,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `profile_name`, `software_version`, `prov_output`)
);
DROP TABLE IF EXISTS `report_voip`;
CREATE TABLE `report_voip`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
`software_version` VARCHAR(64) NOT NULL,
`line` INTEGER NOT NULL,
`mos_avg` INTEGER,
`jitter_avg` INTEGER,
`jitter_max` INTEGER,
`percent_loss_avg` INTEGER,
`call_length_avg` INTEGER,
`call_length_total` INTEGER NOT NULL,
`incoming_call_count` INTEGER NOT NULL,
`outgoing_call_count` INTEGER NOT NULL,
`outgoing_call_failed_count` INTEGER NOT NULL,
`aborted_call_count` INTEGER NOT NULL,
`no_sip_service_time` INTEGER NOT NULL,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `profile_name`, `software_version`, `line`)
);
DROP TABLE IF EXISTS `report_voip_tr`;
CREATE TABLE `report_voip_tr`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
`software_version` VARCHAR(64) NOT NULL,
`line` VARCHAR(16) NOT NULL,
`line_status` VARCHAR(64) NOT NULL,
`overruns_count` INTEGER NOT NULL,
`underruns_count` INTEGER NOT NULL,
`percent_loss_avg` INTEGER,
`call_length_avg` INTEGER,
`call_length_total` INTEGER NOT NULL,
`incoming_call_count` INTEGER NOT NULL,
`outgoing_call_count` INTEGER NOT NULL,
`outgoing_call_failed_count` INTEGER NOT NULL,
`aborted_call_count` INTEGER NOT NULL,
`no_sip_service_time` INTEGER NOT NULL,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `profile_name`, `software_version`, `line`, `line_status`)
);
DROP TABLE IF EXISTS `report_hw`;
CREATE TABLE `report_hw`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
`software_version` VARCHAR(64) NOT NULL,
`boot_count` INTEGER NOT NULL,
`boot_watchdog_count` INTEGER NOT NULL,
`boot_misc_count` INTEGER NOT NULL,
`boot_power_count` INTEGER NOT NULL,
`boot_reset_count` INTEGER NOT NULL,
`boot_prov_count` INTEGER NOT NULL,
`boot_prov_sw_count` INTEGER NOT NULL,
`boot_prov_conf_count` INTEGER NOT NULL,
`boot_prov_boot_count` INTEGER NOT NULL,
`boot_user_count` INTEGER NOT NULL,
`mem_heap_ddr_pool_avg` INTEGER,
`mem_heap_ddr_current_avg` INTEGER,
`mem_heap_ddr_low_avg` INTEGER,
`mem_heap_ocm_pool_avg` INTEGER,
`mem_heap_ocm_current_avg` INTEGER,
`mem_heap_ocm_low_avg` INTEGER,
`mem_np_ddr_pool_avg` INTEGER,
`mem_np_ddr_current_avg` INTEGER,
`mem_np_ddr_low_avg` INTEGER,
`mem_np_ocm_pool_avg` INTEGER,
`mem_np_ocm_current_avg` INTEGER,
`mem_np_ocm_low_avg` INTEGER,
`cpe_uptime_avg` INTEGER,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `profile_name`, `software_version`)
);
DROP TABLE IF EXISTS `report_hw_tr`;
CREATE TABLE `report_hw_tr`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
`software_version` VARCHAR(64) NOT NULL,
`cpe_uptime_avg` INTEGER,
`memory_total_avg` INTEGER,
`memory_free_avg` INTEGER,
`cpu_usage_avg` INTEGER,
`process_count_avg` INTEGER,
`temperature_now_avg` INTEGER,
`temperature_max_avg` INTEGER,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `profile_name`, `software_version`)
);
DROP TABLE IF EXISTS `report_gateway_tr`;
CREATE TABLE `report_gateway_tr`
(
`timestamp_` DATETIME NOT NULL,
`period_type` INTEGER NOT NULL,
`unit_type_name` VARCHAR(64) NOT NULL,
`profile_name` VARCHAR(64) NOT NULL,
`software_version` VARCHAR(64) NOT NULL,
`ping_success_count_avg` INTEGER,
`ping_failure_count_avg` INTEGER,
`ping_response_time_avg` INTEGER,
`download_speed_avg` INTEGER,
`upload_speed_avg` INTEGER,
`wan_uptime_avg` INTEGER,
PRIMARY KEY (`timestamp_`, `period_type`, `unit_type_name`, `profile_name`, `software_version`)
);
-- Setup initial admin user with default password "freeacs"
INSERT INTO user_ (id, username, secret, fullname, accesslist, is_admin)
VALUES (1, 'admin', '4E9BA006A68A8767D65B3761E038CF9040C54A00', 'Admin user', 'Admin', 1); | the_stack |
-- 2019-10-17T13:32:41.243Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Parent_Column_ID=NULL,Updated=TO_TIMESTAMP('2019-10-17 16:32:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540707
;
-- 2019-10-17T13:33:55.114Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=NULL,Updated=TO_TIMESTAMP('2019-10-17 16:33:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=393
;
-- 2019-10-17T13:34:04.286Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=NULL,Updated=TO_TIMESTAMP('2019-10-17 16:34:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=392
;
-- 2019-10-17T13:34:24.669Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=194,Updated=TO_TIMESTAMP('2019-10-17 16:34:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=392
;
-- 2019-10-17T13:34:31.197Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=194,Updated=TO_TIMESTAMP('2019-10-17 16:34:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=393
;
-- 2019-10-17T13:35:22.797Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=NULL,Updated=TO_TIMESTAMP('2019-10-17 16:35:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=393
;
-- 2019-10-17T13:35:29.005Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=NULL,Updated=TO_TIMESTAMP('2019-10-17 16:35:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=392
;
-- 2019-10-17T13:39:42.737Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsKey='Y', IsUpdateable='N',Updated=TO_TIMESTAMP('2019-10-17 16:39:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=552818
;
-- 2019-10-17T13:52:03.478Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Column_ID=NULL, AD_Element_ID=1382, AD_Table_ID=393, CommitWarning=NULL, Description='Position auf einem Bankauszug zu dieser Bank', Help='Die "Auszugs-Position" bezeichnet eine eindeutige Transaktion (Einzahlung, Auszahlung, Auslage/Gebühr) für den definierten Zeitraum bei dieser Bank.', InternalName='C_BankStatementLine', Name='Auszugs-Position',Updated=TO_TIMESTAMP('2019-10-17 16:52:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540707
;
-- 2019-10-17T13:52:03.506Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=4937, Description='Zahlung', Help='Bei einer Zahlung handelt es sich um einen Zahlungseingang oder Zahlungsausgang (Bar, Bank, Kreditkarte).', Name='Zahlung',Updated=TO_TIMESTAMP('2019-10-17 16:52:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556403
;
-- 2019-10-17T13:52:03.545Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1384)
;
-- 2019-10-17T13:52:03.573Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556403
;
-- 2019-10-17T13:52:03.576Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556403)
;
-- 2019-10-17T13:52:03.591Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=4929, Description='Der Eintrag ist im System aktiv', Help='Es gibt zwei Möglichkeiten, einen Datensatz nicht mehr verfügbar zu machen: einer ist, ihn zu löschen; der andere, ihn zu deaktivieren. Ein deaktivierter Eintrag ist nicht mehr für eine Auswahl verfügbar, aber verfügbar für die Verwendung in Berichten. Es gibt zwei Gründe, Datensätze zu deaktivieren und nicht zu löschen: (1) Das System braucht den Datensatz für Revisionszwecke. (2) Der Datensatz wird von anderen Datensätzen referenziert. Z.B. können Sie keinen Geschäftspartner löschen, wenn es Rechnungen für diesen Geschäftspartner gibt. Sie deaktivieren den Geschäftspartner und verhindern, dass dieser Eintrag in zukünftigen Vorgängen verwendet wird.', Name='Aktiv',Updated=TO_TIMESTAMP('2019-10-17 16:52:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556412
;
-- 2019-10-17T13:52:03.592Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(348)
;
-- 2019-10-17T13:52:04.199Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556412
;
-- 2019-10-17T13:52:04.200Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556412)
;
-- 2019-10-17T13:52:04.211Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=4928, Description='Organisatorische Einheit des Mandanten', Help='Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.', Name='Sektion',Updated=TO_TIMESTAMP('2019-10-17 16:52:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556411
;
-- 2019-10-17T13:52:04.212Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(113)
;
-- 2019-10-17T13:52:04.574Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556411
;
-- 2019-10-17T13:52:04.574Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556411)
;
-- 2019-10-17T13:52:04.581Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=4927, Description='Mandant für diese Installation.', Help='Ein Mandant ist eine Firma oder eine juristische Person. Sie können keine Daten über Mandanten hinweg verwenden. .', Name='Mandant',Updated=TO_TIMESTAMP('2019-10-17 16:52:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556410
;
-- 2019-10-17T13:52:04.582Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(102)
;
-- 2019-10-17T13:52:05.170Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556410
;
-- 2019-10-17T13:52:05.171Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556410)
;
-- 2019-10-17T13:52:05.180Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=54669, Description='Calculated amount of discount', Help='The Discount Amount indicates the discount amount for a document or line.', Name='Skonto',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556395
;
-- 2019-10-17T13:52:05.181Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1395)
;
-- 2019-10-17T13:52:05.185Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556395
;
-- 2019-10-17T13:52:05.186Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556395)
;
-- 2019-10-17T13:52:05.191Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=54670, Description='Amount to write-off', Help='The Write Off Amount indicates the amount to be written off as uncollectible.', Name='Write-off Amount',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556396
;
-- 2019-10-17T13:52:05.192Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1450)
;
-- 2019-10-17T13:52:05.197Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556396
;
-- 2019-10-17T13:52:05.197Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556396)
;
-- 2019-10-17T13:52:05.204Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=54671, Description='Over-Payment (unallocated) or Under-Payment (partial payment)', Help='Overpayments (negative) are unallocated amounts and allow you to receive money for more than the particular invoice.
Underpayments (positive) is a partial payment for the invoice. You do not write off the unpaid amount.', Name='Over/Under Payment',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556397
;
-- 2019-10-17T13:52:05.205Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1818)
;
-- 2019-10-17T13:52:05.215Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556397
;
-- 2019-10-17T13:52:05.215Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556397)
;
-- 2019-10-17T13:52:05.222Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=54672, Description='Over-Payment (unallocated) or Under-Payment (partial payment) Amount', Help='Overpayments (negative) are unallocated amounts and allow you to receive money for more than the particular invoice.
Underpayments (positive) is a partial payment for the invoice. You do not write off the unpaid amount.', Name='Over/Under Payment',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556398
;
-- 2019-10-17T13:52:05.223Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1819)
;
-- 2019-10-17T13:52:05.226Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556398
;
-- 2019-10-17T13:52:05.226Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556398)
;
-- 2019-10-17T13:52:05.231Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=10780, Description='Bezeichnet einen Geschäftspartner', Help='Ein Geschäftspartner ist jemand, mit dem Sie interagieren. Dies kann Lieferanten, Kunden, Mitarbeiter oder Handelsvertreter umfassen.', Name='Geschäftspartner',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556407
;
-- 2019-10-17T13:52:05.232Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1001232)
;
-- 2019-10-17T13:52:05.234Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556407
;
-- 2019-10-17T13:52:05.235Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556407)
;
-- 2019-10-17T13:52:05.241Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=5219, Description='Einzelne Zeile in dem Dokument', Help='Indicates the unique line for a document. It will also control the display order of the lines within a document.', Name='Zeile Nr.',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556406
;
-- 2019-10-17T13:52:05.243Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(439)
;
-- 2019-10-17T13:52:05.256Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556406
;
-- 2019-10-17T13:52:05.256Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556406)
;
-- 2019-10-17T13:52:05.262Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=61508, Description=NULL, Help=NULL, Name='Linked Statement Line',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556405
;
-- 2019-10-17T13:52:05.263Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(55172)
;
-- 2019-10-17T13:52:05.265Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556405
;
-- 2019-10-17T13:52:05.266Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556405)
;
-- 2019-10-17T13:52:05.271Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=61507, Description='Cashbook/Bank account To', Help=NULL, Name='Cashbook/Bank account To',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556404
;
-- 2019-10-17T13:52:05.271Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(542687)
;
-- 2019-10-17T13:52:05.273Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556404
;
-- 2019-10-17T13:52:05.274Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556404)
;
-- 2019-10-17T13:52:05.279Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=4934, Description='Bank Statement of account', Help='The Bank Statement identifies a unique Bank Statement for a defined time period. The statement defines all transactions that occurred', Name='Bankauszug',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556391
;
-- 2019-10-17T13:52:05.280Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1381)
;
-- 2019-10-17T13:52:05.283Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556391
;
-- 2019-10-17T13:52:05.284Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556391)
;
-- 2019-10-17T13:52:05.289Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=4926, Description='Position auf einem Bankauszug zu dieser Bank', Help='Die "Auszugs-Position" bezeichnet eine eindeutige Transaktion (Einzahlung, Auszahlung, Auslage/Gebühr) für den definierten Zeitraum bei dieser Bank.', Name='Auszugs-Position',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556392
;
-- 2019-10-17T13:52:05.290Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1382)
;
-- 2019-10-17T13:52:05.293Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556392
;
-- 2019-10-17T13:52:05.294Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556392)
;
-- 2019-10-17T13:52:05.456Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541180
;
-- 2019-10-17T13:52:05.457Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556393
;
-- 2019-10-17T13:52:05.458Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=556393
;
-- 2019-10-17T13:52:05.460Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=556393
;
-- 2019-10-17T13:52:05.467Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=5216, Description='Accounting Date', Help='The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.', Name='Buchungsdatum',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556400
;
-- 2019-10-17T13:52:05.468Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(263)
;
-- 2019-10-17T13:52:05.473Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556400
;
-- 2019-10-17T13:52:05.474Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556400)
;
-- 2019-10-17T13:52:05.481Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=5222, Description='Date when money is available', Help='The Effective Date indicates the date that money is available from the bank.', Name='Effective date',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556401
;
-- 2019-10-17T13:52:05.482Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1487)
;
-- 2019-10-17T13:52:05.484Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556401
;
-- 2019-10-17T13:52:05.485Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556401)
;
-- 2019-10-17T13:52:05.492Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=5221, Description='Betrag einer Transaktion', Help='"Bewegungs-Betrag" gibt den Betrag für einen einzelnen Vorgang an.', Name='Bewegungs-Betrag',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556394
;
-- 2019-10-17T13:52:05.493Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1136)
;
-- 2019-10-17T13:52:05.495Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556394
;
-- 2019-10-17T13:52:05.496Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556394)
;
-- 2019-10-17T13:52:05.502Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=5217, Description='Die Währung für diesen Eintrag', Help='Bezeichnet die auf Dokumenten oder Berichten verwendete Währung', Name='Währung',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556399
;
-- 2019-10-17T13:52:05.503Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(193)
;
-- 2019-10-17T13:52:05.586Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556399
;
-- 2019-10-17T13:52:05.587Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556399)
;
-- 2019-10-17T13:52:05.593Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=10779, Description='Invoice Identifier', Help='The Invoice Document.', Name='Rechnung',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556402
;
-- 2019-10-17T13:52:05.594Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1008)
;
-- 2019-10-17T13:52:05.606Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556402
;
-- 2019-10-17T13:52:05.607Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556402)
;
-- 2019-10-17T13:52:05.614Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=8986, Description='Ihre Kunden- oder Lieferantennummer beim Geschäftspartner', Help='Die "Referenznummer" kann auf Bestellungen und Rechnungen gedruckt werden um Ihre Dokumente beim Geschäftspartner einfacher zuordnen zu können.', Name='Referenznummer',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556409
;
-- 2019-10-17T13:52:05.617Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(540)
;
-- 2019-10-17T13:52:05.625Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556409
;
-- 2019-10-17T13:52:05.625Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556409)
;
-- 2019-10-17T13:52:05.632Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=12463, Description='Checkbox sagt aus, ob der Beleg verarbeitet wurde. ', Help='Verarbeitete Belege dürfen in der Regel nich mehr geändert werden.', Name='Verarbeitet',Updated=TO_TIMESTAMP('2019-10-17 16:52:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556408
;
-- 2019-10-17T13:52:05.633Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1000173)
;
-- 2019-10-17T13:52:05.634Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556408
;
-- 2019-10-17T13:52:05.634Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556408)
;
-- 2019-10-17T13:52:05.637Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_tab_translation_from_ad_element(1382)
;
-- 2019-10-17T13:52:05.643Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Tab(540707)
;
-- 2019-10-17T13:52:26.947Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Column_ID=4937,Updated=TO_TIMESTAMP('2019-10-17 16:52:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540707
;
-- 2019-10-17T14:00:00.789Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET IsSOTrx='N',Updated=TO_TIMESTAMP('2019-10-17 17:00:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=540722
;
-- 2019-10-17T14:00:26.138Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=194, PO_Window_ID=540722,Updated=TO_TIMESTAMP('2019-10-17 17:00:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=392
;
-- 2019-10-17T14:00:39.749Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET AD_Window_ID=194, PO_Window_ID=540722,Updated=TO_TIMESTAMP('2019-10-17 17:00:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=393
;
-- 2019-10-17T14:04:07.618Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Column_ID=NULL, AD_Element_ID=543988, AD_Table_ID=540687, CommitWarning=NULL, Description=NULL, Help=NULL, InternalName='C_BankStatementLine_v1', Name='Validation Rule Depends On',Updated=TO_TIMESTAMP('2019-10-17 17:04:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540707
;
-- 2019-10-17T14:04:07.638Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552821, Description='Calculated amount of discount', Help='The Discount Amount indicates the discount amount for a document or line.', Name='Skonto',Updated=TO_TIMESTAMP('2019-10-17 17:04:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556395
;
-- 2019-10-17T14:04:07.642Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1395)
;
-- 2019-10-17T14:04:07.651Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556395
;
-- 2019-10-17T14:04:07.654Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556395)
;
-- 2019-10-17T14:04:07.666Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552836, Description='Mandant für diese Installation.', Help='Ein Mandant ist eine Firma oder eine juristische Person. Sie können keine Daten über Mandanten hinweg verwenden. .', Name='Mandant',Updated=TO_TIMESTAMP('2019-10-17 17:04:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556410
;
-- 2019-10-17T14:04:07.667Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(102)
;
-- 2019-10-17T14:04:08.066Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556410
;
-- 2019-10-17T14:04:08.067Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556410)
;
-- 2019-10-17T14:04:08.078Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552837, Description='Organisatorische Einheit des Mandanten', Help='Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.', Name='Sektion',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556411
;
-- 2019-10-17T14:04:08.079Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(113)
;
-- 2019-10-17T14:04:08.282Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556411
;
-- 2019-10-17T14:04:08.283Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556411)
;
-- 2019-10-17T14:04:08.289Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552842, Description='Der Eintrag ist im System aktiv', Help='Es gibt zwei Möglichkeiten, einen Datensatz nicht mehr verfügbar zu machen: einer ist, ihn zu löschen; der andere, ihn zu deaktivieren. Ein deaktivierter Eintrag ist nicht mehr für eine Auswahl verfügbar, aber verfügbar für die Verwendung in Berichten. Es gibt zwei Gründe, Datensätze zu deaktivieren und nicht zu löschen: (1) Das System braucht den Datensatz für Revisionszwecke. (2) Der Datensatz wird von anderen Datensätzen referenziert. Z.B. können Sie keinen Geschäftspartner löschen, wenn es Rechnungen für diesen Geschäftspartner gibt. Sie deaktivieren den Geschäftspartner und verhindern, dass dieser Eintrag in zukünftigen Vorgängen verwendet wird.', Name='Aktiv',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556412
;
-- 2019-10-17T14:04:08.290Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(348)
;
-- 2019-10-17T14:04:08.483Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556412
;
-- 2019-10-17T14:04:08.483Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556412)
;
-- 2019-10-17T14:04:08.489Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552833, Description='Bezeichnet einen Geschäftspartner', Help='Ein Geschäftspartner ist jemand, mit dem Sie interagieren. Dies kann Lieferanten, Kunden, Mitarbeiter oder Handelsvertreter umfassen.', Name='Geschäftspartner',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556407
;
-- 2019-10-17T14:04:08.490Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1001232)
;
-- 2019-10-17T14:04:08.492Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556407
;
-- 2019-10-17T14:04:08.493Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556407)
;
-- 2019-10-17T14:04:08.498Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552829, Description='Zahlung', Help='Bei einer Zahlung handelt es sich um einen Zahlungseingang oder Zahlungsausgang (Bar, Bank, Kreditkarte).', Name='Zahlung',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556403
;
-- 2019-10-17T14:04:08.499Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1384)
;
-- 2019-10-17T14:04:08.508Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556403
;
-- 2019-10-17T14:04:08.509Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556403)
;
-- 2019-10-17T14:04:08.516Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552831, Description=NULL, Help=NULL, Name='Linked Statement Line',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556405
;
-- 2019-10-17T14:04:08.516Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(55172)
;
-- 2019-10-17T14:04:08.518Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556405
;
-- 2019-10-17T14:04:08.519Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556405)
;
-- 2019-10-17T14:04:08.524Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552830, Description='Cashbook/Bank account To', Help=NULL, Name='Cashbook/Bank account To',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556404
;
-- 2019-10-17T14:04:08.525Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(542687)
;
-- 2019-10-17T14:04:08.526Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556404
;
-- 2019-10-17T14:04:08.527Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556404)
;
-- 2019-10-17T14:04:08.532Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552832, Description='Einzelne Zeile in dem Dokument', Help='Indicates the unique line for a document. It will also control the display order of the lines within a document.', Name='Zeile Nr.',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556406
;
-- 2019-10-17T14:04:08.533Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(439)
;
-- 2019-10-17T14:04:08.538Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556406
;
-- 2019-10-17T14:04:08.538Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556406)
;
-- 2019-10-17T14:04:08.544Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552824, Description='Over-Payment (unallocated) or Under-Payment (partial payment) Amount', Help='Overpayments (negative) are unallocated amounts and allow you to receive money for more than the particular invoice.
Underpayments (positive) is a partial payment for the invoice. You do not write off the unpaid amount.', Name='Over/Under Payment',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556398
;
-- 2019-10-17T14:04:08.546Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1819)
;
-- 2019-10-17T14:04:08.548Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556398
;
-- 2019-10-17T14:04:08.549Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556398)
;
-- 2019-10-17T14:04:08.554Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552823, Description='Over-Payment (unallocated) or Under-Payment (partial payment)', Help='Overpayments (negative) are unallocated amounts and allow you to receive money for more than the particular invoice.
Underpayments (positive) is a partial payment for the invoice. You do not write off the unpaid amount.', Name='Over/Under Payment',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556397
;
-- 2019-10-17T14:04:08.555Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1818)
;
-- 2019-10-17T14:04:08.558Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556397
;
-- 2019-10-17T14:04:08.558Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556397)
;
-- 2019-10-17T14:04:08.563Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552822, Description='Amount to write-off', Help='The Write Off Amount indicates the amount to be written off as uncollectible.', Name='Write-off Amount',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556396
;
-- 2019-10-17T14:04:08.564Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1450)
;
-- 2019-10-17T14:04:08.567Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556396
;
-- 2019-10-17T14:04:08.567Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556396)
;
-- 2019-10-17T14:04:08.573Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552817, Description='Bank Statement of account', Help='The Bank Statement identifies a unique Bank Statement for a defined time period. The statement defines all transactions that occurred', Name='Bankauszug',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556391
;
-- 2019-10-17T14:04:08.574Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1381)
;
-- 2019-10-17T14:04:08.576Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556391
;
-- 2019-10-17T14:04:08.577Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556391)
;
-- 2019-10-17T14:04:08.582Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552818, Description='Position auf einem Bankauszug zu dieser Bank', Help='Die "Auszugs-Position" bezeichnet eine eindeutige Transaktion (Einzahlung, Auszahlung, Auslage/Gebühr) für den definierten Zeitraum bei dieser Bank.', Name='Auszugs-Position',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556392
;
-- 2019-10-17T14:04:08.582Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1382)
;
-- 2019-10-17T14:04:08.585Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556392
;
-- 2019-10-17T14:04:08.585Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556392)
;
-- 2019-10-17T14:04:08.591Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552826, Description='Accounting Date', Help='The Accounting Date indicates the date to be used on the General Ledger account entries generated from this document. It is also used for any currency conversion.', Name='Buchungsdatum',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556400
;
-- 2019-10-17T14:04:08.592Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(263)
;
-- 2019-10-17T14:04:08.596Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556400
;
-- 2019-10-17T14:04:08.597Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556400)
;
-- 2019-10-17T14:04:08.602Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552827, Description='Date when money is available', Help='The Effective Date indicates the date that money is available from the bank.', Name='Effective date',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556401
;
-- 2019-10-17T14:04:08.603Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1487)
;
-- 2019-10-17T14:04:08.604Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556401
;
-- 2019-10-17T14:04:08.605Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556401)
;
-- 2019-10-17T14:04:08.610Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552820, Description='Betrag einer Transaktion', Help='"Bewegungs-Betrag" gibt den Betrag für einen einzelnen Vorgang an.', Name='Bewegungs-Betrag',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556394
;
-- 2019-10-17T14:04:08.611Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1136)
;
-- 2019-10-17T14:04:08.612Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556394
;
-- 2019-10-17T14:04:08.612Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556394)
;
-- 2019-10-17T14:04:08.618Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552825, Description='Die Währung für diesen Eintrag', Help='Bezeichnet die auf Dokumenten oder Berichten verwendete Währung', Name='Währung',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556399
;
-- 2019-10-17T14:04:08.619Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(193)
;
-- 2019-10-17T14:04:08.638Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556399
;
-- 2019-10-17T14:04:08.639Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556399)
;
-- 2019-10-17T14:04:08.644Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552828, Description='Invoice Identifier', Help='The Invoice Document.', Name='Rechnung',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556402
;
-- 2019-10-17T14:04:08.645Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1008)
;
-- 2019-10-17T14:04:08.654Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556402
;
-- 2019-10-17T14:04:08.655Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556402)
;
-- 2019-10-17T14:04:08.660Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552835, Description='Ihre Kunden- oder Lieferantennummer beim Geschäftspartner', Help='Die "Referenznummer" kann auf Bestellungen und Rechnungen gedruckt werden um Ihre Dokumente beim Geschäftspartner einfacher zuordnen zu können.', Name='Referenznummer',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556409
;
-- 2019-10-17T14:04:08.661Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(540)
;
-- 2019-10-17T14:04:08.665Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556409
;
-- 2019-10-17T14:04:08.665Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556409)
;
-- 2019-10-17T14:04:08.672Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=552834, Description='Checkbox sagt aus, ob der Beleg verarbeitet wurde. ', Help='Verarbeitete Belege dürfen in der Regel nich mehr geändert werden.', Name='Verarbeitet',Updated=TO_TIMESTAMP('2019-10-17 17:04:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556408
;
-- 2019-10-17T14:04:08.673Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(1000173)
;
-- 2019-10-17T14:04:08.674Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=556408
;
-- 2019-10-17T14:04:08.674Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(556408)
;
-- 2019-10-17T14:04:08.676Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_tab_translation_from_ad_element(543988)
;
-- 2019-10-17T14:04:08.683Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Tab(540707)
;
-- 2019-10-17T14:04:50.635Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Element_ID=1001846, CommitWarning=NULL, Description='Position auf einem Bankauszug zu dieser Bank', Help='Die "Auszugs-Position" bezeichnet eine eindeutige Transaktion (Einzahlung, Auszahlung, Auslage/Gebühr) für den definierten Zeitraum bei dieser Bank.', Name='Auszugs-Position',Updated=TO_TIMESTAMP('2019-10-17 17:04:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540707
;
-- 2019-10-17T14:04:50.637Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_tab_translation_from_ad_element(1001846)
;
-- 2019-10-17T14:04:50.642Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Tab(540707)
;
-- 2019-10-17T14:05:28.846Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Column_ID=552829,Updated=TO_TIMESTAMP('2019-10-17 17:05:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540707
;
-- 2019-10-17T14:12:40.117Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET IsSOTrx='Y',Updated=TO_TIMESTAMP('2019-10-17 17:12:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=540722
;
-- 2019-10-17T14:13:27.667Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET PO_Window_ID=NULL,Updated=TO_TIMESTAMP('2019-10-17 17:13:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=393
;
-- 2019-10-17T14:13:39.988Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET PO_Window_ID=NULL,Updated=TO_TIMESTAMP('2019-10-17 17:13:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=392
;
-- 2019-10-17T14:16:26.086Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Column_ID=14327,Updated=TO_TIMESTAMP('2019-10-17 17:16:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=755
; | the_stack |
IF OBJECT_ID('dbo.usp_TransliterationEN2RU', 'P') IS NULL
EXECUTE ('CREATE PROCEDURE dbo.usp_TransliterationEN2RU AS SELECT 1;');
GO
ALTER PROCEDURE usp_TransliterationEN2RU (
@inputString NVARCHAR(MAX)
, @transid INT = NULL
)
/*
.SYNOPSIS
Процедура транслитерации кирилицы в латинский и французский алфавиты.
.DESCRIPTION
По умолчанию процедура возвращает все 3 типа разных транслитераций, но с помощью параметра @transid можно вернуть только один необходимый.
.PARAMETER @inputString
Текст кириллицей со знаками препинания, тип данных NVARCHAR(MAX)
.PARAMETER @transid
Варианты транслитерации:
1 - в соответствии с приложением 6 приказа МВД России от 26 мая 1997 г. N 310 http://legalacts.ru/doc/prikaz-mvd-rf-ot-26051997-n-310/ ОБРАЗЦЫ НАПИСАНИЯ ФАМИЛИЙ, ИМЕН И ДРУГИХ ДАННЫХ НА ФРАНЦУЗСКОМ ЯЗЫКЕ
2 - в соответствии с ГОСТ Р 52535.1-2006 http://docs.cntd.ru/document/1200045268 Приложение А (обязательное). Транслитерация кириллицы для русского алфавита
3 - в соответствии с п. 97 приказа ФМС России N 320 от 15 октября 2012 г.[10] в соответствии с рекомендованным ИКАО международным стандартом (Doc 9303, часть 1, добавлении 9 к разделу IV) http://www.icao.int/publications/Documents/9303_p1_v1_cons_ru.pdf
.EXAMPLE
EXEC usp_TransliterationEN2RU @inputString = 'Шрамко Александр';
.EXAMPLE
EXEC usp_TransliterationEN2RU @inputString = 'ВаСиньин еГЕпа. ксения чьё ю вася мясо шняжка !!!' , @transid = 1;
.NOTE
Version: 3.0
Modified: 218-04-02 23:05:21 UTC+3 by Konstantin Taranov
Author: Shramko Aleksandr https://github.com/shramko/mssql/blob/master/transliteration.sql
Link: https://github.com/ktaranov/sqlserver-kit/blob/master/Stored_Procedure/usp_TransliterationEN2RU.sql
*/
AS
BEGIN TRY
DECLARE @outputstring NVARCHAR(MAX)
, @counter INT
, @ch1 NVARCHAR(10)
, @ch2 NVARCHAR(10)
, @ch3 NVARCHAR(10);
DECLARE @result_table TABLE (
id INT
,translate NVARCHAR(MAX)
)
------------------------------------------------------------------
------- 1 - в соответствии с приложением 6 приказа МВД России от 26 мая 1997 г. N 310 ------------------
SELECT @counter = 1
,@outputstring = '';
--подготовка случаев: С - между двумя гласными выражается - ss - Goussev.
DECLARE @t1 TABLE (ch NCHAR(1));
INSERT INTO @t1
SELECT N'А'
UNION ALL
SELECT N'Е'
UNION ALL
SELECT N'Ё'
UNION ALL
SELECT N'И'
UNION ALL
SELECT N'О'
UNION ALL
SELECT N'У'
UNION ALL
SELECT N'Ы'
UNION ALL
SELECT N'Э'
UNION ALL
SELECT N'Ю'
UNION ALL
SELECT N'Я';
DECLARE @t2 TABLE (ch NCHAR(1));
INSERT INTO @t2
SELECT N'С';
DECLARE @str NVARCHAR(4000) = N'';
SELECT @str = @str + t1.ch + t2.ch + t3.ch + N'|'
FROM @t1 t1
, @t2 t2
, @t1 t3;
WHILE (@counter <= LEN(@inputString))
BEGIN
SET @ch1 = SUBSTRING(@inputString, @counter, 1);
SET @ch2 = SUBSTRING(@inputString, @counter, 2);
PRINT (@counter);
SELECT @outputstring = @outputstring + CASE
WHEN J8 > 0
THEN CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN 'INE'
ELSE 'ine'
END
WHEN J7 > 0
THEN CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN 'IE'
ELSE 'ie'
END
WHEN J6 > 0
THEN CASE
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'X'
ELSE 'x'
END
WHEN J5 > 0
THEN CASE
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'SS'
ELSE 'ss'
END
WHEN J4 > 0
THEN CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN 'GUIA'
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'Guia'
ELSE 'guia'
END
WHEN J3 > 0
THEN CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN 'GUIOU'
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'Guiou'
ELSE 'guiou'
END
WHEN J2 > 0
THEN REPLACE(SUBSTRING(CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN '|GUE|GUE|GUI|GUI|GUY'
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN '|Gue|Gue|Gui|Gui|Guy'
ELSE '|gue|gue|gui|gui|guy'
END, J2 + 1, 3), '|', '')
WHEN J1 > 0
THEN SUBSTRING(CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN 'OUKHTSCHIA'
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'OuKhTsChIa'
ELSE 'oukhtschia'
END, J1 * 2 - 1, 2)
WHEN J11 > 0
THEN SUBSTRING(CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN 'TCHIOU'
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'TchIou'
ELSE 'tchiou'
END, J11 * J11, 3)
WHEN J0 > 0
THEN SUBSTRING(CASE
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'ABVGDEEJZIYKLMNOPRSTFYE'
ELSE 'abvgdeejziyklmnoprstfye'
END, J0, 1)
ELSE CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN REPLACE(@ch1, 'Щ', 'SHTCH')
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN REPLACE(@ch1, 'Щ', 'Shtch')
ELSE REPLACE(@ch1, 'щ', 'shtch')
END
END
,@counter = @counter + CASE
WHEN J2 + J3 + J4 + J6 + J7 + J8 > 0
THEN 2
ELSE 1
END
FROM (
SELECT PATINDEX('%|' + SUBSTRING(UPPER(@inputString), @counter, 3 ) + '|%', '|ИН |ИН,|ИН.|ИН;|ИН:|') AS J8 -- Фамилия на "ин" пишутся с "e" - Vassine - Васин.
, PATINDEX('%|' + SUBSTRING(UPPER(@inputString), @counter, 2 ) + '|%', '|ЬЕ|ЬЁ|') AS J7 -- Если в фамилии после "ь" следует "e", то пишется "ie"
, PATINDEX('%|' + SUBSTRING(UPPER(@inputString), @counter, 2 ) + '|%', '|КС|') AS J6 -- Сочетание "кс" во французском тексте пишется как "х"
, PATINDEX('%|' + SUBSTRING(UPPER(@inputString), @counter - 1, 3) + '|%', '|' + @str) AS J5 -- С - между двумя гласными выражается - ss
, PATINDEX('%|' + SUBSTRING(UPPER(@inputString), @counter, 2) + '|%', '|ГЯ|') AS J4 --G,g перед e, i, у пишется с "u" (gue, gui, guy)
, PATINDEX('%|' + SUBSTRING(UPPER(@inputString), @counter, 2) + '|%', '|ГЮ|') AS J3 --G,g перед e, i, у пишется с "u" (gue, gui, guy)
, PATINDEX('%|' + SUBSTRING(UPPER(@inputString), @counter, 2) + '|%', '|ГЕ||ГЭ||ГИ||ГЙ||ГЫ|') AS J2 --G,g перед e, i, у пишется с "u" (gue, gui, guy)
, PATINDEX('%' + SUBSTRING(UPPER(@inputString), @counter, 1) + '%', 'УХЦШЯ') AS J1
, PATINDEX('%' + SUBSTRING(UPPER(@inputString), @counter, 1) + '%', 'ЧЮ') AS J11
, PATINDEX('%' + SUBSTRING(UPPER(@inputString), @counter, 1) + '%', 'АБВГДЕЁЖЗИЙКЛМНОПРСТФЫЭЪЬ') AS J0
) J
END;
INSERT INTO @result_table
SELECT 1
,@outputstring;
/*------ 2 - в соответствии с ГОСТ Р 52535.1-2006 -----------------*/
SELECT @counter = 1
,@outputstring = '';
WHILE (@counter <= len(@inputString))
BEGIN
SELECT @ch1 = SUBSTRING(@inputString, @counter, 1)
SELECT @ch2 = SUBSTRING(@inputString, @counter, 2)
SELECT @outputstring = @outputstring + CASE
WHEN J1 > 0
THEN SUBSTRING(CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN 'ZHKHTCCHSHIAIU'
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'ZhKhTcChShIaIu'
ELSE 'zhkhtcchshiaiu'
END, J1 * 2 - 1, 2)
WHEN J0 > 0
THEN SUBSTRING(CASE
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'ABVGDEEZIIKLMNOPRSTUFYE'
ELSE 'abvgdeeziiklmnoprstufye'
END, J0, 1)
ELSE CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = UPPER(@ch2)
THEN REPLACE(@ch1, 'Щ', 'SHCH')
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = UPPER(@ch1)
THEN REPLACE(@ch1, 'Щ', 'Shch')
ELSE REPLACE(@ch1, 'щ', 'shch')
END
END
,@counter = @counter + 1
FROM (
SELECT PATINDEX('%' + UPPER(@ch1) + '%', 'ЖХЦЧШЯЮ') AS J1
,PATINDEX('%' + UPPER(@ch1) + '%', 'АБВГДЕЁЗИЙКЛМНОПРСТУФЫЭЪЬ') AS J0
) J
END;
INSERT INTO @result_table (
id
,translate
)
SELECT 2
,@outputstring
/* 3 - в соответствии с п. 97 приказа ФМС России N 320 от 15 октября 2012 г.[10]
в соответствии с рекомендованным ИКАО международным стандартом (Doc 9303, часть 1, добавлении 9 к разделу IV) */
SELECT @counter = 1
,@outputstring = '';
WHILE (@counter <= len(@inputString))
BEGIN
SELECT @ch1 = SUBSTRING(@inputString, @counter, 1);
SELECT @ch2 = SUBSTRING(@inputString, @counter, 2);
SELECT @outputstring = @outputstring + CASE
WHEN J1 > 0
THEN SUBSTRING(CASE
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'ZHKHTSCHSHIAIUIE'
ELSE 'zhkhtschshiaiuie'
END, J1 * 2 - 1, 2)
WHEN J0 > 0
THEN SUBSTRING(CASE
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN 'ABVGDEEZIYKLMNOPRSTUFYE'
ELSE 'abvgdeeziyklmnoprstufye'
END, J0, 1)
ELSE CASE
WHEN @ch2 COLLATE Cyrillic_General_CS_AS = upper(@ch2)
THEN REPLACE(@ch1, 'Щ', 'SHCH')
WHEN @ch1 COLLATE Cyrillic_General_CS_AS = upper(@ch1)
THEN REPLACE(@ch1, 'Щ', 'Shch')
ELSE REPLACE(@ch1, 'щ', 'shch')
END
END
,@counter = @counter + 1
FROM (
SELECT PATINDEX('%' + UPPER(@ch1) + '%', 'ЖХЦЧШЯЮЪ') AS J1
,PATINDEX('%' + UPPER(@ch1) + '%', 'АБВГДЕЁЗИЙКЛМНОПРСТУФЫЭЬ') AS J0
) J
END;
INSERT INTO @result_table (
id
,translate
)
SELECT 3
,@outputstring;
-------- вывод результата ------------------------
SELECT *
FROM @result_table
WHERE (
@transid IS NOT NULL
AND id = @transid
)
OR (
id IS NOT NULL
AND @transid IS NULL
);
END TRY
BEGIN CATCH
THROW
PRINT 'Error: ' + CONVERT(VARCHAR(50), ERROR_NUMBER()) +
', Severity: ' + CONVERT(VARCHAR(5), ERROR_SEVERITY()) +
', State: ' + CONVERT(VARCHAR(5), ERROR_STATE()) +
', Procedure: ' + ISNULL(ERROR_PROCEDURE(), '-') +
', Line: ' + CONVERT(VARCHAR(5), ERROR_LINE()) +
', User name: ' + CONVERT(SYSNAME, ORIGINAL_LOGIN());
PRINT ERROR_MESSAGE();
END CATCH;
GO | the_stack |
--3 range partitioned table which's partition key contain multiple columns
-- ****BD: partition's top boundary,
-- ****BD(2): boundary of the second range partition
-- ****-BD(2): one value less than BD(2) and greater than BD(1)
-- ****BD(Z): boundary of the last range partition
-- ****+BD(Z): one value greater than DB(Z)
-- ****BD(N): 1<N<Z
-- ****ITEM: item expression, ITEM(<): < expression
-- ****OTHER: does not support expression for pruning,
-- ****NOKEY: expression which does not contain partition key
-- 3.1 expression(c1)
-- 3.1.1 ITEM
--Y 3.1.1.1 < -BD(1)
--Y 3.1.1.2 <= -BD(1)
--Y 3.1.1.3 < BD(1)
--Y 3.1.1.4 <= BD(1)
--Y 3.1.1.5 < -BD(N)
--Y 3.1.1.6 <= -BD(N)
--Y 3.1.1.7 < BD(N)
--Y 3.1.1.8 <= BD(N)
--Y 3.1.1.9 < -BD(Z)
--Y 3.1.1.10 <= -BD(Z)
--Y 3.1.1.11 < BD(Z)
--Y 3.1.1.12 <= BD(Z)
--Y 3.1.1.13 < +BD(Z)
--Y 3.1.1.14 > -BD(1)
--Y 3.1.1.15 >= -BD(1)
--Y 3.1.1.16 > BD(1)
--Y 3.1.1.17 >= BD(1)
--Y 3.1.1.18 > -BD(N)
--Y 3.1.1.19 >= -BD(N)
--Y 3.1.1.20 > BD(N)
--Y 3.1.1.21 >= BD(N)
--Y 3.1.1.22 > BD(Z)
--Y 3.1.1.23 >= BD(Z)
--Y 3.1.1.24 > +BD(Z)
--Y 3.1.1.25 = -BD(1)
--Y 3.1.1.26 = BD(1)
--Y 3.1.1.27 = -BD(N)
--Y 3.1.1.28 = BD(N)
--Y 3.1.1.29 = BD(Z)
-- 3.1.2 composite
--Y 3.1.2.1 ITEM(<) AND ITEM(<)
--Y 3.1.2.2 ITEM(>) AND ITEM(>)
--Y 3.1.2.3 ITEM(>) AND ITEM(<) (NOT NULL)
--Y 3.1.2.4 ITEM(>) AND ITEM(<) (NULL)
--Y 3.1.2.5 ITEM(=) OR ITEM(<) (NOT NULL)
--Y 3.1.2.6 ITEM(=) OR ITEM(<) (NULL)
--Y 3.1.2.7 ITEM(=) OR ITEM(>) (NOT NULL)
--Y 3.1.2.8 ITEM(=) OR ITEM(>) (NULL)
--Y 3.1.2.9 ITEM(<) OR ITEM(>) (NOT NULL)
--Y 3.1.2.10 ITEM(<) OR ITEM(>) (NULL)
--Y 3.1.2.11 ITEM(<) OR OTHER
--Y 3.1.2.12 NOKEY OR ITEM(>)
-- 3.2 expression(c1,c2)
-- 3.2.1 >/>=
--Y 3.2.1.1 ITEM(c1>) AND ITEM(c2>)
--U 3.2.1.2 ITEM(c1>=) AND ITEM(c2>)
--Y 3.2.1.3 ITEM(c1>) AND ITEM(c2>=)
--Y 3.2.1.4 ITEM(c1>=) AND ITEM(c2>=)
-- 3.2.2 =
--Y 3.2.2.1 ITEM(c1=) AND ITEM(c2=)
-- 3.2.3 </<=
--Y 3.2.3.1 ITEM(c1<) AND ITEM(c2<)
--U 3.2.3.2 ITEM(c1<=) AND ITEM(c2<)
--Y 3.2.3.3 ITEM(c1<) AND ITEM(c2<=)
--Y 3.2.3.4 ITEM(c1<=) AND ITEM(c2<=)
-- 3.2.4 composite
--U 3.2.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c1<) AND ITEM(c2<)
--U 3.2.4.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c1<) AND ITEM(c2<=)
--Y 3.2.4.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c1<=) AND ITEM(c2<=)
--Y 3.2.4.4 (ITEM(c1>) AND ITEM(c2>)) OR (ITEM(c1<) AND ITEM(c2<))
--Y 3.2.4.5 (ITEM(c1>=) AND ITEM(c2>)) OR (ITEM(c1<) AND ITEM(c2<=))
--Y 3.2.4.6 (ITEM(c1>=) AND ITEM(c2>=)) OR (ITEM(c1<=) AND ITEM(c2<=))
-- 3.3 expression(c1,c2,c3)
-- 3.3.1 >/>=
--Y 3.3.1.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>)
--U 3.3.1.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>)
--U 3.3.1.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>)
--U 3.3.1.4 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=)
-- 3.3.2 =
--Y 3.3.2.1 ITEM(c1=) AND ITEM(c2=) AND ITEM(c3=)
-- 3.3.3 </<=
--Y 3.3.3.1 ITEM(c1<) AND ITEM(c2<) AND ITEM(c3<)
--N 3.3.3.2 ITEM(c1<=) AND ITEM(c2<) AND ITEM(c3<)
--U 3.3.3.3 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<)
--Y 3.3.3.4 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<=)
-- 3.3.4 composite
--N 3.3.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c1<) AND ITEM(c2<)
--N 3.3.4.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c1<) AND ITEM(c2<=)
--Y 3.3.4.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3=>) AND ITEM(c1<=) AND ITEM(c2<=)
--N 3.3.4.4 (ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>)) OR (ITEM(c1<) AND ITEM(c2<))
--N 3.3.4.5 (ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>)) OR (ITEM(c1<) AND ITEM(c2<=))
--Y 3.3.4.6 (ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=)) OR (ITEM(c1<=) AND ITEM(c2<=))
-- 3.4 expression(c1,c2,c3,c4)
-- 3.4.1 >/>=
--Y 3.4.1.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>)
--N 3.4.1.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>)
--Y 3.4.1.3 ITEM(c1>) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>=)
--Y 3.4.1.4 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>=)
-- 3.4.2 =
--Y 3.4.2.1 ITEM(c1=) AND ITEM(c2=) AND ITEM(c3=) AND ITEM(c4=)
-- 3.4.3 </<=
--N 3.4.3.1 ITEM(c1<) AND ITEM(c2<) AND ITEM(c3<) AND ITEM(c4<)
--N 3.4.3.2 ITEM(c1<=) AND ITEM(c2<) AND ITEM(c3<) AND ITEM(c4<)
--Y 3.4.3.3 ITEM(c1<) AND ITEM(c2<=) AND ITEM(c3<) AND ITEM(c4<)
--Y 3.4.3.4 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<=) AND ITEM(c4<=)
-- 3.4.4 composite
--N 3.4.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>) AND ITEM(c1<) AND ITEM(c2<)
--N 3.4.4.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>) AND ITEM(c1<) AND ITEM(c2<=)
--Y 3.4.4.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>=) AND ITEM(c1<=) AND ITEM(c2<=)
--N 3.4.4.4 (ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>)) OR (ITEM(c1<) AND ITEM(c2<))
--N 3.4.4.5 (ITEM(c1>) AND ITEM(c2>=) AND ITEM(c3>) AND ITEM(c4>)) OR (ITEM(c1<) AND ITEM(c2<=))
--U 3.4.4.6 (ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>=)) OR (ITEM(c1<=) AND ITEM(c2<=))
-- 3.5 expression(c1,c3)
-- 3.5.1 >/>=
--Y 3.5.1.1 ITEM(c1>) AND ITEM(c3>)
-- 3.5.2 =
--U 3.5.2.1 ITEM(c1=) AND ITEM(c3=)
-- 3.5.3 </<=
--Y 3.5.3.1 ITEM(c1<=) AND ITEM(c3<=)
-- 3.5.4 composite
--Y 3.3.4.1 ITEM(c1>) AND ITEM(c3>) AND ITEM(c1<) AND ITEM(c2<)
-- 3.6 expression(c2)
--Y 3.6.1 ITEM(c2>)
--Y 3.6.2 ITEM(c2<)
--Y 3.6.3 ITEM(c2>=) OR (ITEM(c1>) AND ITEM(c2>))
-- 3.7 expression(c2,c4)
--Y 3.7.1 ITEM(c2>) AND ITEM(c4>)
--Y 3.7.2 ITEM(c2<= AND ITEM(c4<=)
create table partition_pruning_multikey_t1(c1 timestamp, c2 text, c3 float, c4 int, c5 int)
partition by range(c1,c2,c3,c4)
(
partition p0000 values less than ('2003-01-01 00:00:00','AAAA',100.0,100),
partition p0001 values less than ('2003-01-01 00:00:00','AAAA',100.0,200),
partition p0002 values less than ('2003-01-01 00:00:00','AAAA',100.0,300),
partition p0010 values less than ('2003-01-01 00:00:00','AAAA',200.0,100),
partition p0011 values less than ('2003-01-01 00:00:00','AAAA',200.0,200),
partition p0012 values less than ('2003-01-01 00:00:00','AAAA',200.0,300),
partition p0020 values less than ('2003-01-01 00:00:00','AAAA',300.0,100),
partition p0021 values less than ('2003-01-01 00:00:00','AAAA',300.0,200),
partition p0022 values less than ('2003-01-01 00:00:00','AAAA',300.0,300),
partition p0100 values less than ('2003-01-01 00:00:00','DDDD',100.0,100),
partition p0101 values less than ('2003-01-01 00:00:00','DDDD',100.0,200),
partition p0102 values less than ('2003-01-01 00:00:00','DDDD',100.0,300),
partition p0110 values less than ('2003-01-01 00:00:00','DDDD',200.0,100),
partition p0111 values less than ('2003-01-01 00:00:00','DDDD',200.0,200),
partition p0112 values less than ('2003-01-01 00:00:00','DDDD',200.0,300),
partition p0120 values less than ('2003-01-01 00:00:00','DDDD',300.0,100),
partition p0121 values less than ('2003-01-01 00:00:00','DDDD',300.0,200),
partition p0122 values less than ('2003-01-01 00:00:00','DDDD',300.0,300),
partition p0200 values less than ('2003-01-01 00:00:00','HHHH',100.0,100),
partition p0201 values less than ('2003-01-01 00:00:00','HHHH',100.0,200),
partition p0202 values less than ('2003-01-01 00:00:00','HHHH',100.0,300),
partition p0210 values less than ('2003-01-01 00:00:00','HHHH',200.0,100),
partition p0211 values less than ('2003-01-01 00:00:00','HHHH',200.0,200),
partition p0212 values less than ('2003-01-01 00:00:00','HHHH',200.0,300),
partition p0220 values less than ('2003-01-01 00:00:00','HHHH',300.0,100),
partition p0221 values less than ('2003-01-01 00:00:00','HHHH',300.0,200),
partition p0222 values less than ('2003-01-01 00:00:00','HHHH',300.0,300),
--27
partition p1000 values less than ('2003-04-01 00:00:00','AAAA',100.0,100),
partition p1001 values less than ('2003-04-01 00:00:00','AAAA',100.0,200),
partition p1002 values less than ('2003-04-01 00:00:00','AAAA',100.0,300),
partition p1010 values less than ('2003-04-01 00:00:00','AAAA',200.0,100),
partition p1011 values less than ('2003-04-01 00:00:00','AAAA',200.0,200),
partition p1012 values less than ('2003-04-01 00:00:00','AAAA',200.0,300),
partition p1020 values less than ('2003-04-01 00:00:00','AAAA',300.0,100),
partition p1021 values less than ('2003-04-01 00:00:00','AAAA',300.0,200),
partition p1022 values less than ('2003-04-01 00:00:00','AAAA',300.0,300),
partition p1100 values less than ('2003-04-01 00:00:00','DDDD',100.0,100),
partition p1101 values less than ('2003-04-01 00:00:00','DDDD',100.0,200),
partition p1102 values less than ('2003-04-01 00:00:00','DDDD',100.0,300),
partition p1110 values less than ('2003-04-01 00:00:00','DDDD',300.0,100),
partition p1111 values less than ('2003-04-01 00:00:00','DDDD',300.0,200),
partition p1112 values less than ('2003-04-01 00:00:00','DDDD',300.0,300),
partition p1200 values less than ('2003-04-01 00:00:00','HHHH',100.0,100),
partition p1201 values less than ('2003-04-01 00:00:00','HHHH',100.0,200),
partition p1202 values less than ('2003-04-01 00:00:00','HHHH',100.0,300),
partition p1220 values less than ('2003-04-01 00:00:00','HHHH',300.0,100),
partition p1221 values less than ('2003-04-01 00:00:00','HHHH',300.0,200),
partition p1222 values less than ('2003-04-01 00:00:00','HHHH',300.0,300),
partition p1223 values less than ('2003-04-01 00:00:00','HHHH',MAXVALUE,MAXVALUE),
--49
partition p2000 values less than ('2003-07-01 00:00:00','AAAA',100.0,100),
partition p2001 values less than ('2003-07-01 00:00:00','AAAA',100.0,200),
partition p2002 values less than ('2003-07-01 00:00:00','AAAA',100.0,300),
partition p2010 values less than ('2003-07-01 00:00:00','AAAA',200.0,100),
partition p2011 values less than ('2003-07-01 00:00:00','AAAA',200.0,200),
partition p2012 values less than ('2003-07-01 00:00:00','AAAA',200.0,300),
partition p2020 values less than ('2003-07-01 00:00:00','AAAA',300.0,100),
partition p2021 values less than ('2003-07-01 00:00:00','AAAA',300.0,200),
partition p2022 values less than ('2003-07-01 00:00:00','AAAA',300.0,300),
partition p2200 values less than ('2003-07-01 00:00:00','HHHH',100.0,100),
partition p2201 values less than ('2003-07-01 00:00:00','HHHH',100.0,200),
partition p2202 values less than ('2003-07-01 00:00:00','HHHH',100.0,300),
partition p2210 values less than ('2003-07-01 00:00:00','HHHH',200.0,100),
partition p2211 values less than ('2003-07-01 00:00:00','HHHH',200.0,200),
partition p2212 values less than ('2003-07-01 00:00:00','HHHH',200.0,300),
partition p2220 values less than ('2003-07-01 00:00:00','HHHH',300.0,100),
partition p2221 values less than ('2003-07-01 00:00:00','HHHH',300.0,200),
partition p2222 values less than ('2003-07-01 00:00:00','HHHH',300.0,300),
partition p2322 values less than ('2003-07-01 00:00:00',MAXVALUE,300.0,300),
--68
partition p3000 values less than ('2003-10-01 00:00:00','AAAA',100.0,100),
partition p3001 values less than ('2003-10-01 00:00:00','AAAA',100.0,200),
partition p3002 values less than ('2003-10-01 00:00:00','AAAA',100.0,300),
partition p3010 values less than ('2003-10-01 00:00:00','AAAA',200.0,100),
partition p3011 values less than ('2003-10-01 00:00:00','AAAA',200.0,200),
partition p3012 values less than ('2003-10-01 00:00:00','AAAA',200.0,300),
partition p3020 values less than ('2003-10-01 00:00:00','AAAA',300.0,100),
partition p3021 values less than ('2003-10-01 00:00:00','AAAA',300.0,200),
partition p3022 values less than ('2003-10-01 00:00:00','AAAA',300.0,300),
partition p3100 values less than ('2003-10-01 00:00:00','DDDD',100.0,100),
partition p3101 values less than ('2003-10-01 00:00:00','DDDD',100.0,200),
partition p3102 values less than ('2003-10-01 00:00:00','DDDD',100.0,300),
partition p3110 values less than ('2003-10-01 00:00:00','DDDD',200.0,100),
partition p3111 values less than ('2003-10-01 00:00:00','DDDD',200.0,200),
partition p3112 values less than ('2003-10-01 00:00:00','DDDD',200.0,300),
partition p3120 values less than ('2003-10-01 00:00:00','DDDD',300.0,100),
partition p3121 values less than ('2003-10-01 00:00:00','DDDD',300.0,200),
partition p3122 values less than ('2003-10-01 00:00:00','DDDD',300.0,300),
partition p3200 values less than ('2003-10-01 00:00:00','HHHH',100.0,100),
partition p3201 values less than ('2003-10-01 00:00:00','HHHH',100.0,200),
partition p3202 values less than ('2003-10-01 00:00:00','HHHH',100.0,300),
partition p3210 values less than ('2003-10-01 00:00:00','HHHH',200.0,100),
partition p3211 values less than ('2003-10-01 00:00:00','HHHH',200.0,200),
partition p3212 values less than ('2003-10-01 00:00:00','HHHH',200.0,300),
partition p3220 values less than ('2003-10-01 00:00:00','HHHH',300.0,100),
partition p3221 values less than ('2003-10-01 00:00:00','HHHH',300.0,200),
partition p3222 values less than ('2003-10-01 00:00:00','HHHH',300.0,300),
partition p3233 values less than ('2003-10-01 00:00:00',MAXVALUE,MAXVALUE,MAXVALUE)
--96
);
--expect:1-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1;
--3.1 expression(c1)
--3.1.1 ITEM
--3.1.1.1 < -BD(1)
--expect: 1
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2002-10-01 00:00:00';
--3.1.1.2 <= -BD(1)
--expect: 1
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2002-10-01 00:00:00';
--3.1.1.3 < BD(1)
--expect: 1
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-01-01 00:00:00';
--3.1.1.4 <= BD(1)
--expect: 1-28
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-01-01 00:00:00';
--3.1.1.5 < -BD(N)
--expect: 1-50
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-06-01 00:00:00';
--3.1.1.6 <= -BD(N)
--expect: 1-50
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-06-01 00:00:00';
--3.1.1.7 < BD(N)
--expect: 1-50
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-07-01 00:00:00';
--3.1.1.8 <= BD(N)
--expect: 1-69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-07-01 00:00:00';
--3.1.1.9 < -BD(Z)
--expect: 1-69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-09-01 00:00:00';
--3.1.1.10 <= -BD(Z)
--expect: 1-69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-09-01 00:00:00';
--3.1.1.11 < BD(Z)
--expect: 1-69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-10-01 00:00:00';
--3.1.1.12 <= BD(Z)
--expect: 1-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-10-01 00:00:00';
--3.1.1.13 < +BD(Z)
--expect: 1-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2004-01-01 00:00:00';
--3.1.1.14 > -BD(1)
--expect: 1-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2002-10-01 00:00:00';
--3.1.1.15 >= -BD(1)
--expect: 1-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2002-10-01 00:00:00';
--3.1.1.16 > BD(1)
--expect: 28-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-01-01 00:00:00';
--3.1.1.17 >= BD(1)
--expect: 1-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-01-01 00:00:00';
--3.1.1.18 > -BD(N)
--expect: 50-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-06-01 00:00:00';
--3.1.1.19 >= -BD(N)
--expect: 50-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-06-01 00:00:00';
--3.1.1.20 > BD(N)
--expect: 69-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-07-01 00:00:00';
--3.1.1.21 >= BD(N)
--expect: 50-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-07-01 00:00:00';
--3.1.1.22 > BD(Z)
--expect: NONE
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-10-01 00:00:00';
--3.1.1.23 >= BD(Z)
--expect: 69-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00';
--3.1.1.24 > +BD(Z)
--expect: NONE
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2004-10-01 00:00:00';
--3.1.1.25 = -BD(1)
--expect: 1
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2002-10-01 00:00:00';
--3.1.1.26 = BD(1)
--expect: 1-28
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-01-01 00:00:00';
--3.1.1.27 = -BD(N)
--expect: 50
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-06-01 00:00:00';
--3.1.1.28 = BD(N)
--expect: 50-69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-07-01 00:00:00';
--3.1.1.29 = BD(Z)
--expect: 69-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-10-01 00:00:00';
--3.1.2 composite
--3.1.2.1 ITEM(<) AND ITEM(<)
--expect: 1-50
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-09-01 00:00:00' AND c1<='2003-04-01 00:00:00';
--3.1.2.2 ITEM(>) AND ITEM(>)
--expect: 69-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-09-01 00:00:00' AND c1>='2003-04-01 00:00:00';
--3.1.2.3 ITEM(>) AND ITEM(<) (NOT NULL)
--expect: 28-69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-09-01 00:00:00' AND c1>='2003-04-01 00:00:00';
--3.1.2.4 ITEM(>) AND ITEM(<) (NULL)
--expect: NONE
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-09-01 00:00:00' AND c1<='2003-04-01 00:00:00';
--expect: 28-50
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c1<='2003-04-01 00:00:00';
--3.1.2.5 ITEM(=) OR ITEM(<) (NOT NULL)
--expect: 1-50
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-04-01 00:00:00' OR c1<'2003-06-01 00:00:00';
--3.1.2.6 ITEM(=) OR ITEM(<) (NULL)
--expect: 1-50,69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-09-01 00:00:00' OR c1<'2003-06-01 00:00:00';
--3.1.2.7 ITEM(=) OR ITEM(>) (NOT NULL)
--expect: 50-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-09-01 00:00:00' OR c1>'2003-06-01 00:00:00';
--3.1.2.8 ITEM(=) OR ITEM(>) (NULL)
--expect: 50,69-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-09-01 00:00:00' OR c1='2003-06-01 00:00:00';
--3.1.2.9 ITEM(<) OR ITEM(>) (NOT NULL)
--expect: 1-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-10-01 00:00:00' OR c1>'2003-06-01 00:00:00';
--3.1.2.10 ITEM(<) OR ITEM(>) (NULL)
--expect: 1-50,69-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00' OR c1<'2003-06-01 00:00:00';
--3.1.2.11 ITEM(<) AND OTHER
--expect: 69-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00' AND c5 IS NULL;
--3.1.2.12 NOKEY OR ITEM(>)
--expect: 1-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-10-01 00:00:00' OR c5<100;
--3.2 expression(c1,c2)
--3.2.1 >/>=
--3.2.1.1 ITEM(c1>) AND ITEM(c2>)
--expect: 28 / 37-50 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-03-01 00:00:00' AND c2>'CCCC';
--expect: 50 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'CCCC';
--expect: 50 / 59-69 / 87-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'DDDD';
--3.2.1.2 ITEM(c1>=) AND ITEM(c2>)
--expect: 43-50 / 59-69 / 87-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>'DDDD';
--3.2.1.3 ITEM(c1>) AND ITEM(c2>=)
--expect: 50 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>='DDDD';
--3.2.1.4 ITEM(c1>=) AND ITEM(c2>=)
--expect: 37-50 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD';
--3.2.2 =
--3.2.2.1 ITEM(c1=) AND ITEM(c2=)
--expect: 37-43
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-04-01 00:00:00' AND c2='DDDD';
--3.2.3 </<=
--3.2.3.1 ITEM(c1<) AND ITEM(c2<)
--expect: 1-10 / 28
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-04-01 00:00:00' AND c2<'DDDD';
--3.2.3.2 ITEM(c1<=) AND ITEM(c2<)
--expect: 1-10 / 28-37
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<'DDDD';
--3.2.3.3 ITEM(c1<) AND ITEM(c2<=)
--expect: 1-19 / 28
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-04-01 00:00:00' AND c2<='DDDD';
--3.2.3.4 ITEM(c1<=) AND ITEM(c2<=)
--expect: 1-19 / 28-43
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD';
--3.2.4 composite
--3.2.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c1<) AND ITEM(c2<)
--expect: 50 / 59 / 69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'DDDD' AND c1<'2003-10-01 00:00:00' AND c2<'HHHH';
--3.2.4.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c1<) AND ITEM(c2<=)
--expect: 43-50 / 59-69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>'DDDD' AND c1<'2003-10-01 00:00:00' AND c2<='HHHH';
--3.2.4.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c1<=) AND ITEM(c2<=)
--expect: 37-50 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c1<='2003-10-01 00:00:00' AND c2<='HHHH';
--3.2.4.4 (ITEM(c1>) AND ITEM(c2>)) OR (ITEM(c1<) AND ITEM(c2<))
--expect: 1-10 / 28 / 69 / 96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where (c1>'2003-07-01 00:00:00' AND c2>'HHHH') OR (c1<'2003-04-01 00:00:00' AND c2<'DDDD');
--3.2.4.5 (ITEM(c1>=) AND ITEM(c2>)) OR (ITEM(c1<) AND ITEM(c2<=))
--expect: 1-19 / 28 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where (c1>='2003-07-01 00:00:00' AND c2>'BBBB') OR (c1<'2003-04-01 00:00:00' AND c2<='DDDD');
--3.2.4.6 (ITEM(c1>=) AND ITEM(c2>=)) OR (ITEM(c1<=) AND ITEM(c2<=))
--expect: 1-19 / 28-43 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where (c1>='2003-07-01 00:00:00' AND c2>='BBBB') OR (c1<='2003-04-01 00:00:00' AND c2<='DDDD');
--3.3 expression(c1,c2,c3)
--3.3.1 >/>=
--3.3.1.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>)
--expect: 50 / 59-69 / 87-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'DDDD' AND c3>50.0;
--3.3.1.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>)
--expect: 43-50 / 59-69 / 87-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>'DDDD' AND c3>50.0;
--3.3.1.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>)
--expect: 37 / 40-43 / 46-50 / 59 / 62-69 / 78 / 81-87 / 90-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>100.0;
--3.3.1.4 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=)
--expect: 37-50 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0;
--3.3.2 =
--3.3.2.1 ITEM(c1=) AND ITEM(c2=) AND ITEM(c3=)
--expect: 40-43
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-04-01 00:00:00' AND c2='DDDD' AND c3=300.0;
--3.3.3 </<=
--3.3.3.1 ITEM(c1<) AND ITEM(c2<) AND ITEM(c3<)
--expect: 1 / 10 / 28
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<'2003-04-01 00:00:00' AND c2<'DDDD' AND c3<100.0;
--3.3.3.2 ITEM(c1<=) AND ITEM(c2<) AND ITEM(c3<)
--NA
--3.3.3.3 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<)
--expect: 1 / 10 / 19 / 28 / 37
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<100.0;
--3.3.3.4 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<=)
--expect: 1-4 / 10-13 / 19 / 28-29 / 30-31 / 37-40
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<=100.0;
--3.3.4 composite
--3.3.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c1<) AND ITEM(c2<)
--NA
--3.3.4.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c1<) AND ITEM(c2<=)
--NA
--3.3.4.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c1<=) AND ITEM(c2<=)
--expect: 37-43 / 50 / 59
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c1<='2003-07-01 00:00:00' AND c2<='DDDD';
--3.3.4.4 (ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>)) OR (ITEM(c1<) AND ITEM(c2<))
--NA
--3.3.4.5 (ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>)) OR (ITEM(c1<) AND ITEM(c2<=))
--NA
--3.3.4.6 (ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=)) OR (ITEM(c1<=) AND ITEM(c2<=))
--expect: 1-4 / 10-13 / 19 / 28-31 / 37-40 / 50-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where (c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<=100.0) OR (c1>='2003-07-01 00:00:00' AND c2>='AAAA');
--3.4 expression(c1,c2,c3,c4)
--3.4.1 >/>=
--3.4.1.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>)
--expect: 50 / 59 / 62 / 64-65 / 67-69 / 87 / 90 / 92-93 / 95-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>'2003-04-01 00:00:00' AND c2>'DDDD' AND c3>100.0 AND c4>200;
--3.4.1.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>)
--NA
--3.4.1.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>)
--expect: 39-40 / 42-43 / 45-46 / 48-50 / 59 / 61-62 / 64-65 / 67-69 / 78 / 80-81 / 83-84 / 86-87 / 89-90 / 92-93 / 95-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>200;
--3.4.1.4 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>=)
--expect: 39-50 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>=200;
--3.4.2 =
--3.4.2.1 ITEM(c1=) AND ITEM(c2=) AND ITEM(c3=) AND ITEM(c4=)
--expect: 39
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-04-01 00:00:00' AND c2='DDDD' AND c3=100.0 AND c4=200;
--3.4.3 </<=
--3.4.3.1 ITEM(c1<) AND ITEM(c2<) AND ITEM(c3<) AND ITEM(c4<)
--NA
--3.4.3.2 ITEM(c1<=) AND ITEM(c2<) AND ITEM(c3<) AND ITEM(c4<)
--NA
--3.4.3.3 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<=) AND ITEM(c4<)
--expect: 1-2 / 4 / 10-11 / 13 / 19 / 28-29 / 31 / 37-38
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<=100.0 AND c4<200;
--3.4.3.4 ITEM(c1<=) AND ITEM(c2<=) AND ITEM(c3<=) AND ITEM(c4<=)
--expect: 1-3 / 10-12 / 19 / 28-30 / 37-39 (4, 13, 31 should be eliminated)
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-04-01 00:00:00' AND c2<='DDDD' AND c3<=100.0 AND c4<=200;
--3.4.4 composite
--3.4.4.1 ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>) AND ITEM(c1<) AND ITEM(c2<)
--NA
--3.4.4.2 ITEM(c1>=) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>) AND ITEM(c1<) AND ITEM(c2<=)
--NA
--3.4.4.3 ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>=) AND ITEM(c1<=) AND ITEM(c2<=)
--expect: 39-43 / 50 / 59
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1
where c1>='2003-04-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>=200
AND c1<='2003-07-01 00:00:00' AND c2<='DDDD';
--3.4.4.4 (ITEM(c1>) AND ITEM(c2>) AND ITEM(c3>) AND ITEM(c4>)) OR (ITEM(c1<) AND ITEM(c2<))
--NA
--3.4.4.5 (ITEM(c1>) AND ITEM(c2>=) AND ITEM(c3>) AND ITEM(c4>)) OR (ITEM(c1<) AND ITEM(c2<=))
--NA
--3.4.4.6 (ITEM(c1>=) AND ITEM(c2>=) AND ITEM(c3>=) AND ITEM(c4>=)) OR (ITEM(c1<=) AND ITEM(c2<=))
--expect: 1-10 / 28-37 / 59-69 / 78-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1
where (c1>='2003-07-01 00:00:00' AND c2>='DDDD' AND c3>=100.0 AND c4>=200)
OR (c1<='2003-04-01 00:00:00' AND c2<'DDDD');
--3.5 expression(c1,c3)
--3.5.1 >/>=
--3.5.1.1 ITEM(c1>=) AND ITEM(c3>)
--expect: 50-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-07-01 00:00:00' AND c3>=100.0;
--3.5.2 =
--3.5.2.1 ITEM(c1=) AND ITEM(c3=)
--expect: 50-53 / 59-62 / 68
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1='2003-07-01 00:00:00' AND c3=100.0;
--3.5.3 </<=
--3.5.3.1 ITEM(c1<=) AND ITEM(c3<=)
--expect: 1-4 / 10-13 / 19-22 / 28-31 / 37-40 / 43-46 / 50-53 / 59-62 / 68
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1<='2003-07-01 00:00:00' AND c3<=100.0;
--3.5.4 composite
--3.5.4.1 ITEM(c1>) AND ITEM(c3>) AND ITEM(c1<) AND ITEM(c2<)
--expect: 50-59 / 69
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c1>='2003-07-01 00:00:00' AND c3>=100.0 AND c1<'2003-10-01 00:00:00' AND c2<='DDDD';
--3.6 expression(c2)
--3.6.1 ITEM(c2>)
--expect: 1 / 19-28 / 43-50 / 59-69 / 87-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c2>'DDDD';
--3.6.2 ITEM(c2<)
--expect: 1-10 / 28-37 / 50-59 / 69-78
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c2<'DDDD';
--3.6.3 ITEM(c2>=) OR (ITEM(c1>) AND ITEM(c2>))
--expect: 1 / 19-28 / 43-50 / 59-69 / 87-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c2>'DDDD' OR (c1>'2003-04-01 00:00:00' AND c2>='HHHH');
--3.7 expression(c2,c4)
--3.7.1 ITEM(c2>) AND ITEM(c4>)
--expect: 1 / 19 / 21-22 / 24-25 / 27-28 / 43 / 45-46 / 48-50 / 59 / 61-62 / 64-65 / 67-69 / 87 / 89-90 / 92-93 / 95-96
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c2>'DDDD' AND c4>200;
--3.7.2 ITEM(c2<= AND ITEM(c4<=)
--expect: 1-19 / 28-43 / 50-59 / 69-87
explain (ANALYZE false,VERBOSE false, COSTS false,BUFFERS false,TIMING false)
select * from partition_pruning_multikey_t1 where c2<='DDDD' AND c4<=200;
drop table partition_pruning_multikey_t1; | the_stack |
/* chinese simplified (China) charsets: */
/* GB (GB2312), GBK, MS936, APPLE_CHINSIMP */
/* ======================================================================= */
static sal_uInt16 const aImplUniToDBCSTab_GB_00[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, /* 0x00 */
0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, /* 0x00 */
0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, /* 0x10 */
0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, /* 0x10 */
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, /* 0x20 */
0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, /* 0x20 */
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, /* 0x30 */
0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, /* 0x30 */
0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, /* 0x40 */
0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, /* 0x40 */
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, /* 0x50 */
0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, /* 0x50 */
0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, /* 0x60 */
0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, /* 0x60 */
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, /* 0x70 */
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0xA1E8, 0, 0, 0xA1EC, /* 0xA0 */
0xA1A7, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0xA1E3, 0xA1C0, 0, 0, 0, 0, 0, 0xA1A4, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0xA1C1, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0xA8A4, 0xA8A2, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0xA8A8, 0xA8A6, 0xA8BA, 0, 0xA8AC, 0xA8AA, 0, 0, /* 0xE0 */
0, 0, 0xA8B0, 0xA8AE, 0, 0, 0, 0xA1C2, /* 0xF0 */
0, 0xA8B4, 0xA8B2, 0, 0xA8B9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLECHINSIMP_00[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, /* 0x00 */
0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, /* 0x00 */
0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, /* 0x10 */
0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, /* 0x10 */
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, /* 0x20 */
0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, /* 0x20 */
0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, /* 0x30 */
0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, /* 0x30 */
0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, /* 0x40 */
0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F, /* 0x40 */
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, /* 0x50 */
0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, /* 0x50 */
0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, /* 0x60 */
0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, /* 0x60 */
0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, /* 0x70 */
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0x00A0, 0, 0xA1E9, 0xA1EA, 0xA1E8, 0xA3A4, 0, 0xA1EC, /* 0xA0 */
0xA1A7, 0x00FD, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0xA1E3, 0xA1C0, 0, 0, 0, 0, 0, 0xA1A4, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0xA1C1, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0xA8A4, 0xA8A2, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0xA8A8, 0xA8A6, 0xA8BA, 0, 0xA8AC, 0xA8AA, 0, 0, /* 0xE0 */
0, 0, 0xA8B0, 0xA8AE, 0, 0, 0, 0xA1C2, /* 0xF0 */
0, 0xA8B4, 0xA8B2, 0, 0xA8B9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_01[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA8A1, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0xA8A5, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0xA8A7, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0xA8A9, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0xA8BD, 0, 0, 0, /* 0x40 */
0xA8BE, 0, 0, 0, 0, 0xA8AD, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0xA8B1, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0xA8A3, 0, /* 0xC0 */
0xA8AB, 0, 0xA8AF, 0, 0xA8B3, 0, 0xA8B5, 0, /* 0xD0 */
0xA8B6, 0, 0xA8B7, 0, 0xA8B8 /* 0xD0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_02[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA8BB, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0xA8C0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0xA1A6, /* 0xC0 */
0, 0xA1A5, 0xA840, 0xA841, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0xA842 /* 0xD0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_02[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA8BB, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0xA8C0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0xA1A6, /* 0xC0 */
0, 0xA1A5 /* 0xC0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_03[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA6A1, 0xA6A2, 0xA6A3, 0xA6A4, 0xA6A5, 0xA6A6, 0xA6A7, /* 0x90 */
0xA6A8, 0xA6A9, 0xA6AA, 0xA6AB, 0xA6AC, 0xA6AD, 0xA6AE, 0xA6AF, /* 0x90 */
0xA6B0, 0xA6B1, 0, 0xA6B2, 0xA6B3, 0xA6B4, 0xA6B5, 0xA6B6, /* 0xA0 */
0xA6B7, 0xA6B8, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0xA6C1, 0xA6C2, 0xA6C3, 0xA6C4, 0xA6C5, 0xA6C6, 0xA6C7, /* 0xB0 */
0xA6C8, 0xA6C9, 0xA6CA, 0xA6CB, 0xA6CC, 0xA6CD, 0xA6CE, 0xA6CF, /* 0xB0 */
0xA6D0, 0xA6D1, 0, 0xA6D2, 0xA6D3, 0xA6D4, 0xA6D5, 0xA6D6, /* 0xC0 */
0xA6D7, 0xA6D8 /* 0xC0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_04[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA7A7, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0xA7A1, 0xA7A2, 0xA7A3, 0xA7A4, 0xA7A5, 0xA7A6, 0xA7A8, 0xA7A9, /* 0x10 */
0xA7AA, 0xA7AB, 0xA7AC, 0xA7AD, 0xA7AE, 0xA7AF, 0xA7B0, 0xA7B1, /* 0x10 */
0xA7B2, 0xA7B3, 0xA7B4, 0xA7B5, 0xA7B6, 0xA7B7, 0xA7B8, 0xA7B9, /* 0x20 */
0xA7BA, 0xA7BB, 0xA7BC, 0xA7BD, 0xA7BE, 0xA7BF, 0xA7C0, 0xA7C1, /* 0x20 */
0xA7D1, 0xA7D2, 0xA7D3, 0xA7D4, 0xA7D5, 0xA7D6, 0xA7D8, 0xA7D9, /* 0x30 */
0xA7DA, 0xA7DB, 0xA7DC, 0xA7DD, 0xA7DE, 0xA7DF, 0xA7E0, 0xA7E1, /* 0x30 */
0xA7E2, 0xA7E3, 0xA7E4, 0xA7E5, 0xA7E6, 0xA7E7, 0xA7E8, 0xA7E9, /* 0x40 */
0xA7EA, 0xA7EB, 0xA7EC, 0xA7ED, 0xA7EE, 0xA7EF, 0xA7F0, 0xA7F1, /* 0x40 */
0, 0xA7D7 /* 0x50 */
/* 0x50 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLECHINSIMP_1E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x30 */
0xA8BC, /* 0x30 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_20[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA95C, 0, 0, 0xA843, 0xA1AA, 0xA844, 0xA1AC, 0, /* 0x10 */
0xA1AE, 0xA1AF, 0, 0, 0xA1B0, 0xA1B1, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0xA845, 0xA1AD, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0xA1EB, 0, 0xA1E4, 0xA1E5, 0, 0xA846, 0, 0, /* 0x30 */
0, 0, 0, 0xA1F9, 0, 0, 0xA3FE, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0x0080 /* 0xA0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_20[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1AA, 0xA1AA, 0xA1AC, 0, /* 0x10 */
0xA1AE, 0xA1AF, 0, 0, 0xA1B0, 0xA1B1, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0xA1AD, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0xA1EB, 0, 0xA1E4, 0xA1E5, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0xA1F9, 0, 0, 0xA3FE, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0x0080 /* 0xA0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_21[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1E6, 0, 0xA847, 0, 0, /* 0x00 */
0, 0xA848, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0xA1ED, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0xA959, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0xA2F1, 0xA2F2, 0xA2F3, 0xA2F4, 0xA2F5, 0xA2F6, 0xA2F7, 0xA2F8, /* 0x60 */
0xA2F9, 0xA2FA, 0xA2FB, 0xA2FC, 0, 0, 0, 0, /* 0x60 */
0xA2A1, 0xA2A2, 0xA2A3, 0xA2A4, 0xA2A5, 0xA2A6, 0xA2A7, 0xA2A8, /* 0x70 */
0xA2A9, 0xA2AA, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0xA1FB, 0xA1FC, 0xA1FA, 0xA1FD, 0, 0, 0xA849, 0xA84A, /* 0x90 */
0xA84B, 0xA84C /* 0x90 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_21[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1E6, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0xA1ED, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0xA2F1, 0xA2F2, 0xA2F3, 0xA2F4, 0xA2F5, 0xA2F6, 0xA2F7, 0xA2F8, /* 0x60 */
0xA2F9, 0xA2FA, 0xA2FB, 0xA2FC, 0, 0, 0, 0, /* 0x60 */
0xA2A1, 0xA2A2, 0xA2A3, 0xA2A4, 0xA2A5, 0xA2A6, 0xA2A7, 0xA2A8, /* 0x70 */
0xA2A9, 0xA2AA, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0xA1FB, 0xA1FC, 0xA1FA, 0xA1FD /* 0x90 */
/* 0x90 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLECHINSIMP_21[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1E6, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0xA1ED, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0x00FE, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0xA2F1, 0xA2F2, 0xA2F3, 0xA2F4, 0xA2F5, 0xA2F6, 0xA2F7, 0xA2F8, /* 0x60 */
0xA2F9, 0xA2FA, 0xA2FB, 0xA2FC, 0, 0, 0, 0, /* 0x60 */
0xA2A1, 0xA2A2, 0xA2A3, 0xA2A4, 0xA2A5, 0xA2A6, 0xA2A7, 0xA2A8, /* 0x70 */
0xA2A9, 0xA2AA, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0xA1FB, 0xA1FC, 0xA1FA, 0xA1FD /* 0x90 */
/* 0x90 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_22[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0xA1CA, 0, 0, 0, 0, 0, 0, 0xA1C7, /* 0x00 */
0, 0xA1C6, 0, 0, 0, 0xA84D, 0, 0, /* 0x10 */
0, 0, 0xA1CC, 0, 0, 0xA1D8, 0xA1DE, 0xA84E, /* 0x10 */
0xA1CF, 0, 0, 0xA84F, 0, 0xA1CE, 0, 0xA1C4, /* 0x20 */
0xA1C5, 0xA1C9, 0xA1C8, 0xA1D2, 0, 0, 0xA1D3, 0, /* 0x20 */
0, 0, 0, 0, 0xA1E0, 0xA1DF, 0xA1C3, 0xA1CB, /* 0x30 */
0, 0, 0, 0, 0, 0xA1D7, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0xA1D6, 0, 0, 0, 0xA1D5, 0, 0, 0, /* 0x40 */
0, 0, 0xA850, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0xA1D9, 0xA1D4, 0, 0, 0xA1DC, 0xA1DD, 0xA851, 0xA852, /* 0x60 */
0, 0, 0, 0, 0, 0, 0xA1DA, 0xA1DB, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0xA892, 0, 0, /* 0x90 */
0, 0xA1D1, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0xA1CD, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0xA853, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0xA1AD /* 0xE0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_22[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0xA1CA, 0, 0, 0, 0, 0, 0, 0xA1C7, /* 0x00 */
0, 0xA1C6, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0xA1CC, 0, 0, 0xA1D8, 0xA1DE, 0, /* 0x10 */
0xA1CF, 0, 0, 0, 0, 0xA1CE, 0, 0xA1C4, /* 0x20 */
0xA1C5, 0xA1C9, 0xA1C8, 0xA1D2, 0, 0, 0xA1D3, 0, /* 0x20 */
0, 0, 0, 0, 0xA1E0, 0xA1DF, 0xA1C3, 0xA1CB, /* 0x30 */
0, 0, 0, 0, 0, 0xA1D7, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0xA1D6, 0, 0, 0, 0xA1D5, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0xA1D9, 0xA1D4, 0, 0, 0xA1DC, 0xA1DD, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0xA1DA, 0xA1DB, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0xA1D1, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0xA1CD, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0xA1AD /* 0xE0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_23[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1D0 /* 0x10 */
/* 0x10 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_24[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA2D9, 0xA2DA, 0xA2DB, 0xA2DC, 0xA2DD, 0xA2DE, 0xA2DF, 0xA2E0, /* 0x60 */
0xA2E1, 0xA2E2, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0xA2C5, 0xA2C6, 0xA2C7, 0xA2C8, /* 0x70 */
0xA2C9, 0xA2CA, 0xA2CB, 0xA2CC, 0xA2CD, 0xA2CE, 0xA2CF, 0xA2D0, /* 0x70 */
0xA2D1, 0xA2D2, 0xA2D3, 0xA2D4, 0xA2D5, 0xA2D6, 0xA2D7, 0xA2D8, /* 0x80 */
0xA2B1, 0xA2B2, 0xA2B3, 0xA2B4, 0xA2B5, 0xA2B6, 0xA2B7, 0xA2B8, /* 0x80 */
0xA2B9, 0xA2BA, 0xA2BB, 0xA2BC, 0xA2BD, 0xA2BE, 0xA2BF, 0xA2C0, /* 0x90 */
0xA2C1, 0xA2C2, 0xA2C3, 0xA2C4 /* 0x90 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_25[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA9A4, 0xA9A5, 0xA9A6, 0xA9A7, 0xA9A8, 0xA9A9, 0xA9AA, 0xA9AB, /* 0x00 */
0xA9AC, 0xA9AD, 0xA9AE, 0xA9AF, 0xA9B0, 0xA9B1, 0xA9B2, 0xA9B3, /* 0x00 */
0xA9B4, 0xA9B5, 0xA9B6, 0xA9B7, 0xA9B8, 0xA9B9, 0xA9BA, 0xA9BB, /* 0x10 */
0xA9BC, 0xA9BD, 0xA9BE, 0xA9BF, 0xA9C0, 0xA9C1, 0xA9C2, 0xA9C3, /* 0x10 */
0xA9C4, 0xA9C5, 0xA9C6, 0xA9C7, 0xA9C8, 0xA9C9, 0xA9CA, 0xA9CB, /* 0x20 */
0xA9CC, 0xA9CD, 0xA9CE, 0xA9CF, 0xA9D0, 0xA9D1, 0xA9D2, 0xA9D3, /* 0x20 */
0xA9D4, 0xA9D5, 0xA9D6, 0xA9D7, 0xA9D8, 0xA9D9, 0xA9DA, 0xA9DB, /* 0x30 */
0xA9DC, 0xA9DD, 0xA9DE, 0xA9DF, 0xA9E0, 0xA9E1, 0xA9E2, 0xA9E3, /* 0x30 */
0xA9E4, 0xA9E5, 0xA9E6, 0xA9E7, 0xA9E8, 0xA9E9, 0xA9EA, 0xA9EB, /* 0x40 */
0xA9EC, 0xA9ED, 0xA9EE, 0xA9EF, 0, 0, 0, 0, /* 0x40 */
0xA854, 0xA855, 0xA856, 0xA857, 0xA858, 0xA859, 0xA85A, 0xA85B, /* 0x50 */
0xA85C, 0xA85D, 0xA85E, 0xA85F, 0xA860, 0xA861, 0xA862, 0xA863, /* 0x50 */
0xA864, 0xA865, 0xA866, 0xA867, 0xA868, 0xA869, 0xA86A, 0xA86B, /* 0x60 */
0xA86C, 0xA86D, 0xA86E, 0xA86F, 0xA870, 0xA871, 0xA872, 0xA873, /* 0x60 */
0xA874, 0xA875, 0xA876, 0xA877, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0xA878, 0xA879, 0xA87A, 0xA87B, 0xA87C, 0xA87D, 0xA87E, /* 0x80 */
0xA880, 0xA881, 0xA882, 0xA883, 0xA884, 0xA885, 0xA886, 0xA887, /* 0x80 */
0, 0, 0, 0xA888, 0xA889, 0xA88A, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0xA1F6, 0xA1F5, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0xA1F8, 0xA1F7, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0xA88B, 0xA88C, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0xA1F4, 0xA1F3, /* 0xC0 */
0, 0, 0, 0xA1F0, 0, 0, 0xA1F2, 0xA1F1, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0xA88D, 0xA88E, 0xA88F, 0xA890 /* 0xE0 */
/* 0xE0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_25[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA9A4, 0xA9A5, 0xA9A6, 0xA9A7, 0xA9A8, 0xA9A9, 0xA9AA, 0xA9AB, /* 0x00 */
0xA9AC, 0xA9AD, 0xA9AE, 0xA9AF, 0xA9B0, 0xA9B1, 0xA9B2, 0xA9B3, /* 0x00 */
0xA9B4, 0xA9B5, 0xA9B6, 0xA9B7, 0xA9B8, 0xA9B9, 0xA9BA, 0xA9BB, /* 0x10 */
0xA9BC, 0xA9BD, 0xA9BE, 0xA9BF, 0xA9C0, 0xA9C1, 0xA9C2, 0xA9C3, /* 0x10 */
0xA9C4, 0xA9C5, 0xA9C6, 0xA9C7, 0xA9C8, 0xA9C9, 0xA9CA, 0xA9CB, /* 0x20 */
0xA9CC, 0xA9CD, 0xA9CE, 0xA9CF, 0xA9D0, 0xA9D1, 0xA9D2, 0xA9D3, /* 0x20 */
0xA9D4, 0xA9D5, 0xA9D6, 0xA9D7, 0xA9D8, 0xA9D9, 0xA9DA, 0xA9DB, /* 0x30 */
0xA9DC, 0xA9DD, 0xA9DE, 0xA9DF, 0xA9E0, 0xA9E1, 0xA9E2, 0xA9E3, /* 0x30 */
0xA9E4, 0xA9E5, 0xA9E6, 0xA9E7, 0xA9E8, 0xA9E9, 0xA9EA, 0xA9EB, /* 0x40 */
0xA9EC, 0xA9ED, 0xA9EE, 0xA9EF, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0xA1F6, 0xA1F5, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0xA1F8, 0xA1F7, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0xA1F4, 0xA1F3, /* 0xC0 */
0, 0, 0, 0xA1F0, 0, 0, 0xA1F2, 0xA1F1 /* 0xC0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_26[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1EF, 0xA1EE, 0, /* 0x00 */
0, 0xA891, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0xA1E2, 0, 0xA1E1 /* 0x40 */
/* 0x40 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_26[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1EF, 0xA1EE, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0xA1E2, 0, 0xA1E1 /* 0x40 */
/* 0x40 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_2E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE50, 0, 0, 0xFE54, 0, 0, 0, /* 0x80 */
0xFE57, 0, 0, 0xFE58, 0xFE5D, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0xFE5E, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0xFE6B, /* 0xA0 */
0, 0, 0xFE6E, 0, 0, 0, 0xFE71, 0, /* 0xA0 */
0, 0, 0, 0xFE73, 0, 0, 0xFE74, 0xFE75, /* 0xB0 */
0, 0, 0, 0xFE79, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0xFE84 /* 0xC0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_30[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1A1, 0xA1A2, 0xA1A3, 0xA1A8, 0, 0xA1A9, 0xA965, 0xA996, /* 0x00 */
0xA1B4, 0xA1B5, 0xA1B6, 0xA1B7, 0xA1B8, 0xA1B9, 0xA1BA, 0xA1BB, /* 0x00 */
0xA1BE, 0xA1BF, 0xA893, 0xA1FE, 0xA1B2, 0xA1B3, 0xA1BC, 0xA1BD, /* 0x10 */
0, 0, 0, 0, 0xA1AB, 0xA894, 0xA895, 0, /* 0x10 */
0, 0xA940, 0xA941, 0xA942, 0xA943, 0xA944, 0xA945, 0xA946, /* 0x20 */
0xA947, 0xA948, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0xA4A1, 0xA4A2, 0xA4A3, 0xA4A4, 0xA4A5, 0xA4A6, 0xA4A7, /* 0x40 */
0xA4A8, 0xA4A9, 0xA4AA, 0xA4AB, 0xA4AC, 0xA4AD, 0xA4AE, 0xA4AF, /* 0x40 */
0xA4B0, 0xA4B1, 0xA4B2, 0xA4B3, 0xA4B4, 0xA4B5, 0xA4B6, 0xA4B7, /* 0x50 */
0xA4B8, 0xA4B9, 0xA4BA, 0xA4BB, 0xA4BC, 0xA4BD, 0xA4BE, 0xA4BF, /* 0x50 */
0xA4C0, 0xA4C1, 0xA4C2, 0xA4C3, 0xA4C4, 0xA4C5, 0xA4C6, 0xA4C7, /* 0x60 */
0xA4C8, 0xA4C9, 0xA4CA, 0xA4CB, 0xA4CC, 0xA4CD, 0xA4CE, 0xA4CF, /* 0x60 */
0xA4D0, 0xA4D1, 0xA4D2, 0xA4D3, 0xA4D4, 0xA4D5, 0xA4D6, 0xA4D7, /* 0x70 */
0xA4D8, 0xA4D9, 0xA4DA, 0xA4DB, 0xA4DC, 0xA4DD, 0xA4DE, 0xA4DF, /* 0x70 */
0xA4E0, 0xA4E1, 0xA4E2, 0xA4E3, 0xA4E4, 0xA4E5, 0xA4E6, 0xA4E7, /* 0x80 */
0xA4E8, 0xA4E9, 0xA4EA, 0xA4EB, 0xA4EC, 0xA4ED, 0xA4EE, 0xA4EF, /* 0x80 */
0xA4F0, 0xA4F1, 0xA4F2, 0xA4F3, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0xA961, 0xA962, 0xA966, 0xA967, 0, /* 0x90 */
0, 0xA5A1, 0xA5A2, 0xA5A3, 0xA5A4, 0xA5A5, 0xA5A6, 0xA5A7, /* 0xA0 */
0xA5A8, 0xA5A9, 0xA5AA, 0xA5AB, 0xA5AC, 0xA5AD, 0xA5AE, 0xA5AF, /* 0xA0 */
0xA5B0, 0xA5B1, 0xA5B2, 0xA5B3, 0xA5B4, 0xA5B5, 0xA5B6, 0xA5B7, /* 0xB0 */
0xA5B8, 0xA5B9, 0xA5BA, 0xA5BB, 0xA5BC, 0xA5BD, 0xA5BE, 0xA5BF, /* 0xB0 */
0xA5C0, 0xA5C1, 0xA5C2, 0xA5C3, 0xA5C4, 0xA5C5, 0xA5C6, 0xA5C7, /* 0xC0 */
0xA5C8, 0xA5C9, 0xA5CA, 0xA5CB, 0xA5CC, 0xA5CD, 0xA5CE, 0xA5CF, /* 0xC0 */
0xA5D0, 0xA5D1, 0xA5D2, 0xA5D3, 0xA5D4, 0xA5D5, 0xA5D6, 0xA5D7, /* 0xD0 */
0xA5D8, 0xA5D9, 0xA5DA, 0xA5DB, 0xA5DC, 0xA5DD, 0xA5DE, 0xA5DF, /* 0xD0 */
0xA5E0, 0xA5E1, 0xA5E2, 0xA5E3, 0xA5E4, 0xA5E5, 0xA5E6, 0xA5E7, /* 0xE0 */
0xA5E8, 0xA5E9, 0xA5EA, 0xA5EB, 0xA5EC, 0xA5ED, 0xA5EE, 0xA5EF, /* 0xE0 */
0xA5F0, 0xA5F1, 0xA5F2, 0xA5F3, 0xA5F4, 0xA5F5, 0xA5F6, 0, /* 0xF0 */
0, 0, 0, 0xA1A4, 0xA960, 0xA963, 0xA964 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_30[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA1A1, 0xA1A2, 0xA1A3, 0xA1A8, 0, 0xA1A9, 0, 0, /* 0x00 */
0xA1B4, 0xA1B5, 0xA1B6, 0xA1B7, 0xA1B8, 0xA1B9, 0xA1BA, 0xA1BB, /* 0x00 */
0xA1BE, 0xA1BF, 0, 0xA1FE, 0xA1B2, 0xA1B3, 0xA1BC, 0xA1BD, /* 0x10 */
0, 0, 0, 0, 0xA1AB, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0xA4A1, 0xA4A2, 0xA4A3, 0xA4A4, 0xA4A5, 0xA4A6, 0xA4A7, /* 0x40 */
0xA4A8, 0xA4A9, 0xA4AA, 0xA4AB, 0xA4AC, 0xA4AD, 0xA4AE, 0xA4AF, /* 0x40 */
0xA4B0, 0xA4B1, 0xA4B2, 0xA4B3, 0xA4B4, 0xA4B5, 0xA4B6, 0xA4B7, /* 0x50 */
0xA4B8, 0xA4B9, 0xA4BA, 0xA4BB, 0xA4BC, 0xA4BD, 0xA4BE, 0xA4BF, /* 0x50 */
0xA4C0, 0xA4C1, 0xA4C2, 0xA4C3, 0xA4C4, 0xA4C5, 0xA4C6, 0xA4C7, /* 0x60 */
0xA4C8, 0xA4C9, 0xA4CA, 0xA4CB, 0xA4CC, 0xA4CD, 0xA4CE, 0xA4CF, /* 0x60 */
0xA4D0, 0xA4D1, 0xA4D2, 0xA4D3, 0xA4D4, 0xA4D5, 0xA4D6, 0xA4D7, /* 0x70 */
0xA4D8, 0xA4D9, 0xA4DA, 0xA4DB, 0xA4DC, 0xA4DD, 0xA4DE, 0xA4DF, /* 0x70 */
0xA4E0, 0xA4E1, 0xA4E2, 0xA4E3, 0xA4E4, 0xA4E5, 0xA4E6, 0xA4E7, /* 0x80 */
0xA4E8, 0xA4E9, 0xA4EA, 0xA4EB, 0xA4EC, 0xA4ED, 0xA4EE, 0xA4EF, /* 0x80 */
0xA4F0, 0xA4F1, 0xA4F2, 0xA4F3, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0xA5A1, 0xA5A2, 0xA5A3, 0xA5A4, 0xA5A5, 0xA5A6, 0xA5A7, /* 0xA0 */
0xA5A8, 0xA5A9, 0xA5AA, 0xA5AB, 0xA5AC, 0xA5AD, 0xA5AE, 0xA5AF, /* 0xA0 */
0xA5B0, 0xA5B1, 0xA5B2, 0xA5B3, 0xA5B4, 0xA5B5, 0xA5B6, 0xA5B7, /* 0xB0 */
0xA5B8, 0xA5B9, 0xA5BA, 0xA5BB, 0xA5BC, 0xA5BD, 0xA5BE, 0xA5BF, /* 0xB0 */
0xA5C0, 0xA5C1, 0xA5C2, 0xA5C3, 0xA5C4, 0xA5C5, 0xA5C6, 0xA5C7, /* 0xC0 */
0xA5C8, 0xA5C9, 0xA5CA, 0xA5CB, 0xA5CC, 0xA5CD, 0xA5CE, 0xA5CF, /* 0xC0 */
0xA5D0, 0xA5D1, 0xA5D2, 0xA5D3, 0xA5D4, 0xA5D5, 0xA5D6, 0xA5D7, /* 0xD0 */
0xA5D8, 0xA5D9, 0xA5DA, 0xA5DB, 0xA5DC, 0xA5DD, 0xA5DE, 0xA5DF, /* 0xD0 */
0xA5E0, 0xA5E1, 0xA5E2, 0xA5E3, 0xA5E4, 0xA5E5, 0xA5E6, 0xA5E7, /* 0xE0 */
0xA5E8, 0xA5E9, 0xA5EA, 0xA5EB, 0xA5EC, 0xA5ED, 0xA5EE, 0xA5EF, /* 0xE0 */
0xA5F0, 0xA5F1, 0xA5F2, 0xA5F3, 0xA5F4, 0xA5F5, 0xA5F6, 0, /* 0xF0 */
0, 0, 0, 0xA1A4 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_31[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA8C5, 0xA8C6, 0xA8C7, /* 0x00 */
0xA8C8, 0xA8C9, 0xA8CA, 0xA8CB, 0xA8CC, 0xA8CD, 0xA8CE, 0xA8CF, /* 0x00 */
0xA8D0, 0xA8D1, 0xA8D2, 0xA8D3, 0xA8D4, 0xA8D5, 0xA8D6, 0xA8D7, /* 0x10 */
0xA8D8, 0xA8D9, 0xA8DA, 0xA8DB, 0xA8DC, 0xA8DD, 0xA8DE, 0xA8DF, /* 0x10 */
0xA8E0, 0xA8E1, 0xA8E2, 0xA8E3, 0xA8E4, 0xA8E5, 0xA8E6, 0xA8E7, /* 0x20 */
0xA8E8, 0xA8E9 /* 0x20 */
};
/* ----------------------------------------------------------------------- */
/* GB only from 32_20 to 32_29 */
static sal_uInt16 const aImplUniToDBCSTab_GBK_32[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA2E5, 0xA2E6, 0xA2E7, 0xA2E8, 0xA2E9, 0xA2EA, 0xA2EB, 0xA2EC, /* 0x20 */
0xA2ED, 0xA2EE, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0xA95A, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0xA949 /* 0xA0 */
/* 0xA0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_33[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x80 */
0xA94A, 0xA94B, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0xA94C, 0xA94D, 0xA94E, 0, /* 0x90 */
0, 0xA94F, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0xA950, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0xA951, 0, /* 0xC0 */
0, 0xA952, 0xA953, 0, 0, 0xA954 /* 0xD0 */
/* 0xD0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_34[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE56, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0xFE55 /* 0x70 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_35[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x90 */
0xFE5A /* 0x90 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_36[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0xFE5C, 0, /* 0x00 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0xFE5B /* 0x10 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_39[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x10 */
0xFE60, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0xFE5F, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0xFE62, /* 0xC0 */
0xFE65, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0xFE63 /* 0xD0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_3A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE64 /* 0x70 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_3B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x40 */
0xFE68 /* 0x40 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_3C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x60 */
0xFE69, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0xFE6A /* 0xE0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_40[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE6F /* 0x50 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_41[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x50 */
0xFE70 /* 0x50 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_43[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE72, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0xFE78, 0, 0, 0, /* 0xA0 */
0, 0xFE77, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0xFE7A /* 0xD0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_44[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE7B /* 0xD0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_46[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x40 */
0xFE7D, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0xFE7C /* 0x60 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_47[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE80, 0, 0, 0, 0, /* 0x20 */
0, 0xFE81, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0xFE82, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0xFE83 /* 0x80 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_49[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE85, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0xFE86, 0, 0, 0xFE87, 0, 0, /* 0x70 */
0, 0, 0xFE88, 0xFE89, 0, 0xFE8A, 0xFE8B, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0xFE8D, 0, 0, 0, 0xFE8C, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0xFE8F, 0xFE8E /* 0xB0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_4C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE96, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0xFE93, /* 0x90 */
0xFE94, 0xFE95, 0xFE97, 0xFE92 /* 0xA0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_4D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFE98, 0xFE99, 0xFE9A, 0xFE9B, 0xFE9C, /* 0x10 */
0xFE9D, 0xFE9E, 0, 0, 0, 0, 0, 0, /* 0x10 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0xFE9F /* 0xA0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_4E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD2BB, 0xB6A1, 0x8140, 0xC6DF, 0x8141, 0x8142, 0x8143, 0xCDF2, /* 0x00 */
0xD5C9, 0xC8FD, 0xC9CF, 0xCFC2, 0xD8A2, 0xB2BB, 0xD3EB, 0x8144, /* 0x00 */
0xD8A4, 0xB3F3, 0x8145, 0xD7A8, 0xC7D2, 0xD8A7, 0xCAC0, 0x8146, /* 0x10 */
0xC7F0, 0xB1FB, 0xD2B5, 0xB4D4, 0xB6AB, 0xCBBF, 0xD8A9, 0x8147, /* 0x10 */
0x8148, 0x8149, 0xB6AA, 0x814A, 0xC1BD, 0xD1CF, 0x814B, 0xC9A5, /* 0x20 */
0xD8AD, 0x814C, 0xB8F6, 0xD1BE, 0xE3DC, 0xD6D0, 0x814D, 0x814E, /* 0x20 */
0xB7E1, 0x814F, 0xB4AE, 0x8150, 0xC1D9, 0x8151, 0xD8BC, 0x8152, /* 0x30 */
0xCDE8, 0xB5A4, 0xCEAA, 0xD6F7, 0x8153, 0xC0F6, 0xBED9, 0xD8AF, /* 0x30 */
0x8154, 0x8155, 0x8156, 0xC4CB, 0x8157, 0xBEC3, 0x8158, 0xD8B1, /* 0x40 */
0xC3B4, 0xD2E5, 0x8159, 0xD6AE, 0xCEDA, 0xD5A7, 0xBAF5, 0xB7A6, /* 0x40 */
0xC0D6, 0x815A, 0xC6B9, 0xC5D2, 0xC7C7, 0x815B, 0xB9D4, 0x815C, /* 0x50 */
0xB3CB, 0xD2D2, 0x815D, 0x815E, 0xD8BF, 0xBEC5, 0xC6F2, 0xD2B2, /* 0x50 */
0xCFB0, 0xCFE7, 0x815F, 0x8160, 0x8161, 0x8162, 0xCAE9, 0x8163, /* 0x60 */
0x8164, 0xD8C0, 0x8165, 0x8166, 0x8167, 0x8168, 0x8169, 0x816A, /* 0x60 */
0xC2F2, 0xC2D2, 0x816B, 0xC8E9, 0x816C, 0x816D, 0x816E, 0x816F, /* 0x70 */
0x8170, 0x8171, 0x8172, 0x8173, 0x8174, 0x8175, 0xC7AC, 0x8176, /* 0x70 */
0x8177, 0x8178, 0x8179, 0x817A, 0x817B, 0x817C, 0xC1CB, 0x817D, /* 0x80 */
0xD3E8, 0xD5F9, 0x817E, 0xCAC2, 0xB6FE, 0xD8A1, 0xD3DA, 0xBFF7, /* 0x80 */
0x8180, 0xD4C6, 0xBBA5, 0xD8C1, 0xCEE5, 0xBEAE, 0x8181, 0x8182, /* 0x90 */
0xD8A8, 0x8183, 0xD1C7, 0xD0A9, 0x8184, 0x8185, 0x8186, 0xD8BD, /* 0x90 */
0xD9EF, 0xCDF6, 0xBFBA, 0x8187, 0xBDBB, 0xBAA5, 0xD2E0, 0xB2FA, /* 0xA0 */
0xBAE0, 0xC4B6, 0x8188, 0xCFED, 0xBEA9, 0xCDA4, 0xC1C1, 0x8189, /* 0xA0 */
0x818A, 0x818B, 0xC7D7, 0xD9F1, 0x818C, 0xD9F4, 0x818D, 0x818E, /* 0xB0 */
0x818F, 0x8190, 0xC8CB, 0xD8E9, 0x8191, 0x8192, 0x8193, 0xD2DA, /* 0xB0 */
0xCAB2, 0xC8CA, 0xD8EC, 0xD8EA, 0xD8C6, 0xBDF6, 0xC6CD, 0xB3F0, /* 0xC0 */
0x8194, 0xD8EB, 0xBDF1, 0xBDE9, 0x8195, 0xC8D4, 0xB4D3, 0x8196, /* 0xC0 */
0x8197, 0xC2D8, 0x8198, 0xB2D6, 0xD7D0, 0xCACB, 0xCBFB, 0xD5CC, /* 0xD0 */
0xB8B6, 0xCFC9, 0x8199, 0x819A, 0x819B, 0xD9DA, 0xD8F0, 0xC7AA, /* 0xD0 */
0x819C, 0xD8EE, 0x819D, 0xB4FA, 0xC1EE, 0xD2D4, 0x819E, 0x819F, /* 0xE0 */
0xD8ED, 0x81A0, 0xD2C7, 0xD8EF, 0xC3C7, 0x81A1, 0x81A2, 0x81A3, /* 0xE0 */
0xD1F6, 0x81A4, 0xD6D9, 0xD8F2, 0x81A5, 0xD8F5, 0xBCFE, 0xBCDB, /* 0xF0 */
0x81A6, 0x81A7, 0x81A8, 0xC8CE, 0x81A9, 0xB7DD, 0x81AA, 0xB7C2 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_4F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x81AB, 0xC6F3, 0x81AC, 0x81AD, 0x81AE, 0x81AF, 0x81B0, 0x81B1, /* 0x00 */
0x81B2, 0xD8F8, 0xD2C1, 0x81B3, 0x81B4, 0xCEE9, 0xBCBF, 0xB7FC, /* 0x00 */
0xB7A5, 0xD0DD, 0x81B5, 0x81B6, 0x81B7, 0x81B8, 0x81B9, 0xD6DA, /* 0x10 */
0xD3C5, 0xBBEF, 0xBBE1, 0xD8F1, 0x81BA, 0x81BB, 0xC9A1, 0xCEB0, /* 0x10 */
0xB4AB, 0x81BC, 0xD8F3, 0x81BD, 0xC9CB, 0xD8F6, 0xC2D7, 0xD8F7, /* 0x20 */
0x81BE, 0x81BF, 0xCEB1, 0xD8F9, 0x81C0, 0x81C1, 0x81C2, 0xB2AE, /* 0x20 */
0xB9C0, 0x81C3, 0xD9A3, 0x81C4, 0xB0E9, 0x81C5, 0xC1E6, 0x81C6, /* 0x30 */
0xC9EC, 0x81C7, 0xCBC5, 0x81C8, 0xCBC6, 0xD9A4, 0x81C9, 0x81CA, /* 0x30 */
0x81CB, 0x81CC, 0x81CD, 0xB5E8, 0x81CE, 0x81CF, 0xB5AB, 0x81D0, /* 0x40 */
0x81D1, 0x81D2, 0x81D3, 0x81D4, 0x81D5, 0xCEBB, 0xB5CD, 0xD7A1, /* 0x40 */
0xD7F4, 0xD3D3, 0x81D6, 0xCCE5, 0x81D7, 0xBACE, 0x81D8, 0xD9A2, /* 0x50 */
0xD9DC, 0xD3E0, 0xD8FD, 0xB7F0, 0xD7F7, 0xD8FE, 0xD8FA, 0xD9A1, /* 0x50 */
0xC4E3, 0x81D9, 0x81DA, 0xD3B6, 0xD8F4, 0xD9DD, 0x81DB, 0xD8FB, /* 0x60 */
0x81DC, 0xC5E5, 0x81DD, 0x81DE, 0xC0D0, 0x81DF, 0x81E0, 0xD1F0, /* 0x60 */
0xB0DB, 0x81E1, 0x81E2, 0xBCD1, 0xD9A6, 0x81E3, 0xD9A5, 0x81E4, /* 0x70 */
0x81E5, 0x81E6, 0x81E7, 0xD9AC, 0xD9AE, 0x81E8, 0xD9AB, 0xCAB9, /* 0x70 */
0x81E9, 0x81EA, 0x81EB, 0xD9A9, 0xD6B6, 0x81EC, 0x81ED, 0x81EE, /* 0x80 */
0xB3DE, 0xD9A8, 0x81EF, 0xC0FD, 0x81F0, 0xCACC, 0x81F1, 0xD9AA, /* 0x80 */
0x81F2, 0xD9A7, 0x81F3, 0x81F4, 0xD9B0, 0x81F5, 0x81F6, 0xB6B1, /* 0x90 */
0x81F7, 0x81F8, 0x81F9, 0xB9A9, 0x81FA, 0xD2C0, 0x81FB, 0x81FC, /* 0x90 */
0xCFC0, 0x81FD, 0x81FE, 0xC2C2, 0x8240, 0xBDC4, 0xD5EC, 0xB2E0, /* 0xA0 */
0xC7C8, 0xBFEB, 0xD9AD, 0x8241, 0xD9AF, 0x8242, 0xCEEA, 0xBAEE, /* 0xA0 */
0x8243, 0x8244, 0x8245, 0x8246, 0x8247, 0xC7D6, 0x8248, 0x8249, /* 0xB0 */
0x824A, 0x824B, 0x824C, 0x824D, 0x824E, 0x824F, 0x8250, 0xB1E3, /* 0xB0 */
0x8251, 0x8252, 0x8253, 0xB4D9, 0xB6ED, 0xD9B4, 0x8254, 0x8255, /* 0xC0 */
0x8256, 0x8257, 0xBFA1, 0x8258, 0x8259, 0x825A, 0xD9DE, 0xC7CE, /* 0xC0 */
0xC0FE, 0xD9B8, 0x825B, 0x825C, 0x825D, 0x825E, 0x825F, 0xCBD7, /* 0xD0 */
0xB7FD, 0x8260, 0xD9B5, 0x8261, 0xD9B7, 0xB1A3, 0xD3E1, 0xD9B9, /* 0xD0 */
0x8262, 0xD0C5, 0x8263, 0xD9B6, 0x8264, 0x8265, 0xD9B1, 0x8266, /* 0xE0 */
0xD9B2, 0xC1A9, 0xD9B3, 0x8267, 0x8268, 0xBCF3, 0xD0DE, 0xB8A9, /* 0xE0 */
0x8269, 0xBEE3, 0x826A, 0xD9BD, 0x826B, 0x826C, 0x826D, 0x826E, /* 0xF0 */
0xD9BA, 0x826F, 0xB0B3, 0x8270, 0x8271, 0x8272, 0xD9C2, 0x8273 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_50[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8274, 0x8275, 0x8276, 0x8277, 0x8278, 0x8279, 0x827A, 0x827B, /* 0x00 */
0x827C, 0x827D, 0x827E, 0x8280, 0xD9C4, 0xB1B6, 0x8281, 0xD9BF, /* 0x00 */
0x8282, 0x8283, 0xB5B9, 0x8284, 0xBEF3, 0x8285, 0x8286, 0x8287, /* 0x10 */
0xCCC8, 0xBAF2, 0xD2D0, 0x8288, 0xD9C3, 0x8289, 0x828A, 0xBDE8, /* 0x10 */
0x828B, 0xB3AB, 0x828C, 0x828D, 0x828E, 0xD9C5, 0xBEEB, 0x828F, /* 0x20 */
0xD9C6, 0xD9BB, 0xC4DF, 0x8290, 0xD9BE, 0xD9C1, 0xD9C0, 0x8291, /* 0x20 */
0x8292, 0x8293, 0x8294, 0x8295, 0x8296, 0x8297, 0x8298, 0x8299, /* 0x30 */
0x829A, 0x829B, 0xD5AE, 0x829C, 0xD6B5, 0x829D, 0xC7E3, 0x829E, /* 0x30 */
0x829F, 0x82A0, 0x82A1, 0xD9C8, 0x82A2, 0x82A3, 0x82A4, 0xBCD9, /* 0x40 */
0xD9CA, 0x82A5, 0x82A6, 0x82A7, 0xD9BC, 0x82A8, 0xD9CB, 0xC6AB, /* 0x40 */
0x82A9, 0x82AA, 0x82AB, 0x82AC, 0x82AD, 0xD9C9, 0x82AE, 0x82AF, /* 0x50 */
0x82B0, 0x82B1, 0xD7F6, 0x82B2, 0xCDA3, 0x82B3, 0x82B4, 0x82B5, /* 0x50 */
0x82B6, 0x82B7, 0x82B8, 0x82B9, 0x82BA, 0xBDA1, 0x82BB, 0x82BC, /* 0x60 */
0x82BD, 0x82BE, 0x82BF, 0x82C0, 0xD9CC, 0x82C1, 0x82C2, 0x82C3, /* 0x60 */
0x82C4, 0x82C5, 0x82C6, 0x82C7, 0x82C8, 0x82C9, 0xC5BC, 0xCDB5, /* 0x70 */
0x82CA, 0x82CB, 0x82CC, 0xD9CD, 0x82CD, 0x82CE, 0xD9C7, 0xB3A5, /* 0x70 */
0xBFFE, 0x82CF, 0x82D0, 0x82D1, 0x82D2, 0xB8B5, 0x82D3, 0x82D4, /* 0x80 */
0xC0FC, 0x82D5, 0x82D6, 0x82D7, 0x82D8, 0xB0F8, 0x82D9, 0x82DA, /* 0x80 */
0x82DB, 0x82DC, 0x82DD, 0x82DE, 0x82DF, 0x82E0, 0x82E1, 0x82E2, /* 0x90 */
0x82E3, 0x82E4, 0x82E5, 0x82E6, 0x82E7, 0x82E8, 0x82E9, 0x82EA, /* 0x90 */
0x82EB, 0x82EC, 0x82ED, 0xB4F6, 0x82EE, 0xD9CE, 0x82EF, 0xD9CF, /* 0xA0 */
0xB4A2, 0xD9D0, 0x82F0, 0x82F1, 0xB4DF, 0x82F2, 0x82F3, 0x82F4, /* 0xA0 */
0x82F5, 0x82F6, 0xB0C1, 0x82F7, 0x82F8, 0x82F9, 0x82FA, 0x82FB, /* 0xB0 */
0x82FC, 0x82FD, 0xD9D1, 0xC9B5, 0x82FE, 0x8340, 0x8341, 0x8342, /* 0xB0 */
0x8343, 0x8344, 0x8345, 0x8346, 0x8347, 0x8348, 0x8349, 0x834A, /* 0xC0 */
0x834B, 0x834C, 0x834D, 0x834E, 0x834F, 0x8350, 0x8351, 0xCFF1, /* 0xC0 */
0x8352, 0x8353, 0x8354, 0x8355, 0x8356, 0x8357, 0xD9D2, 0x8358, /* 0xD0 */
0x8359, 0x835A, 0xC1C5, 0x835B, 0x835C, 0x835D, 0x835E, 0x835F, /* 0xD0 */
0x8360, 0x8361, 0x8362, 0x8363, 0x8364, 0x8365, 0xD9D6, 0xC9AE, /* 0xE0 */
0x8366, 0x8367, 0x8368, 0x8369, 0xD9D5, 0xD9D4, 0xD9D7, 0x836A, /* 0xE0 */
0x836B, 0x836C, 0x836D, 0xCBDB, 0x836E, 0xBDA9, 0x836F, 0x8370, /* 0xF0 */
0x8371, 0x8372, 0x8373, 0xC6A7, 0x8374, 0x8375, 0x8376, 0x8377 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_51[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8378, 0x8379, 0x837A, 0x837B, 0x837C, 0x837D, 0xD9D3, 0xD9D8, /* 0x00 */
0x837E, 0x8380, 0x8381, 0xD9D9, 0x8382, 0x8383, 0x8384, 0x8385, /* 0x00 */
0x8386, 0x8387, 0xC8E5, 0x8388, 0x8389, 0x838A, 0x838B, 0x838C, /* 0x10 */
0x838D, 0x838E, 0x838F, 0x8390, 0x8391, 0x8392, 0x8393, 0x8394, /* 0x10 */
0x8395, 0xC0DC, 0x8396, 0x8397, 0x8398, 0x8399, 0x839A, 0x839B, /* 0x20 */
0x839C, 0x839D, 0x839E, 0x839F, 0x83A0, 0x83A1, 0x83A2, 0x83A3, /* 0x20 */
0x83A4, 0x83A5, 0x83A6, 0x83A7, 0x83A8, 0x83A9, 0x83AA, 0x83AB, /* 0x30 */
0x83AC, 0x83AD, 0x83AE, 0x83AF, 0x83B0, 0x83B1, 0x83B2, 0xB6F9, /* 0x30 */
0xD8A3, 0xD4CA, 0x83B3, 0xD4AA, 0xD0D6, 0xB3E4, 0xD5D7, 0x83B4, /* 0x40 */
0xCFC8, 0xB9E2, 0x83B5, 0xBFCB, 0x83B6, 0xC3E2, 0x83B7, 0x83B8, /* 0x40 */
0x83B9, 0xB6D2, 0x83BA, 0x83BB, 0xCDC3, 0xD9EE, 0xD9F0, 0x83BC, /* 0x50 */
0x83BD, 0x83BE, 0xB5B3, 0x83BF, 0xB6B5, 0x83C0, 0x83C1, 0x83C2, /* 0x50 */
0x83C3, 0x83C4, 0xBEA4, 0x83C5, 0x83C6, 0xC8EB, 0x83C7, 0x83C8, /* 0x60 */
0xC8AB, 0x83C9, 0x83CA, 0xB0CB, 0xB9AB, 0xC1F9, 0xD9E2, 0x83CB, /* 0x60 */
0xC0BC, 0xB9B2, 0x83CC, 0xB9D8, 0xD0CB, 0xB1F8, 0xC6E4, 0xBEDF, /* 0x70 */
0xB5E4, 0xD7C8, 0x83CD, 0xD1F8, 0xBCE6, 0xCADE, 0x83CE, 0x83CF, /* 0x70 */
0xBCBD, 0xD9E6, 0xD8E7, 0x83D0, 0x83D1, 0xC4DA, 0x83D2, 0x83D3, /* 0x80 */
0xB8D4, 0xC8BD, 0x83D4, 0x83D5, 0xB2E1, 0xD4D9, 0x83D6, 0x83D7, /* 0x80 */
0x83D8, 0x83D9, 0xC3B0, 0x83DA, 0x83DB, 0xC3E1, 0xDAA2, 0xC8DF, /* 0x90 */
0x83DC, 0xD0B4, 0x83DD, 0xBEFC, 0xC5A9, 0x83DE, 0x83DF, 0x83E0, /* 0x90 */
0xB9DA, 0x83E1, 0xDAA3, 0x83E2, 0xD4A9, 0xDAA4, 0x83E3, 0x83E4, /* 0xA0 */
0x83E5, 0x83E6, 0x83E7, 0xD9FB, 0xB6AC, 0x83E8, 0x83E9, 0xB7EB, /* 0xA0 */
0xB1F9, 0xD9FC, 0xB3E5, 0xBEF6, 0x83EA, 0xBFF6, 0xD2B1, 0xC0E4, /* 0xB0 */
0x83EB, 0x83EC, 0x83ED, 0xB6B3, 0xD9FE, 0xD9FD, 0x83EE, 0x83EF, /* 0xB0 */
0xBEBB, 0x83F0, 0x83F1, 0x83F2, 0xC6E0, 0x83F3, 0xD7BC, 0xDAA1, /* 0xC0 */
0x83F4, 0xC1B9, 0x83F5, 0xB5F2, 0xC1E8, 0x83F6, 0x83F7, 0xBCF5, /* 0xC0 */
0x83F8, 0xB4D5, 0x83F9, 0x83FA, 0x83FB, 0x83FC, 0x83FD, 0x83FE, /* 0xD0 */
0x8440, 0x8441, 0x8442, 0xC1DD, 0x8443, 0xC4FD, 0x8444, 0x8445, /* 0xD0 */
0xBCB8, 0xB7B2, 0x8446, 0x8447, 0xB7EF, 0x8448, 0x8449, 0x844A, /* 0xE0 */
0x844B, 0x844C, 0x844D, 0xD9EC, 0x844E, 0xC6BE, 0x844F, 0xBFAD, /* 0xE0 */
0xBBCB, 0x8450, 0x8451, 0xB5CA, 0x8452, 0xDBC9, 0xD0D7, 0x8453, /* 0xF0 */
0xCDB9, 0xB0BC, 0xB3F6, 0xBBF7, 0xDBCA, 0xBAAF, 0x8454, 0xD4E4 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_52[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xB5B6, 0xB5F3, 0xD8D6, 0xC8D0, 0x8455, 0x8456, 0xB7D6, 0xC7D0, /* 0x00 */
0xD8D7, 0x8457, 0xBFAF, 0x8458, 0x8459, 0xDBBB, 0xD8D8, 0x845A, /* 0x00 */
0x845B, 0xD0CC, 0xBBAE, 0x845C, 0x845D, 0x845E, 0xEBBE, 0xC1D0, /* 0x10 */
0xC1F5, 0xD4F2, 0xB8D5, 0xB4B4, 0x845F, 0xB3F5, 0x8460, 0x8461, /* 0x10 */
0xC9BE, 0x8462, 0x8463, 0x8464, 0xC5D0, 0x8465, 0x8466, 0x8467, /* 0x20 */
0xC5D9, 0xC0FB, 0x8468, 0xB1F0, 0x8469, 0xD8D9, 0xB9CE, 0x846A, /* 0x20 */
0xB5BD, 0x846B, 0x846C, 0xD8DA, 0x846D, 0x846E, 0xD6C6, 0xCBA2, /* 0x30 */
0xC8AF, 0xC9B2, 0xB4CC, 0xBFCC, 0x846F, 0xB9F4, 0x8470, 0xD8DB, /* 0x30 */
0xD8DC, 0xB6E7, 0xBCC1, 0xCCEA, 0x8471, 0x8472, 0x8473, 0x8474, /* 0x40 */
0x8475, 0x8476, 0xCFF7, 0x8477, 0xD8DD, 0xC7B0, 0x8478, 0x8479, /* 0x40 */
0xB9D0, 0xBDA3, 0x847A, 0x847B, 0xCCDE, 0x847C, 0xC6CA, 0x847D, /* 0x50 */
0x847E, 0x8480, 0x8481, 0x8482, 0xD8E0, 0x8483, 0xD8DE, 0x8484, /* 0x50 */
0x8485, 0xD8DF, 0x8486, 0x8487, 0x8488, 0xB0FE, 0x8489, 0xBEE7, /* 0x60 */
0x848A, 0xCAA3, 0xBCF4, 0x848B, 0x848C, 0x848D, 0x848E, 0xB8B1, /* 0x60 */
0x848F, 0x8490, 0xB8EE, 0x8491, 0x8492, 0x8493, 0x8494, 0x8495, /* 0x70 */
0x8496, 0x8497, 0x8498, 0x8499, 0x849A, 0xD8E2, 0x849B, 0xBDCB, /* 0x70 */
0x849C, 0xD8E4, 0xD8E3, 0x849D, 0x849E, 0x849F, 0x84A0, 0x84A1, /* 0x80 */
0xC5FC, 0x84A2, 0x84A3, 0x84A4, 0x84A5, 0x84A6, 0x84A7, 0x84A8, /* 0x80 */
0xD8E5, 0x84A9, 0x84AA, 0xD8E6, 0x84AB, 0x84AC, 0x84AD, 0x84AE, /* 0x90 */
0x84AF, 0x84B0, 0x84B1, 0xC1A6, 0x84B2, 0xC8B0, 0xB0EC, 0xB9A6, /* 0x90 */
0xBCD3, 0xCEF1, 0xDBBD, 0xC1D3, 0x84B3, 0x84B4, 0x84B5, 0x84B6, /* 0xA0 */
0xB6AF, 0xD6FA, 0xC5AC, 0xBDD9, 0xDBBE, 0xDBBF, 0x84B7, 0x84B8, /* 0xA0 */
0x84B9, 0xC0F8, 0xBEA2, 0xC0CD, 0x84BA, 0x84BB, 0x84BC, 0x84BD, /* 0xB0 */
0x84BE, 0x84BF, 0x84C0, 0x84C1, 0x84C2, 0x84C3, 0xDBC0, 0xCAC6, /* 0xB0 */
0x84C4, 0x84C5, 0x84C6, 0xB2AA, 0x84C7, 0x84C8, 0x84C9, 0xD3C2, /* 0xC0 */
0x84CA, 0xC3E3, 0x84CB, 0xD1AB, 0x84CC, 0x84CD, 0x84CE, 0x84CF, /* 0xC0 */
0xDBC2, 0x84D0, 0xC0D5, 0x84D1, 0x84D2, 0x84D3, 0xDBC3, 0x84D4, /* 0xD0 */
0xBFB1, 0x84D5, 0x84D6, 0x84D7, 0x84D8, 0x84D9, 0x84DA, 0xC4BC, /* 0xD0 */
0x84DB, 0x84DC, 0x84DD, 0x84DE, 0xC7DA, 0x84DF, 0x84E0, 0x84E1, /* 0xE0 */
0x84E2, 0x84E3, 0x84E4, 0x84E5, 0x84E6, 0x84E7, 0x84E8, 0x84E9, /* 0xE0 */
0xDBC4, 0x84EA, 0x84EB, 0x84EC, 0x84ED, 0x84EE, 0x84EF, 0x84F0, /* 0xF0 */
0x84F1, 0xD9E8, 0xC9D7, 0x84F2, 0x84F3, 0x84F4, 0xB9B4, 0xCEF0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_53[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD4C8, 0x84F5, 0x84F6, 0x84F7, 0x84F8, 0xB0FC, 0xB4D2, 0x84F9, /* 0x00 */
0xD0D9, 0x84FA, 0x84FB, 0x84FC, 0x84FD, 0xD9E9, 0x84FE, 0xDECB, /* 0x00 */
0xD9EB, 0x8540, 0x8541, 0x8542, 0x8543, 0xD8B0, 0xBBAF, 0xB1B1, /* 0x10 */
0x8544, 0xB3D7, 0xD8CE, 0x8545, 0x8546, 0xD4D1, 0x8547, 0x8548, /* 0x10 */
0xBDB3, 0xBFEF, 0x8549, 0xCFBB, 0x854A, 0x854B, 0xD8D0, 0x854C, /* 0x20 */
0x854D, 0x854E, 0xB7CB, 0x854F, 0x8550, 0x8551, 0xD8D1, 0x8552, /* 0x20 */
0x8553, 0x8554, 0x8555, 0x8556, 0x8557, 0x8558, 0x8559, 0x855A, /* 0x30 */
0x855B, 0xC6A5, 0xC7F8, 0xD2BD, 0x855C, 0x855D, 0xD8D2, 0xC4E4, /* 0x30 */
0x855E, 0xCAAE, 0x855F, 0xC7A7, 0x8560, 0xD8A6, 0x8561, 0xC9FD, /* 0x40 */
0xCEE7, 0xBBDC, 0xB0EB, 0x8562, 0x8563, 0x8564, 0xBBAA, 0xD0AD, /* 0x40 */
0x8565, 0xB1B0, 0xD7E4, 0xD7BF, 0x8566, 0xB5A5, 0xC2F4, 0xC4CF, /* 0x50 */
0x8567, 0x8568, 0xB2A9, 0x8569, 0xB2B7, 0x856A, 0xB1E5, 0xDFB2, /* 0x50 */
0xD5BC, 0xBFA8, 0xC2AC, 0xD8D5, 0xC2B1, 0x856B, 0xD8D4, 0xCED4, /* 0x60 */
0x856C, 0xDAE0, 0x856D, 0xCEC0, 0x856E, 0x856F, 0xD8B4, 0xC3AE, /* 0x60 */
0xD3A1, 0xCEA3, 0x8570, 0xBCB4, 0xC8B4, 0xC2D1, 0x8571, 0xBEED, /* 0x70 */
0xD0B6, 0x8572, 0xDAE1, 0x8573, 0x8574, 0x8575, 0x8576, 0xC7E4, /* 0x70 */
0x8577, 0x8578, 0xB3A7, 0x8579, 0xB6F2, 0xCCFC, 0xC0FA, 0x857A, /* 0x80 */
0x857B, 0xC0F7, 0x857C, 0xD1B9, 0xD1E1, 0xD8C7, 0x857D, 0x857E, /* 0x80 */
0x8580, 0x8581, 0x8582, 0x8583, 0x8584, 0xB2DE, 0x8585, 0x8586, /* 0x90 */
0xC0E5, 0x8587, 0xBAF1, 0x8588, 0x8589, 0xD8C8, 0x858A, 0xD4AD, /* 0x90 */
0x858B, 0x858C, 0xCFE1, 0xD8C9, 0x858D, 0xD8CA, 0xCFC3, 0x858E, /* 0xA0 */
0xB3F8, 0xBEC7, 0x858F, 0x8590, 0x8591, 0x8592, 0xD8CB, 0x8593, /* 0xA0 */
0x8594, 0x8595, 0x8596, 0x8597, 0x8598, 0x8599, 0xDBCC, 0x859A, /* 0xB0 */
0x859B, 0x859C, 0x859D, 0xC8A5, 0x859E, 0x859F, 0x85A0, 0xCFD8, /* 0xB0 */
0x85A1, 0xC8FE, 0xB2CE, 0x85A2, 0x85A3, 0x85A4, 0x85A5, 0x85A6, /* 0xC0 */
0xD3D6, 0xB2E6, 0xBCB0, 0xD3D1, 0xCBAB, 0xB7B4, 0x85A7, 0x85A8, /* 0xC0 */
0x85A9, 0xB7A2, 0x85AA, 0x85AB, 0xCAE5, 0x85AC, 0xC8A1, 0xCADC, /* 0xD0 */
0xB1E4, 0xD0F0, 0x85AD, 0xC5D1, 0x85AE, 0x85AF, 0x85B0, 0xDBC5, /* 0xD0 */
0xB5FE, 0x85B1, 0x85B2, 0xBFDA, 0xB9C5, 0xBEE4, 0xC1ED, 0x85B3, /* 0xE0 */
0xDFB6, 0xDFB5, 0xD6BB, 0xBDD0, 0xD5D9, 0xB0C8, 0xB6A3, 0xBFC9, /* 0xE0 */
0xCCA8, 0xDFB3, 0xCAB7, 0xD3D2, 0x85B4, 0xD8CF, 0xD2B6, 0xBAC5, /* 0xF0 */
0xCBBE, 0xCCBE, 0x85B5, 0xDFB7, 0xB5F0, 0xDFB4, 0x85B6, 0x85B7 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_54[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x85B8, 0xD3F5, 0x85B9, 0xB3D4, 0xB8F7, 0x85BA, 0xDFBA, 0x85BB, /* 0x00 */
0xBACF, 0xBCAA, 0xB5F5, 0x85BC, 0xCDAC, 0xC3FB, 0xBAF3, 0xC0F4, /* 0x00 */
0xCDC2, 0xCFF2, 0xDFB8, 0xCFC5, 0x85BD, 0xC2C0, 0xDFB9, 0xC2F0, /* 0x10 */
0x85BE, 0x85BF, 0x85C0, 0xBEFD, 0x85C1, 0xC1DF, 0xCDCC, 0xD2F7, /* 0x10 */
0xB7CD, 0xDFC1, 0x85C2, 0xDFC4, 0x85C3, 0x85C4, 0xB7F1, 0xB0C9, /* 0x20 */
0xB6D6, 0xB7D4, 0x85C5, 0xBAAC, 0xCCFD, 0xBFD4, 0xCBB1, 0xC6F4, /* 0x20 */
0x85C6, 0xD6A8, 0xDFC5, 0x85C7, 0xCEE2, 0xB3B3, 0x85C8, 0x85C9, /* 0x30 */
0xCEFC, 0xB4B5, 0x85CA, 0xCEC7, 0xBAF0, 0x85CB, 0xCEE1, 0x85CC, /* 0x30 */
0xD1BD, 0x85CD, 0x85CE, 0xDFC0, 0x85CF, 0x85D0, 0xB4F4, 0x85D1, /* 0x40 */
0xB3CA, 0x85D2, 0xB8E6, 0xDFBB, 0x85D3, 0x85D4, 0x85D5, 0x85D6, /* 0x40 */
0xC4C5, 0x85D7, 0xDFBC, 0xDFBD, 0xDFBE, 0xC5BB, 0xDFBF, 0xDFC2, /* 0x50 */
0xD4B1, 0xDFC3, 0x85D8, 0xC7BA, 0xCED8, 0x85D9, 0x85DA, 0x85DB, /* 0x50 */
0x85DC, 0x85DD, 0xC4D8, 0x85DE, 0xDFCA, 0x85DF, 0xDFCF, 0x85E0, /* 0x60 */
0xD6DC, 0x85E1, 0x85E2, 0x85E3, 0x85E4, 0x85E5, 0x85E6, 0x85E7, /* 0x60 */
0x85E8, 0xDFC9, 0xDFDA, 0xCEB6, 0x85E9, 0xBAC7, 0xDFCE, 0xDFC8, /* 0x70 */
0xC5DE, 0x85EA, 0x85EB, 0xC9EB, 0xBAF4, 0xC3FC, 0x85EC, 0x85ED, /* 0x70 */
0xBED7, 0x85EE, 0xDFC6, 0x85EF, 0xDFCD, 0x85F0, 0xC5D8, 0x85F1, /* 0x80 */
0x85F2, 0x85F3, 0x85F4, 0xD5A6, 0xBACD, 0x85F5, 0xBECC, 0xD3BD, /* 0x80 */
0xB8C0, 0x85F6, 0xD6E4, 0x85F7, 0xDFC7, 0xB9BE, 0xBFA7, 0x85F8, /* 0x90 */
0x85F9, 0xC1FC, 0xDFCB, 0xDFCC, 0x85FA, 0xDFD0, 0x85FB, 0x85FC, /* 0x90 */
0x85FD, 0x85FE, 0x8640, 0xDFDB, 0xDFE5, 0x8641, 0xDFD7, 0xDFD6, /* 0xA0 */
0xD7C9, 0xDFE3, 0xDFE4, 0xE5EB, 0xD2A7, 0xDFD2, 0x8642, 0xBFA9, /* 0xA0 */
0x8643, 0xD4DB, 0x8644, 0xBFC8, 0xDFD4, 0x8645, 0x8646, 0x8647, /* 0xB0 */
0xCFCC, 0x8648, 0x8649, 0xDFDD, 0x864A, 0xD1CA, 0x864B, 0xDFDE, /* 0xB0 */
0xB0A7, 0xC6B7, 0xDFD3, 0x864C, 0xBAE5, 0x864D, 0xB6DF, 0xCDDB, /* 0xC0 */
0xB9FE, 0xD4D5, 0x864E, 0x864F, 0xDFDF, 0xCFEC, 0xB0A5, 0xDFE7, /* 0xC0 */
0xDFD1, 0xD1C6, 0xDFD5, 0xDFD8, 0xDFD9, 0xDFDC, 0x8650, 0xBBA9, /* 0xD0 */
0x8651, 0xDFE0, 0xDFE1, 0x8652, 0xDFE2, 0xDFE6, 0xDFE8, 0xD3B4, /* 0xD0 */
0x8653, 0x8654, 0x8655, 0x8656, 0x8657, 0xB8E7, 0xC5B6, 0xDFEA, /* 0xE0 */
0xC9DA, 0xC1A8, 0xC4C4, 0x8658, 0x8659, 0xBFDE, 0xCFF8, 0x865A, /* 0xE0 */
0x865B, 0x865C, 0xD5DC, 0xDFEE, 0x865D, 0x865E, 0x865F, 0x8660, /* 0xF0 */
0x8661, 0x8662, 0xB2B8, 0x8663, 0xBADF, 0xDFEC, 0x8664, 0xDBC1 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_55[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8665, 0xD1E4, 0x8666, 0x8667, 0x8668, 0x8669, 0xCBF4, 0xB4BD, /* 0x00 */
0x866A, 0xB0A6, 0x866B, 0x866C, 0x866D, 0x866E, 0x866F, 0xDFF1, /* 0x00 */
0xCCC6, 0xDFF2, 0x8670, 0x8671, 0xDFED, 0x8672, 0x8673, 0x8674, /* 0x10 */
0x8675, 0x8676, 0x8677, 0xDFE9, 0x8678, 0x8679, 0x867A, 0x867B, /* 0x10 */
0xDFEB, 0x867C, 0xDFEF, 0xDFF0, 0xBBBD, 0x867D, 0x867E, 0xDFF3, /* 0x20 */
0x8680, 0x8681, 0xDFF4, 0x8682, 0xBBA3, 0x8683, 0xCADB, 0xCEA8, /* 0x20 */
0xE0A7, 0xB3AA, 0x8684, 0xE0A6, 0x8685, 0x8686, 0x8687, 0xE0A1, /* 0x30 */
0x8688, 0x8689, 0x868A, 0x868B, 0xDFFE, 0x868C, 0xCDD9, 0xDFFC, /* 0x30 */
0x868D, 0xDFFA, 0x868E, 0xBFD0, 0xD7C4, 0x868F, 0xC9CC, 0x8690, /* 0x40 */
0x8691, 0xDFF8, 0xB0A1, 0x8692, 0x8693, 0x8694, 0x8695, 0x8696, /* 0x40 */
0xDFFD, 0x8697, 0x8698, 0x8699, 0x869A, 0xDFFB, 0xE0A2, 0x869B, /* 0x50 */
0x869C, 0x869D, 0x869E, 0x869F, 0xE0A8, 0x86A0, 0x86A1, 0x86A2, /* 0x50 */
0x86A3, 0xB7C8, 0x86A4, 0x86A5, 0xC6A1, 0xC9B6, 0xC0B2, 0xDFF5, /* 0x60 */
0x86A6, 0x86A7, 0xC5BE, 0x86A8, 0xD8C4, 0xDFF9, 0xC4F6, 0x86A9, /* 0x60 */
0x86AA, 0x86AB, 0x86AC, 0x86AD, 0x86AE, 0xE0A3, 0xE0A4, 0xE0A5, /* 0x70 */
0xD0A5, 0x86AF, 0x86B0, 0xE0B4, 0xCCE4, 0x86B1, 0xE0B1, 0x86B2, /* 0x70 */
0xBFA6, 0xE0AF, 0xCEB9, 0xE0AB, 0xC9C6, 0x86B3, 0x86B4, 0xC0AE, /* 0x80 */
0xE0AE, 0xBAED, 0xBAB0, 0xE0A9, 0x86B5, 0x86B6, 0x86B7, 0xDFF6, /* 0x80 */
0x86B8, 0xE0B3, 0x86B9, 0x86BA, 0xE0B8, 0x86BB, 0x86BC, 0x86BD, /* 0x90 */
0xB4AD, 0xE0B9, 0x86BE, 0x86BF, 0xCFB2, 0xBAC8, 0x86C0, 0xE0B0, /* 0x90 */
0x86C1, 0x86C2, 0x86C3, 0x86C4, 0x86C5, 0x86C6, 0x86C7, 0xD0FA, /* 0xA0 */
0x86C8, 0x86C9, 0x86CA, 0x86CB, 0x86CC, 0x86CD, 0x86CE, 0x86CF, /* 0xA0 */
0x86D0, 0xE0AC, 0x86D1, 0xD4FB, 0x86D2, 0xDFF7, 0x86D3, 0xC5E7, /* 0xB0 */
0x86D4, 0xE0AD, 0x86D5, 0xD3F7, 0x86D6, 0xE0B6, 0xE0B7, 0x86D7, /* 0xB0 */
0x86D8, 0x86D9, 0x86DA, 0x86DB, 0xE0C4, 0xD0E1, 0x86DC, 0x86DD, /* 0xC0 */
0x86DE, 0xE0BC, 0x86DF, 0x86E0, 0xE0C9, 0xE0CA, 0x86E1, 0x86E2, /* 0xC0 */
0x86E3, 0xE0BE, 0xE0AA, 0xC9A4, 0xE0C1, 0x86E4, 0xE0B2, 0x86E5, /* 0xD0 */
0x86E6, 0x86E7, 0x86E8, 0x86E9, 0xCAC8, 0xE0C3, 0x86EA, 0xE0B5, /* 0xD0 */
0x86EB, 0xCECB, 0x86EC, 0xCBC3, 0xE0CD, 0xE0C6, 0xE0C2, 0x86ED, /* 0xE0 */
0xE0CB, 0x86EE, 0xE0BA, 0xE0BF, 0xE0C0, 0x86EF, 0x86F0, 0xE0C5, /* 0xE0 */
0x86F1, 0x86F2, 0xE0C7, 0xE0C8, 0x86F3, 0xE0CC, 0x86F4, 0xE0BB, /* 0xF0 */
0x86F5, 0x86F6, 0x86F7, 0x86F8, 0x86F9, 0xCBD4, 0xE0D5, 0x86FA /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_56[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE0D6, 0xE0D2, 0x86FB, 0x86FC, 0x86FD, 0x86FE, 0x8740, 0x8741, /* 0x00 */
0xE0D0, 0xBCCE, 0x8742, 0x8743, 0xE0D1, 0x8744, 0xB8C2, 0xD8C5, /* 0x00 */
0x8745, 0x8746, 0x8747, 0x8748, 0x8749, 0x874A, 0x874B, 0x874C, /* 0x10 */
0xD0EA, 0x874D, 0x874E, 0xC2EF, 0x874F, 0x8750, 0xE0CF, 0xE0BD, /* 0x10 */
0x8751, 0x8752, 0x8753, 0xE0D4, 0xE0D3, 0x8754, 0x8755, 0xE0D7, /* 0x20 */
0x8756, 0x8757, 0x8758, 0x8759, 0xE0DC, 0xE0D8, 0x875A, 0x875B, /* 0x20 */
0x875C, 0xD6F6, 0xB3B0, 0x875D, 0xD7EC, 0x875E, 0xCBBB, 0x875F, /* 0x30 */
0x8760, 0xE0DA, 0x8761, 0xCEFB, 0x8762, 0x8763, 0x8764, 0xBAD9, /* 0x30 */
0x8765, 0x8766, 0x8767, 0x8768, 0x8769, 0x876A, 0x876B, 0x876C, /* 0x40 */
0x876D, 0x876E, 0x876F, 0x8770, 0xE0E1, 0xE0DD, 0xD2AD, 0x8771, /* 0x40 */
0x8772, 0x8773, 0x8774, 0x8775, 0xE0E2, 0x8776, 0x8777, 0xE0DB, /* 0x50 */
0xE0D9, 0xE0DF, 0x8778, 0x8779, 0xE0E0, 0x877A, 0x877B, 0x877C, /* 0x50 */
0x877D, 0x877E, 0xE0DE, 0x8780, 0xE0E4, 0x8781, 0x8782, 0x8783, /* 0x60 */
0xC6F7, 0xD8AC, 0xD4EB, 0xE0E6, 0xCAC9, 0x8784, 0x8785, 0x8786, /* 0x60 */
0x8787, 0xE0E5, 0x8788, 0x8789, 0x878A, 0x878B, 0xB8C1, 0x878C, /* 0x70 */
0x878D, 0x878E, 0x878F, 0xE0E7, 0xE0E8, 0x8790, 0x8791, 0x8792, /* 0x70 */
0x8793, 0x8794, 0x8795, 0x8796, 0x8797, 0xE0E9, 0xE0E3, 0x8798, /* 0x80 */
0x8799, 0x879A, 0x879B, 0x879C, 0x879D, 0x879E, 0xBABF, 0xCCE7, /* 0x80 */
0x879F, 0x87A0, 0x87A1, 0xE0EA, 0x87A2, 0x87A3, 0x87A4, 0x87A5, /* 0x90 */
0x87A6, 0x87A7, 0x87A8, 0x87A9, 0x87AA, 0x87AB, 0x87AC, 0x87AD, /* 0x90 */
0x87AE, 0x87AF, 0x87B0, 0xCFF9, 0x87B1, 0x87B2, 0x87B3, 0x87B4, /* 0xA0 */
0x87B5, 0x87B6, 0x87B7, 0x87B8, 0x87B9, 0x87BA, 0x87BB, 0xE0EB, /* 0xA0 */
0x87BC, 0x87BD, 0x87BE, 0x87BF, 0x87C0, 0x87C1, 0x87C2, 0xC8C2, /* 0xB0 */
0x87C3, 0x87C4, 0x87C5, 0x87C6, 0xBDC0, 0x87C7, 0x87C8, 0x87C9, /* 0xB0 */
0x87CA, 0x87CB, 0x87CC, 0x87CD, 0x87CE, 0x87CF, 0x87D0, 0x87D1, /* 0xC0 */
0x87D2, 0x87D3, 0xC4D2, 0x87D4, 0x87D5, 0x87D6, 0x87D7, 0x87D8, /* 0xC0 */
0x87D9, 0x87DA, 0x87DB, 0x87DC, 0xE0EC, 0x87DD, 0x87DE, 0xE0ED, /* 0xD0 */
0x87DF, 0x87E0, 0xC7F4, 0xCBC4, 0x87E1, 0xE0EE, 0xBBD8, 0xD8B6, /* 0xD0 */
0xD2F2, 0xE0EF, 0xCDC5, 0x87E2, 0xB6DA, 0x87E3, 0x87E4, 0x87E5, /* 0xE0 */
0x87E6, 0x87E7, 0x87E8, 0xE0F1, 0x87E9, 0xD4B0, 0x87EA, 0x87EB, /* 0xE0 */
0xC0A7, 0xB4D1, 0x87EC, 0x87ED, 0xCEA7, 0xE0F0, 0x87EE, 0x87EF, /* 0xF0 */
0x87F0, 0xE0F2, 0xB9CC, 0x87F1, 0x87F2, 0xB9FA, 0xCDBC, 0xE0F3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_57[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x87F3, 0x87F4, 0x87F5, 0xC6D4, 0xE0F4, 0x87F6, 0xD4B2, 0x87F7, /* 0x00 */
0xC8A6, 0xE0F6, 0xE0F5, 0x87F8, 0x87F9, 0x87FA, 0x87FB, 0x87FC, /* 0x00 */
0x87FD, 0x87FE, 0x8840, 0x8841, 0x8842, 0x8843, 0x8844, 0x8845, /* 0x10 */
0x8846, 0x8847, 0x8848, 0x8849, 0xE0F7, 0x884A, 0x884B, 0xCDC1, /* 0x10 */
0x884C, 0x884D, 0x884E, 0xCAA5, 0x884F, 0x8850, 0x8851, 0x8852, /* 0x20 */
0xD4DA, 0xDBD7, 0xDBD9, 0x8853, 0xDBD8, 0xB9E7, 0xDBDC, 0xDBDD, /* 0x20 */
0xB5D8, 0x8854, 0x8855, 0xDBDA, 0x8856, 0x8857, 0x8858, 0x8859, /* 0x30 */
0x885A, 0xDBDB, 0xB3A1, 0xDBDF, 0x885B, 0x885C, 0xBBF8, 0x885D, /* 0x30 */
0xD6B7, 0x885E, 0xDBE0, 0x885F, 0x8860, 0x8861, 0x8862, 0xBEF9, /* 0x40 */
0x8863, 0x8864, 0xB7BB, 0x8865, 0xDBD0, 0xCCAE, 0xBFB2, 0xBBB5, /* 0x40 */
0xD7F8, 0xBFD3, 0x8866, 0x8867, 0x8868, 0x8869, 0x886A, 0xBFE9, /* 0x50 */
0x886B, 0x886C, 0xBCE1, 0xCCB3, 0xDBDE, 0xB0D3, 0xCEEB, 0xB7D8, /* 0x50 */
0xD7B9, 0xC6C2, 0x886D, 0x886E, 0xC0A4, 0x886F, 0xCCB9, 0x8870, /* 0x60 */
0xDBE7, 0xDBE1, 0xC6BA, 0xDBE3, 0x8871, 0xDBE8, 0x8872, 0xC5F7, /* 0x60 */
0x8873, 0x8874, 0x8875, 0xDBEA, 0x8876, 0x8877, 0xDBE9, 0xBFC0, /* 0x70 */
0x8878, 0x8879, 0x887A, 0xDBE6, 0xDBE5, 0x887B, 0x887C, 0x887D, /* 0x70 */
0x887E, 0x8880, 0xB4B9, 0xC0AC, 0xC2A2, 0xDBE2, 0xDBE4, 0x8881, /* 0x80 */
0x8882, 0x8883, 0x8884, 0xD0CD, 0xDBED, 0x8885, 0x8886, 0x8887, /* 0x80 */
0x8888, 0x8889, 0xC0DD, 0xDBF2, 0x888A, 0x888B, 0x888C, 0x888D, /* 0x90 */
0x888E, 0x888F, 0x8890, 0xB6E2, 0x8891, 0x8892, 0x8893, 0x8894, /* 0x90 */
0xDBF3, 0xDBD2, 0xB9B8, 0xD4AB, 0xDBEC, 0x8895, 0xBFD1, 0xDBF0, /* 0xA0 */
0x8896, 0xDBD1, 0x8897, 0xB5E6, 0x8898, 0xDBEB, 0xBFE5, 0x8899, /* 0xA0 */
0x889A, 0x889B, 0xDBEE, 0x889C, 0xDBF1, 0x889D, 0x889E, 0x889F, /* 0xB0 */
0xDBF9, 0x88A0, 0x88A1, 0x88A2, 0x88A3, 0x88A4, 0x88A5, 0x88A6, /* 0xB0 */
0x88A7, 0x88A8, 0xB9A1, 0xB0A3, 0x88A9, 0x88AA, 0x88AB, 0x88AC, /* 0xC0 */
0x88AD, 0x88AE, 0x88AF, 0xC2F1, 0x88B0, 0x88B1, 0xB3C7, 0xDBEF, /* 0xC0 */
0x88B2, 0x88B3, 0xDBF8, 0x88B4, 0xC6D2, 0xDBF4, 0x88B5, 0x88B6, /* 0xD0 */
0xDBF5, 0xDBF7, 0xDBF6, 0x88B7, 0x88B8, 0xDBFE, 0x88B9, 0xD3F2, /* 0xD0 */
0xB2BA, 0x88BA, 0x88BB, 0x88BC, 0xDBFD, 0x88BD, 0x88BE, 0x88BF, /* 0xE0 */
0x88C0, 0x88C1, 0x88C2, 0x88C3, 0x88C4, 0xDCA4, 0x88C5, 0xDBFB, /* 0xE0 */
0x88C6, 0x88C7, 0x88C8, 0x88C9, 0xDBFA, 0x88CA, 0x88CB, 0x88CC, /* 0xF0 */
0xDBFC, 0xC5E0, 0xBBF9, 0x88CD, 0x88CE, 0xDCA3, 0x88CF, 0x88D0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_58[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xDCA5, 0x88D1, 0xCCC3, 0x88D2, 0x88D3, 0x88D4, 0xB6D1, 0xDDC0, /* 0x00 */
0x88D5, 0x88D6, 0x88D7, 0xDCA1, 0x88D8, 0xDCA2, 0x88D9, 0x88DA, /* 0x00 */
0x88DB, 0xC7B5, 0x88DC, 0x88DD, 0x88DE, 0xB6E9, 0x88DF, 0x88E0, /* 0x10 */
0x88E1, 0xDCA7, 0x88E2, 0x88E3, 0x88E4, 0x88E5, 0xDCA6, 0x88E6, /* 0x10 */
0xDCA9, 0xB1A4, 0x88E7, 0x88E8, 0xB5CC, 0x88E9, 0x88EA, 0x88EB, /* 0x20 */
0x88EC, 0x88ED, 0xBFB0, 0x88EE, 0x88EF, 0x88F0, 0x88F1, 0x88F2, /* 0x20 */
0xD1DF, 0x88F3, 0x88F4, 0x88F5, 0x88F6, 0xB6C2, 0x88F7, 0x88F8, /* 0x30 */
0x88F9, 0x88FA, 0x88FB, 0x88FC, 0x88FD, 0x88FE, 0x8940, 0x8941, /* 0x30 */
0x8942, 0x8943, 0x8944, 0x8945, 0xDCA8, 0x8946, 0x8947, 0x8948, /* 0x40 */
0x8949, 0x894A, 0x894B, 0x894C, 0xCBFA, 0xEBF3, 0x894D, 0x894E, /* 0x40 */
0x894F, 0xCBDC, 0x8950, 0x8951, 0xCBFE, 0x8952, 0x8953, 0x8954, /* 0x50 */
0xCCC1, 0x8955, 0x8956, 0x8957, 0x8958, 0x8959, 0xC8FB, 0x895A, /* 0x50 */
0x895B, 0x895C, 0x895D, 0x895E, 0x895F, 0xDCAA, 0x8960, 0x8961, /* 0x60 */
0x8962, 0x8963, 0x8964, 0xCCEE, 0xDCAB, 0x8965, 0x8966, 0x8967, /* 0x60 */
0x8968, 0x8969, 0x896A, 0x896B, 0x896C, 0x896D, 0x896E, 0x896F, /* 0x70 */
0x8970, 0x8971, 0x8972, 0x8973, 0x8974, 0x8975, 0xDBD3, 0x8976, /* 0x70 */
0xDCAF, 0xDCAC, 0x8977, 0xBEB3, 0x8978, 0xCAFB, 0x8979, 0x897A, /* 0x80 */
0x897B, 0xDCAD, 0x897C, 0x897D, 0x897E, 0x8980, 0x8981, 0x8982, /* 0x80 */
0x8983, 0x8984, 0xC9CA, 0xC4B9, 0x8985, 0x8986, 0x8987, 0x8988, /* 0x90 */
0x8989, 0xC7BD, 0xDCAE, 0x898A, 0x898B, 0x898C, 0xD4F6, 0xD0E6, /* 0x90 */
0x898D, 0x898E, 0x898F, 0x8990, 0x8991, 0x8992, 0x8993, 0x8994, /* 0xA0 */
0xC4AB, 0xB6D5, 0x8995, 0x8996, 0x8997, 0x8998, 0x8999, 0x899A, /* 0xA0 */
0x899B, 0x899C, 0x899D, 0x899E, 0x899F, 0x89A0, 0x89A1, 0x89A2, /* 0xB0 */
0x89A3, 0x89A4, 0x89A5, 0x89A6, 0xDBD4, 0x89A7, 0x89A8, 0x89A9, /* 0xB0 */
0x89AA, 0xB1DA, 0x89AB, 0x89AC, 0x89AD, 0xDBD5, 0x89AE, 0x89AF, /* 0xC0 */
0x89B0, 0x89B1, 0x89B2, 0x89B3, 0x89B4, 0x89B5, 0x89B6, 0x89B7, /* 0xC0 */
0x89B8, 0xDBD6, 0x89B9, 0x89BA, 0x89BB, 0xBABE, 0x89BC, 0x89BD, /* 0xD0 */
0x89BE, 0x89BF, 0x89C0, 0x89C1, 0x89C2, 0x89C3, 0x89C4, 0x89C5, /* 0xD0 */
0x89C6, 0x89C7, 0x89C8, 0x89C9, 0xC8C0, 0x89CA, 0x89CB, 0x89CC, /* 0xE0 */
0x89CD, 0x89CE, 0x89CF, 0xCABF, 0xC8C9, 0x89D0, 0xD7B3, 0x89D1, /* 0xE0 */
0xC9F9, 0x89D2, 0x89D3, 0xBFC7, 0x89D4, 0x89D5, 0xBAF8, 0x89D6, /* 0xF0 */
0x89D7, 0xD2BC, 0x89D8, 0x89D9, 0x89DA, 0x89DB, 0x89DC, 0x89DD /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_59[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x89DE, 0x89DF, 0xE2BA, 0x89E0, 0xB4A6, 0x89E1, 0x89E2, 0xB1B8, /* 0x00 */
0x89E3, 0x89E4, 0x89E5, 0x89E6, 0x89E7, 0xB8B4, 0x89E8, 0xCFC4, /* 0x00 */
0x89E9, 0x89EA, 0x89EB, 0x89EC, 0xD9E7, 0xCFA6, 0xCDE2, 0x89ED, /* 0x10 */
0x89EE, 0xD9ED, 0xB6E0, 0x89EF, 0xD2B9, 0x89F0, 0x89F1, 0xB9BB, /* 0x10 */
0x89F2, 0x89F3, 0x89F4, 0x89F5, 0xE2B9, 0xE2B7, 0x89F6, 0xB4F3, /* 0x20 */
0x89F7, 0xCCEC, 0xCCAB, 0xB7F2, 0x89F8, 0xD8B2, 0xD1EB, 0xBABB, /* 0x20 */
0x89F9, 0xCAA7, 0x89FA, 0x89FB, 0xCDB7, 0x89FC, 0x89FD, 0xD2C4, /* 0x30 */
0xBFE4, 0xBCD0, 0xB6E1, 0x89FE, 0xDEC5, 0x8A40, 0x8A41, 0x8A42, /* 0x30 */
0x8A43, 0xDEC6, 0xDBBC, 0x8A44, 0xD1D9, 0x8A45, 0x8A46, 0xC6E6, /* 0x40 */
0xC4CE, 0xB7EE, 0x8A47, 0xB7DC, 0x8A48, 0x8A49, 0xBFFC, 0xD7E0, /* 0x40 */
0x8A4A, 0xC6F5, 0x8A4B, 0x8A4C, 0xB1BC, 0xDEC8, 0xBDB1, 0xCCD7, /* 0x50 */
0xDECA, 0x8A4D, 0xDEC9, 0x8A4E, 0x8A4F, 0x8A50, 0x8A51, 0x8A52, /* 0x50 */
0xB5EC, 0x8A53, 0xC9DD, 0x8A54, 0x8A55, 0xB0C2, 0x8A56, 0x8A57, /* 0x60 */
0x8A58, 0x8A59, 0x8A5A, 0x8A5B, 0x8A5C, 0x8A5D, 0x8A5E, 0x8A5F, /* 0x60 */
0x8A60, 0x8A61, 0x8A62, 0xC5AE, 0xC5AB, 0x8A63, 0xC4CC, 0x8A64, /* 0x70 */
0xBCE9, 0xCBFD, 0x8A65, 0x8A66, 0x8A67, 0xBAC3, 0x8A68, 0x8A69, /* 0x70 */
0x8A6A, 0xE5F9, 0xC8E7, 0xE5FA, 0xCDFD, 0x8A6B, 0xD7B1, 0xB8BE, /* 0x80 */
0xC2E8, 0x8A6C, 0xC8D1, 0x8A6D, 0x8A6E, 0xE5FB, 0x8A6F, 0x8A70, /* 0x80 */
0x8A71, 0x8A72, 0xB6CA, 0xBCCB, 0x8A73, 0x8A74, 0xD1FD, 0xE6A1, /* 0x90 */
0x8A75, 0xC3EE, 0x8A76, 0x8A77, 0x8A78, 0x8A79, 0xE6A4, 0x8A7A, /* 0x90 */
0x8A7B, 0x8A7C, 0x8A7D, 0xE5FE, 0xE6A5, 0xCDD7, 0x8A7E, 0x8A80, /* 0xA0 */
0xB7C1, 0xE5FC, 0xE5FD, 0xE6A3, 0x8A81, 0x8A82, 0xC4DD, 0xE6A8, /* 0xA0 */
0x8A83, 0x8A84, 0xE6A7, 0x8A85, 0x8A86, 0x8A87, 0x8A88, 0x8A89, /* 0xB0 */
0x8A8A, 0xC3C3, 0x8A8B, 0xC6DE, 0x8A8C, 0x8A8D, 0xE6AA, 0x8A8E, /* 0xB0 */
0x8A8F, 0x8A90, 0x8A91, 0x8A92, 0x8A93, 0x8A94, 0xC4B7, 0x8A95, /* 0xC0 */
0x8A96, 0x8A97, 0xE6A2, 0xCABC, 0x8A98, 0x8A99, 0x8A9A, 0x8A9B, /* 0xC0 */
0xBDE3, 0xB9C3, 0xE6A6, 0xD0D5, 0xCEAF, 0x8A9C, 0x8A9D, 0xE6A9, /* 0xD0 */
0xE6B0, 0x8A9E, 0xD2A6, 0x8A9F, 0xBDAA, 0xE6AD, 0x8AA0, 0x8AA1, /* 0xD0 */
0x8AA2, 0x8AA3, 0x8AA4, 0xE6AF, 0x8AA5, 0xC0D1, 0x8AA6, 0x8AA7, /* 0xE0 */
0xD2CC, 0x8AA8, 0x8AA9, 0x8AAA, 0xBCA7, 0x8AAB, 0x8AAC, 0x8AAD, /* 0xE0 */
0x8AAE, 0x8AAF, 0x8AB0, 0x8AB1, 0x8AB2, 0x8AB3, 0x8AB4, 0x8AB5, /* 0xF0 */
0x8AB6, 0xE6B1, 0x8AB7, 0xD2F6, 0x8AB8, 0x8AB9, 0x8ABA, 0xD7CB /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_5A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8ABB, 0xCDFE, 0x8ABC, 0xCDDE, 0xC2A6, 0xE6AB, 0xE6AC, 0xBDBF, /* 0x00 */
0xE6AE, 0xE6B3, 0x8ABD, 0x8ABE, 0xE6B2, 0x8ABF, 0x8AC0, 0x8AC1, /* 0x00 */
0x8AC2, 0xE6B6, 0x8AC3, 0xE6B8, 0x8AC4, 0x8AC5, 0x8AC6, 0x8AC7, /* 0x10 */
0xC4EF, 0x8AC8, 0x8AC9, 0x8ACA, 0xC4C8, 0x8ACB, 0x8ACC, 0xBEEA, /* 0x10 */
0xC9EF, 0x8ACD, 0x8ACE, 0xE6B7, 0x8ACF, 0xB6F0, 0x8AD0, 0x8AD1, /* 0x20 */
0x8AD2, 0xC3E4, 0x8AD3, 0x8AD4, 0x8AD5, 0x8AD6, 0x8AD7, 0x8AD8, /* 0x20 */
0x8AD9, 0xD3E9, 0xE6B4, 0x8ADA, 0xE6B5, 0x8ADB, 0xC8A2, 0x8ADC, /* 0x30 */
0x8ADD, 0x8ADE, 0x8ADF, 0x8AE0, 0xE6BD, 0x8AE1, 0x8AE2, 0x8AE3, /* 0x30 */
0xE6B9, 0x8AE4, 0x8AE5, 0x8AE6, 0x8AE7, 0x8AE8, 0xC6C5, 0x8AE9, /* 0x40 */
0x8AEA, 0xCDF1, 0xE6BB, 0x8AEB, 0x8AEC, 0x8AED, 0x8AEE, 0x8AEF, /* 0x40 */
0x8AF0, 0x8AF1, 0x8AF2, 0x8AF3, 0x8AF4, 0xE6BC, 0x8AF5, 0x8AF6, /* 0x50 */
0x8AF7, 0x8AF8, 0xBBE9, 0x8AF9, 0x8AFA, 0x8AFB, 0x8AFC, 0x8AFD, /* 0x50 */
0x8AFE, 0x8B40, 0xE6BE, 0x8B41, 0x8B42, 0x8B43, 0x8B44, 0xE6BA, /* 0x60 */
0x8B45, 0x8B46, 0xC0B7, 0x8B47, 0x8B48, 0x8B49, 0x8B4A, 0x8B4B, /* 0x60 */
0x8B4C, 0x8B4D, 0x8B4E, 0x8B4F, 0xD3A4, 0xE6BF, 0xC9F4, 0xE6C3, /* 0x70 */
0x8B50, 0x8B51, 0xE6C4, 0x8B52, 0x8B53, 0x8B54, 0x8B55, 0xD0F6, /* 0x70 */
0x8B56, 0x8B57, 0x8B58, 0x8B59, 0x8B5A, 0x8B5B, 0x8B5C, 0x8B5D, /* 0x80 */
0x8B5E, 0x8B5F, 0x8B60, 0x8B61, 0x8B62, 0x8B63, 0x8B64, 0x8B65, /* 0x80 */
0x8B66, 0x8B67, 0xC3BD, 0x8B68, 0x8B69, 0x8B6A, 0x8B6B, 0x8B6C, /* 0x90 */
0x8B6D, 0x8B6E, 0xC3C4, 0xE6C2, 0x8B6F, 0x8B70, 0x8B71, 0x8B72, /* 0x90 */
0x8B73, 0x8B74, 0x8B75, 0x8B76, 0x8B77, 0x8B78, 0x8B79, 0x8B7A, /* 0xA0 */
0x8B7B, 0x8B7C, 0xE6C1, 0x8B7D, 0x8B7E, 0x8B80, 0x8B81, 0x8B82, /* 0xA0 */
0x8B83, 0x8B84, 0xE6C7, 0xCFB1, 0x8B85, 0xEBF4, 0x8B86, 0x8B87, /* 0xB0 */
0xE6CA, 0x8B88, 0x8B89, 0x8B8A, 0x8B8B, 0x8B8C, 0xE6C5, 0x8B8D, /* 0xB0 */
0x8B8E, 0xBCDE, 0xC9A9, 0x8B8F, 0x8B90, 0x8B91, 0x8B92, 0x8B93, /* 0xC0 */
0x8B94, 0xBCB5, 0x8B95, 0x8B96, 0xCFD3, 0x8B97, 0x8B98, 0x8B99, /* 0xC0 */
0x8B9A, 0x8B9B, 0xE6C8, 0x8B9C, 0xE6C9, 0x8B9D, 0xE6CE, 0x8B9E, /* 0xD0 */
0xE6D0, 0x8B9F, 0x8BA0, 0x8BA1, 0xE6D1, 0x8BA2, 0x8BA3, 0x8BA4, /* 0xD0 */
0xE6CB, 0xB5D5, 0x8BA5, 0xE6CC, 0x8BA6, 0x8BA7, 0xE6CF, 0x8BA8, /* 0xE0 */
0x8BA9, 0xC4DB, 0x8BAA, 0xE6C6, 0x8BAB, 0x8BAC, 0x8BAD, 0x8BAE, /* 0xE0 */
0x8BAF, 0xE6CD, 0x8BB0, 0x8BB1, 0x8BB2, 0x8BB3, 0x8BB4, 0x8BB5, /* 0xF0 */
0x8BB6, 0x8BB7, 0x8BB8, 0x8BB9, 0x8BBA, 0x8BBB, 0x8BBC, 0x8BBD /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_5B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8BBE, 0x8BBF, 0x8BC0, 0x8BC1, 0x8BC2, 0x8BC3, 0x8BC4, 0x8BC5, /* 0x00 */
0x8BC6, 0xE6D2, 0x8BC7, 0x8BC8, 0x8BC9, 0x8BCA, 0x8BCB, 0x8BCC, /* 0x00 */
0x8BCD, 0x8BCE, 0x8BCF, 0x8BD0, 0x8BD1, 0x8BD2, 0xE6D4, 0xE6D3, /* 0x10 */
0x8BD3, 0x8BD4, 0x8BD5, 0x8BD6, 0x8BD7, 0x8BD8, 0x8BD9, 0x8BDA, /* 0x10 */
0x8BDB, 0x8BDC, 0x8BDD, 0x8BDE, 0x8BDF, 0x8BE0, 0x8BE1, 0x8BE2, /* 0x20 */
0x8BE3, 0x8BE4, 0x8BE5, 0x8BE6, 0x8BE7, 0x8BE8, 0x8BE9, 0x8BEA, /* 0x20 */
0x8BEB, 0x8BEC, 0xE6D5, 0x8BED, 0xD9F8, 0x8BEE, 0x8BEF, 0xE6D6, /* 0x30 */
0x8BF0, 0x8BF1, 0x8BF2, 0x8BF3, 0x8BF4, 0x8BF5, 0x8BF6, 0x8BF7, /* 0x30 */
0xE6D7, 0x8BF8, 0x8BF9, 0x8BFA, 0x8BFB, 0x8BFC, 0x8BFD, 0x8BFE, /* 0x40 */
0x8C40, 0x8C41, 0x8C42, 0x8C43, 0x8C44, 0x8C45, 0x8C46, 0x8C47, /* 0x40 */
0xD7D3, 0xE6DD, 0x8C48, 0xE6DE, 0xBFD7, 0xD4D0, 0x8C49, 0xD7D6, /* 0x50 */
0xB4E6, 0xCBEF, 0xE6DA, 0xD8C3, 0xD7CE, 0xD0A2, 0x8C4A, 0xC3CF, /* 0x50 */
0x8C4B, 0x8C4C, 0xE6DF, 0xBCBE, 0xB9C2, 0xE6DB, 0xD1A7, 0x8C4D, /* 0x60 */
0x8C4E, 0xBAA2, 0xC2CF, 0x8C4F, 0xD8AB, 0x8C50, 0x8C51, 0x8C52, /* 0x60 */
0xCAEB, 0xE5EE, 0x8C53, 0xE6DC, 0x8C54, 0xB7F5, 0x8C55, 0x8C56, /* 0x70 */
0x8C57, 0x8C58, 0xC8E6, 0x8C59, 0x8C5A, 0xC4F5, 0x8C5B, 0x8C5C, /* 0x70 */
0xE5B2, 0xC4FE, 0x8C5D, 0xCBFC, 0xE5B3, 0xD5AC, 0x8C5E, 0xD3EE, /* 0x80 */
0xCAD8, 0xB0B2, 0x8C5F, 0xCBCE, 0xCDEA, 0x8C60, 0x8C61, 0xBAEA, /* 0x80 */
0x8C62, 0x8C63, 0x8C64, 0xE5B5, 0x8C65, 0xE5B4, 0x8C66, 0xD7DA, /* 0x90 */
0xB9D9, 0xD6E6, 0xB6A8, 0xCDF0, 0xD2CB, 0xB1A6, 0xCAB5, 0x8C67, /* 0x90 */
0xB3E8, 0xC9F3, 0xBFCD, 0xD0FB, 0xCAD2, 0xE5B6, 0xBBC2, 0x8C68, /* 0xA0 */
0x8C69, 0x8C6A, 0xCFDC, 0xB9AC, 0x8C6B, 0x8C6C, 0x8C6D, 0x8C6E, /* 0xA0 */
0xD4D7, 0x8C6F, 0x8C70, 0xBAA6, 0xD1E7, 0xCFFC, 0xBCD2, 0x8C71, /* 0xB0 */
0xE5B7, 0xC8DD, 0x8C72, 0x8C73, 0x8C74, 0xBFED, 0xB1F6, 0xCBDE, /* 0xB0 */
0x8C75, 0x8C76, 0xBCC5, 0x8C77, 0xBCC4, 0xD2FA, 0xC3DC, 0xBFDC, /* 0xC0 */
0x8C78, 0x8C79, 0x8C7A, 0x8C7B, 0xB8BB, 0x8C7C, 0x8C7D, 0x8C7E, /* 0xC0 */
0xC3C2, 0x8C80, 0xBAAE, 0xD4A2, 0x8C81, 0x8C82, 0x8C83, 0x8C84, /* 0xD0 */
0x8C85, 0x8C86, 0x8C87, 0x8C88, 0x8C89, 0xC7DE, 0xC4AF, 0xB2EC, /* 0xD0 */
0x8C8A, 0xB9D1, 0x8C8B, 0x8C8C, 0xE5BB, 0xC1C8, 0x8C8D, 0x8C8E, /* 0xE0 */
0xD5AF, 0x8C8F, 0x8C90, 0x8C91, 0x8C92, 0x8C93, 0xE5BC, 0x8C94, /* 0xE0 */
0xE5BE, 0x8C95, 0x8C96, 0x8C97, 0x8C98, 0x8C99, 0x8C9A, 0x8C9B, /* 0xF0 */
0xB4E7, 0xB6D4, 0xCBC2, 0xD1B0, 0xB5BC, 0x8C9C, 0x8C9D, 0xCAD9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_5C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8C9E, 0xB7E2, 0x8C9F, 0x8CA0, 0xC9E4, 0x8CA1, 0xBDAB, 0x8CA2, /* 0x00 */
0x8CA3, 0xCEBE, 0xD7F0, 0x8CA4, 0x8CA5, 0x8CA6, 0x8CA7, 0xD0A1, /* 0x00 */
0x8CA8, 0xC9D9, 0x8CA9, 0x8CAA, 0xB6FB, 0xE6D8, 0xBCE2, 0x8CAB, /* 0x10 */
0xB3BE, 0x8CAC, 0xC9D0, 0x8CAD, 0xE6D9, 0xB3A2, 0x8CAE, 0x8CAF, /* 0x10 */
0x8CB0, 0x8CB1, 0xDECC, 0x8CB2, 0xD3C8, 0xDECD, 0x8CB3, 0xD2A2, /* 0x20 */
0x8CB4, 0x8CB5, 0x8CB6, 0x8CB7, 0xDECE, 0x8CB8, 0x8CB9, 0x8CBA, /* 0x20 */
0x8CBB, 0xBECD, 0x8CBC, 0x8CBD, 0xDECF, 0x8CBE, 0x8CBF, 0x8CC0, /* 0x30 */
0xCAAC, 0xD2FC, 0xB3DF, 0xE5EA, 0xC4E1, 0xBEA1, 0xCEB2, 0xC4F2, /* 0x30 */
0xBED6, 0xC6A8, 0xB2E3, 0x8CC1, 0x8CC2, 0xBED3, 0x8CC3, 0x8CC4, /* 0x40 */
0xC7FC, 0xCCEB, 0xBDEC, 0xCEDD, 0x8CC5, 0x8CC6, 0xCABA, 0xC6C1, /* 0x40 */
0xE5EC, 0xD0BC, 0x8CC7, 0x8CC8, 0x8CC9, 0xD5B9, 0x8CCA, 0x8CCB, /* 0x50 */
0x8CCC, 0xE5ED, 0x8CCD, 0x8CCE, 0x8CCF, 0x8CD0, 0xCAF4, 0x8CD1, /* 0x50 */
0xCDC0, 0xC2C5, 0x8CD2, 0xE5EF, 0x8CD3, 0xC2C4, 0xE5F0, 0x8CD4, /* 0x60 */
0x8CD5, 0x8CD6, 0x8CD7, 0x8CD8, 0x8CD9, 0x8CDA, 0xE5F8, 0xCDCD, /* 0x60 */
0x8CDB, 0xC9BD, 0x8CDC, 0x8CDD, 0x8CDE, 0x8CDF, 0x8CE0, 0x8CE1, /* 0x70 */
0x8CE2, 0xD2D9, 0xE1A8, 0x8CE3, 0x8CE4, 0x8CE5, 0x8CE6, 0xD3EC, /* 0x70 */
0x8CE7, 0xCBEA, 0xC6F1, 0x8CE8, 0x8CE9, 0x8CEA, 0x8CEB, 0x8CEC, /* 0x80 */
0xE1AC, 0x8CED, 0x8CEE, 0x8CEF, 0xE1A7, 0xE1A9, 0x8CF0, 0x8CF1, /* 0x80 */
0xE1AA, 0xE1AF, 0x8CF2, 0x8CF3, 0xB2ED, 0x8CF4, 0xE1AB, 0xB8DA, /* 0x90 */
0xE1AD, 0xE1AE, 0xE1B0, 0xB5BA, 0xE1B1, 0x8CF5, 0x8CF6, 0x8CF7, /* 0x90 */
0x8CF8, 0x8CF9, 0xE1B3, 0xE1B8, 0x8CFA, 0x8CFB, 0x8CFC, 0x8CFD, /* 0xA0 */
0x8CFE, 0xD1D2, 0x8D40, 0xE1B6, 0xE1B5, 0xC1EB, 0x8D41, 0x8D42, /* 0xA0 */
0x8D43, 0xE1B7, 0x8D44, 0xD4C0, 0x8D45, 0xE1B2, 0x8D46, 0xE1BA, /* 0xB0 */
0xB0B6, 0x8D47, 0x8D48, 0x8D49, 0x8D4A, 0xE1B4, 0x8D4B, 0xBFF9, /* 0xB0 */
0x8D4C, 0xE1B9, 0x8D4D, 0x8D4E, 0xE1BB, 0x8D4F, 0x8D50, 0x8D51, /* 0xC0 */
0x8D52, 0x8D53, 0x8D54, 0xE1BE, 0x8D55, 0x8D56, 0x8D57, 0x8D58, /* 0xC0 */
0x8D59, 0x8D5A, 0xE1BC, 0x8D5B, 0x8D5C, 0x8D5D, 0x8D5E, 0x8D5F, /* 0xD0 */
0x8D60, 0xD6C5, 0x8D61, 0x8D62, 0x8D63, 0x8D64, 0x8D65, 0x8D66, /* 0xD0 */
0x8D67, 0xCFBF, 0x8D68, 0x8D69, 0xE1BD, 0xE1BF, 0xC2CD, 0x8D6A, /* 0xE0 */
0xB6EB, 0x8D6B, 0xD3F8, 0x8D6C, 0x8D6D, 0xC7CD, 0x8D6E, 0x8D6F, /* 0xE0 */
0xB7E5, 0x8D70, 0x8D71, 0x8D72, 0x8D73, 0x8D74, 0x8D75, 0x8D76, /* 0xF0 */
0x8D77, 0x8D78, 0x8D79, 0xBEFE, 0x8D7A, 0x8D7B, 0x8D7C, 0x8D7D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_5D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8D7E, 0x8D80, 0xE1C0, 0xE1C1, 0x8D81, 0x8D82, 0xE1C7, 0xB3E7, /* 0x00 */
0x8D83, 0x8D84, 0x8D85, 0x8D86, 0x8D87, 0x8D88, 0xC6E9, 0x8D89, /* 0x00 */
0x8D8A, 0x8D8B, 0x8D8C, 0x8D8D, 0xB4DE, 0x8D8E, 0xD1C2, 0x8D8F, /* 0x10 */
0x8D90, 0x8D91, 0x8D92, 0xE1C8, 0x8D93, 0x8D94, 0xE1C6, 0x8D95, /* 0x10 */
0x8D96, 0x8D97, 0x8D98, 0x8D99, 0xE1C5, 0x8D9A, 0xE1C3, 0xE1C2, /* 0x20 */
0x8D9B, 0xB1C0, 0x8D9C, 0x8D9D, 0x8D9E, 0xD5B8, 0xE1C4, 0x8D9F, /* 0x20 */
0x8DA0, 0x8DA1, 0x8DA2, 0x8DA3, 0xE1CB, 0x8DA4, 0x8DA5, 0x8DA6, /* 0x30 */
0x8DA7, 0x8DA8, 0x8DA9, 0x8DAA, 0x8DAB, 0xE1CC, 0xE1CA, 0x8DAC, /* 0x30 */
0x8DAD, 0x8DAE, 0x8DAF, 0x8DB0, 0x8DB1, 0x8DB2, 0x8DB3, 0xEFFA, /* 0x40 */
0x8DB4, 0x8DB5, 0xE1D3, 0xE1D2, 0xC7B6, 0x8DB6, 0x8DB7, 0x8DB8, /* 0x40 */
0x8DB9, 0x8DBA, 0x8DBB, 0x8DBC, 0x8DBD, 0x8DBE, 0x8DBF, 0x8DC0, /* 0x50 */
0xE1C9, 0x8DC1, 0x8DC2, 0xE1CE, 0x8DC3, 0xE1D0, 0x8DC4, 0x8DC5, /* 0x50 */
0x8DC6, 0x8DC7, 0x8DC8, 0x8DC9, 0x8DCA, 0x8DCB, 0x8DCC, 0x8DCD, /* 0x60 */
0x8DCE, 0xE1D4, 0x8DCF, 0xE1D1, 0xE1CD, 0x8DD0, 0x8DD1, 0xE1CF, /* 0x60 */
0x8DD2, 0x8DD3, 0x8DD4, 0x8DD5, 0xE1D5, 0x8DD6, 0x8DD7, 0x8DD8, /* 0x70 */
0x8DD9, 0x8DDA, 0x8DDB, 0x8DDC, 0x8DDD, 0x8DDE, 0x8DDF, 0x8DE0, /* 0x70 */
0x8DE1, 0x8DE2, 0xE1D6, 0x8DE3, 0x8DE4, 0x8DE5, 0x8DE6, 0x8DE7, /* 0x80 */
0x8DE8, 0x8DE9, 0x8DEA, 0x8DEB, 0x8DEC, 0x8DED, 0x8DEE, 0x8DEF, /* 0x80 */
0x8DF0, 0x8DF1, 0x8DF2, 0x8DF3, 0x8DF4, 0x8DF5, 0x8DF6, 0x8DF7, /* 0x90 */
0x8DF8, 0xE1D7, 0x8DF9, 0x8DFA, 0x8DFB, 0xE1D8, 0x8DFC, 0x8DFD, /* 0x90 */
0x8DFE, 0x8E40, 0x8E41, 0x8E42, 0x8E43, 0x8E44, 0x8E45, 0x8E46, /* 0xA0 */
0x8E47, 0x8E48, 0x8E49, 0x8E4A, 0x8E4B, 0x8E4C, 0x8E4D, 0x8E4E, /* 0xA0 */
0x8E4F, 0x8E50, 0x8E51, 0x8E52, 0x8E53, 0x8E54, 0x8E55, 0xE1DA, /* 0xB0 */
0x8E56, 0x8E57, 0x8E58, 0x8E59, 0x8E5A, 0x8E5B, 0x8E5C, 0x8E5D, /* 0xB0 */
0x8E5E, 0x8E5F, 0x8E60, 0x8E61, 0x8E62, 0xE1DB, 0x8E63, 0x8E64, /* 0xC0 */
0x8E65, 0x8E66, 0x8E67, 0x8E68, 0x8E69, 0xCEA1, 0x8E6A, 0x8E6B, /* 0xC0 */
0x8E6C, 0x8E6D, 0x8E6E, 0x8E6F, 0x8E70, 0x8E71, 0x8E72, 0x8E73, /* 0xD0 */
0x8E74, 0x8E75, 0x8E76, 0xE7DD, 0x8E77, 0xB4A8, 0xD6DD, 0x8E78, /* 0xD0 */
0x8E79, 0xD1B2, 0xB3B2, 0x8E7A, 0x8E7B, 0xB9A4, 0xD7F3, 0xC7C9, /* 0xE0 */
0xBEDE, 0xB9AE, 0x8E7C, 0xCED7, 0x8E7D, 0x8E7E, 0xB2EE, 0xDBCF, /* 0xE0 */
0x8E80, 0xBCBA, 0xD2D1, 0xCBC8, 0xB0CD, 0x8E81, 0x8E82, 0xCFEF, /* 0xF0 */
0x8E83, 0x8E84, 0x8E85, 0x8E86, 0x8E87, 0xD9E3, 0xBDED, 0x8E88 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_5E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x8E89, 0xB1D2, 0xCAD0, 0xB2BC, 0x8E8A, 0xCBA7, 0xB7AB, 0x8E8B, /* 0x00 */
0xCAA6, 0x8E8C, 0x8E8D, 0x8E8E, 0xCFA3, 0x8E8F, 0x8E90, 0xE0F8, /* 0x00 */
0xD5CA, 0xE0FB, 0x8E91, 0x8E92, 0xE0FA, 0xC5C1, 0xCCFB, 0x8E93, /* 0x10 */
0xC1B1, 0xE0F9, 0xD6E3, 0xB2AF, 0xD6C4, 0xB5DB, 0x8E94, 0x8E95, /* 0x10 */
0x8E96, 0x8E97, 0x8E98, 0x8E99, 0x8E9A, 0x8E9B, 0xB4F8, 0xD6A1, /* 0x20 */
0x8E9C, 0x8E9D, 0x8E9E, 0x8E9F, 0x8EA0, 0xCFAF, 0xB0EF, 0x8EA1, /* 0x20 */
0x8EA2, 0xE0FC, 0x8EA3, 0x8EA4, 0x8EA5, 0x8EA6, 0x8EA7, 0xE1A1, /* 0x30 */
0xB3A3, 0x8EA8, 0x8EA9, 0xE0FD, 0xE0FE, 0xC3B1, 0x8EAA, 0x8EAB, /* 0x30 */
0x8EAC, 0x8EAD, 0xC3DD, 0x8EAE, 0xE1A2, 0xB7F9, 0x8EAF, 0x8EB0, /* 0x40 */
0x8EB1, 0x8EB2, 0x8EB3, 0x8EB4, 0xBBCF, 0x8EB5, 0x8EB6, 0x8EB7, /* 0x40 */
0x8EB8, 0x8EB9, 0x8EBA, 0x8EBB, 0xE1A3, 0xC4BB, 0x8EBC, 0x8EBD, /* 0x50 */
0x8EBE, 0x8EBF, 0x8EC0, 0xE1A4, 0x8EC1, 0x8EC2, 0xE1A5, 0x8EC3, /* 0x50 */
0x8EC4, 0xE1A6, 0xB4B1, 0x8EC5, 0x8EC6, 0x8EC7, 0x8EC8, 0x8EC9, /* 0x60 */
0x8ECA, 0x8ECB, 0x8ECC, 0x8ECD, 0x8ECE, 0x8ECF, 0x8ED0, 0x8ED1, /* 0x60 */
0x8ED2, 0x8ED3, 0xB8C9, 0xC6BD, 0xC4EA, 0x8ED4, 0xB2A2, 0x8ED5, /* 0x70 */
0xD0D2, 0x8ED6, 0xE7DB, 0xBBC3, 0xD3D7, 0xD3C4, 0x8ED7, 0xB9E3, /* 0x70 */
0xE2CF, 0x8ED8, 0x8ED9, 0x8EDA, 0xD7AF, 0x8EDB, 0xC7EC, 0xB1D3, /* 0x80 */
0x8EDC, 0x8EDD, 0xB4B2, 0xE2D1, 0x8EDE, 0x8EDF, 0x8EE0, 0xD0F2, /* 0x80 */
0xC2AE, 0xE2D0, 0x8EE1, 0xBFE2, 0xD3A6, 0xB5D7, 0xE2D2, 0xB5EA, /* 0x90 */
0x8EE2, 0xC3ED, 0xB8FD, 0x8EE3, 0xB8AE, 0x8EE4, 0xC5D3, 0xB7CF, /* 0x90 */
0xE2D4, 0x8EE5, 0x8EE6, 0x8EE7, 0x8EE8, 0xE2D3, 0xB6C8, 0xD7F9, /* 0xA0 */
0x8EE9, 0x8EEA, 0x8EEB, 0x8EEC, 0x8EED, 0xCDA5, 0x8EEE, 0x8EEF, /* 0xA0 */
0x8EF0, 0x8EF1, 0x8EF2, 0xE2D8, 0x8EF3, 0xE2D6, 0xCAFC, 0xBFB5, /* 0xB0 */
0xD3B9, 0xE2D5, 0x8EF4, 0x8EF5, 0x8EF6, 0x8EF7, 0xE2D7, 0x8EF8, /* 0xB0 */
0x8EF9, 0x8EFA, 0x8EFB, 0x8EFC, 0x8EFD, 0x8EFE, 0x8F40, 0x8F41, /* 0xC0 */
0x8F42, 0xC1AE, 0xC0C8, 0x8F43, 0x8F44, 0x8F45, 0x8F46, 0x8F47, /* 0xC0 */
0x8F48, 0xE2DB, 0xE2DA, 0xC0AA, 0x8F49, 0x8F4A, 0xC1CE, 0x8F4B, /* 0xD0 */
0x8F4C, 0x8F4D, 0x8F4E, 0xE2DC, 0x8F4F, 0x8F50, 0x8F51, 0x8F52, /* 0xD0 */
0x8F53, 0x8F54, 0x8F55, 0x8F56, 0x8F57, 0x8F58, 0x8F59, 0x8F5A, /* 0xE0 */
0xE2DD, 0x8F5B, 0xE2DE, 0x8F5C, 0x8F5D, 0x8F5E, 0x8F5F, 0x8F60, /* 0xE0 */
0x8F61, 0x8F62, 0x8F63, 0x8F64, 0xDBC8, 0x8F65, 0xD1D3, 0xCDA2, /* 0xF0 */
0x8F66, 0x8F67, 0xBDA8, 0x8F68, 0x8F69, 0x8F6A, 0xDEC3, 0xD8A5 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_5F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xBFAA, 0xDBCD, 0xD2EC, 0xC6FA, 0xC5AA, 0x8F6B, 0x8F6C, 0x8F6D, /* 0x00 */
0xDEC4, 0x8F6E, 0xB1D7, 0xDFAE, 0x8F6F, 0x8F70, 0x8F71, 0xCABD, /* 0x00 */
0x8F72, 0xDFB1, 0x8F73, 0xB9AD, 0x8F74, 0xD2FD, 0x8F75, 0xB8A5, /* 0x10 */
0xBAEB, 0x8F76, 0x8F77, 0xB3DA, 0x8F78, 0x8F79, 0x8F7A, 0xB5DC, /* 0x10 */
0xD5C5, 0x8F7B, 0x8F7C, 0x8F7D, 0x8F7E, 0xC3D6, 0xCFD2, 0xBBA1, /* 0x20 */
0x8F80, 0xE5F3, 0xE5F2, 0x8F81, 0x8F82, 0xE5F4, 0x8F83, 0xCDE4, /* 0x20 */
0x8F84, 0xC8F5, 0x8F85, 0x8F86, 0x8F87, 0x8F88, 0x8F89, 0x8F8A, /* 0x30 */
0x8F8B, 0xB5AF, 0xC7BF, 0x8F8C, 0xE5F6, 0x8F8D, 0x8F8E, 0x8F8F, /* 0x30 */
0xECB0, 0x8F90, 0x8F91, 0x8F92, 0x8F93, 0x8F94, 0x8F95, 0x8F96, /* 0x40 */
0x8F97, 0x8F98, 0x8F99, 0x8F9A, 0x8F9B, 0x8F9C, 0x8F9D, 0x8F9E, /* 0x40 */
0xE5E6, 0x8F9F, 0xB9E9, 0xB5B1, 0x8FA0, 0xC2BC, 0xE5E8, 0xE5E7, /* 0x50 */
0xE5E9, 0x8FA1, 0x8FA2, 0x8FA3, 0x8FA4, 0xD2CD, 0x8FA5, 0x8FA6, /* 0x50 */
0x8FA7, 0xE1EA, 0xD0CE, 0x8FA8, 0xCDAE, 0x8FA9, 0xD1E5, 0x8FAA, /* 0x60 */
0x8FAB, 0xB2CA, 0xB1EB, 0x8FAC, 0xB1F2, 0xC5ED, 0x8FAD, 0x8FAE, /* 0x60 */
0xD5C3, 0xD3B0, 0x8FAF, 0xE1DC, 0x8FB0, 0x8FB1, 0x8FB2, 0xE1DD, /* 0x70 */
0x8FB3, 0xD2DB, 0x8FB4, 0xB3B9, 0xB1CB, 0x8FB5, 0x8FB6, 0x8FB7, /* 0x70 */
0xCDF9, 0xD5F7, 0xE1DE, 0x8FB8, 0xBEB6, 0xB4FD, 0x8FB9, 0xE1DF, /* 0x80 */
0xBADC, 0xE1E0, 0xBBB2, 0xC2C9, 0xE1E1, 0x8FBA, 0x8FBB, 0x8FBC, /* 0x80 */
0xD0EC, 0x8FBD, 0xCDBD, 0x8FBE, 0x8FBF, 0xE1E2, 0x8FC0, 0xB5C3, /* 0x90 */
0xC5C7, 0xE1E3, 0x8FC1, 0x8FC2, 0xE1E4, 0x8FC3, 0x8FC4, 0x8FC5, /* 0x90 */
0x8FC6, 0xD3F9, 0x8FC7, 0x8FC8, 0x8FC9, 0x8FCA, 0x8FCB, 0x8FCC, /* 0xA0 */
0xE1E5, 0x8FCD, 0xD1AD, 0x8FCE, 0x8FCF, 0xE1E6, 0xCEA2, 0x8FD0, /* 0xA0 */
0x8FD1, 0x8FD2, 0x8FD3, 0x8FD4, 0x8FD5, 0xE1E7, 0x8FD6, 0xB5C2, /* 0xB0 */
0x8FD7, 0x8FD8, 0x8FD9, 0x8FDA, 0xE1E8, 0xBBD5, 0x8FDB, 0x8FDC, /* 0xB0 */
0x8FDD, 0x8FDE, 0x8FDF, 0xD0C4, 0xE2E0, 0xB1D8, 0xD2E4, 0x8FE0, /* 0xC0 */
0x8FE1, 0xE2E1, 0x8FE2, 0x8FE3, 0xBCC9, 0xC8CC, 0x8FE4, 0xE2E3, /* 0xC0 */
0xECFE, 0xECFD, 0xDFAF, 0x8FE5, 0x8FE6, 0x8FE7, 0xE2E2, 0xD6BE, /* 0xD0 */
0xCDFC, 0xC3A6, 0x8FE8, 0x8FE9, 0x8FEA, 0xE3C3, 0x8FEB, 0x8FEC, /* 0xD0 */
0xD6D2, 0xE2E7, 0x8FED, 0x8FEE, 0xE2E8, 0x8FEF, 0x8FF0, 0xD3C7, /* 0xE0 */
0x8FF1, 0x8FF2, 0xE2EC, 0xBFEC, 0x8FF3, 0xE2ED, 0xE2E5, 0x8FF4, /* 0xE0 */
0x8FF5, 0xB3C0, 0x8FF6, 0x8FF7, 0x8FF8, 0xC4EE, 0x8FF9, 0x8FFA, /* 0xF0 */
0xE2EE, 0x8FFB, 0x8FFC, 0xD0C3, 0x8FFD, 0xBAF6, 0xE2E9, 0xB7DE /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_60[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xBBB3, 0xCCAC, 0xCBCB, 0xE2E4, 0xE2E6, 0xE2EA, 0xE2EB, 0x8FFE, /* 0x00 */
0x9040, 0x9041, 0xE2F7, 0x9042, 0x9043, 0xE2F4, 0xD4F5, 0xE2F3, /* 0x00 */
0x9044, 0x9045, 0xC5AD, 0x9046, 0xD5FA, 0xC5C2, 0xB2C0, 0x9047, /* 0x10 */
0x9048, 0xE2EF, 0x9049, 0xE2F2, 0xC1AF, 0xCBBC, 0x904A, 0x904B, /* 0x10 */
0xB5A1, 0xE2F9, 0x904C, 0x904D, 0x904E, 0xBCB1, 0xE2F1, 0xD0D4, /* 0x20 */
0xD4B9, 0xE2F5, 0xB9D6, 0xE2F6, 0x904F, 0x9050, 0x9051, 0xC7D3, /* 0x20 */
0x9052, 0x9053, 0x9054, 0x9055, 0x9056, 0xE2F0, 0x9057, 0x9058, /* 0x30 */
0x9059, 0x905A, 0x905B, 0xD7DC, 0xEDA1, 0x905C, 0x905D, 0xE2F8, /* 0x30 */
0x905E, 0xEDA5, 0xE2FE, 0xCAD1, 0x905F, 0x9060, 0x9061, 0x9062, /* 0x40 */
0x9063, 0x9064, 0x9065, 0xC1B5, 0x9066, 0xBBD0, 0x9067, 0x9068, /* 0x40 */
0xBFD6, 0x9069, 0xBAE3, 0x906A, 0x906B, 0xCBA1, 0x906C, 0x906D, /* 0x50 */
0x906E, 0xEDA6, 0xEDA3, 0x906F, 0x9070, 0xEDA2, 0x9071, 0x9072, /* 0x50 */
0x9073, 0x9074, 0xBBD6, 0xEDA7, 0xD0F4, 0x9075, 0x9076, 0xEDA4, /* 0x60 */
0xBADE, 0xB6F7, 0xE3A1, 0xB6B2, 0xCCF1, 0xB9A7, 0x9077, 0xCFA2, /* 0x60 */
0xC7A1, 0x9078, 0x9079, 0xBFD2, 0x907A, 0x907B, 0xB6F1, 0x907C, /* 0x70 */
0xE2FA, 0xE2FB, 0xE2FD, 0xE2FC, 0xC4D5, 0xE3A2, 0x907D, 0xD3C1, /* 0x70 */
0x907E, 0x9080, 0x9081, 0xE3A7, 0xC7C4, 0x9082, 0x9083, 0x9084, /* 0x80 */
0x9085, 0xCFA4, 0x9086, 0x9087, 0xE3A9, 0xBAB7, 0x9088, 0x9089, /* 0x80 */
0x908A, 0x908B, 0xE3A8, 0x908C, 0xBBDA, 0x908D, 0xE3A3, 0x908E, /* 0x90 */
0x908F, 0x9090, 0xE3A4, 0xE3AA, 0x9091, 0xE3A6, 0x9092, 0xCEF2, /* 0x90 */
0xD3C6, 0x9093, 0x9094, 0xBBBC, 0x9095, 0x9096, 0xD4C3, 0x9097, /* 0xA0 */
0xC4FA, 0x9098, 0x9099, 0xEDA8, 0xD0FC, 0xE3A5, 0x909A, 0xC3F5, /* 0xA0 */
0x909B, 0xE3AD, 0xB1AF, 0x909C, 0xE3B2, 0x909D, 0x909E, 0x909F, /* 0xB0 */
0xBCC2, 0x90A0, 0x90A1, 0xE3AC, 0xB5BF, 0x90A2, 0x90A3, 0x90A4, /* 0xB0 */
0x90A5, 0x90A6, 0x90A7, 0x90A8, 0x90A9, 0xC7E9, 0xE3B0, 0x90AA, /* 0xC0 */
0x90AB, 0x90AC, 0xBEAA, 0xCDEF, 0x90AD, 0x90AE, 0x90AF, 0x90B0, /* 0xC0 */
0x90B1, 0xBBF3, 0x90B2, 0x90B3, 0x90B4, 0xCCE8, 0x90B5, 0x90B6, /* 0xD0 */
0xE3AF, 0x90B7, 0xE3B1, 0x90B8, 0xCFA7, 0xE3AE, 0x90B9, 0xCEA9, /* 0xD0 */
0xBBDD, 0x90BA, 0x90BB, 0x90BC, 0x90BD, 0x90BE, 0xB5EB, 0xBEE5, /* 0xE0 */
0xB2D2, 0xB3CD, 0x90BF, 0xB1B9, 0xE3AB, 0xB2D1, 0xB5AC, 0xB9DF, /* 0xE0 */
0xB6E8, 0x90C0, 0x90C1, 0xCFEB, 0xE3B7, 0x90C2, 0xBBCC, 0x90C3, /* 0xF0 */
0x90C4, 0xC8C7, 0xD0CA, 0x90C5, 0x90C6, 0x90C7, 0x90C8, 0x90C9 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_61[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE3B8, 0xB3EE, 0x90CA, 0x90CB, 0x90CC, 0x90CD, 0xEDA9, 0x90CE, /* 0x00 */
0xD3FA, 0xD3E4, 0x90CF, 0x90D0, 0x90D1, 0xEDAA, 0xE3B9, 0xD2E2, /* 0x00 */
0x90D2, 0x90D3, 0x90D4, 0x90D5, 0x90D6, 0xE3B5, 0x90D7, 0x90D8, /* 0x10 */
0x90D9, 0x90DA, 0xD3DE, 0x90DB, 0x90DC, 0x90DD, 0x90DE, 0xB8D0, /* 0x10 */
0xE3B3, 0x90DF, 0x90E0, 0xE3B6, 0xB7DF, 0x90E1, 0xE3B4, 0xC0A2, /* 0x20 */
0x90E2, 0x90E3, 0x90E4, 0xE3BA, 0x90E5, 0x90E6, 0x90E7, 0x90E8, /* 0x20 */
0x90E9, 0x90EA, 0x90EB, 0x90EC, 0x90ED, 0x90EE, 0x90EF, 0x90F0, /* 0x30 */
0x90F1, 0x90F2, 0x90F3, 0x90F4, 0x90F5, 0x90F6, 0x90F7, 0xD4B8, /* 0x30 */
0x90F8, 0x90F9, 0x90FA, 0x90FB, 0x90FC, 0x90FD, 0x90FE, 0x9140, /* 0x40 */
0xB4C8, 0x9141, 0xE3BB, 0x9142, 0xBBC5, 0x9143, 0xC9F7, 0x9144, /* 0x40 */
0x9145, 0xC9E5, 0x9146, 0x9147, 0x9148, 0xC4BD, 0x9149, 0x914A, /* 0x50 */
0x914B, 0x914C, 0x914D, 0x914E, 0x914F, 0xEDAB, 0x9150, 0x9151, /* 0x50 */
0x9152, 0x9153, 0xC2FD, 0x9154, 0x9155, 0x9156, 0x9157, 0xBBDB, /* 0x60 */
0xBFAE, 0x9158, 0x9159, 0x915A, 0x915B, 0x915C, 0x915D, 0x915E, /* 0x60 */
0xCEBF, 0x915F, 0x9160, 0x9161, 0x9162, 0xE3BC, 0x9163, 0xBFB6, /* 0x70 */
0x9164, 0x9165, 0x9166, 0x9167, 0x9168, 0x9169, 0x916A, 0x916B, /* 0x70 */
0x916C, 0x916D, 0x916E, 0x916F, 0x9170, 0x9171, 0x9172, 0x9173, /* 0x80 */
0x9174, 0x9175, 0x9176, 0xB1EF, 0x9177, 0x9178, 0xD4F7, 0x9179, /* 0x80 */
0x917A, 0x917B, 0x917C, 0x917D, 0xE3BE, 0x917E, 0x9180, 0x9181, /* 0x90 */
0x9182, 0x9183, 0x9184, 0x9185, 0x9186, 0xEDAD, 0x9187, 0x9188, /* 0x90 */
0x9189, 0x918A, 0x918B, 0x918C, 0x918D, 0x918E, 0x918F, 0xE3BF, /* 0xA0 */
0xBAA9, 0xEDAC, 0x9190, 0x9191, 0xE3BD, 0x9192, 0x9193, 0x9194, /* 0xA0 */
0x9195, 0x9196, 0x9197, 0x9198, 0x9199, 0x919A, 0x919B, 0xE3C0, /* 0xB0 */
0x919C, 0x919D, 0x919E, 0x919F, 0x91A0, 0x91A1, 0xBAB6, 0x91A2, /* 0xB0 */
0x91A3, 0x91A4, 0xB6AE, 0x91A5, 0x91A6, 0x91A7, 0x91A8, 0x91A9, /* 0xC0 */
0xD0B8, 0x91AA, 0xB0C3, 0xEDAE, 0x91AB, 0x91AC, 0x91AD, 0x91AE, /* 0xC0 */
0x91AF, 0xEDAF, 0xC0C1, 0x91B0, 0xE3C1, 0x91B1, 0x91B2, 0x91B3, /* 0xD0 */
0x91B4, 0x91B5, 0x91B6, 0x91B7, 0x91B8, 0x91B9, 0x91BA, 0x91BB, /* 0xD0 */
0x91BC, 0x91BD, 0x91BE, 0x91BF, 0x91C0, 0x91C1, 0xC5B3, 0x91C2, /* 0xE0 */
0x91C3, 0x91C4, 0x91C5, 0x91C6, 0x91C7, 0x91C8, 0x91C9, 0x91CA, /* 0xE0 */
0x91CB, 0x91CC, 0x91CD, 0x91CE, 0x91CF, 0xE3C2, 0x91D0, 0x91D1, /* 0xF0 */
0x91D2, 0x91D3, 0x91D4, 0x91D5, 0x91D6, 0x91D7, 0x91D8, 0xDCB2 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_62[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x91D9, 0x91DA, 0x91DB, 0x91DC, 0x91DD, 0x91DE, 0xEDB0, 0x91DF, /* 0x00 */
0xB8EA, 0x91E0, 0xCEEC, 0xEAA7, 0xD0E7, 0xCAF9, 0xC8D6, 0xCFB7, /* 0x00 */
0xB3C9, 0xCED2, 0xBDE4, 0x91E1, 0x91E2, 0xE3DE, 0xBBF2, 0xEAA8, /* 0x10 */
0xD5BD, 0x91E3, 0xC6DD, 0xEAA9, 0x91E4, 0x91E5, 0x91E6, 0xEAAA, /* 0x10 */
0x91E7, 0xEAAC, 0xEAAB, 0x91E8, 0xEAAE, 0xEAAD, 0x91E9, 0x91EA, /* 0x20 */
0x91EB, 0x91EC, 0xBDD8, 0x91ED, 0xEAAF, 0x91EE, 0xC2BE, 0x91EF, /* 0x20 */
0x91F0, 0x91F1, 0x91F2, 0xB4C1, 0xB4F7, 0x91F3, 0x91F4, 0xBBA7, /* 0x30 */
0x91F5, 0x91F6, 0x91F7, 0x91F8, 0x91F9, 0xECE6, 0xECE5, 0xB7BF, /* 0x30 */
0xCBF9, 0xB1E2, 0x91FA, 0xECE7, 0x91FB, 0x91FC, 0x91FD, 0xC9C8, /* 0x40 */
0xECE8, 0xECE9, 0x91FE, 0xCAD6, 0xDED0, 0xB2C5, 0xD4FA, 0x9240, /* 0x40 */
0x9241, 0xC6CB, 0xB0C7, 0xB4F2, 0xC8D3, 0x9242, 0x9243, 0x9244, /* 0x50 */
0xCDD0, 0x9245, 0x9246, 0xBFB8, 0x9247, 0x9248, 0x9249, 0x924A, /* 0x50 */
0x924B, 0x924C, 0x924D, 0xBFDB, 0x924E, 0x924F, 0xC7A4, 0xD6B4, /* 0x60 */
0x9250, 0xC0A9, 0xDED1, 0xC9A8, 0xD1EF, 0xC5A4, 0xB0E7, 0xB3B6, /* 0x60 */
0xC8C5, 0x9251, 0x9252, 0xB0E2, 0x9253, 0x9254, 0xB7F6, 0x9255, /* 0x70 */
0x9256, 0xC5FA, 0x9257, 0x9258, 0xB6F3, 0x9259, 0xD5D2, 0xB3D0, /* 0x70 */
0xBCBC, 0x925A, 0x925B, 0x925C, 0xB3AD, 0x925D, 0x925E, 0x925F, /* 0x80 */
0x9260, 0xBEF1, 0xB0D1, 0x9261, 0x9262, 0x9263, 0x9264, 0x9265, /* 0x80 */
0x9266, 0xD2D6, 0xCAE3, 0xD7A5, 0x9267, 0xCDB6, 0xB6B6, 0xBFB9, /* 0x90 */
0xD5DB, 0x9268, 0xB8A7, 0xC5D7, 0x9269, 0x926A, 0x926B, 0xDED2, /* 0x90 */
0xBFD9, 0xC2D5, 0xC7C0, 0x926C, 0xBBA4, 0xB1A8, 0x926D, 0x926E, /* 0xA0 */
0xC5EA, 0x926F, 0x9270, 0xC5FB, 0xCCA7, 0x9271, 0x9272, 0x9273, /* 0xA0 */
0x9274, 0xB1A7, 0x9275, 0x9276, 0x9277, 0xB5D6, 0x9278, 0x9279, /* 0xB0 */
0x927A, 0xC4A8, 0x927B, 0xDED3, 0xD1BA, 0xB3E9, 0x927C, 0xC3F2, /* 0xB0 */
0x927D, 0x927E, 0xB7F7, 0x9280, 0xD6F4, 0xB5A3, 0xB2F0, 0xC4B4, /* 0xC0 */
0xC4E9, 0xC0AD, 0xDED4, 0x9281, 0xB0E8, 0xC5C4, 0xC1E0, 0x9282, /* 0xC0 */
0xB9D5, 0x9283, 0xBEDC, 0xCDD8, 0xB0CE, 0x9284, 0xCDCF, 0xDED6, /* 0xD0 */
0xBED0, 0xD7BE, 0xDED5, 0xD5D0, 0xB0DD, 0x9285, 0x9286, 0xC4E2, /* 0xD0 */
0x9287, 0x9288, 0xC2A3, 0xBCF0, 0x9289, 0xD3B5, 0xC0B9, 0xC5A1, /* 0xE0 */
0xB2A6, 0xD4F1, 0x928A, 0x928B, 0xC0A8, 0xCAC3, 0xDED7, 0xD5FC, /* 0xE0 */
0x928C, 0xB9B0, 0x928D, 0xC8AD, 0xCBA9, 0x928E, 0xDED9, 0xBFBD, /* 0xF0 */
0x928F, 0x9290, 0x9291, 0x9292, 0xC6B4, 0xD7A7, 0xCAB0, 0xC4C3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_63[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9293, 0xB3D6, 0xB9D2, 0x9294, 0x9295, 0x9296, 0x9297, 0xD6B8, /* 0x00 */
0xEAFC, 0xB0B4, 0x9298, 0x9299, 0x929A, 0x929B, 0xBFE6, 0x929C, /* 0x00 */
0x929D, 0xCCF4, 0x929E, 0x929F, 0x92A0, 0x92A1, 0xCDDA, 0x92A2, /* 0x10 */
0x92A3, 0x92A4, 0xD6BF, 0xC2CE, 0x92A5, 0xCECE, 0xCCA2, 0xD0AE, /* 0x10 */
0xC4D3, 0xB5B2, 0xDED8, 0xD5F5, 0xBCB7, 0xBBD3, 0x92A6, 0x92A7, /* 0x20 */
0xB0A4, 0x92A8, 0xC5B2, 0xB4EC, 0x92A9, 0x92AA, 0x92AB, 0xD5F1, /* 0x20 */
0x92AC, 0x92AD, 0xEAFD, 0x92AE, 0x92AF, 0x92B0, 0x92B1, 0x92B2, /* 0x30 */
0x92B3, 0xDEDA, 0xCDA6, 0x92B4, 0x92B5, 0xCDEC, 0x92B6, 0x92B7, /* 0x30 */
0x92B8, 0x92B9, 0xCEE6, 0xDEDC, 0x92BA, 0xCDB1, 0xC0A6, 0x92BB, /* 0x40 */
0x92BC, 0xD7BD, 0x92BD, 0xDEDB, 0xB0C6, 0xBAB4, 0xC9D3, 0xC4F3, /* 0x40 */
0xBEE8, 0x92BE, 0x92BF, 0x92C0, 0x92C1, 0xB2B6, 0x92C2, 0x92C3, /* 0x50 */
0x92C4, 0x92C5, 0x92C6, 0x92C7, 0x92C8, 0x92C9, 0xC0CC, 0xCBF0, /* 0x50 */
0x92CA, 0xBCF1, 0xBBBB, 0xB5B7, 0x92CB, 0x92CC, 0x92CD, 0xC5F5, /* 0x60 */
0x92CE, 0xDEE6, 0x92CF, 0x92D0, 0x92D1, 0xDEE3, 0xBEDD, 0x92D2, /* 0x60 */
0x92D3, 0xDEDF, 0x92D4, 0x92D5, 0x92D6, 0x92D7, 0xB4B7, 0xBDDD, /* 0x70 */
0x92D8, 0x92D9, 0xDEE0, 0xC4ED, 0x92DA, 0x92DB, 0x92DC, 0x92DD, /* 0x70 */
0xCFC6, 0x92DE, 0xB5E0, 0x92DF, 0x92E0, 0x92E1, 0x92E2, 0xB6DE, /* 0x80 */
0xCADA, 0xB5F4, 0xDEE5, 0x92E3, 0xD5C6, 0x92E4, 0xDEE1, 0xCCCD, /* 0x80 */
0xC6FE, 0x92E5, 0xC5C5, 0x92E6, 0x92E7, 0x92E8, 0xD2B4, 0x92E9, /* 0x90 */
0xBEF2, 0x92EA, 0x92EB, 0x92EC, 0x92ED, 0x92EE, 0x92EF, 0x92F0, /* 0x90 */
0xC2D3, 0x92F1, 0xCCBD, 0xB3B8, 0x92F2, 0xBDD3, 0x92F3, 0xBFD8, /* 0xA0 */
0xCDC6, 0xD1DA, 0xB4EB, 0x92F4, 0xDEE4, 0xDEDD, 0xDEE7, 0x92F5, /* 0xA0 */
0xEAFE, 0x92F6, 0x92F7, 0xC2B0, 0xDEE2, 0x92F8, 0x92F9, 0xD6C0, /* 0xB0 */
0xB5A7, 0x92FA, 0xB2F4, 0x92FB, 0xDEE8, 0x92FC, 0xDEF2, 0x92FD, /* 0xB0 */
0x92FE, 0x9340, 0x9341, 0x9342, 0xDEED, 0x9343, 0xDEF1, 0x9344, /* 0xC0 */
0x9345, 0xC8E0, 0x9346, 0x9347, 0x9348, 0xD7E1, 0xDEEF, 0xC3E8, /* 0xC0 */
0xCCE1, 0x9349, 0xB2E5, 0x934A, 0x934B, 0x934C, 0xD2BE, 0x934D, /* 0xD0 */
0x934E, 0x934F, 0x9350, 0x9351, 0x9352, 0x9353, 0xDEEE, 0x9354, /* 0xD0 */
0xDEEB, 0xCED5, 0x9355, 0xB4A7, 0x9356, 0x9357, 0x9358, 0x9359, /* 0xE0 */
0x935A, 0xBFAB, 0xBEBE, 0x935B, 0x935C, 0xBDD2, 0x935D, 0x935E, /* 0xE0 */
0x935F, 0x9360, 0xDEE9, 0x9361, 0xD4AE, 0x9362, 0xDEDE, 0x9363, /* 0xF0 */
0xDEEA, 0x9364, 0x9365, 0x9366, 0x9367, 0xC0BF, 0x9368, 0xDEEC /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_64[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xB2F3, 0xB8E9, 0xC2A7, 0x9369, 0x936A, 0xBDC1, 0x936B, 0x936C, /* 0x00 */
0x936D, 0x936E, 0x936F, 0xDEF5, 0xDEF8, 0x9370, 0x9371, 0xB2AB, /* 0x00 */
0xB4A4, 0x9372, 0x9373, 0xB4EA, 0xC9A6, 0x9374, 0x9375, 0x9376, /* 0x10 */
0x9377, 0x9378, 0x9379, 0xDEF6, 0xCBD1, 0x937A, 0xB8E3, 0x937B, /* 0x10 */
0xDEF7, 0xDEFA, 0x937C, 0x937D, 0x937E, 0x9380, 0xDEF9, 0x9381, /* 0x20 */
0x9382, 0x9383, 0xCCC2, 0x9384, 0xB0E1, 0xB4EE, 0x9385, 0x9386, /* 0x20 */
0x9387, 0x9388, 0x9389, 0x938A, 0xE5BA, 0x938B, 0x938C, 0x938D, /* 0x30 */
0x938E, 0x938F, 0xD0AF, 0x9390, 0x9391, 0xB2EB, 0x9392, 0xEBA1, /* 0x30 */
0x9393, 0xDEF4, 0x9394, 0x9395, 0xC9E3, 0xDEF3, 0xB0DA, 0xD2A1, /* 0x40 */
0xB1F7, 0x9396, 0xCCAF, 0x9397, 0x9398, 0x9399, 0x939A, 0x939B, /* 0x40 */
0x939C, 0x939D, 0xDEF0, 0x939E, 0xCBA4, 0x939F, 0x93A0, 0x93A1, /* 0x50 */
0xD5AA, 0x93A2, 0x93A3, 0x93A4, 0x93A5, 0x93A6, 0xDEFB, 0x93A7, /* 0x50 */
0x93A8, 0x93A9, 0x93AA, 0x93AB, 0x93AC, 0x93AD, 0x93AE, 0xB4DD, /* 0x60 */
0x93AF, 0xC4A6, 0x93B0, 0x93B1, 0x93B2, 0xDEFD, 0x93B3, 0x93B4, /* 0x60 */
0x93B5, 0x93B6, 0x93B7, 0x93B8, 0x93B9, 0x93BA, 0x93BB, 0x93BC, /* 0x70 */
0xC3FE, 0xC4A1, 0xDFA1, 0x93BD, 0x93BE, 0x93BF, 0x93C0, 0x93C1, /* 0x70 */
0x93C2, 0x93C3, 0xC1CC, 0x93C4, 0xDEFC, 0xBEEF, 0x93C5, 0xC6B2, /* 0x80 */
0x93C6, 0x93C7, 0x93C8, 0x93C9, 0x93CA, 0x93CB, 0x93CC, 0x93CD, /* 0x80 */
0x93CE, 0xB3C5, 0xC8F6, 0x93CF, 0x93D0, 0xCBBA, 0xDEFE, 0x93D1, /* 0x90 */
0x93D2, 0xDFA4, 0x93D3, 0x93D4, 0x93D5, 0x93D6, 0xD7B2, 0x93D7, /* 0x90 */
0x93D8, 0x93D9, 0x93DA, 0x93DB, 0xB3B7, 0x93DC, 0x93DD, 0x93DE, /* 0xA0 */
0x93DF, 0xC1C3, 0x93E0, 0x93E1, 0xC7CB, 0xB2A5, 0xB4E9, 0x93E2, /* 0xA0 */
0xD7AB, 0x93E3, 0x93E4, 0x93E5, 0x93E6, 0xC4EC, 0x93E7, 0xDFA2, /* 0xB0 */
0xDFA3, 0x93E8, 0xDFA5, 0x93E9, 0xBAB3, 0x93EA, 0x93EB, 0x93EC, /* 0xB0 */
0xDFA6, 0x93ED, 0xC0DE, 0x93EE, 0x93EF, 0xC9C3, 0x93F0, 0x93F1, /* 0xC0 */
0x93F2, 0x93F3, 0x93F4, 0x93F5, 0x93F6, 0xB2D9, 0xC7E6, 0x93F7, /* 0xC0 */
0xDFA7, 0x93F8, 0xC7DC, 0x93F9, 0x93FA, 0x93FB, 0x93FC, 0xDFA8, /* 0xD0 */
0xEBA2, 0x93FD, 0x93FE, 0x9440, 0x9441, 0x9442, 0xCBD3, 0x9443, /* 0xD0 */
0x9444, 0x9445, 0xDFAA, 0x9446, 0xDFA9, 0x9447, 0xB2C1, 0x9448, /* 0xE0 */
0x9449, 0x944A, 0x944B, 0x944C, 0x944D, 0x944E, 0x944F, 0x9450, /* 0xE0 */
0x9451, 0x9452, 0x9453, 0x9454, 0x9455, 0x9456, 0x9457, 0x9458, /* 0xF0 */
0x9459, 0x945A, 0x945B, 0x945C, 0x945D, 0x945E, 0x945F, 0x9460 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_65[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xC5CA, 0x9461, 0x9462, 0x9463, 0x9464, 0x9465, 0x9466, 0x9467, /* 0x00 */
0x9468, 0xDFAB, 0x9469, 0x946A, 0x946B, 0x946C, 0x946D, 0x946E, /* 0x00 */
0x946F, 0x9470, 0xD4DC, 0x9471, 0x9472, 0x9473, 0x9474, 0x9475, /* 0x10 */
0xC8C1, 0x9476, 0x9477, 0x9478, 0x9479, 0x947A, 0x947B, 0x947C, /* 0x10 */
0x947D, 0x947E, 0x9480, 0x9481, 0x9482, 0xDFAC, 0x9483, 0x9484, /* 0x20 */
0x9485, 0x9486, 0x9487, 0xBEF0, 0x9488, 0x9489, 0xDFAD, 0xD6A7, /* 0x20 */
0x948A, 0x948B, 0x948C, 0x948D, 0xEAB7, 0xEBB6, 0xCAD5, 0x948E, /* 0x30 */
0xD8FC, 0xB8C4, 0x948F, 0xB9A5, 0x9490, 0x9491, 0xB7C5, 0xD5FE, /* 0x30 */
0x9492, 0x9493, 0x9494, 0x9495, 0x9496, 0xB9CA, 0x9497, 0x9498, /* 0x40 */
0xD0A7, 0xF4CD, 0x9499, 0x949A, 0xB5D0, 0x949B, 0x949C, 0xC3F4, /* 0x40 */
0x949D, 0xBEC8, 0x949E, 0x949F, 0x94A0, 0xEBB7, 0xB0BD, 0x94A1, /* 0x50 */
0x94A2, 0xBDCC, 0x94A3, 0xC1B2, 0x94A4, 0xB1D6, 0xB3A8, 0x94A5, /* 0x50 */
0x94A6, 0x94A7, 0xB8D2, 0xC9A2, 0x94A8, 0x94A9, 0xB6D8, 0x94AA, /* 0x60 */
0x94AB, 0x94AC, 0x94AD, 0xEBB8, 0xBEB4, 0x94AE, 0x94AF, 0x94B0, /* 0x60 */
0xCAFD, 0x94B1, 0xC7C3, 0x94B2, 0xD5FB, 0x94B3, 0x94B4, 0xB7F3, /* 0x70 */
0x94B5, 0x94B6, 0x94B7, 0x94B8, 0x94B9, 0x94BA, 0x94BB, 0x94BC, /* 0x70 */
0x94BD, 0x94BE, 0x94BF, 0x94C0, 0x94C1, 0x94C2, 0x94C3, 0xCEC4, /* 0x80 */
0x94C4, 0x94C5, 0x94C6, 0xD5AB, 0xB1F3, 0x94C7, 0x94C8, 0x94C9, /* 0x80 */
0xECB3, 0xB0DF, 0x94CA, 0xECB5, 0x94CB, 0x94CC, 0x94CD, 0xB6B7, /* 0x90 */
0x94CE, 0xC1CF, 0x94CF, 0xF5FA, 0xD0B1, 0x94D0, 0x94D1, 0xD5E5, /* 0x90 */
0x94D2, 0xCED3, 0x94D3, 0x94D4, 0xBDEF, 0xB3E2, 0x94D5, 0xB8AB, /* 0xA0 */
0x94D6, 0xD5B6, 0x94D7, 0xEDBD, 0x94D8, 0xB6CF, 0x94D9, 0xCBB9, /* 0xA0 */
0xD0C2, 0x94DA, 0x94DB, 0x94DC, 0x94DD, 0x94DE, 0x94DF, 0x94E0, /* 0xB0 */
0x94E1, 0xB7BD, 0x94E2, 0x94E3, 0xECB6, 0xCAA9, 0x94E4, 0x94E5, /* 0xB0 */
0x94E6, 0xC5D4, 0x94E7, 0xECB9, 0xECB8, 0xC2C3, 0xECB7, 0x94E8, /* 0xC0 */
0x94E9, 0x94EA, 0x94EB, 0xD0FD, 0xECBA, 0x94EC, 0xECBB, 0xD7E5, /* 0xC0 */
0x94ED, 0x94EE, 0xECBC, 0x94EF, 0x94F0, 0x94F1, 0xECBD, 0xC6EC, /* 0xD0 */
0x94F2, 0x94F3, 0x94F4, 0x94F5, 0x94F6, 0x94F7, 0x94F8, 0x94F9, /* 0xD0 */
0xCEDE, 0x94FA, 0xBCC8, 0x94FB, 0x94FC, 0xC8D5, 0xB5A9, 0xBEC9, /* 0xE0 */
0xD6BC, 0xD4E7, 0x94FD, 0x94FE, 0xD1AE, 0xD0F1, 0xEAB8, 0xEAB9, /* 0xE0 */
0xEABA, 0xBAB5, 0x9540, 0x9541, 0x9542, 0x9543, 0xCAB1, 0xBFF5, /* 0xF0 */
0x9544, 0x9545, 0xCDFA, 0x9546, 0x9547, 0x9548, 0x9549, 0x954A /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_66[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xEAC0, 0x954B, 0xB0BA, 0xEABE, 0x954C, 0x954D, 0xC0A5, 0x954E, /* 0x00 */
0x954F, 0x9550, 0xEABB, 0x9551, 0xB2FD, 0x9552, 0xC3F7, 0xBBE8, /* 0x00 */
0x9553, 0x9554, 0x9555, 0xD2D7, 0xCEF4, 0xEABF, 0x9556, 0x9557, /* 0x10 */
0x9558, 0xEABC, 0x9559, 0x955A, 0x955B, 0xEAC3, 0x955C, 0xD0C7, /* 0x10 */
0xD3B3, 0x955D, 0x955E, 0x955F, 0x9560, 0xB4BA, 0x9561, 0xC3C1, /* 0x20 */
0xD7F2, 0x9562, 0x9563, 0x9564, 0x9565, 0xD5D1, 0x9566, 0xCAC7, /* 0x20 */
0x9567, 0xEAC5, 0x9568, 0x9569, 0xEAC4, 0xEAC7, 0xEAC6, 0x956A, /* 0x30 */
0x956B, 0x956C, 0x956D, 0x956E, 0xD6E7, 0x956F, 0xCFD4, 0x9570, /* 0x30 */
0x9571, 0xEACB, 0x9572, 0xBBCE, 0x9573, 0x9574, 0x9575, 0x9576, /* 0x40 */
0x9577, 0x9578, 0x9579, 0xBDFA, 0xC9CE, 0x957A, 0x957B, 0xEACC, /* 0x40 */
0x957C, 0x957D, 0xC9B9, 0xCFFE, 0xEACA, 0xD4CE, 0xEACD, 0xEACF, /* 0x50 */
0x957E, 0x9580, 0xCDED, 0x9581, 0x9582, 0x9583, 0x9584, 0xEAC9, /* 0x50 */
0x9585, 0xEACE, 0x9586, 0x9587, 0xCEEE, 0x9588, 0xBBDE, 0x9589, /* 0x60 */
0xB3BF, 0x958A, 0x958B, 0x958C, 0x958D, 0x958E, 0xC6D5, 0xBEB0, /* 0x60 */
0xCEFA, 0x958F, 0x9590, 0x9591, 0xC7E7, 0x9592, 0xBEA7, 0xEAD0, /* 0x70 */
0x9593, 0x9594, 0xD6C7, 0x9595, 0x9596, 0x9597, 0xC1C0, 0x9598, /* 0x70 */
0x9599, 0x959A, 0xD4DD, 0x959B, 0xEAD1, 0x959C, 0x959D, 0xCFBE, /* 0x80 */
0x959E, 0x959F, 0x95A0, 0x95A1, 0xEAD2, 0x95A2, 0x95A3, 0x95A4, /* 0x80 */
0x95A5, 0xCAEE, 0x95A6, 0x95A7, 0x95A8, 0x95A9, 0xC5AF, 0xB0B5, /* 0x90 */
0x95AA, 0x95AB, 0x95AC, 0x95AD, 0x95AE, 0xEAD4, 0x95AF, 0x95B0, /* 0x90 */
0x95B1, 0x95B2, 0x95B3, 0x95B4, 0x95B5, 0x95B6, 0x95B7, 0xEAD3, /* 0xA0 */
0xF4DF, 0x95B8, 0x95B9, 0x95BA, 0x95BB, 0x95BC, 0xC4BA, 0x95BD, /* 0xA0 */
0x95BE, 0x95BF, 0x95C0, 0x95C1, 0xB1A9, 0x95C2, 0x95C3, 0x95C4, /* 0xB0 */
0x95C5, 0xE5DF, 0x95C6, 0x95C7, 0x95C8, 0x95C9, 0xEAD5, 0x95CA, /* 0xB0 */
0x95CB, 0x95CC, 0x95CD, 0x95CE, 0x95CF, 0x95D0, 0x95D1, 0x95D2, /* 0xC0 */
0x95D3, 0x95D4, 0x95D5, 0x95D6, 0x95D7, 0x95D8, 0x95D9, 0x95DA, /* 0xC0 */
0x95DB, 0x95DC, 0x95DD, 0x95DE, 0x95DF, 0x95E0, 0x95E1, 0x95E2, /* 0xD0 */
0x95E3, 0xCAEF, 0x95E4, 0xEAD6, 0xEAD7, 0xC6D8, 0x95E5, 0x95E6, /* 0xD0 */
0x95E7, 0x95E8, 0x95E9, 0x95EA, 0x95EB, 0x95EC, 0xEAD8, 0x95ED, /* 0xE0 */
0x95EE, 0xEAD9, 0x95EF, 0x95F0, 0x95F1, 0x95F2, 0x95F3, 0x95F4, /* 0xE0 */
0xD4BB, 0x95F5, 0xC7FA, 0xD2B7, 0xB8FC, 0x95F6, 0x95F7, 0xEAC2, /* 0xF0 */
0x95F8, 0xB2DC, 0x95F9, 0x95FA, 0xC2FC, 0x95FB, 0xD4F8, 0xCCE6 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_67[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD7EE, 0x95FC, 0x95FD, 0x95FE, 0x9640, 0x9641, 0x9642, 0x9643, /* 0x00 */
0xD4C2, 0xD3D0, 0xEBC3, 0xC5F3, 0x9644, 0xB7FE, 0x9645, 0x9646, /* 0x00 */
0xEBD4, 0x9647, 0x9648, 0x9649, 0xCBB7, 0xEBDE, 0x964A, 0xC0CA, /* 0x10 */
0x964B, 0x964C, 0x964D, 0xCDFB, 0x964E, 0xB3AF, 0x964F, 0xC6DA, /* 0x10 */
0x9650, 0x9651, 0x9652, 0x9653, 0x9654, 0x9655, 0xEBFC, 0x9656, /* 0x20 */
0xC4BE, 0x9657, 0xCEB4, 0xC4A9, 0xB1BE, 0xD4FD, 0x9658, 0xCAF5, /* 0x20 */
0x9659, 0xD6EC, 0x965A, 0x965B, 0xC6D3, 0xB6E4, 0x965C, 0x965D, /* 0x30 */
0x965E, 0x965F, 0xBBFA, 0x9660, 0x9661, 0xD0E0, 0x9662, 0x9663, /* 0x30 */
0xC9B1, 0x9664, 0xD4D3, 0xC8A8, 0x9665, 0x9666, 0xB8CB, 0x9667, /* 0x40 */
0xE8BE, 0xC9BC, 0x9668, 0x9669, 0xE8BB, 0x966A, 0xC0EE, 0xD0D3, /* 0x40 */
0xB2C4, 0xB4E5, 0x966B, 0xE8BC, 0x966C, 0x966D, 0xD5C8, 0x966E, /* 0x50 */
0x966F, 0x9670, 0x9671, 0x9672, 0xB6C5, 0x9673, 0xE8BD, 0xCAF8, /* 0x50 */
0xB8DC, 0xCCF5, 0x9674, 0x9675, 0x9676, 0xC0B4, 0x9677, 0x9678, /* 0x60 */
0xD1EE, 0xE8BF, 0xE8C2, 0x9679, 0x967A, 0xBABC, 0x967B, 0xB1AD, /* 0x60 */
0xBDDC, 0x967C, 0xEABD, 0xE8C3, 0x967D, 0xE8C6, 0x967E, 0xE8CB, /* 0x70 */
0x9680, 0x9681, 0x9682, 0x9683, 0xE8CC, 0x9684, 0xCBC9, 0xB0E5, /* 0x70 */
0x9685, 0xBCAB, 0x9686, 0x9687, 0xB9B9, 0x9688, 0x9689, 0xE8C1, /* 0x80 */
0x968A, 0xCDF7, 0x968B, 0xE8CA, 0x968C, 0x968D, 0x968E, 0x968F, /* 0x80 */
0xCEF6, 0x9690, 0x9691, 0x9692, 0x9693, 0xD5ED, 0x9694, 0xC1D6, /* 0x90 */
0xE8C4, 0x9695, 0xC3B6, 0x9696, 0xB9FB, 0xD6A6, 0xE8C8, 0x9697, /* 0x90 */
0x9698, 0x9699, 0xCAE0, 0xD4E6, 0x969A, 0xE8C0, 0x969B, 0xE8C5, /* 0xA0 */
0xE8C7, 0x969C, 0xC7B9, 0xB7E3, 0x969D, 0xE8C9, 0x969E, 0xBFDD, /* 0xA0 */
0xE8D2, 0x969F, 0x96A0, 0xE8D7, 0x96A1, 0xE8D5, 0xBCDC, 0xBCCF, /* 0xB0 */
0xE8DB, 0x96A2, 0x96A3, 0x96A4, 0x96A5, 0x96A6, 0x96A7, 0x96A8, /* 0xB0 */
0x96A9, 0xE8DE, 0x96AA, 0xE8DA, 0xB1FA, 0x96AB, 0x96AC, 0x96AD, /* 0xC0 */
0x96AE, 0x96AF, 0x96B0, 0x96B1, 0x96B2, 0x96B3, 0x96B4, 0xB0D8, /* 0xC0 */
0xC4B3, 0xB8CC, 0xC6E2, 0xC8BE, 0xC8E1, 0x96B5, 0x96B6, 0x96B7, /* 0xD0 */
0xE8CF, 0xE8D4, 0xE8D6, 0x96B8, 0xB9F1, 0xE8D8, 0xD7F5, 0x96B9, /* 0xD0 */
0xC4FB, 0x96BA, 0xE8DC, 0x96BB, 0x96BC, 0xB2E9, 0x96BD, 0x96BE, /* 0xE0 */
0x96BF, 0xE8D1, 0x96C0, 0x96C1, 0xBCED, 0x96C2, 0x96C3, 0xBFC2, /* 0xE0 */
0xE8CD, 0xD6F9, 0x96C4, 0xC1F8, 0xB2F1, 0x96C5, 0x96C6, 0x96C7, /* 0xF0 */
0x96C8, 0x96C9, 0x96CA, 0x96CB, 0x96CC, 0xE8DF, 0x96CD, 0xCAC1 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_68[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE8D9, 0x96CE, 0x96CF, 0x96D0, 0x96D1, 0xD5A4, 0x96D2, 0xB1EA, /* 0x00 */
0xD5BB, 0xE8CE, 0xE8D0, 0xB6B0, 0xE8D3, 0x96D3, 0xE8DD, 0xC0B8, /* 0x00 */
0x96D4, 0xCAF7, 0x96D5, 0xCBA8, 0x96D6, 0x96D7, 0xC6DC, 0xC0F5, /* 0x10 */
0x96D8, 0x96D9, 0x96DA, 0x96DB, 0x96DC, 0xE8E9, 0x96DD, 0x96DE, /* 0x10 */
0x96DF, 0xD0A3, 0x96E0, 0x96E1, 0x96E2, 0x96E3, 0x96E4, 0x96E5, /* 0x20 */
0x96E6, 0xE8F2, 0xD6EA, 0x96E7, 0x96E8, 0x96E9, 0x96EA, 0x96EB, /* 0x20 */
0x96EC, 0x96ED, 0xE8E0, 0xE8E1, 0x96EE, 0x96EF, 0x96F0, 0xD1F9, /* 0x30 */
0xBACB, 0xB8F9, 0x96F1, 0x96F2, 0xB8F1, 0xD4D4, 0xE8EF, 0x96F3, /* 0x30 */
0xE8EE, 0xE8EC, 0xB9F0, 0xCCD2, 0xE8E6, 0xCEA6, 0xBFF2, 0x96F4, /* 0x40 */
0xB0B8, 0xE8F1, 0xE8F0, 0x96F5, 0xD7C0, 0x96F6, 0xE8E4, 0x96F7, /* 0x40 */
0xCDA9, 0xC9A3, 0x96F8, 0xBBB8, 0xBDDB, 0xE8EA, 0x96F9, 0x96FA, /* 0x50 */
0x96FB, 0x96FC, 0x96FD, 0x96FE, 0x9740, 0x9741, 0x9742, 0x9743, /* 0x50 */
0xE8E2, 0xE8E3, 0xE8E5, 0xB5B5, 0xE8E7, 0xC7C5, 0xE8EB, 0xE8ED, /* 0x60 */
0xBDB0, 0xD7AE, 0x9744, 0xE8F8, 0x9745, 0x9746, 0x9747, 0x9748, /* 0x60 */
0x9749, 0x974A, 0x974B, 0x974C, 0xE8F5, 0x974D, 0xCDB0, 0xE8F6, /* 0x70 */
0x974E, 0x974F, 0x9750, 0x9751, 0x9752, 0x9753, 0x9754, 0x9755, /* 0x70 */
0x9756, 0xC1BA, 0x9757, 0xE8E8, 0x9758, 0xC3B7, 0xB0F0, 0x9759, /* 0x80 */
0x975A, 0x975B, 0x975C, 0x975D, 0x975E, 0x975F, 0x9760, 0xE8F4, /* 0x80 */
0x9761, 0x9762, 0x9763, 0xE8F7, 0x9764, 0x9765, 0x9766, 0xB9A3, /* 0x90 */
0x9767, 0x9768, 0x9769, 0x976A, 0x976B, 0x976C, 0x976D, 0x976E, /* 0x90 */
0x976F, 0x9770, 0xC9D2, 0x9771, 0x9772, 0x9773, 0xC3CE, 0xCEE0, /* 0xA0 */
0xC0E6, 0x9774, 0x9775, 0x9776, 0x9777, 0xCBF3, 0x9778, 0xCCDD, /* 0xA0 */
0xD0B5, 0x9779, 0x977A, 0xCAE1, 0x977B, 0xE8F3, 0x977C, 0x977D, /* 0xB0 */
0x977E, 0x9780, 0x9781, 0x9782, 0x9783, 0x9784, 0x9785, 0x9786, /* 0xB0 */
0xBCEC, 0x9787, 0xE8F9, 0x9788, 0x9789, 0x978A, 0x978B, 0x978C, /* 0xC0 */
0x978D, 0xC3DE, 0x978E, 0xC6E5, 0x978F, 0xB9F7, 0x9790, 0x9791, /* 0xC0 */
0x9792, 0x9793, 0xB0F4, 0x9794, 0x9795, 0xD7D8, 0x9796, 0x9797, /* 0xD0 */
0xBCAC, 0x9798, 0xC5EF, 0x9799, 0x979A, 0x979B, 0x979C, 0x979D, /* 0xD0 */
0xCCC4, 0x979E, 0x979F, 0xE9A6, 0x97A0, 0x97A1, 0x97A2, 0x97A3, /* 0xE0 */
0x97A4, 0x97A5, 0x97A6, 0x97A7, 0x97A8, 0x97A9, 0xC9AD, 0x97AA, /* 0xE0 */
0xE9A2, 0xC0E2, 0x97AB, 0x97AC, 0x97AD, 0xBFC3, 0x97AE, 0x97AF, /* 0xF0 */
0x97B0, 0xE8FE, 0xB9D7, 0x97B1, 0xE8FB, 0x97B2, 0x97B3, 0x97B4 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_69[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x97B5, 0xE9A4, 0x97B6, 0x97B7, 0x97B8, 0xD2CE, 0x97B9, 0x97BA, /* 0x00 */
0x97BB, 0x97BC, 0x97BD, 0xE9A3, 0x97BE, 0xD6B2, 0xD7B5, 0x97BF, /* 0x00 */
0xE9A7, 0x97C0, 0xBDB7, 0x97C1, 0x97C2, 0x97C3, 0x97C4, 0x97C5, /* 0x10 */
0x97C6, 0x97C7, 0x97C8, 0x97C9, 0x97CA, 0x97CB, 0x97CC, 0xE8FC, /* 0x10 */
0xE8FD, 0x97CD, 0x97CE, 0x97CF, 0xE9A1, 0x97D0, 0x97D1, 0x97D2, /* 0x20 */
0x97D3, 0x97D4, 0x97D5, 0x97D6, 0x97D7, 0xCDD6, 0x97D8, 0x97D9, /* 0x20 */
0xD2AC, 0x97DA, 0x97DB, 0x97DC, 0xE9B2, 0x97DD, 0x97DE, 0x97DF, /* 0x30 */
0x97E0, 0xE9A9, 0x97E1, 0x97E2, 0x97E3, 0xB4AA, 0x97E4, 0xB4BB, /* 0x30 */
0x97E5, 0x97E6, 0xE9AB, 0x97E7, 0x97E8, 0x97E9, 0x97EA, 0x97EB, /* 0x40 */
0x97EC, 0x97ED, 0x97EE, 0x97EF, 0x97F0, 0x97F1, 0x97F2, 0x97F3, /* 0x40 */
0x97F4, 0x97F5, 0x97F6, 0x97F7, 0xD0A8, 0x97F8, 0x97F9, 0xE9A5, /* 0x50 */
0x97FA, 0x97FB, 0xB3FE, 0x97FC, 0x97FD, 0xE9AC, 0xC0E3, 0x97FE, /* 0x50 */
0xE9AA, 0x9840, 0x9841, 0xE9B9, 0x9842, 0x9843, 0xE9B8, 0x9844, /* 0x60 */
0x9845, 0x9846, 0x9847, 0xE9AE, 0x9848, 0x9849, 0xE8FA, 0x984A, /* 0x60 */
0x984B, 0xE9A8, 0x984C, 0x984D, 0x984E, 0x984F, 0x9850, 0xBFAC, /* 0x70 */
0xE9B1, 0xE9BA, 0x9851, 0x9852, 0xC2A5, 0x9853, 0x9854, 0x9855, /* 0x70 */
0xE9AF, 0x9856, 0xB8C5, 0x9857, 0xE9AD, 0x9858, 0xD3DC, 0xE9B4, /* 0x80 */
0xE9B5, 0xE9B7, 0x9859, 0x985A, 0x985B, 0xE9C7, 0x985C, 0x985D, /* 0x80 */
0x985E, 0x985F, 0x9860, 0x9861, 0xC0C6, 0xE9C5, 0x9862, 0x9863, /* 0x90 */
0xE9B0, 0x9864, 0x9865, 0xE9BB, 0xB0F1, 0x9866, 0x9867, 0x9868, /* 0x90 */
0x9869, 0x986A, 0x986B, 0x986C, 0x986D, 0x986E, 0x986F, 0xE9BC, /* 0xA0 */
0xD5A5, 0x9870, 0x9871, 0xE9BE, 0x9872, 0xE9BF, 0x9873, 0x9874, /* 0xA0 */
0x9875, 0xE9C1, 0x9876, 0x9877, 0xC1F1, 0x9878, 0x9879, 0xC8B6, /* 0xB0 */
0x987A, 0x987B, 0x987C, 0xE9BD, 0x987D, 0x987E, 0x9880, 0x9881, /* 0xB0 */
0x9882, 0xE9C2, 0x9883, 0x9884, 0x9885, 0x9886, 0x9887, 0x9888, /* 0xC0 */
0x9889, 0x988A, 0xE9C3, 0x988B, 0xE9B3, 0x988C, 0xE9B6, 0x988D, /* 0xC0 */
0xBBB1, 0x988E, 0x988F, 0x9890, 0xE9C0, 0x9891, 0x9892, 0x9893, /* 0xD0 */
0x9894, 0x9895, 0x9896, 0xBCF7, 0x9897, 0x9898, 0x9899, 0xE9C4, /* 0xD0 */
0xE9C6, 0x989A, 0x989B, 0x989C, 0x989D, 0x989E, 0x989F, 0x98A0, /* 0xE0 */
0x98A1, 0x98A2, 0x98A3, 0x98A4, 0x98A5, 0xE9CA, 0x98A6, 0x98A7, /* 0xE0 */
0x98A8, 0x98A9, 0xE9CE, 0x98AA, 0x98AB, 0x98AC, 0x98AD, 0x98AE, /* 0xF0 */
0x98AF, 0x98B0, 0x98B1, 0x98B2, 0x98B3, 0xB2DB, 0x98B4, 0xE9C8 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_6A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x98B5, 0x98B6, 0x98B7, 0x98B8, 0x98B9, 0x98BA, 0x98BB, 0x98BC, /* 0x00 */
0x98BD, 0x98BE, 0xB7AE, 0x98BF, 0x98C0, 0x98C1, 0x98C2, 0x98C3, /* 0x00 */
0x98C4, 0x98C5, 0x98C6, 0x98C7, 0x98C8, 0x98C9, 0x98CA, 0xE9CB, /* 0x10 */
0xE9CC, 0x98CB, 0x98CC, 0x98CD, 0x98CE, 0x98CF, 0x98D0, 0xD5C1, /* 0x10 */
0x98D1, 0xC4A3, 0x98D2, 0x98D3, 0x98D4, 0x98D5, 0x98D6, 0x98D7, /* 0x20 */
0xE9D8, 0x98D8, 0xBAE1, 0x98D9, 0x98DA, 0x98DB, 0x98DC, 0xE9C9, /* 0x20 */
0x98DD, 0xD3A3, 0x98DE, 0x98DF, 0x98E0, 0xE9D4, 0x98E1, 0x98E2, /* 0x30 */
0x98E3, 0x98E4, 0x98E5, 0x98E6, 0x98E7, 0xE9D7, 0xE9D0, 0x98E8, /* 0x30 */
0x98E9, 0x98EA, 0x98EB, 0x98EC, 0xE9CF, 0x98ED, 0x98EE, 0xC7C1, /* 0x40 */
0x98EF, 0x98F0, 0x98F1, 0x98F2, 0x98F3, 0x98F4, 0x98F5, 0x98F6, /* 0x40 */
0xE9D2, 0x98F7, 0x98F8, 0x98F9, 0x98FA, 0x98FB, 0x98FC, 0x98FD, /* 0x50 */
0xE9D9, 0xB3C8, 0x98FE, 0xE9D3, 0x9940, 0x9941, 0x9942, 0x9943, /* 0x50 */
0x9944, 0xCFF0, 0x9945, 0x9946, 0x9947, 0xE9CD, 0x9948, 0x9949, /* 0x60 */
0x994A, 0x994B, 0x994C, 0x994D, 0x994E, 0x994F, 0x9950, 0x9951, /* 0x60 */
0x9952, 0xB3F7, 0x9953, 0x9954, 0x9955, 0x9956, 0x9957, 0x9958, /* 0x70 */
0x9959, 0xE9D6, 0x995A, 0x995B, 0xE9DA, 0x995C, 0x995D, 0x995E, /* 0x70 */
0xCCB4, 0x995F, 0x9960, 0x9961, 0xCFAD, 0x9962, 0x9963, 0x9964, /* 0x80 */
0x9965, 0x9966, 0x9967, 0x9968, 0x9969, 0x996A, 0xE9D5, 0x996B, /* 0x80 */
0xE9DC, 0xE9DB, 0x996C, 0x996D, 0x996E, 0x996F, 0x9970, 0xE9DE, /* 0x90 */
0x9971, 0x9972, 0x9973, 0x9974, 0x9975, 0x9976, 0x9977, 0x9978, /* 0x90 */
0xE9D1, 0x9979, 0x997A, 0x997B, 0x997C, 0x997D, 0x997E, 0x9980, /* 0xA0 */
0x9981, 0xE9DD, 0x9982, 0xE9DF, 0xC3CA, 0x9983, 0x9984, 0x9985, /* 0xA0 */
0x9986, 0x9987, 0x9988, 0x9989, 0x998A, 0x998B, 0x998C, 0x998D, /* 0xB0 */
0x998E, 0x998F, 0x9990, 0x9991, 0x9992, 0x9993, 0x9994, 0x9995, /* 0xB0 */
0x9996, 0x9997, 0x9998, 0x9999, 0x999A, 0x999B, 0x999C, 0x999D, /* 0xC0 */
0x999E, 0x999F, 0x99A0, 0x99A1, 0x99A2, 0x99A3, 0x99A4, 0x99A5, /* 0xC0 */
0x99A6, 0x99A7, 0x99A8, 0x99A9, 0x99AA, 0x99AB, 0x99AC, 0x99AD, /* 0xD0 */
0x99AE, 0x99AF, 0x99B0, 0x99B1, 0x99B2, 0x99B3, 0x99B4, 0x99B5, /* 0xD0 */
0x99B6, 0x99B7, 0x99B8, 0x99B9, 0x99BA, 0x99BB, 0x99BC, 0x99BD, /* 0xE0 */
0x99BE, 0x99BF, 0x99C0, 0x99C1, 0x99C2, 0x99C3, 0x99C4, 0x99C5, /* 0xE0 */
0x99C6, 0x99C7, 0x99C8, 0x99C9, 0x99CA, 0x99CB, 0x99CC, 0x99CD, /* 0xF0 */
0x99CE, 0x99CF, 0x99D0, 0x99D1, 0x99D2, 0x99D3, 0x99D4, 0x99D5 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_6B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x99D6, 0x99D7, 0x99D8, 0x99D9, 0x99DA, 0x99DB, 0x99DC, 0x99DD, /* 0x00 */
0x99DE, 0x99DF, 0x99E0, 0x99E1, 0x99E2, 0x99E3, 0x99E4, 0x99E5, /* 0x00 */
0x99E6, 0x99E7, 0x99E8, 0x99E9, 0x99EA, 0x99EB, 0x99EC, 0x99ED, /* 0x10 */
0x99EE, 0x99EF, 0x99F0, 0x99F1, 0x99F2, 0x99F3, 0x99F4, 0x99F5, /* 0x10 */
0xC7B7, 0xB4CE, 0xBBB6, 0xD0C0, 0xECA3, 0x99F6, 0x99F7, 0xC5B7, /* 0x20 */
0x99F8, 0x99F9, 0x99FA, 0x99FB, 0x99FC, 0x99FD, 0x99FE, 0x9A40, /* 0x20 */
0x9A41, 0x9A42, 0xD3FB, 0x9A43, 0x9A44, 0x9A45, 0x9A46, 0xECA4, /* 0x30 */
0x9A47, 0xECA5, 0xC6DB, 0x9A48, 0x9A49, 0x9A4A, 0xBFEE, 0x9A4B, /* 0x30 */
0x9A4C, 0x9A4D, 0x9A4E, 0xECA6, 0x9A4F, 0x9A50, 0xECA7, 0xD0AA, /* 0x40 */
0x9A51, 0xC7B8, 0x9A52, 0x9A53, 0xB8E8, 0x9A54, 0x9A55, 0x9A56, /* 0x40 */
0x9A57, 0x9A58, 0x9A59, 0x9A5A, 0x9A5B, 0x9A5C, 0x9A5D, 0x9A5E, /* 0x50 */
0x9A5F, 0xECA8, 0x9A60, 0x9A61, 0x9A62, 0x9A63, 0x9A64, 0x9A65, /* 0x50 */
0x9A66, 0x9A67, 0xD6B9, 0xD5FD, 0xB4CB, 0xB2BD, 0xCEE4, 0xC6E7, /* 0x60 */
0x9A68, 0x9A69, 0xCDE1, 0x9A6A, 0x9A6B, 0x9A6C, 0x9A6D, 0x9A6E, /* 0x60 */
0x9A6F, 0x9A70, 0x9A71, 0x9A72, 0x9A73, 0x9A74, 0x9A75, 0x9A76, /* 0x70 */
0x9A77, 0xB4F5, 0x9A78, 0xCBC0, 0xBCDF, 0x9A79, 0x9A7A, 0x9A7B, /* 0x70 */
0x9A7C, 0xE9E2, 0xE9E3, 0xD1EA, 0xE9E5, 0x9A7D, 0xB4F9, 0xE9E4, /* 0x80 */
0x9A7E, 0xD1B3, 0xCAE2, 0xB2D0, 0x9A80, 0xE9E8, 0x9A81, 0x9A82, /* 0x80 */
0x9A83, 0x9A84, 0xE9E6, 0xE9E7, 0x9A85, 0x9A86, 0xD6B3, 0x9A87, /* 0x90 */
0x9A88, 0x9A89, 0xE9E9, 0xE9EA, 0x9A8A, 0x9A8B, 0x9A8C, 0x9A8D, /* 0x90 */
0x9A8E, 0xE9EB, 0x9A8F, 0x9A90, 0x9A91, 0x9A92, 0x9A93, 0x9A94, /* 0xA0 */
0x9A95, 0x9A96, 0xE9EC, 0x9A97, 0x9A98, 0x9A99, 0x9A9A, 0x9A9B, /* 0xA0 */
0x9A9C, 0x9A9D, 0x9A9E, 0xECAF, 0xC5B9, 0xB6CE, 0x9A9F, 0xD2F3, /* 0xB0 */
0x9AA0, 0x9AA1, 0x9AA2, 0x9AA3, 0x9AA4, 0x9AA5, 0x9AA6, 0xB5EE, /* 0xB0 */
0x9AA7, 0xBBD9, 0xECB1, 0x9AA8, 0x9AA9, 0xD2E3, 0x9AAA, 0x9AAB, /* 0xC0 */
0x9AAC, 0x9AAD, 0x9AAE, 0xCEE3, 0x9AAF, 0xC4B8, 0x9AB0, 0xC3BF, /* 0xC0 */
0x9AB1, 0x9AB2, 0xB6BE, 0xD8B9, 0xB1C8, 0xB1CF, 0xB1D1, 0xC5FE, /* 0xD0 */
0x9AB3, 0xB1D0, 0x9AB4, 0xC3AB, 0x9AB5, 0x9AB6, 0x9AB7, 0x9AB8, /* 0xD0 */
0x9AB9, 0xD5B1, 0x9ABA, 0x9ABB, 0x9ABC, 0x9ABD, 0x9ABE, 0x9ABF, /* 0xE0 */
0x9AC0, 0x9AC1, 0xEBA4, 0xBAC1, 0x9AC2, 0x9AC3, 0x9AC4, 0xCCBA, /* 0xE0 */
0x9AC5, 0x9AC6, 0x9AC7, 0xEBA5, 0x9AC8, 0xEBA7, 0x9AC9, 0x9ACA, /* 0xF0 */
0x9ACB, 0xEBA8, 0x9ACC, 0x9ACD, 0x9ACE, 0xEBA6, 0x9ACF, 0x9AD0 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_6C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9AD1, 0x9AD2, 0x9AD3, 0x9AD4, 0x9AD5, 0xEBA9, 0xEBAB, 0xEBAA, /* 0x00 */
0x9AD6, 0x9AD7, 0x9AD8, 0x9AD9, 0x9ADA, 0xEBAC, 0x9ADB, 0xCACF, /* 0x00 */
0xD8B5, 0xC3F1, 0x9ADC, 0xC3A5, 0xC6F8, 0xEBAD, 0xC4CA, 0x9ADD, /* 0x10 */
0xEBAE, 0xEBAF, 0xEBB0, 0xB7D5, 0x9ADE, 0x9ADF, 0x9AE0, 0xB7FA, /* 0x10 */
0x9AE1, 0xEBB1, 0xC7E2, 0x9AE2, 0xEBB3, 0x9AE3, 0xBAA4, 0xD1F5, /* 0x20 */
0xB0B1, 0xEBB2, 0xEBB4, 0x9AE4, 0x9AE5, 0x9AE6, 0xB5AA, 0xC2C8, /* 0x20 */
0xC7E8, 0x9AE7, 0xEBB5, 0x9AE8, 0xCBAE, 0xE3DF, 0x9AE9, 0x9AEA, /* 0x30 */
0xD3C0, 0x9AEB, 0x9AEC, 0x9AED, 0x9AEE, 0xD9DB, 0x9AEF, 0x9AF0, /* 0x30 */
0xCDA1, 0xD6AD, 0xC7F3, 0x9AF1, 0x9AF2, 0x9AF3, 0xD9E0, 0xBBE3, /* 0x40 */
0x9AF4, 0xBABA, 0xE3E2, 0x9AF5, 0x9AF6, 0x9AF7, 0x9AF8, 0x9AF9, /* 0x40 */
0xCFAB, 0x9AFA, 0x9AFB, 0x9AFC, 0xE3E0, 0xC9C7, 0x9AFD, 0xBAB9, /* 0x50 */
0x9AFE, 0x9B40, 0x9B41, 0xD1B4, 0xE3E1, 0xC8EA, 0xB9AF, 0xBDAD, /* 0x50 */
0xB3D8, 0xCEDB, 0x9B42, 0x9B43, 0xCCC0, 0x9B44, 0x9B45, 0x9B46, /* 0x60 */
0xE3E8, 0xE3E9, 0xCDF4, 0x9B47, 0x9B48, 0x9B49, 0x9B4A, 0x9B4B, /* 0x60 */
0xCCAD, 0x9B4C, 0xBCB3, 0x9B4D, 0xE3EA, 0x9B4E, 0xE3EB, 0x9B4F, /* 0x70 */
0x9B50, 0xD0DA, 0x9B51, 0x9B52, 0x9B53, 0xC6FB, 0xB7DA, 0x9B54, /* 0x70 */
0x9B55, 0xC7DF, 0xD2CA, 0xCED6, 0x9B56, 0xE3E4, 0xE3EC, 0x9B57, /* 0x80 */
0xC9F2, 0xB3C1, 0x9B58, 0x9B59, 0xE3E7, 0x9B5A, 0x9B5B, 0xC6E3, /* 0x80 */
0xE3E5, 0x9B5C, 0x9B5D, 0xEDB3, 0xE3E6, 0x9B5E, 0x9B5F, 0x9B60, /* 0x90 */
0x9B61, 0xC9B3, 0x9B62, 0xC5E6, 0x9B63, 0x9B64, 0x9B65, 0xB9B5, /* 0x90 */
0x9B66, 0xC3BB, 0x9B67, 0xE3E3, 0xC5BD, 0xC1A4, 0xC2D9, 0xB2D7, /* 0xA0 */
0x9B68, 0xE3ED, 0xBBA6, 0xC4AD, 0x9B69, 0xE3F0, 0xBEDA, 0x9B6A, /* 0xA0 */
0x9B6B, 0xE3FB, 0xE3F5, 0xBAD3, 0x9B6C, 0x9B6D, 0x9B6E, 0x9B6F, /* 0xB0 */
0xB7D0, 0xD3CD, 0x9B70, 0xD6CE, 0xD5D3, 0xB9C1, 0xD5B4, 0xD1D8, /* 0xB0 */
0x9B71, 0x9B72, 0x9B73, 0x9B74, 0xD0B9, 0xC7F6, 0x9B75, 0x9B76, /* 0xC0 */
0x9B77, 0xC8AA, 0xB2B4, 0x9B78, 0xC3DA, 0x9B79, 0x9B7A, 0x9B7B, /* 0xC0 */
0xE3EE, 0x9B7C, 0x9B7D, 0xE3FC, 0xE3EF, 0xB7A8, 0xE3F7, 0xE3F4, /* 0xD0 */
0x9B7E, 0x9B80, 0x9B81, 0xB7BA, 0x9B82, 0x9B83, 0xC5A2, 0x9B84, /* 0xD0 */
0xE3F6, 0xC5DD, 0xB2A8, 0xC6FC, 0x9B85, 0xC4E0, 0x9B86, 0x9B87, /* 0xE0 */
0xD7A2, 0x9B88, 0xC0E1, 0xE3F9, 0x9B89, 0x9B8A, 0xE3FA, 0xE3FD, /* 0xE0 */
0xCCA9, 0xE3F3, 0x9B8B, 0xD3BE, 0x9B8C, 0xB1C3, 0xEDB4, 0xE3F1, /* 0xF0 */
0xE3F2, 0x9B8D, 0xE3F8, 0xD0BA, 0xC6C3, 0xD4F3, 0xE3FE, 0x9B8E /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_6D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9B8F, 0xBDE0, 0x9B90, 0x9B91, 0xE4A7, 0x9B92, 0x9B93, 0xE4A6, /* 0x00 */
0x9B94, 0x9B95, 0x9B96, 0xD1F3, 0xE4A3, 0x9B97, 0xE4A9, 0x9B98, /* 0x00 */
0x9B99, 0x9B9A, 0xC8F7, 0x9B9B, 0x9B9C, 0x9B9D, 0x9B9E, 0xCFB4, /* 0x10 */
0x9B9F, 0xE4A8, 0xE4AE, 0xC2E5, 0x9BA0, 0x9BA1, 0xB6B4, 0x9BA2, /* 0x10 */
0x9BA3, 0x9BA4, 0x9BA5, 0x9BA6, 0x9BA7, 0xBDF2, 0x9BA8, 0xE4A2, /* 0x20 */
0x9BA9, 0x9BAA, 0xBAE9, 0xE4AA, 0x9BAB, 0x9BAC, 0xE4AC, 0x9BAD, /* 0x20 */
0x9BAE, 0xB6FD, 0xD6DE, 0xE4B2, 0x9BAF, 0xE4AD, 0x9BB0, 0x9BB1, /* 0x30 */
0x9BB2, 0xE4A1, 0x9BB3, 0xBBEE, 0xCDDD, 0xC7A2, 0xC5C9, 0x9BB4, /* 0x30 */
0x9BB5, 0xC1F7, 0x9BB6, 0xE4A4, 0x9BB7, 0xC7B3, 0xBDAC, 0xBDBD, /* 0x40 */
0xE4A5, 0x9BB8, 0xD7C7, 0xB2E2, 0x9BB9, 0xE4AB, 0xBCC3, 0xE4AF, /* 0x40 */
0x9BBA, 0xBBEB, 0xE4B0, 0xC5A8, 0xE4B1, 0x9BBB, 0x9BBC, 0x9BBD, /* 0x50 */
0x9BBE, 0xD5E3, 0xBFA3, 0x9BBF, 0xE4BA, 0x9BC0, 0xE4B7, 0x9BC1, /* 0x50 */
0xE4BB, 0x9BC2, 0x9BC3, 0xE4BD, 0x9BC4, 0x9BC5, 0xC6D6, 0x9BC6, /* 0x60 */
0x9BC7, 0xBAC6, 0xC0CB, 0x9BC8, 0x9BC9, 0x9BCA, 0xB8A1, 0xE4B4, /* 0x60 */
0x9BCB, 0x9BCC, 0x9BCD, 0x9BCE, 0xD4A1, 0x9BCF, 0x9BD0, 0xBAA3, /* 0x70 */
0xBDFE, 0x9BD1, 0x9BD2, 0x9BD3, 0xE4BC, 0x9BD4, 0x9BD5, 0x9BD6, /* 0x70 */
0x9BD7, 0x9BD8, 0xCDBF, 0x9BD9, 0x9BDA, 0xC4F9, 0x9BDB, 0x9BDC, /* 0x80 */
0xCFFB, 0xC9E6, 0x9BDD, 0x9BDE, 0xD3BF, 0x9BDF, 0xCFD1, 0x9BE0, /* 0x80 */
0x9BE1, 0xE4B3, 0x9BE2, 0xE4B8, 0xE4B9, 0xCCE9, 0x9BE3, 0x9BE4, /* 0x90 */
0x9BE5, 0x9BE6, 0x9BE7, 0xCCCE, 0x9BE8, 0xC0D4, 0xE4B5, 0xC1B0, /* 0x90 */
0xE4B6, 0xCED0, 0x9BE9, 0xBBC1, 0xB5D3, 0x9BEA, 0xC8F3, 0xBDA7, /* 0xA0 */
0xD5C7, 0xC9AC, 0xB8A2, 0xE4CA, 0x9BEB, 0x9BEC, 0xE4CC, 0xD1C4, /* 0xA0 */
0x9BED, 0x9BEE, 0xD2BA, 0x9BEF, 0x9BF0, 0xBAAD, 0x9BF1, 0x9BF2, /* 0xB0 */
0xBAD4, 0x9BF3, 0x9BF4, 0x9BF5, 0x9BF6, 0x9BF7, 0x9BF8, 0xE4C3, /* 0xB0 */
0xB5ED, 0x9BF9, 0x9BFA, 0x9BFB, 0xD7CD, 0xE4C0, 0xCFFD, 0xE4BF, /* 0xC0 */
0x9BFC, 0x9BFD, 0x9BFE, 0xC1DC, 0xCCCA, 0x9C40, 0x9C41, 0x9C42, /* 0xC0 */
0x9C43, 0xCAE7, 0x9C44, 0x9C45, 0x9C46, 0x9C47, 0xC4D7, 0x9C48, /* 0xD0 */
0xCCD4, 0xE4C8, 0x9C49, 0x9C4A, 0x9C4B, 0xE4C7, 0xE4C1, 0x9C4C, /* 0xD0 */
0xE4C4, 0xB5AD, 0x9C4D, 0x9C4E, 0xD3D9, 0x9C4F, 0xE4C6, 0x9C50, /* 0xE0 */
0x9C51, 0x9C52, 0x9C53, 0xD2F9, 0xB4E3, 0x9C54, 0xBBB4, 0x9C55, /* 0xE0 */
0x9C56, 0xC9EE, 0x9C57, 0xB4BE, 0x9C58, 0x9C59, 0x9C5A, 0xBBEC, /* 0xF0 */
0x9C5B, 0xD1CD, 0x9C5C, 0xCCED, 0xEDB5, 0x9C5D, 0x9C5E, 0x9C5F /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_6E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9C60, 0x9C61, 0x9C62, 0x9C63, 0x9C64, 0xC7E5, 0x9C65, 0x9C66, /* 0x00 */
0x9C67, 0x9C68, 0xD4A8, 0x9C69, 0xE4CB, 0xD7D5, 0xE4C2, 0x9C6A, /* 0x00 */
0xBDA5, 0xE4C5, 0x9C6B, 0x9C6C, 0xD3E6, 0x9C6D, 0xE4C9, 0xC9F8, /* 0x10 */
0x9C6E, 0x9C6F, 0xE4BE, 0x9C70, 0x9C71, 0xD3E5, 0x9C72, 0x9C73, /* 0x10 */
0xC7FE, 0xB6C9, 0x9C74, 0xD4FC, 0xB2B3, 0xE4D7, 0x9C75, 0x9C76, /* 0x20 */
0x9C77, 0xCEC2, 0x9C78, 0xE4CD, 0x9C79, 0xCEBC, 0x9C7A, 0xB8DB, /* 0x20 */
0x9C7B, 0x9C7C, 0xE4D6, 0x9C7D, 0xBFCA, 0x9C7E, 0x9C80, 0x9C81, /* 0x30 */
0xD3CE, 0x9C82, 0xC3EC, 0x9C83, 0x9C84, 0x9C85, 0x9C86, 0x9C87, /* 0x30 */
0x9C88, 0x9C89, 0x9C8A, 0xC5C8, 0xE4D8, 0x9C8B, 0x9C8C, 0x9C8D, /* 0x40 */
0x9C8E, 0x9C8F, 0x9C90, 0x9C91, 0x9C92, 0xCDC4, 0xE4CF, 0x9C93, /* 0x40 */
0x9C94, 0x9C95, 0x9C96, 0xE4D4, 0xE4D5, 0x9C97, 0xBAFE, 0x9C98, /* 0x50 */
0xCFE6, 0x9C99, 0x9C9A, 0xD5BF, 0x9C9B, 0x9C9C, 0x9C9D, 0xE4D2, /* 0x50 */
0x9C9E, 0x9C9F, 0x9CA0, 0x9CA1, 0x9CA2, 0x9CA3, 0x9CA4, 0x9CA5, /* 0x60 */
0x9CA6, 0x9CA7, 0x9CA8, 0xE4D0, 0x9CA9, 0x9CAA, 0xE4CE, 0x9CAB, /* 0x60 */
0x9CAC, 0x9CAD, 0x9CAE, 0x9CAF, 0x9CB0, 0x9CB1, 0x9CB2, 0x9CB3, /* 0x70 */
0x9CB4, 0x9CB5, 0x9CB6, 0x9CB7, 0x9CB8, 0x9CB9, 0xCDE5, 0xCAAA, /* 0x70 */
0x9CBA, 0x9CBB, 0x9CBC, 0xC0A3, 0x9CBD, 0xBDA6, 0xE4D3, 0x9CBE, /* 0x80 */
0x9CBF, 0xB8C8, 0x9CC0, 0x9CC1, 0x9CC2, 0x9CC3, 0x9CC4, 0xE4E7, /* 0x80 */
0xD4B4, 0x9CC5, 0x9CC6, 0x9CC7, 0x9CC8, 0x9CC9, 0x9CCA, 0x9CCB, /* 0x90 */
0xE4DB, 0x9CCC, 0x9CCD, 0x9CCE, 0xC1EF, 0x9CCF, 0x9CD0, 0xE4E9, /* 0x90 */
0x9CD1, 0x9CD2, 0xD2E7, 0x9CD3, 0x9CD4, 0xE4DF, 0x9CD5, 0xE4E0, /* 0xA0 */
0x9CD6, 0x9CD7, 0xCFAA, 0x9CD8, 0x9CD9, 0x9CDA, 0x9CDB, 0xCBDD, /* 0xA0 */
0x9CDC, 0xE4DA, 0xE4D1, 0x9CDD, 0xE4E5, 0x9CDE, 0xC8DC, 0xE4E3, /* 0xB0 */
0x9CDF, 0x9CE0, 0xC4E7, 0xE4E2, 0x9CE1, 0xE4E1, 0x9CE2, 0x9CE3, /* 0xB0 */
0x9CE4, 0xB3FC, 0xE4E8, 0x9CE5, 0x9CE6, 0x9CE7, 0x9CE8, 0xB5E1, /* 0xC0 */
0x9CE9, 0x9CEA, 0x9CEB, 0xD7CC, 0x9CEC, 0x9CED, 0x9CEE, 0xE4E6, /* 0xC0 */
0x9CEF, 0xBBAC, 0x9CF0, 0xD7D2, 0xCCCF, 0xEBF8, 0x9CF1, 0xE4E4, /* 0xD0 */
0x9CF2, 0x9CF3, 0xB9F6, 0x9CF4, 0x9CF5, 0x9CF6, 0xD6CD, 0xE4D9, /* 0xD0 */
0xE4DC, 0xC2FA, 0xE4DE, 0x9CF7, 0xC2CB, 0xC0C4, 0xC2D0, 0x9CF8, /* 0xE0 */
0xB1F5, 0xCCB2, 0x9CF9, 0x9CFA, 0x9CFB, 0x9CFC, 0x9CFD, 0x9CFE, /* 0xE0 */
0x9D40, 0x9D41, 0x9D42, 0x9D43, 0xB5CE, 0x9D44, 0x9D45, 0x9D46, /* 0xF0 */
0x9D47, 0xE4EF, 0x9D48, 0x9D49, 0x9D4A, 0x9D4B, 0x9D4C, 0x9D4D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_6F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9D4E, 0x9D4F, 0xC6AF, 0x9D50, 0x9D51, 0x9D52, 0xC6E1, 0x9D53, /* 0x00 */
0x9D54, 0xE4F5, 0x9D55, 0x9D56, 0x9D57, 0x9D58, 0x9D59, 0xC2A9, /* 0x00 */
0x9D5A, 0x9D5B, 0x9D5C, 0xC0EC, 0xD1DD, 0xE4EE, 0x9D5D, 0x9D5E, /* 0x10 */
0x9D5F, 0x9D60, 0x9D61, 0x9D62, 0x9D63, 0x9D64, 0x9D65, 0x9D66, /* 0x10 */
0xC4AE, 0x9D67, 0x9D68, 0x9D69, 0xE4ED, 0x9D6A, 0x9D6B, 0x9D6C, /* 0x20 */
0x9D6D, 0xE4F6, 0xE4F4, 0xC2FE, 0x9D6E, 0xE4DD, 0x9D6F, 0xE4F0, /* 0x20 */
0x9D70, 0xCAFE, 0x9D71, 0xD5C4, 0x9D72, 0x9D73, 0xE4F1, 0x9D74, /* 0x30 */
0x9D75, 0x9D76, 0x9D77, 0x9D78, 0x9D79, 0x9D7A, 0xD1FA, 0x9D7B, /* 0x30 */
0x9D7C, 0x9D7D, 0x9D7E, 0x9D80, 0x9D81, 0x9D82, 0xE4EB, 0xE4EC, /* 0x40 */
0x9D83, 0x9D84, 0x9D85, 0xE4F2, 0x9D86, 0xCEAB, 0x9D87, 0x9D88, /* 0x40 */
0x9D89, 0x9D8A, 0x9D8B, 0x9D8C, 0x9D8D, 0x9D8E, 0x9D8F, 0x9D90, /* 0x50 */
0xC5CB, 0x9D91, 0x9D92, 0x9D93, 0xC7B1, 0x9D94, 0xC2BA, 0x9D95, /* 0x50 */
0x9D96, 0x9D97, 0xE4EA, 0x9D98, 0x9D99, 0x9D9A, 0xC1CA, 0x9D9B, /* 0x60 */
0x9D9C, 0x9D9D, 0x9D9E, 0x9D9F, 0x9DA0, 0xCCB6, 0xB3B1, 0x9DA1, /* 0x60 */
0x9DA2, 0x9DA3, 0xE4FB, 0x9DA4, 0xE4F3, 0x9DA5, 0x9DA6, 0x9DA7, /* 0x70 */
0xE4FA, 0x9DA8, 0xE4FD, 0x9DA9, 0xE4FC, 0x9DAA, 0x9DAB, 0x9DAC, /* 0x70 */
0x9DAD, 0x9DAE, 0x9DAF, 0x9DB0, 0xB3CE, 0x9DB1, 0x9DB2, 0x9DB3, /* 0x80 */
0xB3BA, 0xE4F7, 0x9DB4, 0x9DB5, 0xE4F9, 0xE4F8, 0xC5EC, 0x9DB6, /* 0x80 */
0x9DB7, 0x9DB8, 0x9DB9, 0x9DBA, 0x9DBB, 0x9DBC, 0x9DBD, 0x9DBE, /* 0x90 */
0x9DBF, 0x9DC0, 0x9DC1, 0x9DC2, 0xC0BD, 0x9DC3, 0x9DC4, 0x9DC5, /* 0x90 */
0x9DC6, 0xD4E8, 0x9DC7, 0x9DC8, 0x9DC9, 0x9DCA, 0x9DCB, 0xE5A2, /* 0xA0 */
0x9DCC, 0x9DCD, 0x9DCE, 0x9DCF, 0x9DD0, 0x9DD1, 0x9DD2, 0x9DD3, /* 0xA0 */
0x9DD4, 0x9DD5, 0x9DD6, 0xB0C4, 0x9DD7, 0x9DD8, 0xE5A4, 0x9DD9, /* 0xB0 */
0x9DDA, 0xE5A3, 0x9DDB, 0x9DDC, 0x9DDD, 0x9DDE, 0x9DDF, 0x9DE0, /* 0xB0 */
0xBCA4, 0x9DE1, 0xE5A5, 0x9DE2, 0x9DE3, 0x9DE4, 0x9DE5, 0x9DE6, /* 0xC0 */
0x9DE7, 0xE5A1, 0x9DE8, 0x9DE9, 0x9DEA, 0x9DEB, 0x9DEC, 0x9DED, /* 0xC0 */
0x9DEE, 0xE4FE, 0xB1F4, 0x9DEF, 0x9DF0, 0x9DF1, 0x9DF2, 0x9DF3, /* 0xD0 */
0x9DF4, 0x9DF5, 0x9DF6, 0x9DF7, 0x9DF8, 0x9DF9, 0xE5A8, 0x9DFA, /* 0xD0 */
0xE5A9, 0xE5A6, 0x9DFB, 0x9DFC, 0x9DFD, 0x9DFE, 0x9E40, 0x9E41, /* 0xE0 */
0x9E42, 0x9E43, 0x9E44, 0x9E45, 0x9E46, 0x9E47, 0xE5A7, 0xE5AA, /* 0xE0 */
0x9E48, 0x9E49, 0x9E4A, 0x9E4B, 0x9E4C, 0x9E4D, 0x9E4E, 0x9E4F, /* 0xF0 */
0x9E50, 0x9E51, 0x9E52, 0x9E53, 0x9E54, 0x9E55, 0x9E56, 0x9E57 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_70[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9E58, 0x9E59, 0x9E5A, 0x9E5B, 0x9E5C, 0x9E5D, 0x9E5E, 0x9E5F, /* 0x00 */
0x9E60, 0x9E61, 0x9E62, 0x9E63, 0x9E64, 0x9E65, 0x9E66, 0x9E67, /* 0x00 */
0x9E68, 0xC6D9, 0x9E69, 0x9E6A, 0x9E6B, 0x9E6C, 0x9E6D, 0x9E6E, /* 0x10 */
0x9E6F, 0x9E70, 0xE5AB, 0xE5AD, 0x9E71, 0x9E72, 0x9E73, 0x9E74, /* 0x10 */
0x9E75, 0x9E76, 0x9E77, 0xE5AC, 0x9E78, 0x9E79, 0x9E7A, 0x9E7B, /* 0x20 */
0x9E7C, 0x9E7D, 0x9E7E, 0x9E80, 0x9E81, 0x9E82, 0x9E83, 0x9E84, /* 0x20 */
0x9E85, 0x9E86, 0x9E87, 0x9E88, 0x9E89, 0xE5AF, 0x9E8A, 0x9E8B, /* 0x30 */
0x9E8C, 0xE5AE, 0x9E8D, 0x9E8E, 0x9E8F, 0x9E90, 0x9E91, 0x9E92, /* 0x30 */
0x9E93, 0x9E94, 0x9E95, 0x9E96, 0x9E97, 0x9E98, 0x9E99, 0x9E9A, /* 0x40 */
0x9E9B, 0x9E9C, 0x9E9D, 0x9E9E, 0xB9E0, 0x9E9F, 0x9EA0, 0xE5B0, /* 0x40 */
0x9EA1, 0x9EA2, 0x9EA3, 0x9EA4, 0x9EA5, 0x9EA6, 0x9EA7, 0x9EA8, /* 0x50 */
0x9EA9, 0x9EAA, 0x9EAB, 0x9EAC, 0x9EAD, 0x9EAE, 0xE5B1, 0x9EAF, /* 0x50 */
0x9EB0, 0x9EB1, 0x9EB2, 0x9EB3, 0x9EB4, 0x9EB5, 0x9EB6, 0x9EB7, /* 0x60 */
0x9EB8, 0x9EB9, 0x9EBA, 0xBBF0, 0xECE1, 0xC3F0, 0x9EBB, 0xB5C6, /* 0x60 */
0xBBD2, 0x9EBC, 0x9EBD, 0x9EBE, 0x9EBF, 0xC1E9, 0xD4EE, 0x9EC0, /* 0x70 */
0xBEC4, 0x9EC1, 0x9EC2, 0x9EC3, 0xD7C6, 0x9EC4, 0xD4D6, 0xB2D3, /* 0x70 */
0xECBE, 0x9EC5, 0x9EC6, 0x9EC7, 0x9EC8, 0xEAC1, 0x9EC9, 0x9ECA, /* 0x80 */
0x9ECB, 0xC2AF, 0xB4B6, 0x9ECC, 0x9ECD, 0x9ECE, 0xD1D7, 0x9ECF, /* 0x80 */
0x9ED0, 0x9ED1, 0xB3B4, 0x9ED2, 0xC8B2, 0xBFBB, 0xECC0, 0x9ED3, /* 0x90 */
0x9ED4, 0xD6CB, 0x9ED5, 0x9ED6, 0xECBF, 0xECC1, 0x9ED7, 0x9ED8, /* 0x90 */
0x9ED9, 0x9EDA, 0x9EDB, 0x9EDC, 0x9EDD, 0x9EDE, 0x9EDF, 0x9EE0, /* 0xA0 */
0x9EE1, 0x9EE2, 0x9EE3, 0xECC5, 0xBEE6, 0xCCBF, 0xC5DA, 0xBEBC, /* 0xA0 */
0x9EE4, 0xECC6, 0x9EE5, 0xB1FE, 0x9EE6, 0x9EE7, 0x9EE8, 0xECC4, /* 0xB0 */
0xD5A8, 0xB5E3, 0x9EE9, 0xECC2, 0xC1B6, 0xB3E3, 0x9EEA, 0x9EEB, /* 0xB0 */
0xECC3, 0xCBB8, 0xC0C3, 0xCCFE, 0x9EEC, 0x9EED, 0x9EEE, 0x9EEF, /* 0xC0 */
0xC1D2, 0x9EF0, 0xECC8, 0x9EF1, 0x9EF2, 0x9EF3, 0x9EF4, 0x9EF5, /* 0xC0 */
0x9EF6, 0x9EF7, 0x9EF8, 0x9EF9, 0x9EFA, 0x9EFB, 0x9EFC, 0x9EFD, /* 0xD0 */
0xBAE6, 0xC0D3, 0x9EFE, 0xD6F2, 0x9F40, 0x9F41, 0x9F42, 0xD1CC, /* 0xD0 */
0x9F43, 0x9F44, 0x9F45, 0x9F46, 0xBFBE, 0x9F47, 0xB7B3, 0xC9D5, /* 0xE0 */
0xECC7, 0xBBE2, 0x9F48, 0xCCCC, 0xBDFD, 0xC8C8, 0x9F49, 0xCFA9, /* 0xE0 */
0x9F4A, 0x9F4B, 0x9F4C, 0x9F4D, 0x9F4E, 0x9F4F, 0x9F50, 0xCDE9, /* 0xF0 */
0x9F51, 0xC5EB, 0x9F52, 0x9F53, 0x9F54, 0xB7E9, 0x9F55, 0x9F56 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_71[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x9F57, 0x9F58, 0x9F59, 0x9F5A, 0x9F5B, 0x9F5C, 0x9F5D, 0x9F5E, /* 0x00 */
0x9F5F, 0xD1C9, 0xBAB8, 0x9F60, 0x9F61, 0x9F62, 0x9F63, 0x9F64, /* 0x00 */
0xECC9, 0x9F65, 0x9F66, 0xECCA, 0x9F67, 0xBBC0, 0xECCB, 0x9F68, /* 0x10 */
0xECE2, 0xB1BA, 0xB7D9, 0x9F69, 0x9F6A, 0x9F6B, 0x9F6C, 0x9F6D, /* 0x10 */
0x9F6E, 0x9F6F, 0x9F70, 0x9F71, 0x9F72, 0x9F73, 0xBDB9, 0x9F74, /* 0x20 */
0x9F75, 0x9F76, 0x9F77, 0x9F78, 0x9F79, 0x9F7A, 0x9F7B, 0xECCC, /* 0x20 */
0xD1E6, 0xECCD, 0x9F7C, 0x9F7D, 0x9F7E, 0x9F80, 0xC8BB, 0x9F81, /* 0x30 */
0x9F82, 0x9F83, 0x9F84, 0x9F85, 0x9F86, 0x9F87, 0x9F88, 0x9F89, /* 0x30 */
0x9F8A, 0x9F8B, 0x9F8C, 0x9F8D, 0x9F8E, 0xECD1, 0x9F8F, 0x9F90, /* 0x40 */
0x9F91, 0x9F92, 0xECD3, 0x9F93, 0xBBCD, 0x9F94, 0xBCE5, 0x9F95, /* 0x40 */
0x9F96, 0x9F97, 0x9F98, 0x9F99, 0x9F9A, 0x9F9B, 0x9F9C, 0x9F9D, /* 0x50 */
0x9F9E, 0x9F9F, 0x9FA0, 0x9FA1, 0xECCF, 0x9FA2, 0xC9B7, 0x9FA3, /* 0x50 */
0x9FA4, 0x9FA5, 0x9FA6, 0x9FA7, 0xC3BA, 0x9FA8, 0xECE3, 0xD5D5, /* 0x60 */
0xECD0, 0x9FA9, 0x9FAA, 0x9FAB, 0x9FAC, 0x9FAD, 0xD6F3, 0x9FAE, /* 0x60 */
0x9FAF, 0x9FB0, 0xECD2, 0xECCE, 0x9FB1, 0x9FB2, 0x9FB3, 0x9FB4, /* 0x70 */
0xECD4, 0x9FB5, 0xECD5, 0x9FB6, 0x9FB7, 0xC9BF, 0x9FB8, 0x9FB9, /* 0x70 */
0x9FBA, 0x9FBB, 0x9FBC, 0x9FBD, 0xCFA8, 0x9FBE, 0x9FBF, 0x9FC0, /* 0x80 */
0x9FC1, 0x9FC2, 0xD0DC, 0x9FC3, 0x9FC4, 0x9FC5, 0x9FC6, 0xD1AC, /* 0x80 */
0x9FC7, 0x9FC8, 0x9FC9, 0x9FCA, 0xC8DB, 0x9FCB, 0x9FCC, 0x9FCD, /* 0x90 */
0xECD6, 0xCEF5, 0x9FCE, 0x9FCF, 0x9FD0, 0x9FD1, 0x9FD2, 0xCAEC, /* 0x90 */
0xECDA, 0x9FD3, 0x9FD4, 0x9FD5, 0x9FD6, 0x9FD7, 0x9FD8, 0x9FD9, /* 0xA0 */
0xECD9, 0x9FDA, 0x9FDB, 0x9FDC, 0xB0BE, 0x9FDD, 0x9FDE, 0x9FDF, /* 0xA0 */
0x9FE0, 0x9FE1, 0x9FE2, 0xECD7, 0x9FE3, 0xECD8, 0x9FE4, 0x9FE5, /* 0xB0 */
0x9FE6, 0xECE4, 0x9FE7, 0x9FE8, 0x9FE9, 0x9FEA, 0x9FEB, 0x9FEC, /* 0xB0 */
0x9FED, 0x9FEE, 0x9FEF, 0xC8BC, 0x9FF0, 0x9FF1, 0x9FF2, 0x9FF3, /* 0xC0 */
0x9FF4, 0x9FF5, 0x9FF6, 0x9FF7, 0x9FF8, 0x9FF9, 0xC1C7, 0x9FFA, /* 0xC0 */
0x9FFB, 0x9FFC, 0x9FFD, 0x9FFE, 0xECDC, 0xD1E0, 0xA040, 0xA041, /* 0xD0 */
0xA042, 0xA043, 0xA044, 0xA045, 0xA046, 0xA047, 0xA048, 0xA049, /* 0xD0 */
0xECDB, 0xA04A, 0xA04B, 0xA04C, 0xA04D, 0xD4EF, 0xA04E, 0xECDD, /* 0xE0 */
0xA04F, 0xA050, 0xA051, 0xA052, 0xA053, 0xA054, 0xDBC6, 0xA055, /* 0xE0 */
0xA056, 0xA057, 0xA058, 0xA059, 0xA05A, 0xA05B, 0xA05C, 0xA05D, /* 0xF0 */
0xA05E, 0xECDE, 0xA05F, 0xA060, 0xA061, 0xA062, 0xA063, 0xA064 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_72[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA065, 0xA066, 0xA067, 0xA068, 0xA069, 0xA06A, 0xB1AC, 0xA06B, /* 0x00 */
0xA06C, 0xA06D, 0xA06E, 0xA06F, 0xA070, 0xA071, 0xA072, 0xA073, /* 0x00 */
0xA074, 0xA075, 0xA076, 0xA077, 0xA078, 0xA079, 0xA07A, 0xA07B, /* 0x10 */
0xA07C, 0xA07D, 0xA07E, 0xA080, 0xA081, 0xECDF, 0xA082, 0xA083, /* 0x10 */
0xA084, 0xA085, 0xA086, 0xA087, 0xA088, 0xA089, 0xA08A, 0xA08B, /* 0x20 */
0xECE0, 0xA08C, 0xD7A6, 0xA08D, 0xC5C0, 0xA08E, 0xA08F, 0xA090, /* 0x20 */
0xEBBC, 0xB0AE, 0xA091, 0xA092, 0xA093, 0xBEF4, 0xB8B8, 0xD2AF, /* 0x30 */
0xB0D6, 0xB5F9, 0xA094, 0xD8B3, 0xA095, 0xCBAC, 0xA096, 0xE3DD, /* 0x30 */
0xA097, 0xA098, 0xA099, 0xA09A, 0xA09B, 0xA09C, 0xA09D, 0xC6AC, /* 0x40 */
0xB0E6, 0xA09E, 0xA09F, 0xA0A0, 0xC5C6, 0xEBB9, 0xA0A1, 0xA0A2, /* 0x40 */
0xA0A3, 0xA0A4, 0xEBBA, 0xA0A5, 0xA0A6, 0xA0A7, 0xEBBB, 0xA0A8, /* 0x50 */
0xA0A9, 0xD1C0, 0xA0AA, 0xC5A3, 0xA0AB, 0xEAF2, 0xA0AC, 0xC4B2, /* 0x50 */
0xA0AD, 0xC4B5, 0xC0CE, 0xA0AE, 0xA0AF, 0xA0B0, 0xEAF3, 0xC4C1, /* 0x60 */
0xA0B1, 0xCEEF, 0xA0B2, 0xA0B3, 0xA0B4, 0xA0B5, 0xEAF0, 0xEAF4, /* 0x60 */
0xA0B6, 0xA0B7, 0xC9FC, 0xA0B8, 0xA0B9, 0xC7A3, 0xA0BA, 0xA0BB, /* 0x70 */
0xA0BC, 0xCCD8, 0xCEFE, 0xA0BD, 0xA0BE, 0xA0BF, 0xEAF5, 0xEAF6, /* 0x70 */
0xCFAC, 0xC0E7, 0xA0C0, 0xA0C1, 0xEAF7, 0xA0C2, 0xA0C3, 0xA0C4, /* 0x80 */
0xA0C5, 0xA0C6, 0xB6BF, 0xEAF8, 0xA0C7, 0xEAF9, 0xA0C8, 0xEAFA, /* 0x80 */
0xA0C9, 0xA0CA, 0xEAFB, 0xA0CB, 0xA0CC, 0xA0CD, 0xA0CE, 0xA0CF, /* 0x90 */
0xA0D0, 0xA0D1, 0xA0D2, 0xA0D3, 0xA0D4, 0xA0D5, 0xA0D6, 0xEAF1, /* 0x90 */
0xA0D7, 0xA0D8, 0xA0D9, 0xA0DA, 0xA0DB, 0xA0DC, 0xA0DD, 0xA0DE, /* 0xA0 */
0xA0DF, 0xA0E0, 0xA0E1, 0xA0E2, 0xC8AE, 0xE1EB, 0xA0E3, 0xB7B8, /* 0xA0 */
0xE1EC, 0xA0E4, 0xA0E5, 0xA0E6, 0xE1ED, 0xA0E7, 0xD7B4, 0xE1EE, /* 0xB0 */
0xE1EF, 0xD3CC, 0xA0E8, 0xA0E9, 0xA0EA, 0xA0EB, 0xA0EC, 0xA0ED, /* 0xB0 */
0xA0EE, 0xE1F1, 0xBFF1, 0xE1F0, 0xB5D2, 0xA0EF, 0xA0F0, 0xA0F1, /* 0xC0 */
0xB1B7, 0xA0F2, 0xA0F3, 0xA0F4, 0xA0F5, 0xE1F3, 0xE1F2, 0xA0F6, /* 0xC0 */
0xBAFC, 0xA0F7, 0xE1F4, 0xA0F8, 0xA0F9, 0xA0FA, 0xA0FB, 0xB9B7, /* 0xD0 */
0xA0FC, 0xBED1, 0xA0FD, 0xA0FE, 0xAA40, 0xAA41, 0xC4FC, 0xAA42, /* 0xD0 */
0xBADD, 0xBDC6, 0xAA43, 0xAA44, 0xAA45, 0xAA46, 0xAA47, 0xAA48, /* 0xE0 */
0xE1F5, 0xE1F7, 0xAA49, 0xAA4A, 0xB6C0, 0xCFC1, 0xCAA8, 0xE1F6, /* 0xE0 */
0xD5F8, 0xD3FC, 0xE1F8, 0xE1FC, 0xE1F9, 0xAA4B, 0xAA4C, 0xE1FA, /* 0xF0 */
0xC0EA, 0xAA4D, 0xE1FE, 0xE2A1, 0xC0C7, 0xAA4E, 0xAA4F, 0xAA50 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_73[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xAA51, 0xE1FB, 0xAA52, 0xE1FD, 0xAA53, 0xAA54, 0xAA55, 0xAA56, /* 0x00 */
0xAA57, 0xAA58, 0xE2A5, 0xAA59, 0xAA5A, 0xAA5B, 0xC1D4, 0xAA5C, /* 0x00 */
0xAA5D, 0xAA5E, 0xAA5F, 0xE2A3, 0xAA60, 0xE2A8, 0xB2FE, 0xE2A2, /* 0x10 */
0xAA61, 0xAA62, 0xAA63, 0xC3CD, 0xB2C2, 0xE2A7, 0xE2A6, 0xAA64, /* 0x10 */
0xAA65, 0xE2A4, 0xE2A9, 0xAA66, 0xAA67, 0xE2AB, 0xAA68, 0xAA69, /* 0x20 */
0xAA6A, 0xD0C9, 0xD6ED, 0xC3A8, 0xE2AC, 0xAA6B, 0xCFD7, 0xAA6C, /* 0x20 */
0xAA6D, 0xE2AE, 0xAA6E, 0xAA6F, 0xBAEF, 0xAA70, 0xAA71, 0xE9E0, /* 0x30 */
0xE2AD, 0xE2AA, 0xAA72, 0xAA73, 0xAA74, 0xAA75, 0xBBAB, 0xD4B3, /* 0x30 */
0xAA76, 0xAA77, 0xAA78, 0xAA79, 0xAA7A, 0xAA7B, 0xAA7C, 0xAA7D, /* 0x40 */
0xAA7E, 0xAA80, 0xAA81, 0xAA82, 0xAA83, 0xE2B0, 0xAA84, 0xAA85, /* 0x40 */
0xE2AF, 0xAA86, 0xE9E1, 0xAA87, 0xAA88, 0xAA89, 0xAA8A, 0xE2B1, /* 0x50 */
0xAA8B, 0xAA8C, 0xAA8D, 0xAA8E, 0xAA8F, 0xAA90, 0xAA91, 0xAA92, /* 0x50 */
0xE2B2, 0xAA93, 0xAA94, 0xAA95, 0xAA96, 0xAA97, 0xAA98, 0xAA99, /* 0x60 */
0xAA9A, 0xAA9B, 0xAA9C, 0xAA9D, 0xE2B3, 0xCCA1, 0xAA9E, 0xE2B4, /* 0x60 */
0xAA9F, 0xAAA0, 0xAB40, 0xAB41, 0xAB42, 0xAB43, 0xAB44, 0xAB45, /* 0x70 */
0xAB46, 0xAB47, 0xAB48, 0xAB49, 0xAB4A, 0xAB4B, 0xE2B5, 0xAB4C, /* 0x70 */
0xAB4D, 0xAB4E, 0xAB4F, 0xAB50, 0xD0FE, 0xAB51, 0xAB52, 0xC2CA, /* 0x80 */
0xAB53, 0xD3F1, 0xAB54, 0xCDF5, 0xAB55, 0xAB56, 0xE7E0, 0xAB57, /* 0x80 */
0xAB58, 0xE7E1, 0xAB59, 0xAB5A, 0xAB5B, 0xAB5C, 0xBEC1, 0xAB5D, /* 0x90 */
0xAB5E, 0xAB5F, 0xAB60, 0xC2EA, 0xAB61, 0xAB62, 0xAB63, 0xE7E4, /* 0x90 */
0xAB64, 0xAB65, 0xE7E3, 0xAB66, 0xAB67, 0xAB68, 0xAB69, 0xAB6A, /* 0xA0 */
0xAB6B, 0xCDE6, 0xAB6C, 0xC3B5, 0xAB6D, 0xAB6E, 0xE7E2, 0xBBB7, /* 0xA0 */
0xCFD6, 0xAB6F, 0xC1E1, 0xE7E9, 0xAB70, 0xAB71, 0xAB72, 0xE7E8, /* 0xB0 */
0xAB73, 0xAB74, 0xE7F4, 0xB2A3, 0xAB75, 0xAB76, 0xAB77, 0xAB78, /* 0xB0 */
0xE7EA, 0xAB79, 0xE7E6, 0xAB7A, 0xAB7B, 0xAB7C, 0xAB7D, 0xAB7E, /* 0xC0 */
0xE7EC, 0xE7EB, 0xC9BA, 0xAB80, 0xAB81, 0xD5E4, 0xAB82, 0xE7E5, /* 0xC0 */
0xB7A9, 0xE7E7, 0xAB83, 0xAB84, 0xAB85, 0xAB86, 0xAB87, 0xAB88, /* 0xD0 */
0xAB89, 0xE7EE, 0xAB8A, 0xAB8B, 0xAB8C, 0xAB8D, 0xE7F3, 0xAB8E, /* 0xD0 */
0xD6E9, 0xAB8F, 0xAB90, 0xAB91, 0xAB92, 0xE7ED, 0xAB93, 0xE7F2, /* 0xE0 */
0xAB94, 0xE7F1, 0xAB95, 0xAB96, 0xAB97, 0xB0E0, 0xAB98, 0xAB99, /* 0xE0 */
0xAB9A, 0xAB9B, 0xE7F5, 0xAB9C, 0xAB9D, 0xAB9E, 0xAB9F, 0xABA0, /* 0xF0 */
0xAC40, 0xAC41, 0xAC42, 0xAC43, 0xAC44, 0xAC45, 0xAC46, 0xAC47 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_74[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xAC48, 0xAC49, 0xAC4A, 0xC7F2, 0xAC4B, 0xC0C5, 0xC0ED, 0xAC4C, /* 0x00 */
0xAC4D, 0xC1F0, 0xE7F0, 0xAC4E, 0xAC4F, 0xAC50, 0xAC51, 0xE7F6, /* 0x00 */
0xCBF6, 0xAC52, 0xAC53, 0xAC54, 0xAC55, 0xAC56, 0xAC57, 0xAC58, /* 0x10 */
0xAC59, 0xAC5A, 0xE8A2, 0xE8A1, 0xAC5B, 0xAC5C, 0xAC5D, 0xAC5E, /* 0x10 */
0xAC5F, 0xAC60, 0xD7C1, 0xAC61, 0xAC62, 0xE7FA, 0xE7F9, 0xAC63, /* 0x20 */
0xE7FB, 0xAC64, 0xE7F7, 0xAC65, 0xE7FE, 0xAC66, 0xE7FD, 0xAC67, /* 0x20 */
0xE7FC, 0xAC68, 0xAC69, 0xC1D5, 0xC7D9, 0xC5FD, 0xC5C3, 0xAC6A, /* 0x30 */
0xAC6B, 0xAC6C, 0xAC6D, 0xAC6E, 0xC7ED, 0xAC6F, 0xAC70, 0xAC71, /* 0x30 */
0xAC72, 0xE8A3, 0xAC73, 0xAC74, 0xAC75, 0xAC76, 0xAC77, 0xAC78, /* 0x40 */
0xAC79, 0xAC7A, 0xAC7B, 0xAC7C, 0xAC7D, 0xAC7E, 0xAC80, 0xAC81, /* 0x40 */
0xAC82, 0xAC83, 0xAC84, 0xAC85, 0xAC86, 0xE8A6, 0xAC87, 0xE8A5, /* 0x50 */
0xAC88, 0xE8A7, 0xBAF7, 0xE7F8, 0xE8A4, 0xAC89, 0xC8F0, 0xC9AA, /* 0x50 */
0xAC8A, 0xAC8B, 0xAC8C, 0xAC8D, 0xAC8E, 0xAC8F, 0xAC90, 0xAC91, /* 0x60 */
0xAC92, 0xAC93, 0xAC94, 0xAC95, 0xAC96, 0xE8A9, 0xAC97, 0xAC98, /* 0x60 */
0xB9E5, 0xAC99, 0xAC9A, 0xAC9B, 0xAC9C, 0xAC9D, 0xD1FE, 0xE8A8, /* 0x70 */
0xAC9E, 0xAC9F, 0xACA0, 0xAD40, 0xAD41, 0xAD42, 0xE8AA, 0xAD43, /* 0x70 */
0xE8AD, 0xE8AE, 0xAD44, 0xC1A7, 0xAD45, 0xAD46, 0xAD47, 0xE8AF, /* 0x80 */
0xAD48, 0xAD49, 0xAD4A, 0xE8B0, 0xAD4B, 0xAD4C, 0xE8AC, 0xAD4D, /* 0x80 */
0xE8B4, 0xAD4E, 0xAD4F, 0xAD50, 0xAD51, 0xAD52, 0xAD53, 0xAD54, /* 0x90 */
0xAD55, 0xAD56, 0xAD57, 0xAD58, 0xE8AB, 0xAD59, 0xE8B1, 0xAD5A, /* 0x90 */
0xAD5B, 0xAD5C, 0xAD5D, 0xAD5E, 0xAD5F, 0xAD60, 0xAD61, 0xE8B5, /* 0xA0 */
0xE8B2, 0xE8B3, 0xAD62, 0xAD63, 0xAD64, 0xAD65, 0xAD66, 0xAD67, /* 0xA0 */
0xAD68, 0xAD69, 0xAD6A, 0xAD6B, 0xAD6C, 0xAD6D, 0xAD6E, 0xAD6F, /* 0xB0 */
0xAD70, 0xAD71, 0xE8B7, 0xAD72, 0xAD73, 0xAD74, 0xAD75, 0xAD76, /* 0xB0 */
0xAD77, 0xAD78, 0xAD79, 0xAD7A, 0xAD7B, 0xAD7C, 0xAD7D, 0xAD7E, /* 0xC0 */
0xAD80, 0xAD81, 0xAD82, 0xAD83, 0xAD84, 0xAD85, 0xAD86, 0xAD87, /* 0xC0 */
0xAD88, 0xAD89, 0xE8B6, 0xAD8A, 0xAD8B, 0xAD8C, 0xAD8D, 0xAD8E, /* 0xD0 */
0xAD8F, 0xAD90, 0xAD91, 0xAD92, 0xB9CF, 0xAD93, 0xF0AC, 0xAD94, /* 0xD0 */
0xF0AD, 0xAD95, 0xC6B0, 0xB0EA, 0xC8BF, 0xAD96, 0xCDDF, 0xAD97, /* 0xE0 */
0xAD98, 0xAD99, 0xAD9A, 0xAD9B, 0xAD9C, 0xAD9D, 0xCECD, 0xEAB1, /* 0xE0 */
0xAD9E, 0xAD9F, 0xADA0, 0xAE40, 0xEAB2, 0xAE41, 0xC6BF, 0xB4C9, /* 0xF0 */
0xAE42, 0xAE43, 0xAE44, 0xAE45, 0xAE46, 0xAE47, 0xAE48, 0xEAB3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_75[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xAE49, 0xAE4A, 0xAE4B, 0xAE4C, 0xD5E7, 0xAE4D, 0xAE4E, 0xAE4F, /* 0x00 */
0xAE50, 0xAE51, 0xAE52, 0xAE53, 0xAE54, 0xDDF9, 0xAE55, 0xEAB4, /* 0x00 */
0xAE56, 0xEAB5, 0xAE57, 0xEAB6, 0xAE58, 0xAE59, 0xAE5A, 0xAE5B, /* 0x10 */
0xB8CA, 0xDFB0, 0xC9F5, 0xAE5C, 0xCCF0, 0xAE5D, 0xAE5E, 0xC9FA, /* 0x10 */
0xAE5F, 0xAE60, 0xAE61, 0xAE62, 0xAE63, 0xC9FB, 0xAE64, 0xAE65, /* 0x20 */
0xD3C3, 0xCBA6, 0xAE66, 0xB8A6, 0xF0AE, 0xB1C2, 0xAE67, 0xE5B8, /* 0x20 */
0xCCEF, 0xD3C9, 0xBCD7, 0xC9EA, 0xAE68, 0xB5E7, 0xAE69, 0xC4D0, /* 0x30 */
0xB5E9, 0xAE6A, 0xEEAE, 0xBBAD, 0xAE6B, 0xAE6C, 0xE7DE, 0xAE6D, /* 0x30 */
0xEEAF, 0xAE6E, 0xAE6F, 0xAE70, 0xAE71, 0xB3A9, 0xAE72, 0xAE73, /* 0x40 */
0xEEB2, 0xAE74, 0xAE75, 0xEEB1, 0xBDE7, 0xAE76, 0xEEB0, 0xCEB7, /* 0x40 */
0xAE77, 0xAE78, 0xAE79, 0xAE7A, 0xC5CF, 0xAE7B, 0xAE7C, 0xAE7D, /* 0x50 */
0xAE7E, 0xC1F4, 0xDBCE, 0xEEB3, 0xD0F3, 0xAE80, 0xAE81, 0xAE82, /* 0x50 */
0xAE83, 0xAE84, 0xAE85, 0xAE86, 0xAE87, 0xC2D4, 0xC6E8, 0xAE88, /* 0x60 */
0xAE89, 0xAE8A, 0xB7AC, 0xAE8B, 0xAE8C, 0xAE8D, 0xAE8E, 0xAE8F, /* 0x60 */
0xAE90, 0xAE91, 0xEEB4, 0xAE92, 0xB3EB, 0xAE93, 0xAE94, 0xAE95, /* 0x70 */
0xBBFB, 0xEEB5, 0xAE96, 0xAE97, 0xAE98, 0xAE99, 0xAE9A, 0xE7DC, /* 0x70 */
0xAE9B, 0xAE9C, 0xAE9D, 0xEEB6, 0xAE9E, 0xAE9F, 0xBDAE, 0xAEA0, /* 0x80 */
0xAF40, 0xAF41, 0xAF42, 0xF1E2, 0xAF43, 0xAF44, 0xAF45, 0xCAE8, /* 0x80 */
0xAF46, 0xD2C9, 0xF0DA, 0xAF47, 0xF0DB, 0xAF48, 0xF0DC, 0xC1C6, /* 0x90 */
0xAF49, 0xB8ED, 0xBECE, 0xAF4A, 0xAF4B, 0xF0DE, 0xAF4C, 0xC5B1, /* 0x90 */
0xF0DD, 0xD1F1, 0xAF4D, 0xF0E0, 0xB0CC, 0xBDEA, 0xAF4E, 0xAF4F, /* 0xA0 */
0xAF50, 0xAF51, 0xAF52, 0xD2DF, 0xF0DF, 0xAF53, 0xB4AF, 0xB7E8, /* 0xA0 */
0xF0E6, 0xF0E5, 0xC6A3, 0xF0E1, 0xF0E2, 0xB4C3, 0xAF54, 0xAF55, /* 0xB0 */
0xF0E3, 0xD5EE, 0xAF56, 0xAF57, 0xCCDB, 0xBED2, 0xBCB2, 0xAF58, /* 0xB0 */
0xAF59, 0xAF5A, 0xF0E8, 0xF0E7, 0xF0E4, 0xB2A1, 0xAF5B, 0xD6A2, /* 0xC0 */
0xD3B8, 0xBEB7, 0xC8AC, 0xAF5C, 0xAF5D, 0xF0EA, 0xAF5E, 0xAF5F, /* 0xC0 */
0xAF60, 0xAF61, 0xD1F7, 0xAF62, 0xD6CC, 0xBADB, 0xF0E9, 0xAF63, /* 0xD0 */
0xB6BB, 0xAF64, 0xAF65, 0xCDB4, 0xAF66, 0xAF67, 0xC6A6, 0xAF68, /* 0xD0 */
0xAF69, 0xAF6A, 0xC1A1, 0xF0EB, 0xF0EE, 0xAF6B, 0xF0ED, 0xF0F0, /* 0xE0 */
0xF0EC, 0xAF6C, 0xBBBE, 0xF0EF, 0xAF6D, 0xAF6E, 0xAF6F, 0xAF70, /* 0xE0 */
0xCCB5, 0xF0F2, 0xAF71, 0xAF72, 0xB3D5, 0xAF73, 0xAF74, 0xAF75, /* 0xF0 */
0xAF76, 0xB1D4, 0xAF77, 0xAF78, 0xF0F3, 0xAF79, 0xAF7A, 0xF0F4 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_76[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xF0F6, 0xB4E1, 0xAF7B, 0xF0F1, 0xAF7C, 0xF0F7, 0xAF7D, 0xAF7E, /* 0x00 */
0xAF80, 0xAF81, 0xF0FA, 0xAF82, 0xF0F8, 0xAF83, 0xAF84, 0xAF85, /* 0x00 */
0xF0F5, 0xAF86, 0xAF87, 0xAF88, 0xAF89, 0xF0FD, 0xAF8A, 0xF0F9, /* 0x10 */
0xF0FC, 0xF0FE, 0xAF8B, 0xF1A1, 0xAF8C, 0xAF8D, 0xAF8E, 0xCEC1, /* 0x10 */
0xF1A4, 0xAF8F, 0xF1A3, 0xAF90, 0xC1F6, 0xF0FB, 0xCADD, 0xAF91, /* 0x20 */
0xAF92, 0xB4F1, 0xB1F1, 0xCCB1, 0xAF93, 0xF1A6, 0xAF94, 0xAF95, /* 0x20 */
0xF1A7, 0xAF96, 0xAF97, 0xF1AC, 0xD5CE, 0xF1A9, 0xAF98, 0xAF99, /* 0x30 */
0xC8B3, 0xAF9A, 0xAF9B, 0xAF9C, 0xF1A2, 0xAF9D, 0xF1AB, 0xF1A8, /* 0x30 */
0xF1A5, 0xAF9E, 0xAF9F, 0xF1AA, 0xAFA0, 0xB040, 0xB041, 0xB042, /* 0x40 */
0xB043, 0xB044, 0xB045, 0xB046, 0xB0A9, 0xF1AD, 0xB047, 0xB048, /* 0x40 */
0xB049, 0xB04A, 0xB04B, 0xB04C, 0xF1AF, 0xB04D, 0xF1B1, 0xB04E, /* 0x50 */
0xB04F, 0xB050, 0xB051, 0xB052, 0xF1B0, 0xB053, 0xF1AE, 0xB054, /* 0x50 */
0xB055, 0xB056, 0xB057, 0xD1A2, 0xB058, 0xB059, 0xB05A, 0xB05B, /* 0x60 */
0xB05C, 0xB05D, 0xB05E, 0xF1B2, 0xB05F, 0xB060, 0xB061, 0xF1B3, /* 0x60 */
0xB062, 0xB063, 0xB064, 0xB065, 0xB066, 0xB067, 0xB068, 0xB069, /* 0x70 */
0xB9EF, 0xB06A, 0xB06B, 0xB5C7, 0xB06C, 0xB0D7, 0xB0D9, 0xB06D, /* 0x70 */
0xB06E, 0xB06F, 0xD4ED, 0xB070, 0xB5C4, 0xB071, 0xBDD4, 0xBBCA, /* 0x80 */
0xF0A7, 0xB072, 0xB073, 0xB8DE, 0xB074, 0xB075, 0xF0A8, 0xB076, /* 0x80 */
0xB077, 0xB0A8, 0xB078, 0xF0A9, 0xB079, 0xB07A, 0xCDEE, 0xB07B, /* 0x90 */
0xB07C, 0xF0AA, 0xB07D, 0xB07E, 0xB080, 0xB081, 0xB082, 0xB083, /* 0x90 */
0xB084, 0xB085, 0xB086, 0xB087, 0xF0AB, 0xB088, 0xB089, 0xB08A, /* 0xA0 */
0xB08B, 0xB08C, 0xB08D, 0xB08E, 0xB08F, 0xB090, 0xC6A4, 0xB091, /* 0xA0 */
0xB092, 0xD6E5, 0xF1E4, 0xB093, 0xF1E5, 0xB094, 0xB095, 0xB096, /* 0xB0 */
0xB097, 0xB098, 0xB099, 0xB09A, 0xB09B, 0xB09C, 0xB09D, 0xC3F3, /* 0xB0 */
0xB09E, 0xB09F, 0xD3DB, 0xB0A0, 0xB140, 0xD6D1, 0xC5E8, 0xB141, /* 0xC0 */
0xD3AF, 0xB142, 0xD2E6, 0xB143, 0xB144, 0xEEC1, 0xB0BB, 0xD5B5, /* 0xC0 */
0xD1CE, 0xBCE0, 0xBAD0, 0xB145, 0xBFF8, 0xB146, 0xB8C7, 0xB5C1, /* 0xD0 */
0xC5CC, 0xB147, 0xB148, 0xCAA2, 0xB149, 0xB14A, 0xB14B, 0xC3CB, /* 0xD0 */
0xB14C, 0xB14D, 0xB14E, 0xB14F, 0xB150, 0xEEC2, 0xB151, 0xB152, /* 0xE0 */
0xB153, 0xB154, 0xB155, 0xB156, 0xB157, 0xB158, 0xC4BF, 0xB6A2, /* 0xE0 */
0xB159, 0xEDEC, 0xC3A4, 0xB15A, 0xD6B1, 0xB15B, 0xB15C, 0xB15D, /* 0xF0 */
0xCFE0, 0xEDEF, 0xB15E, 0xB15F, 0xC5CE, 0xB160, 0xB6DC, 0xB161 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_77[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xB162, 0xCAA1, 0xB163, 0xB164, 0xEDED, 0xB165, 0xB166, 0xEDF0, /* 0x00 */
0xEDF1, 0xC3BC, 0xB167, 0xBFB4, 0xB168, 0xEDEE, 0xB169, 0xB16A, /* 0x00 */
0xB16B, 0xB16C, 0xB16D, 0xB16E, 0xB16F, 0xB170, 0xB171, 0xB172, /* 0x10 */
0xB173, 0xEDF4, 0xEDF2, 0xB174, 0xB175, 0xB176, 0xB177, 0xD5E6, /* 0x10 */
0xC3DF, 0xB178, 0xEDF3, 0xB179, 0xB17A, 0xB17B, 0xEDF6, 0xB17C, /* 0x20 */
0xD5A3, 0xD1A3, 0xB17D, 0xB17E, 0xB180, 0xEDF5, 0xB181, 0xC3D0, /* 0x20 */
0xB182, 0xB183, 0xB184, 0xB185, 0xB186, 0xEDF7, 0xBFF4, 0xBEEC, /* 0x30 */
0xEDF8, 0xB187, 0xCCF7, 0xB188, 0xD1DB, 0xB189, 0xB18A, 0xB18B, /* 0x30 */
0xD7C5, 0xD5F6, 0xB18C, 0xEDFC, 0xB18D, 0xB18E, 0xB18F, 0xEDFB, /* 0x40 */
0xB190, 0xB191, 0xB192, 0xB193, 0xB194, 0xB195, 0xB196, 0xB197, /* 0x40 */
0xEDF9, 0xEDFA, 0xB198, 0xB199, 0xB19A, 0xB19B, 0xB19C, 0xB19D, /* 0x50 */
0xB19E, 0xB19F, 0xEDFD, 0xBEA6, 0xB1A0, 0xB240, 0xB241, 0xB242, /* 0x50 */
0xB243, 0xCBAF, 0xEEA1, 0xB6BD, 0xB244, 0xEEA2, 0xC4C0, 0xB245, /* 0x60 */
0xEDFE, 0xB246, 0xB247, 0xBDDE, 0xB2C7, 0xB248, 0xB249, 0xB24A, /* 0x60 */
0xB24B, 0xB24C, 0xB24D, 0xB24E, 0xB24F, 0xB250, 0xB251, 0xB252, /* 0x70 */
0xB253, 0xB6C3, 0xB254, 0xB255, 0xB256, 0xEEA5, 0xD8BA, 0xEEA3, /* 0x70 */
0xEEA6, 0xB257, 0xB258, 0xB259, 0xC3E9, 0xB3F2, 0xB25A, 0xB25B, /* 0x80 */
0xB25C, 0xB25D, 0xB25E, 0xB25F, 0xEEA7, 0xEEA4, 0xCFB9, 0xB260, /* 0x80 */
0xB261, 0xEEA8, 0xC2F7, 0xB262, 0xB263, 0xB264, 0xB265, 0xB266, /* 0x90 */
0xB267, 0xB268, 0xB269, 0xB26A, 0xB26B, 0xB26C, 0xB26D, 0xEEA9, /* 0x90 */
0xEEAA, 0xB26E, 0xDEAB, 0xB26F, 0xB270, 0xC6B3, 0xB271, 0xC7C6, /* 0xA0 */
0xB272, 0xD6F5, 0xB5C9, 0xB273, 0xCBB2, 0xB274, 0xB275, 0xB276, /* 0xA0 */
0xEEAB, 0xB277, 0xB278, 0xCDAB, 0xB279, 0xEEAC, 0xB27A, 0xB27B, /* 0xB0 */
0xB27C, 0xB27D, 0xB27E, 0xD5B0, 0xB280, 0xEEAD, 0xB281, 0xF6C4, /* 0xB0 */
0xB282, 0xB283, 0xB284, 0xB285, 0xB286, 0xB287, 0xB288, 0xB289, /* 0xC0 */
0xB28A, 0xB28B, 0xB28C, 0xB28D, 0xB28E, 0xDBC7, 0xB28F, 0xB290, /* 0xC0 */
0xB291, 0xB292, 0xB293, 0xB294, 0xB295, 0xB296, 0xB297, 0xB4A3, /* 0xD0 */
0xB298, 0xB299, 0xB29A, 0xC3AC, 0xF1E6, 0xB29B, 0xB29C, 0xB29D, /* 0xD0 */
0xB29E, 0xB29F, 0xCAB8, 0xD2D3, 0xB2A0, 0xD6AA, 0xB340, 0xEFF2, /* 0xE0 */
0xB341, 0xBED8, 0xB342, 0xBDC3, 0xEFF3, 0xB6CC, 0xB0AB, 0xB343, /* 0xE0 */
0xB344, 0xB345, 0xB346, 0xCAAF, 0xB347, 0xB348, 0xEDB6, 0xB349, /* 0xF0 */
0xEDB7, 0xB34A, 0xB34B, 0xB34C, 0xB34D, 0xCEF9, 0xB7AF, 0xBFF3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_78[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xEDB8, 0xC2EB, 0xC9B0, 0xB34E, 0xB34F, 0xB350, 0xB351, 0xB352, /* 0x00 */
0xB353, 0xEDB9, 0xB354, 0xB355, 0xC6F6, 0xBFB3, 0xB356, 0xB357, /* 0x00 */
0xB358, 0xEDBC, 0xC5F8, 0xB359, 0xD1D0, 0xB35A, 0xD7A9, 0xEDBA, /* 0x10 */
0xEDBB, 0xB35B, 0xD1E2, 0xB35C, 0xEDBF, 0xEDC0, 0xB35D, 0xEDC4, /* 0x10 */
0xB35E, 0xB35F, 0xB360, 0xEDC8, 0xB361, 0xEDC6, 0xEDCE, 0xD5E8, /* 0x20 */
0xB362, 0xEDC9, 0xB363, 0xB364, 0xEDC7, 0xEDBE, 0xB365, 0xB366, /* 0x20 */
0xC5E9, 0xB367, 0xB368, 0xB369, 0xC6C6, 0xB36A, 0xB36B, 0xC9E9, /* 0x30 */
0xD4D2, 0xEDC1, 0xEDC2, 0xEDC3, 0xEDC5, 0xB36C, 0xC0F9, 0xB36D, /* 0x30 */
0xB4A1, 0xB36E, 0xB36F, 0xB370, 0xB371, 0xB9E8, 0xB372, 0xEDD0, /* 0x40 */
0xB373, 0xB374, 0xB375, 0xB376, 0xEDD1, 0xB377, 0xEDCA, 0xB378, /* 0x40 */
0xEDCF, 0xB379, 0xCEF8, 0xB37A, 0xB37B, 0xCBB6, 0xEDCC, 0xEDCD, /* 0x50 */
0xB37C, 0xB37D, 0xB37E, 0xB380, 0xB381, 0xCFF5, 0xB382, 0xB383, /* 0x50 */
0xB384, 0xB385, 0xB386, 0xB387, 0xB388, 0xB389, 0xB38A, 0xB38B, /* 0x60 */
0xB38C, 0xB38D, 0xEDD2, 0xC1F2, 0xD3B2, 0xEDCB, 0xC8B7, 0xB38E, /* 0x60 */
0xB38F, 0xB390, 0xB391, 0xB392, 0xB393, 0xB394, 0xB395, 0xBCEF, /* 0x70 */
0xB396, 0xB397, 0xB398, 0xB399, 0xC5F0, 0xB39A, 0xB39B, 0xB39C, /* 0x70 */
0xB39D, 0xB39E, 0xB39F, 0xB3A0, 0xB440, 0xB441, 0xB442, 0xEDD6, /* 0x80 */
0xB443, 0xB5EF, 0xB444, 0xB445, 0xC2B5, 0xB0AD, 0xCBE9, 0xB446, /* 0x80 */
0xB447, 0xB1AE, 0xB448, 0xEDD4, 0xB449, 0xB44A, 0xB44B, 0xCDEB, /* 0x90 */
0xB5E2, 0xB44C, 0xEDD5, 0xEDD3, 0xEDD7, 0xB44D, 0xB44E, 0xB5FA, /* 0x90 */
0xB44F, 0xEDD8, 0xB450, 0xEDD9, 0xB451, 0xEDDC, 0xB452, 0xB1CC, /* 0xA0 */
0xB453, 0xB454, 0xB455, 0xB456, 0xB457, 0xB458, 0xB459, 0xB45A, /* 0xA0 */
0xC5F6, 0xBCEE, 0xEDDA, 0xCCBC, 0xB2EA, 0xB45B, 0xB45C, 0xB45D, /* 0xB0 */
0xB45E, 0xEDDB, 0xB45F, 0xB460, 0xB461, 0xB462, 0xC4EB, 0xB463, /* 0xB0 */
0xB464, 0xB4C5, 0xB465, 0xB466, 0xB467, 0xB0F5, 0xB468, 0xB469, /* 0xC0 */
0xB46A, 0xEDDF, 0xC0DA, 0xB4E8, 0xB46B, 0xB46C, 0xB46D, 0xB46E, /* 0xC0 */
0xC5CD, 0xB46F, 0xB470, 0xB471, 0xEDDD, 0xBFC4, 0xB472, 0xB473, /* 0xD0 */
0xB474, 0xEDDE, 0xB475, 0xB476, 0xB477, 0xB478, 0xB479, 0xB47A, /* 0xD0 */
0xB47B, 0xB47C, 0xB47D, 0xB47E, 0xB480, 0xB481, 0xB482, 0xB483, /* 0xE0 */
0xC4A5, 0xB484, 0xB485, 0xB486, 0xEDE0, 0xB487, 0xB488, 0xB489, /* 0xE0 */
0xB48A, 0xB48B, 0xEDE1, 0xB48C, 0xEDE3, 0xB48D, 0xB48E, 0xC1D7, /* 0xF0 */
0xB48F, 0xB490, 0xBBC7, 0xB491, 0xB492, 0xB493, 0xB494, 0xB495 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_79[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xB496, 0xBDB8, 0xB497, 0xB498, 0xB499, 0xEDE2, 0xB49A, 0xB49B, /* 0x00 */
0xB49C, 0xB49D, 0xB49E, 0xB49F, 0xB4A0, 0xB540, 0xB541, 0xB542, /* 0x00 */
0xB543, 0xB544, 0xB545, 0xEDE4, 0xB546, 0xB547, 0xB548, 0xB549, /* 0x10 */
0xB54A, 0xB54B, 0xB54C, 0xB54D, 0xB54E, 0xB54F, 0xEDE6, 0xB550, /* 0x10 */
0xB551, 0xB552, 0xB553, 0xB554, 0xEDE5, 0xB555, 0xB556, 0xB557, /* 0x20 */
0xB558, 0xB559, 0xB55A, 0xB55B, 0xB55C, 0xB55D, 0xB55E, 0xB55F, /* 0x20 */
0xB560, 0xB561, 0xB562, 0xB563, 0xEDE7, 0xB564, 0xB565, 0xB566, /* 0x30 */
0xB567, 0xB568, 0xCABE, 0xECEA, 0xC0F1, 0xB569, 0xC9E7, 0xB56A, /* 0x30 */
0xECEB, 0xC6EE, 0xB56B, 0xB56C, 0xB56D, 0xB56E, 0xECEC, 0xB56F, /* 0x40 */
0xC6ED, 0xECED, 0xB570, 0xB571, 0xB572, 0xB573, 0xB574, 0xB575, /* 0x40 */
0xB576, 0xB577, 0xB578, 0xECF0, 0xB579, 0xB57A, 0xD7E6, 0xECF3, /* 0x50 */
0xB57B, 0xB57C, 0xECF1, 0xECEE, 0xECEF, 0xD7A3, 0xC9F1, 0xCBEE, /* 0x50 */
0xECF4, 0xB57D, 0xECF2, 0xB57E, 0xB580, 0xCFE9, 0xB581, 0xECF6, /* 0x60 */
0xC6B1, 0xB582, 0xB583, 0xB584, 0xB585, 0xBCC0, 0xB586, 0xECF5, /* 0x60 */
0xB587, 0xB588, 0xB589, 0xB58A, 0xB58B, 0xB58C, 0xB58D, 0xB5BB, /* 0x70 */
0xBBF6, 0xB58E, 0xECF7, 0xB58F, 0xB590, 0xB591, 0xB592, 0xB593, /* 0x70 */
0xD9F7, 0xBDFB, 0xB594, 0xB595, 0xC2BB, 0xECF8, 0xB596, 0xB597, /* 0x80 */
0xB598, 0xB599, 0xECF9, 0xB59A, 0xB59B, 0xB59C, 0xB59D, 0xB8A3, /* 0x80 */
0xB59E, 0xB59F, 0xB5A0, 0xB640, 0xB641, 0xB642, 0xB643, 0xB644, /* 0x90 */
0xB645, 0xB646, 0xECFA, 0xB647, 0xB648, 0xB649, 0xB64A, 0xB64B, /* 0x90 */
0xB64C, 0xB64D, 0xB64E, 0xB64F, 0xB650, 0xB651, 0xB652, 0xECFB, /* 0xA0 */
0xB653, 0xB654, 0xB655, 0xB656, 0xB657, 0xB658, 0xB659, 0xB65A, /* 0xA0 */
0xB65B, 0xB65C, 0xB65D, 0xECFC, 0xB65E, 0xB65F, 0xB660, 0xB661, /* 0xB0 */
0xB662, 0xD3ED, 0xD8AE, 0xC0EB, 0xB663, 0xC7DD, 0xBACC, 0xB664, /* 0xB0 */
0xD0E3, 0xCBBD, 0xB665, 0xCDBA, 0xB666, 0xB667, 0xB8D1, 0xB668, /* 0xC0 */
0xB669, 0xB1FC, 0xB66A, 0xC7EF, 0xB66B, 0xD6D6, 0xB66C, 0xB66D, /* 0xC0 */
0xB66E, 0xBFC6, 0xC3EB, 0xB66F, 0xB670, 0xEFF5, 0xB671, 0xB672, /* 0xD0 */
0xC3D8, 0xB673, 0xB674, 0xB675, 0xB676, 0xB677, 0xB678, 0xD7E2, /* 0xD0 */
0xB679, 0xB67A, 0xB67B, 0xEFF7, 0xB3D3, 0xB67C, 0xC7D8, 0xD1ED, /* 0xE0 */
0xB67D, 0xD6C8, 0xB67E, 0xEFF8, 0xB680, 0xEFF6, 0xB681, 0xBBFD, /* 0xE0 */
0xB3C6, 0xB682, 0xB683, 0xB684, 0xB685, 0xB686, 0xB687, 0xB688, /* 0xF0 */
0xBDD5, 0xB689, 0xB68A, 0xD2C6, 0xB68B, 0xBBE0, 0xB68C, 0xB68D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_7A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xCFA1, 0xB68E, 0xEFFC, 0xEFFB, 0xB68F, 0xB690, 0xEFF9, 0xB691, /* 0x00 */
0xB692, 0xB693, 0xB694, 0xB3CC, 0xB695, 0xC9D4, 0xCBB0, 0xB696, /* 0x00 */
0xB697, 0xB698, 0xB699, 0xB69A, 0xEFFE, 0xB69B, 0xB69C, 0xB0DE, /* 0x10 */
0xB69D, 0xB69E, 0xD6C9, 0xB69F, 0xB6A0, 0xB740, 0xEFFD, 0xB741, /* 0x10 */
0xB3ED, 0xB742, 0xB743, 0xF6D5, 0xB744, 0xB745, 0xB746, 0xB747, /* 0x20 */
0xB748, 0xB749, 0xB74A, 0xB74B, 0xB74C, 0xB74D, 0xB74E, 0xB74F, /* 0x20 */
0xB750, 0xB751, 0xB752, 0xCEC8, 0xB753, 0xB754, 0xB755, 0xF0A2, /* 0x30 */
0xB756, 0xF0A1, 0xB757, 0xB5BE, 0xBCDA, 0xBBFC, 0xB758, 0xB8E5, /* 0x30 */
0xB759, 0xB75A, 0xB75B, 0xB75C, 0xB75D, 0xB75E, 0xC4C2, 0xB75F, /* 0x40 */
0xB760, 0xB761, 0xB762, 0xB763, 0xB764, 0xB765, 0xB766, 0xB767, /* 0x40 */
0xB768, 0xF0A3, 0xB769, 0xB76A, 0xB76B, 0xB76C, 0xB76D, 0xCBEB, /* 0x50 */
0xB76E, 0xB76F, 0xB770, 0xB771, 0xB772, 0xB773, 0xB774, 0xB775, /* 0x50 */
0xB776, 0xB777, 0xB778, 0xB779, 0xB77A, 0xB77B, 0xB77C, 0xB77D, /* 0x60 */
0xB77E, 0xB780, 0xB781, 0xB782, 0xB783, 0xB784, 0xB785, 0xB786, /* 0x60 */
0xF0A6, 0xB787, 0xB788, 0xB789, 0xD1A8, 0xB78A, 0xBEBF, 0xC7EE, /* 0x70 */
0xF1B6, 0xF1B7, 0xBFD5, 0xB78B, 0xB78C, 0xB78D, 0xB78E, 0xB4A9, /* 0x70 */
0xF1B8, 0xCDBB, 0xB78F, 0xC7D4, 0xD5AD, 0xB790, 0xF1B9, 0xB791, /* 0x80 */
0xF1BA, 0xB792, 0xB793, 0xB794, 0xB795, 0xC7CF, 0xB796, 0xB797, /* 0x80 */
0xB798, 0xD2A4, 0xD6CF, 0xB799, 0xB79A, 0xF1BB, 0xBDD1, 0xB4B0, /* 0x90 */
0xBEBD, 0xB79B, 0xB79C, 0xB79D, 0xB4DC, 0xCED1, 0xB79E, 0xBFDF, /* 0x90 */
0xF1BD, 0xB79F, 0xB7A0, 0xB840, 0xB841, 0xBFFA, 0xF1BC, 0xB842, /* 0xA0 */
0xF1BF, 0xB843, 0xB844, 0xB845, 0xF1BE, 0xF1C0, 0xB846, 0xB847, /* 0xA0 */
0xB848, 0xB849, 0xB84A, 0xF1C1, 0xB84B, 0xB84C, 0xB84D, 0xB84E, /* 0xB0 */
0xB84F, 0xB850, 0xB851, 0xB852, 0xB853, 0xB854, 0xB855, 0xC1FE, /* 0xB0 */
0xB856, 0xB857, 0xB858, 0xB859, 0xB85A, 0xB85B, 0xB85C, 0xB85D, /* 0xC0 */
0xB85E, 0xB85F, 0xB860, 0xC1A2, 0xB861, 0xB862, 0xB863, 0xB864, /* 0xC0 */
0xB865, 0xB866, 0xB867, 0xB868, 0xB869, 0xB86A, 0xCAFA, 0xB86B, /* 0xD0 */
0xB86C, 0xD5BE, 0xB86D, 0xB86E, 0xB86F, 0xB870, 0xBEBA, 0xBEB9, /* 0xD0 */
0xD5C2, 0xB871, 0xB872, 0xBFA2, 0xB873, 0xCDAF, 0xF1B5, 0xB874, /* 0xE0 */
0xB875, 0xB876, 0xB877, 0xB878, 0xB879, 0xBDDF, 0xB87A, 0xB6CB, /* 0xE0 */
0xB87B, 0xB87C, 0xB87D, 0xB87E, 0xB880, 0xB881, 0xB882, 0xB883, /* 0xF0 */
0xB884, 0xD6F1, 0xF3C3, 0xB885, 0xB886, 0xF3C4, 0xB887, 0xB8CD /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_7B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xB888, 0xB889, 0xB88A, 0xF3C6, 0xF3C7, 0xB88B, 0xB0CA, 0xB88C, /* 0x00 */
0xF3C5, 0xB88D, 0xF3C9, 0xCBF1, 0xB88E, 0xB88F, 0xB890, 0xF3CB, /* 0x00 */
0xB891, 0xD0A6, 0xB892, 0xB893, 0xB1CA, 0xF3C8, 0xB894, 0xB895, /* 0x10 */
0xB896, 0xF3CF, 0xB897, 0xB5D1, 0xB898, 0xB899, 0xF3D7, 0xB89A, /* 0x10 */
0xF3D2, 0xB89B, 0xB89C, 0xB89D, 0xF3D4, 0xF3D3, 0xB7FB, 0xB89E, /* 0x20 */
0xB1BF, 0xB89F, 0xF3CE, 0xF3CA, 0xB5DA, 0xB8A0, 0xF3D0, 0xB940, /* 0x20 */
0xB941, 0xF3D1, 0xB942, 0xF3D5, 0xB943, 0xB944, 0xB945, 0xB946, /* 0x30 */
0xF3CD, 0xB947, 0xBCE3, 0xB948, 0xC1FD, 0xB949, 0xF3D6, 0xB94A, /* 0x30 */
0xB94B, 0xB94C, 0xB94D, 0xB94E, 0xB94F, 0xF3DA, 0xB950, 0xF3CC, /* 0x40 */
0xB951, 0xB5C8, 0xB952, 0xBDEE, 0xF3DC, 0xB953, 0xB954, 0xB7A4, /* 0x40 */
0xBFF0, 0xD6FE, 0xCDB2, 0xB955, 0xB4F0, 0xB956, 0xB2DF, 0xB957, /* 0x50 */
0xF3D8, 0xB958, 0xF3D9, 0xC9B8, 0xB959, 0xF3DD, 0xB95A, 0xB95B, /* 0x50 */
0xF3DE, 0xB95C, 0xF3E1, 0xB95D, 0xB95E, 0xB95F, 0xB960, 0xB961, /* 0x60 */
0xB962, 0xB963, 0xB964, 0xB965, 0xB966, 0xB967, 0xF3DF, 0xB968, /* 0x60 */
0xB969, 0xF3E3, 0xF3E2, 0xB96A, 0xB96B, 0xF3DB, 0xB96C, 0xBFEA, /* 0x70 */
0xB96D, 0xB3EF, 0xB96E, 0xF3E0, 0xB96F, 0xB970, 0xC7A9, 0xB971, /* 0x70 */
0xBCF2, 0xB972, 0xB973, 0xB974, 0xB975, 0xF3EB, 0xB976, 0xB977, /* 0x80 */
0xB978, 0xB979, 0xB97A, 0xB97B, 0xB97C, 0xB9BF, 0xB97D, 0xB97E, /* 0x80 */
0xF3E4, 0xB980, 0xB981, 0xB982, 0xB2AD, 0xBBFE, 0xB983, 0xCBE3, /* 0x90 */
0xB984, 0xB985, 0xB986, 0xB987, 0xF3ED, 0xF3E9, 0xB988, 0xB989, /* 0x90 */
0xB98A, 0xB9DC, 0xF3EE, 0xB98B, 0xB98C, 0xB98D, 0xF3E5, 0xF3E6, /* 0xA0 */
0xF3EA, 0xC2E1, 0xF3EC, 0xF3EF, 0xF3E8, 0xBCFD, 0xB98E, 0xB98F, /* 0xA0 */
0xB990, 0xCFE4, 0xB991, 0xB992, 0xF3F0, 0xB993, 0xB994, 0xB995, /* 0xB0 */
0xF3E7, 0xB996, 0xB997, 0xB998, 0xB999, 0xB99A, 0xB99B, 0xB99C, /* 0xB0 */
0xB99D, 0xF3F2, 0xB99E, 0xB99F, 0xB9A0, 0xBA40, 0xD7AD, 0xC6AA, /* 0xC0 */
0xBA41, 0xBA42, 0xBA43, 0xBA44, 0xF3F3, 0xBA45, 0xBA46, 0xBA47, /* 0xC0 */
0xBA48, 0xF3F1, 0xBA49, 0xC2A8, 0xBA4A, 0xBA4B, 0xBA4C, 0xBA4D, /* 0xD0 */
0xBA4E, 0xB8DD, 0xF3F5, 0xBA4F, 0xBA50, 0xF3F4, 0xBA51, 0xBA52, /* 0xD0 */
0xBA53, 0xB4DB, 0xBA54, 0xBA55, 0xBA56, 0xF3F6, 0xF3F7, 0xBA57, /* 0xE0 */
0xBA58, 0xBA59, 0xF3F8, 0xBA5A, 0xBA5B, 0xBA5C, 0xC0BA, 0xBA5D, /* 0xE0 */
0xBA5E, 0xC0E9, 0xBA5F, 0xBA60, 0xBA61, 0xBA62, 0xBA63, 0xC5F1, /* 0xF0 */
0xBA64, 0xBA65, 0xBA66, 0xBA67, 0xF3FB, 0xBA68, 0xF3FA, 0xBA69 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_7C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xBA6A, 0xBA6B, 0xBA6C, 0xBA6D, 0xBA6E, 0xBA6F, 0xBA70, 0xB4D8, /* 0x00 */
0xBA71, 0xBA72, 0xBA73, 0xF3FE, 0xF3F9, 0xBA74, 0xBA75, 0xF3FC, /* 0x00 */
0xBA76, 0xBA77, 0xBA78, 0xBA79, 0xBA7A, 0xBA7B, 0xF3FD, 0xBA7C, /* 0x10 */
0xBA7D, 0xBA7E, 0xBA80, 0xBA81, 0xBA82, 0xBA83, 0xBA84, 0xF4A1, /* 0x10 */
0xBA85, 0xBA86, 0xBA87, 0xBA88, 0xBA89, 0xBA8A, 0xF4A3, 0xBBC9, /* 0x20 */
0xBA8B, 0xBA8C, 0xF4A2, 0xBA8D, 0xBA8E, 0xBA8F, 0xBA90, 0xBA91, /* 0x20 */
0xBA92, 0xBA93, 0xBA94, 0xBA95, 0xBA96, 0xBA97, 0xBA98, 0xBA99, /* 0x30 */
0xF4A4, 0xBA9A, 0xBA9B, 0xBA9C, 0xBA9D, 0xBA9E, 0xBA9F, 0xB2BE, /* 0x30 */
0xF4A6, 0xF4A5, 0xBAA0, 0xBB40, 0xBB41, 0xBB42, 0xBB43, 0xBB44, /* 0x40 */
0xBB45, 0xBB46, 0xBB47, 0xBB48, 0xBB49, 0xBCAE, 0xBB4A, 0xBB4B, /* 0x40 */
0xBB4C, 0xBB4D, 0xBB4E, 0xBB4F, 0xBB50, 0xBB51, 0xBB52, 0xBB53, /* 0x50 */
0xBB54, 0xBB55, 0xBB56, 0xBB57, 0xBB58, 0xBB59, 0xBB5A, 0xBB5B, /* 0x50 */
0xBB5C, 0xBB5D, 0xBB5E, 0xBB5F, 0xBB60, 0xBB61, 0xBB62, 0xBB63, /* 0x60 */
0xBB64, 0xBB65, 0xBB66, 0xBB67, 0xBB68, 0xBB69, 0xBB6A, 0xBB6B, /* 0x60 */
0xBB6C, 0xBB6D, 0xBB6E, 0xC3D7, 0xD9E1, 0xBB6F, 0xBB70, 0xBB71, /* 0x70 */
0xBB72, 0xBB73, 0xBB74, 0xC0E0, 0xF4CC, 0xD7D1, 0xBB75, 0xBB76, /* 0x70 */
0xBB77, 0xBB78, 0xBB79, 0xBB7A, 0xBB7B, 0xBB7C, 0xBB7D, 0xBB7E, /* 0x80 */
0xBB80, 0xB7DB, 0xBB81, 0xBB82, 0xBB83, 0xBB84, 0xBB85, 0xBB86, /* 0x80 */
0xBB87, 0xF4CE, 0xC1A3, 0xBB88, 0xBB89, 0xC6C9, 0xBB8A, 0xB4D6, /* 0x90 */
0xD5B3, 0xBB8B, 0xBB8C, 0xBB8D, 0xF4D0, 0xF4CF, 0xF4D1, 0xCBDA, /* 0x90 */
0xBB8E, 0xBB8F, 0xF4D2, 0xBB90, 0xD4C1, 0xD6E0, 0xBB91, 0xBB92, /* 0xA0 */
0xBB93, 0xBB94, 0xB7E0, 0xBB95, 0xBB96, 0xBB97, 0xC1B8, 0xBB98, /* 0xA0 */
0xBB99, 0xC1BB, 0xF4D3, 0xBEAC, 0xBB9A, 0xBB9B, 0xBB9C, 0xBB9D, /* 0xB0 */
0xBB9E, 0xB4E2, 0xBB9F, 0xBBA0, 0xF4D4, 0xF4D5, 0xBEAB, 0xBC40, /* 0xB0 */
0xBC41, 0xF4D6, 0xBC42, 0xBC43, 0xBC44, 0xF4DB, 0xBC45, 0xF4D7, /* 0xC0 */
0xF4DA, 0xBC46, 0xBAFD, 0xBC47, 0xF4D8, 0xF4D9, 0xBC48, 0xBC49, /* 0xC0 */
0xBC4A, 0xBC4B, 0xBC4C, 0xBC4D, 0xBC4E, 0xB8E2, 0xCCC7, 0xF4DC, /* 0xD0 */
0xBC4F, 0xB2DA, 0xBC50, 0xBC51, 0xC3D3, 0xBC52, 0xBC53, 0xD4E3, /* 0xD0 */
0xBFB7, 0xBC54, 0xBC55, 0xBC56, 0xBC57, 0xBC58, 0xBC59, 0xBC5A, /* 0xE0 */
0xF4DD, 0xBC5B, 0xBC5C, 0xBC5D, 0xBC5E, 0xBC5F, 0xBC60, 0xC5B4, /* 0xE0 */
0xBC61, 0xBC62, 0xBC63, 0xBC64, 0xBC65, 0xBC66, 0xBC67, 0xBC68, /* 0xF0 */
0xF4E9, 0xBC69, 0xBC6A, 0xCFB5, 0xBC6B, 0xBC6C, 0xBC6D, 0xBC6E /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_7D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xBC6F, 0xBC70, 0xBC71, 0xBC72, 0xBC73, 0xBC74, 0xBC75, 0xBC76, /* 0x00 */
0xBC77, 0xBC78, 0xCEC9, 0xBC79, 0xBC7A, 0xBC7B, 0xBC7C, 0xBC7D, /* 0x00 */
0xBC7E, 0xBC80, 0xBC81, 0xBC82, 0xBC83, 0xBC84, 0xBC85, 0xBC86, /* 0x10 */
0xBC87, 0xBC88, 0xBC89, 0xBC8A, 0xBC8B, 0xBC8C, 0xBC8D, 0xBC8E, /* 0x10 */
0xCBD8, 0xBC8F, 0xCBF7, 0xBC90, 0xBC91, 0xBC92, 0xBC93, 0xBDF4, /* 0x20 */
0xBC94, 0xBC95, 0xBC96, 0xD7CF, 0xBC97, 0xBC98, 0xBC99, 0xC0DB, /* 0x20 */
0xBC9A, 0xBC9B, 0xBC9C, 0xBC9D, 0xBC9E, 0xBC9F, 0xBCA0, 0xBD40, /* 0x30 */
0xBD41, 0xBD42, 0xBD43, 0xBD44, 0xBD45, 0xBD46, 0xBD47, 0xBD48, /* 0x30 */
0xBD49, 0xBD4A, 0xBD4B, 0xBD4C, 0xBD4D, 0xBD4E, 0xBD4F, 0xBD50, /* 0x40 */
0xBD51, 0xBD52, 0xBD53, 0xBD54, 0xBD55, 0xBD56, 0xBD57, 0xBD58, /* 0x40 */
0xBD59, 0xBD5A, 0xBD5B, 0xBD5C, 0xBD5D, 0xBD5E, 0xBD5F, 0xBD60, /* 0x50 */
0xBD61, 0xBD62, 0xBD63, 0xBD64, 0xBD65, 0xBD66, 0xBD67, 0xBD68, /* 0x50 */
0xBD69, 0xBD6A, 0xBD6B, 0xBD6C, 0xBD6D, 0xBD6E, 0xBD6F, 0xBD70, /* 0x60 */
0xBD71, 0xBD72, 0xBD73, 0xBD74, 0xBD75, 0xBD76, 0xD0F5, 0xBD77, /* 0x60 */
0xBD78, 0xBD79, 0xBD7A, 0xBD7B, 0xBD7C, 0xBD7D, 0xBD7E, 0xF4EA, /* 0x70 */
0xBD80, 0xBD81, 0xBD82, 0xBD83, 0xBD84, 0xBD85, 0xBD86, 0xBD87, /* 0x70 */
0xBD88, 0xBD89, 0xBD8A, 0xBD8B, 0xBD8C, 0xBD8D, 0xBD8E, 0xBD8F, /* 0x80 */
0xBD90, 0xBD91, 0xBD92, 0xBD93, 0xBD94, 0xBD95, 0xBD96, 0xBD97, /* 0x80 */
0xBD98, 0xBD99, 0xBD9A, 0xBD9B, 0xBD9C, 0xBD9D, 0xBD9E, 0xBD9F, /* 0x90 */
0xBDA0, 0xBE40, 0xBE41, 0xBE42, 0xBE43, 0xBE44, 0xBE45, 0xBE46, /* 0x90 */
0xBE47, 0xBE48, 0xBE49, 0xBE4A, 0xBE4B, 0xBE4C, 0xF4EB, 0xBE4D, /* 0xA0 */
0xBE4E, 0xBE4F, 0xBE50, 0xBE51, 0xBE52, 0xBE53, 0xF4EC, 0xBE54, /* 0xA0 */
0xBE55, 0xBE56, 0xBE57, 0xBE58, 0xBE59, 0xBE5A, 0xBE5B, 0xBE5C, /* 0xB0 */
0xBE5D, 0xBE5E, 0xBE5F, 0xBE60, 0xBE61, 0xBE62, 0xBE63, 0xBE64, /* 0xB0 */
0xBE65, 0xBE66, 0xBE67, 0xBE68, 0xBE69, 0xBE6A, 0xBE6B, 0xBE6C, /* 0xC0 */
0xBE6D, 0xBE6E, 0xBE6F, 0xBE70, 0xBE71, 0xBE72, 0xBE73, 0xBE74, /* 0xC0 */
0xBE75, 0xBE76, 0xBE77, 0xBE78, 0xBE79, 0xBE7A, 0xBE7B, 0xBE7C, /* 0xD0 */
0xBE7D, 0xBE7E, 0xBE80, 0xBE81, 0xBE82, 0xBE83, 0xBE84, 0xBE85, /* 0xD0 */
0xBE86, 0xBE87, 0xBE88, 0xBE89, 0xBE8A, 0xBE8B, 0xBE8C, 0xBE8D, /* 0xE0 */
0xBE8E, 0xBE8F, 0xBE90, 0xBE91, 0xBE92, 0xBE93, 0xBE94, 0xBE95, /* 0xE0 */
0xBE96, 0xBE97, 0xBE98, 0xBE99, 0xBE9A, 0xBE9B, 0xBE9C, 0xBE9D, /* 0xF0 */
0xBE9E, 0xBE9F, 0xBEA0, 0xBF40, 0xBF41, 0xBF42, 0xBF43, 0xBF44 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_7E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xBF45, 0xBF46, 0xBF47, 0xBF48, 0xBF49, 0xBF4A, 0xBF4B, 0xBF4C, /* 0x00 */
0xBF4D, 0xBF4E, 0xBF4F, 0xBF50, 0xBF51, 0xBF52, 0xBF53, 0xBF54, /* 0x00 */
0xBF55, 0xBF56, 0xBF57, 0xBF58, 0xBF59, 0xBF5A, 0xBF5B, 0xBF5C, /* 0x10 */
0xBF5D, 0xBF5E, 0xBF5F, 0xBF60, 0xBF61, 0xBF62, 0xBF63, 0xBF64, /* 0x10 */
0xBF65, 0xBF66, 0xBF67, 0xBF68, 0xBF69, 0xBF6A, 0xBF6B, 0xBF6C, /* 0x20 */
0xBF6D, 0xBF6E, 0xBF6F, 0xBF70, 0xBF71, 0xBF72, 0xBF73, 0xBF74, /* 0x20 */
0xBF75, 0xBF76, 0xBF77, 0xBF78, 0xBF79, 0xBF7A, 0xBF7B, 0xBF7C, /* 0x30 */
0xBF7D, 0xBF7E, 0xBF80, 0xF7E3, 0xBF81, 0xBF82, 0xBF83, 0xBF84, /* 0x30 */
0xBF85, 0xB7B1, 0xBF86, 0xBF87, 0xBF88, 0xBF89, 0xBF8A, 0xF4ED, /* 0x40 */
0xBF8B, 0xBF8C, 0xBF8D, 0xBF8E, 0xBF8F, 0xBF90, 0xBF91, 0xBF92, /* 0x40 */
0xBF93, 0xBF94, 0xBF95, 0xBF96, 0xBF97, 0xBF98, 0xBF99, 0xBF9A, /* 0x50 */
0xBF9B, 0xBF9C, 0xBF9D, 0xBF9E, 0xBF9F, 0xBFA0, 0xC040, 0xC041, /* 0x50 */
0xC042, 0xC043, 0xC044, 0xC045, 0xC046, 0xC047, 0xC048, 0xC049, /* 0x60 */
0xC04A, 0xC04B, 0xC04C, 0xC04D, 0xC04E, 0xC04F, 0xC050, 0xC051, /* 0x60 */
0xC052, 0xC053, 0xC054, 0xC055, 0xC056, 0xC057, 0xC058, 0xC059, /* 0x70 */
0xC05A, 0xC05B, 0xC05C, 0xC05D, 0xC05E, 0xC05F, 0xC060, 0xC061, /* 0x70 */
0xC062, 0xC063, 0xD7EB, 0xC064, 0xC065, 0xC066, 0xC067, 0xC068, /* 0x80 */
0xC069, 0xC06A, 0xC06B, 0xC06C, 0xC06D, 0xC06E, 0xC06F, 0xC070, /* 0x80 */
0xC071, 0xC072, 0xC073, 0xC074, 0xC075, 0xC076, 0xC077, 0xC078, /* 0x90 */
0xC079, 0xC07A, 0xC07B, 0xF4EE, 0xC07C, 0xC07D, 0xC07E, 0xE6F9, /* 0x90 */
0xBEC0, 0xE6FA, 0xBAEC, 0xE6FB, 0xCFCB, 0xE6FC, 0xD4BC, 0xBCB6, /* 0xA0 */
0xE6FD, 0xE6FE, 0xBCCD, 0xC8D2, 0xCEB3, 0xE7A1, 0xC080, 0xB4BF, /* 0xA0 */
0xE7A2, 0xC9B4, 0xB8D9, 0xC4C9, 0xC081, 0xD7DD, 0xC2DA, 0xB7D7, /* 0xB0 */
0xD6BD, 0xCEC6, 0xB7C4, 0xC082, 0xC083, 0xC5A6, 0xE7A3, 0xCFDF, /* 0xB0 */
0xE7A4, 0xE7A5, 0xE7A6, 0xC1B7, 0xD7E9, 0xC9F0, 0xCFB8, 0xD6AF, /* 0xC0 */
0xD6D5, 0xE7A7, 0xB0ED, 0xE7A8, 0xE7A9, 0xC9DC, 0xD2EF, 0xBEAD, /* 0xC0 */
0xE7AA, 0xB0F3, 0xC8DE, 0xBDE1, 0xE7AB, 0xC8C6, 0xC084, 0xE7AC, /* 0xD0 */
0xBBE6, 0xB8F8, 0xD1A4, 0xE7AD, 0xC2E7, 0xBEF8, 0xBDCA, 0xCDB3, /* 0xD0 */
0xE7AE, 0xE7AF, 0xBEEE, 0xD0E5, 0xC085, 0xCBE7, 0xCCD0, 0xBCCC, /* 0xE0 */
0xE7B0, 0xBCA8, 0xD0F7, 0xE7B1, 0xC086, 0xD0F8, 0xE7B2, 0xE7B3, /* 0xE0 */
0xB4C2, 0xE7B4, 0xE7B5, 0xC9FE, 0xCEAC, 0xC3E0, 0xE7B7, 0xB1C1, /* 0xF0 */
0xB3F1, 0xC087, 0xE7B8, 0xE7B9, 0xD7DB, 0xD5C0, 0xE7BA, 0xC2CC /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_7F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD7BA, 0xE7BB, 0xE7BC, 0xE7BD, 0xBCEA, 0xC3E5, 0xC0C2, 0xE7BE, /* 0x00 */
0xE7BF, 0xBCA9, 0xC088, 0xE7C0, 0xE7C1, 0xE7B6, 0xB6D0, 0xE7C2, /* 0x00 */
0xC089, 0xE7C3, 0xE7C4, 0xBBBA, 0xB5DE, 0xC2C6, 0xB1E0, 0xE7C5, /* 0x10 */
0xD4B5, 0xE7C6, 0xB8BF, 0xE7C8, 0xE7C7, 0xB7EC, 0xC08A, 0xE7C9, /* 0x10 */
0xB2F8, 0xE7CA, 0xE7CB, 0xE7CC, 0xE7CD, 0xE7CE, 0xE7CF, 0xE7D0, /* 0x20 */
0xD3A7, 0xCBF5, 0xE7D1, 0xE7D2, 0xE7D3, 0xE7D4, 0xC9C9, 0xE7D5, /* 0x20 */
0xE7D6, 0xE7D7, 0xE7D8, 0xE7D9, 0xBDC9, 0xE7DA, 0xF3BE, 0xC08B, /* 0x30 */
0xB8D7, 0xC08C, 0xC8B1, 0xC08D, 0xC08E, 0xC08F, 0xC090, 0xC091, /* 0x30 */
0xC092, 0xC093, 0xF3BF, 0xC094, 0xF3C0, 0xF3C1, 0xC095, 0xC096, /* 0x40 */
0xC097, 0xC098, 0xC099, 0xC09A, 0xC09B, 0xC09C, 0xC09D, 0xC09E, /* 0x40 */
0xB9DE, 0xCDF8, 0xC09F, 0xC0A0, 0xD8E8, 0xBAB1, 0xC140, 0xC2DE, /* 0x50 */
0xEEB7, 0xC141, 0xB7A3, 0xC142, 0xC143, 0xC144, 0xC145, 0xEEB9, /* 0x50 */
0xC146, 0xEEB8, 0xB0D5, 0xC147, 0xC148, 0xC149, 0xC14A, 0xC14B, /* 0x60 */
0xEEBB, 0xD5D6, 0xD7EF, 0xC14C, 0xC14D, 0xC14E, 0xD6C3, 0xC14F, /* 0x60 */
0xC150, 0xEEBD, 0xCAF0, 0xC151, 0xEEBC, 0xC152, 0xC153, 0xC154, /* 0x70 */
0xC155, 0xEEBE, 0xC156, 0xC157, 0xC158, 0xC159, 0xEEC0, 0xC15A, /* 0x70 */
0xC15B, 0xEEBF, 0xC15C, 0xC15D, 0xC15E, 0xC15F, 0xC160, 0xC161, /* 0x80 */
0xC162, 0xC163, 0xD1F2, 0xC164, 0xC7BC, 0xC165, 0xC3C0, 0xC166, /* 0x80 */
0xC167, 0xC168, 0xC169, 0xC16A, 0xB8E1, 0xC16B, 0xC16C, 0xC16D, /* 0x90 */
0xC16E, 0xC16F, 0xC1E7, 0xC170, 0xC171, 0xF4C6, 0xD0DF, 0xF4C7, /* 0x90 */
0xC172, 0xCFDB, 0xC173, 0xC174, 0xC8BA, 0xC175, 0xC176, 0xF4C8, /* 0xA0 */
0xC177, 0xC178, 0xC179, 0xC17A, 0xC17B, 0xC17C, 0xC17D, 0xF4C9, /* 0xA0 */
0xF4CA, 0xC17E, 0xF4CB, 0xC180, 0xC181, 0xC182, 0xC183, 0xC184, /* 0xB0 */
0xD9FA, 0xB8FE, 0xC185, 0xC186, 0xE5F1, 0xD3F0, 0xC187, 0xF4E0, /* 0xB0 */
0xC188, 0xCECC, 0xC189, 0xC18A, 0xC18B, 0xB3E1, 0xC18C, 0xC18D, /* 0xC0 */
0xC18E, 0xC18F, 0xF1B4, 0xC190, 0xD2EE, 0xC191, 0xF4E1, 0xC192, /* 0xC0 */
0xC193, 0xC194, 0xC195, 0xC196, 0xCFE8, 0xF4E2, 0xC197, 0xC198, /* 0xD0 */
0xC7CC, 0xC199, 0xC19A, 0xC19B, 0xC19C, 0xC19D, 0xC19E, 0xB5D4, /* 0xD0 */
0xB4E4, 0xF4E4, 0xC19F, 0xC1A0, 0xC240, 0xF4E3, 0xF4E5, 0xC241, /* 0xE0 */
0xC242, 0xF4E6, 0xC243, 0xC244, 0xC245, 0xC246, 0xF4E7, 0xC247, /* 0xE0 */
0xBAB2, 0xB0BF, 0xC248, 0xF4E8, 0xC249, 0xC24A, 0xC24B, 0xC24C, /* 0xF0 */
0xC24D, 0xC24E, 0xC24F, 0xB7AD, 0xD2ED, 0xC250, 0xC251, 0xC252 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_80[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD2AB, 0xC0CF, 0xC253, 0xBFBC, 0xEBA3, 0xD5DF, 0xEAC8, 0xC254, /* 0x00 */
0xC255, 0xC256, 0xC257, 0xF1F3, 0xB6F8, 0xCBA3, 0xC258, 0xC259, /* 0x00 */
0xC4CD, 0xC25A, 0xF1E7, 0xC25B, 0xF1E8, 0xB8FB, 0xF1E9, 0xBAC4, /* 0x10 */
0xD4C5, 0xB0D2, 0xC25C, 0xC25D, 0xF1EA, 0xC25E, 0xC25F, 0xC260, /* 0x10 */
0xF1EB, 0xC261, 0xF1EC, 0xC262, 0xC263, 0xF1ED, 0xF1EE, 0xF1EF, /* 0x20 */
0xF1F1, 0xF1F0, 0xC5D5, 0xC264, 0xC265, 0xC266, 0xC267, 0xC268, /* 0x20 */
0xC269, 0xF1F2, 0xC26A, 0xB6FA, 0xC26B, 0xF1F4, 0xD2AE, 0xDEC7, /* 0x30 */
0xCBCA, 0xC26C, 0xC26D, 0xB3DC, 0xC26E, 0xB5A2, 0xC26F, 0xB9A2, /* 0x30 */
0xC270, 0xC271, 0xC4F4, 0xF1F5, 0xC272, 0xC273, 0xF1F6, 0xC274, /* 0x40 */
0xC275, 0xC276, 0xC1C4, 0xC1FB, 0xD6B0, 0xF1F7, 0xC277, 0xC278, /* 0x40 */
0xC279, 0xC27A, 0xF1F8, 0xC27B, 0xC1AA, 0xC27C, 0xC27D, 0xC27E, /* 0x50 */
0xC6B8, 0xC280, 0xBEDB, 0xC281, 0xC282, 0xC283, 0xC284, 0xC285, /* 0x50 */
0xC286, 0xC287, 0xC288, 0xC289, 0xC28A, 0xC28B, 0xC28C, 0xC28D, /* 0x60 */
0xC28E, 0xF1F9, 0xB4CF, 0xC28F, 0xC290, 0xC291, 0xC292, 0xC293, /* 0x60 */
0xC294, 0xF1FA, 0xC295, 0xC296, 0xC297, 0xC298, 0xC299, 0xC29A, /* 0x70 */
0xC29B, 0xC29C, 0xC29D, 0xC29E, 0xC29F, 0xC2A0, 0xC340, 0xEDB2, /* 0x70 */
0xEDB1, 0xC341, 0xC342, 0xCBE0, 0xD2DE, 0xC343, 0xCBC1, 0xD5D8, /* 0x80 */
0xC344, 0xC8E2, 0xC345, 0xC0DF, 0xBCA1, 0xC346, 0xC347, 0xC348, /* 0x80 */
0xC349, 0xC34A, 0xC34B, 0xEBC1, 0xC34C, 0xC34D, 0xD0A4, 0xC34E, /* 0x90 */
0xD6E2, 0xC34F, 0xB6C7, 0xB8D8, 0xEBC0, 0xB8CE, 0xC350, 0xEBBF, /* 0x90 */
0xB3A6, 0xB9C9, 0xD6AB, 0xC351, 0xB7F4, 0xB7CA, 0xC352, 0xC353, /* 0xA0 */
0xC354, 0xBCE7, 0xB7BE, 0xEBC6, 0xC355, 0xEBC7, 0xB0B9, 0xBFCF, /* 0xA0 */
0xC356, 0xEBC5, 0xD3FD, 0xC357, 0xEBC8, 0xC358, 0xC359, 0xEBC9, /* 0xB0 */
0xC35A, 0xC35B, 0xB7CE, 0xC35C, 0xEBC2, 0xEBC4, 0xC9F6, 0xD6D7, /* 0xB0 */
0xD5CD, 0xD0B2, 0xEBCF, 0xCEB8, 0xEBD0, 0xC35D, 0xB5A8, 0xC35E, /* 0xC0 */
0xC35F, 0xC360, 0xC361, 0xC362, 0xB1B3, 0xEBD2, 0xCCA5, 0xC363, /* 0xC0 */
0xC364, 0xC365, 0xC366, 0xC367, 0xC368, 0xC369, 0xC5D6, 0xEBD3, /* 0xD0 */
0xC36A, 0xEBD1, 0xC5DF, 0xEBCE, 0xCAA4, 0xEBD5, 0xB0FB, 0xC36B, /* 0xD0 */
0xC36C, 0xBAFA, 0xC36D, 0xC36E, 0xD8B7, 0xF1E3, 0xC36F, 0xEBCA, /* 0xE0 */
0xEBCB, 0xEBCC, 0xEBCD, 0xEBD6, 0xE6C0, 0xEBD9, 0xC370, 0xBFE8, /* 0xE0 */
0xD2C8, 0xEBD7, 0xEBDC, 0xB8EC, 0xEBD8, 0xC371, 0xBDBA, 0xC372, /* 0xF0 */
0xD0D8, 0xC373, 0xB0B7, 0xC374, 0xEBDD, 0xC4DC, 0xC375, 0xC376 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_81[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xC377, 0xC378, 0xD6AC, 0xC379, 0xC37A, 0xC37B, 0xB4E0, 0xC37C, /* 0x00 */
0xC37D, 0xC2F6, 0xBCB9, 0xC37E, 0xC380, 0xEBDA, 0xEBDB, 0xD4E0, /* 0x00 */
0xC6EA, 0xC4D4, 0xEBDF, 0xC5A7, 0xD9F5, 0xC381, 0xB2B1, 0xC382, /* 0x10 */
0xEBE4, 0xC383, 0xBDC5, 0xC384, 0xC385, 0xC386, 0xEBE2, 0xC387, /* 0x10 */
0xC388, 0xC389, 0xC38A, 0xC38B, 0xC38C, 0xC38D, 0xC38E, 0xC38F, /* 0x20 */
0xC390, 0xC391, 0xC392, 0xC393, 0xEBE3, 0xC394, 0xC395, 0xB8AC, /* 0x20 */
0xC396, 0xCDD1, 0xEBE5, 0xC397, 0xC398, 0xC399, 0xEBE1, 0xC39A, /* 0x30 */
0xC1B3, 0xC39B, 0xC39C, 0xC39D, 0xC39E, 0xC39F, 0xC6A2, 0xC3A0, /* 0x30 */
0xC440, 0xC441, 0xC442, 0xC443, 0xC444, 0xC445, 0xCCF3, 0xC446, /* 0x40 */
0xEBE6, 0xC447, 0xC0B0, 0xD2B8, 0xEBE7, 0xC448, 0xC449, 0xC44A, /* 0x40 */
0xB8AF, 0xB8AD, 0xC44B, 0xEBE8, 0xC7BB, 0xCDF3, 0xC44C, 0xC44D, /* 0x50 */
0xC44E, 0xEBEA, 0xEBEB, 0xC44F, 0xC450, 0xC451, 0xC452, 0xC453, /* 0x50 */
0xEBED, 0xC454, 0xC455, 0xC456, 0xC457, 0xD0C8, 0xC458, 0xEBF2, /* 0x60 */
0xC459, 0xEBEE, 0xC45A, 0xC45B, 0xC45C, 0xEBF1, 0xC8F9, 0xC45D, /* 0x60 */
0xD1FC, 0xEBEC, 0xC45E, 0xC45F, 0xEBE9, 0xC460, 0xC461, 0xC462, /* 0x70 */
0xC463, 0xB8B9, 0xCFD9, 0xC4E5, 0xEBEF, 0xEBF0, 0xCCDA, 0xCDC8, /* 0x70 */
0xB0F2, 0xC464, 0xEBF6, 0xC465, 0xC466, 0xC467, 0xC468, 0xC469, /* 0x80 */
0xEBF5, 0xC46A, 0xB2B2, 0xC46B, 0xC46C, 0xC46D, 0xC46E, 0xB8E0, /* 0x80 */
0xC46F, 0xEBF7, 0xC470, 0xC471, 0xC472, 0xC473, 0xC474, 0xC475, /* 0x90 */
0xB1EC, 0xC476, 0xC477, 0xCCC5, 0xC4A4, 0xCFA5, 0xC478, 0xC479, /* 0x90 */
0xC47A, 0xC47B, 0xC47C, 0xEBF9, 0xC47D, 0xC47E, 0xECA2, 0xC480, /* 0xA0 */
0xC5F2, 0xC481, 0xEBFA, 0xC482, 0xC483, 0xC484, 0xC485, 0xC486, /* 0xA0 */
0xC487, 0xC488, 0xC489, 0xC9C5, 0xC48A, 0xC48B, 0xC48C, 0xC48D, /* 0xB0 */
0xC48E, 0xC48F, 0xE2DF, 0xEBFE, 0xC490, 0xC491, 0xC492, 0xC493, /* 0xB0 */
0xCDCE, 0xECA1, 0xB1DB, 0xD3B7, 0xC494, 0xC495, 0xD2DC, 0xC496, /* 0xC0 */
0xC497, 0xC498, 0xEBFD, 0xC499, 0xEBFB, 0xC49A, 0xC49B, 0xC49C, /* 0xC0 */
0xC49D, 0xC49E, 0xC49F, 0xC4A0, 0xC540, 0xC541, 0xC542, 0xC543, /* 0xD0 */
0xC544, 0xC545, 0xC546, 0xC547, 0xC548, 0xC549, 0xC54A, 0xC54B, /* 0xD0 */
0xC54C, 0xC54D, 0xC54E, 0xB3BC, 0xC54F, 0xC550, 0xC551, 0xEAB0, /* 0xE0 */
0xC552, 0xC553, 0xD7D4, 0xC554, 0xF4AB, 0xB3F4, 0xC555, 0xC556, /* 0xE0 */
0xC557, 0xC558, 0xC559, 0xD6C1, 0xD6C2, 0xC55A, 0xC55B, 0xC55C, /* 0xF0 */
0xC55D, 0xC55E, 0xC55F, 0xD5E9, 0xBECA, 0xC560, 0xF4A7, 0xC561 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_82[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD2A8, 0xF4A8, 0xF4A9, 0xC562, 0xF4AA, 0xBECB, 0xD3DF, 0xC563, /* 0x00 */
0xC564, 0xC565, 0xC566, 0xC567, 0xC9E0, 0xC9E1, 0xC568, 0xC569, /* 0x00 */
0xF3C2, 0xC56A, 0xCAE6, 0xC56B, 0xCCF2, 0xC56C, 0xC56D, 0xC56E, /* 0x10 */
0xC56F, 0xC570, 0xC571, 0xE2B6, 0xCBB4, 0xC572, 0xCEE8, 0xD6DB, /* 0x10 */
0xC573, 0xF4AD, 0xF4AE, 0xF4AF, 0xC574, 0xC575, 0xC576, 0xC577, /* 0x20 */
0xF4B2, 0xC578, 0xBABD, 0xF4B3, 0xB0E3, 0xF4B0, 0xC579, 0xF4B1, /* 0x20 */
0xBDA2, 0xB2D5, 0xC57A, 0xF4B6, 0xF4B7, 0xB6E6, 0xB2B0, 0xCFCF, /* 0x30 */
0xF4B4, 0xB4AC, 0xC57B, 0xF4B5, 0xC57C, 0xC57D, 0xF4B8, 0xC57E, /* 0x30 */
0xC580, 0xC581, 0xC582, 0xC583, 0xF4B9, 0xC584, 0xC585, 0xCDA7, /* 0x40 */
0xC586, 0xF4BA, 0xC587, 0xF4BB, 0xC588, 0xC589, 0xC58A, 0xF4BC, /* 0x40 */
0xC58B, 0xC58C, 0xC58D, 0xC58E, 0xC58F, 0xC590, 0xC591, 0xC592, /* 0x50 */
0xCBD2, 0xC593, 0xF4BD, 0xC594, 0xC595, 0xC596, 0xC597, 0xF4BE, /* 0x50 */
0xC598, 0xC599, 0xC59A, 0xC59B, 0xC59C, 0xC59D, 0xC59E, 0xC59F, /* 0x60 */
0xF4BF, 0xC5A0, 0xC640, 0xC641, 0xC642, 0xC643, 0xF4DE, 0xC1BC, /* 0x60 */
0xBCE8, 0xC644, 0xC9AB, 0xD1DE, 0xE5F5, 0xC645, 0xC646, 0xC647, /* 0x70 */
0xC648, 0xDCB3, 0xD2D5, 0xC649, 0xC64A, 0xDCB4, 0xB0AC, 0xDCB5, /* 0x70 */
0xC64B, 0xC64C, 0xBDDA, 0xC64D, 0xDCB9, 0xC64E, 0xC64F, 0xC650, /* 0x80 */
0xD8C2, 0xC651, 0xDCB7, 0xD3F3, 0xC652, 0xC9D6, 0xDCBA, 0xDCB6, /* 0x80 */
0xC653, 0xDCBB, 0xC3A2, 0xC654, 0xC655, 0xC656, 0xC657, 0xDCBC, /* 0x90 */
0xDCC5, 0xDCBD, 0xC658, 0xC659, 0xCEDF, 0xD6A5, 0xC65A, 0xDCCF, /* 0x90 */
0xC65B, 0xDCCD, 0xC65C, 0xC65D, 0xDCD2, 0xBDE6, 0xC2AB, 0xC65E, /* 0xA0 */
0xDCB8, 0xDCCB, 0xDCCE, 0xDCBE, 0xB7D2, 0xB0C5, 0xDCC7, 0xD0BE, /* 0xA0 */
0xDCC1, 0xBBA8, 0xC65F, 0xB7BC, 0xDCCC, 0xC660, 0xC661, 0xDCC6, /* 0xB0 */
0xDCBF, 0xC7DB, 0xC662, 0xC663, 0xC664, 0xD1BF, 0xDCC0, 0xC665, /* 0xB0 */
0xC666, 0xDCCA, 0xC667, 0xC668, 0xDCD0, 0xC669, 0xC66A, 0xCEAD, /* 0xC0 */
0xDCC2, 0xC66B, 0xDCC3, 0xDCC8, 0xDCC9, 0xB2D4, 0xDCD1, 0xCBD5, /* 0xC0 */
0xC66C, 0xD4B7, 0xDCDB, 0xDCDF, 0xCCA6, 0xDCE6, 0xC66D, 0xC3E7, /* 0xD0 */
0xDCDC, 0xC66E, 0xC66F, 0xBFC1, 0xDCD9, 0xC670, 0xB0FA, 0xB9B6, /* 0xD0 */
0xDCE5, 0xDCD3, 0xC671, 0xDCC4, 0xDCD6, 0xC8F4, 0xBFE0, 0xC672, /* 0xE0 */
0xC673, 0xC674, 0xC675, 0xC9BB, 0xC676, 0xC677, 0xC678, 0xB1BD, /* 0xE0 */
0xC679, 0xD3A2, 0xC67A, 0xC67B, 0xDCDA, 0xC67C, 0xC67D, 0xDCD5, /* 0xF0 */
0xC67E, 0xC6BB, 0xC680, 0xDCDE, 0xC681, 0xC682, 0xC683, 0xC684 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_83[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xC685, 0xD7C2, 0xC3AF, 0xB7B6, 0xC7D1, 0xC3A9, 0xDCE2, 0xDCD8, /* 0x00 */
0xDCEB, 0xDCD4, 0xC686, 0xC687, 0xDCDD, 0xC688, 0xBEA5, 0xDCD7, /* 0x00 */
0xC689, 0xDCE0, 0xC68A, 0xC68B, 0xDCE3, 0xDCE4, 0xC68C, 0xDCF8, /* 0x10 */
0xC68D, 0xC68E, 0xDCE1, 0xDDA2, 0xDCE7, 0xC68F, 0xC690, 0xC691, /* 0x10 */
0xC692, 0xC693, 0xC694, 0xC695, 0xC696, 0xC697, 0xC698, 0xBCEB, /* 0x20 */
0xB4C4, 0xC699, 0xC69A, 0xC3A3, 0xB2E7, 0xDCFA, 0xC69B, 0xDCF2, /* 0x20 */
0xC69C, 0xDCEF, 0xC69D, 0xDCFC, 0xDCEE, 0xD2F0, 0xB2E8, 0xC69E, /* 0x30 */
0xC8D7, 0xC8E3, 0xDCFB, 0xC69F, 0xDCED, 0xC6A0, 0xC740, 0xC741, /* 0x30 */
0xDCF7, 0xC742, 0xC743, 0xDCF5, 0xC744, 0xC745, 0xBEA3, 0xDCF4, /* 0x40 */
0xC746, 0xB2DD, 0xC747, 0xC748, 0xC749, 0xC74A, 0xC74B, 0xDCF3, /* 0x40 */
0xBCF6, 0xDCE8, 0xBBC4, 0xC74C, 0xC0F3, 0xC74D, 0xC74E, 0xC74F, /* 0x50 */
0xC750, 0xC751, 0xBCD4, 0xDCE9, 0xDCEA, 0xC752, 0xDCF1, 0xDCF6, /* 0x50 */
0xDCF9, 0xB5B4, 0xC753, 0xC8D9, 0xBBE7, 0xDCFE, 0xDCFD, 0xD3AB, /* 0x60 */
0xDDA1, 0xDDA3, 0xDDA5, 0xD2F1, 0xDDA4, 0xDDA6, 0xDDA7, 0xD2A9, /* 0x60 */
0xC754, 0xC755, 0xC756, 0xC757, 0xC758, 0xC759, 0xC75A, 0xBAC9, /* 0x70 */
0xDDA9, 0xC75B, 0xC75C, 0xDDB6, 0xDDB1, 0xDDB4, 0xC75D, 0xC75E, /* 0x70 */
0xC75F, 0xC760, 0xC761, 0xC762, 0xC763, 0xDDB0, 0xC6CE, 0xC764, /* 0x80 */
0xC765, 0xC0F2, 0xC766, 0xC767, 0xC768, 0xC769, 0xC9AF, 0xC76A, /* 0x80 */
0xC76B, 0xC76C, 0xDCEC, 0xDDAE, 0xC76D, 0xC76E, 0xC76F, 0xC770, /* 0x90 */
0xDDB7, 0xC771, 0xC772, 0xDCF0, 0xDDAF, 0xC773, 0xDDB8, 0xC774, /* 0x90 */
0xDDAC, 0xC775, 0xC776, 0xC777, 0xC778, 0xC779, 0xC77A, 0xC77B, /* 0xA0 */
0xDDB9, 0xDDB3, 0xDDAD, 0xC4AA, 0xC77C, 0xC77D, 0xC77E, 0xC780, /* 0xA0 */
0xDDA8, 0xC0B3, 0xC1AB, 0xDDAA, 0xDDAB, 0xC781, 0xDDB2, 0xBBF1, /* 0xB0 */
0xDDB5, 0xD3A8, 0xDDBA, 0xC782, 0xDDBB, 0xC3A7, 0xC783, 0xC784, /* 0xB0 */
0xDDD2, 0xDDBC, 0xC785, 0xC786, 0xC787, 0xDDD1, 0xC788, 0xB9BD, /* 0xC0 */
0xC789, 0xC78A, 0xBED5, 0xC78B, 0xBEFA, 0xC78C, 0xC78D, 0xBACA, /* 0xC0 */
0xC78E, 0xC78F, 0xC790, 0xC791, 0xDDCA, 0xC792, 0xDDC5, 0xC793, /* 0xD0 */
0xDDBF, 0xC794, 0xC795, 0xC796, 0xB2CB, 0xDDC3, 0xC797, 0xDDCB, /* 0xD0 */
0xB2A4, 0xDDD5, 0xC798, 0xC799, 0xC79A, 0xDDBE, 0xC79B, 0xC79C, /* 0xE0 */
0xC79D, 0xC6D0, 0xDDD0, 0xC79E, 0xC79F, 0xC7A0, 0xC840, 0xC841, /* 0xE0 */
0xDDD4, 0xC1E2, 0xB7C6, 0xC842, 0xC843, 0xC844, 0xC845, 0xC846, /* 0xF0 */
0xDDCE, 0xDDCF, 0xC847, 0xC848, 0xC849, 0xDDC4, 0xC84A, 0xC84B /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_84[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xC84C, 0xDDBD, 0xC84D, 0xDDCD, 0xCCD1, 0xC84E, 0xDDC9, 0xC84F, /* 0x00 */
0xC850, 0xC851, 0xC852, 0xDDC2, 0xC3C8, 0xC6BC, 0xCEAE, 0xDDCC, /* 0x00 */
0xC853, 0xDDC8, 0xC854, 0xC855, 0xC856, 0xC857, 0xC858, 0xC859, /* 0x10 */
0xDDC1, 0xC85A, 0xC85B, 0xC85C, 0xDDC6, 0xC2DC, 0xC85D, 0xC85E, /* 0x10 */
0xC85F, 0xC860, 0xC861, 0xC862, 0xD3A9, 0xD3AA, 0xDDD3, 0xCFF4, /* 0x20 */
0xC8F8, 0xC863, 0xC864, 0xC865, 0xC866, 0xC867, 0xC868, 0xC869, /* 0x20 */
0xC86A, 0xDDE6, 0xC86B, 0xC86C, 0xC86D, 0xC86E, 0xC86F, 0xC870, /* 0x30 */
0xDDC7, 0xC871, 0xC872, 0xC873, 0xDDE0, 0xC2E4, 0xC874, 0xC875, /* 0x30 */
0xC876, 0xC877, 0xC878, 0xC879, 0xC87A, 0xC87B, 0xDDE1, 0xC87C, /* 0x40 */
0xC87D, 0xC87E, 0xC880, 0xC881, 0xC882, 0xC883, 0xC884, 0xC885, /* 0x40 */
0xC886, 0xDDD7, 0xC887, 0xC888, 0xC889, 0xC88A, 0xC88B, 0xD6F8, /* 0x50 */
0xC88C, 0xDDD9, 0xDDD8, 0xB8F0, 0xDDD6, 0xC88D, 0xC88E, 0xC88F, /* 0x50 */
0xC890, 0xC6CF, 0xC891, 0xB6AD, 0xC892, 0xC893, 0xC894, 0xC895, /* 0x60 */
0xC896, 0xDDE2, 0xC897, 0xBAF9, 0xD4E1, 0xDDE7, 0xC898, 0xC899, /* 0x60 */
0xC89A, 0xB4D0, 0xC89B, 0xDDDA, 0xC89C, 0xBFFB, 0xDDE3, 0xC89D, /* 0x70 */
0xDDDF, 0xC89E, 0xDDDD, 0xC89F, 0xC8A0, 0xC940, 0xC941, 0xC942, /* 0x70 */
0xC943, 0xC944, 0xB5D9, 0xC945, 0xC946, 0xC947, 0xC948, 0xDDDB, /* 0x80 */
0xDDDC, 0xDDDE, 0xC949, 0xBDAF, 0xDDE4, 0xC94A, 0xDDE5, 0xC94B, /* 0x80 */
0xC94C, 0xC94D, 0xC94E, 0xC94F, 0xC950, 0xC951, 0xC952, 0xDDF5, /* 0x90 */
0xC953, 0xC3C9, 0xC954, 0xC955, 0xCBE2, 0xC956, 0xC957, 0xC958, /* 0x90 */
0xC959, 0xDDF2, 0xC95A, 0xC95B, 0xC95C, 0xC95D, 0xC95E, 0xC95F, /* 0xA0 */
0xC960, 0xC961, 0xC962, 0xC963, 0xC964, 0xC965, 0xC966, 0xD8E1, /* 0xA0 */
0xC967, 0xC968, 0xC6D1, 0xC969, 0xDDF4, 0xC96A, 0xC96B, 0xC96C, /* 0xB0 */
0xD5F4, 0xDDF3, 0xDDF0, 0xC96D, 0xC96E, 0xDDEC, 0xC96F, 0xDDEF, /* 0xB0 */
0xC970, 0xDDE8, 0xC971, 0xC972, 0xD0EE, 0xC973, 0xC974, 0xC975, /* 0xC0 */
0xC976, 0xC8D8, 0xDDEE, 0xC977, 0xC978, 0xDDE9, 0xC979, 0xC97A, /* 0xC0 */
0xDDEA, 0xCBF2, 0xC97B, 0xDDED, 0xC97C, 0xC97D, 0xB1CD, 0xC97E, /* 0xD0 */
0xC980, 0xC981, 0xC982, 0xC983, 0xC984, 0xC0B6, 0xC985, 0xBCBB, /* 0xD0 */
0xDDF1, 0xC986, 0xC987, 0xDDF7, 0xC988, 0xDDF6, 0xDDEB, 0xC989, /* 0xE0 */
0xC98A, 0xC98B, 0xC98C, 0xC98D, 0xC5EE, 0xC98E, 0xC98F, 0xC990, /* 0xE0 */
0xDDFB, 0xC991, 0xC992, 0xC993, 0xC994, 0xC995, 0xC996, 0xC997, /* 0xF0 */
0xC998, 0xC999, 0xC99A, 0xC99B, 0xDEA4, 0xC99C, 0xC99D, 0xDEA3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_85[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xC99E, 0xC99F, 0xC9A0, 0xCA40, 0xCA41, 0xCA42, 0xCA43, 0xCA44, /* 0x00 */
0xCA45, 0xCA46, 0xCA47, 0xCA48, 0xDDF8, 0xCA49, 0xCA4A, 0xCA4B, /* 0x00 */
0xCA4C, 0xC3EF, 0xCA4D, 0xC2FB, 0xCA4E, 0xCA4F, 0xCA50, 0xD5E1, /* 0x10 */
0xCA51, 0xCA52, 0xCEB5, 0xCA53, 0xCA54, 0xCA55, 0xCA56, 0xDDFD, /* 0x10 */
0xCA57, 0xB2CC, 0xCA58, 0xCA59, 0xCA5A, 0xCA5B, 0xCA5C, 0xCA5D, /* 0x20 */
0xCA5E, 0xCA5F, 0xCA60, 0xC4E8, 0xCADF, 0xCA61, 0xCA62, 0xCA63, /* 0x20 */
0xCA64, 0xCA65, 0xCA66, 0xCA67, 0xCA68, 0xCA69, 0xCA6A, 0xC7BE, /* 0x30 */
0xDDFA, 0xDDFC, 0xDDFE, 0xDEA2, 0xB0AA, 0xB1CE, 0xCA6B, 0xCA6C, /* 0x30 */
0xCA6D, 0xCA6E, 0xCA6F, 0xDEAC, 0xCA70, 0xCA71, 0xCA72, 0xCA73, /* 0x40 */
0xDEA6, 0xBDB6, 0xC8EF, 0xCA74, 0xCA75, 0xCA76, 0xCA77, 0xCA78, /* 0x40 */
0xCA79, 0xCA7A, 0xCA7B, 0xCA7C, 0xCA7D, 0xCA7E, 0xDEA1, 0xCA80, /* 0x50 */
0xCA81, 0xDEA5, 0xCA82, 0xCA83, 0xCA84, 0xCA85, 0xDEA9, 0xCA86, /* 0x50 */
0xCA87, 0xCA88, 0xCA89, 0xCA8A, 0xDEA8, 0xCA8B, 0xCA8C, 0xCA8D, /* 0x60 */
0xDEA7, 0xCA8E, 0xCA8F, 0xCA90, 0xCA91, 0xCA92, 0xCA93, 0xCA94, /* 0x60 */
0xCA95, 0xCA96, 0xDEAD, 0xCA97, 0xD4CC, 0xCA98, 0xCA99, 0xCA9A, /* 0x70 */
0xCA9B, 0xDEB3, 0xDEAA, 0xDEAE, 0xCA9C, 0xCA9D, 0xC0D9, 0xCA9E, /* 0x70 */
0xCA9F, 0xCAA0, 0xCB40, 0xCB41, 0xB1A1, 0xDEB6, 0xCB42, 0xDEB1, /* 0x80 */
0xCB43, 0xCB44, 0xCB45, 0xCB46, 0xCB47, 0xCB48, 0xCB49, 0xDEB2, /* 0x80 */
0xCB4A, 0xCB4B, 0xCB4C, 0xCB4D, 0xCB4E, 0xCB4F, 0xCB50, 0xCB51, /* 0x90 */
0xCB52, 0xCB53, 0xCB54, 0xD1A6, 0xDEB5, 0xCB55, 0xCB56, 0xCB57, /* 0x90 */
0xCB58, 0xCB59, 0xCB5A, 0xCB5B, 0xDEAF, 0xCB5C, 0xCB5D, 0xCB5E, /* 0xA0 */
0xDEB0, 0xCB5F, 0xD0BD, 0xCB60, 0xCB61, 0xCB62, 0xDEB4, 0xCAED, /* 0xA0 */
0xDEB9, 0xCB63, 0xCB64, 0xCB65, 0xCB66, 0xCB67, 0xCB68, 0xDEB8, /* 0xB0 */
0xCB69, 0xDEB7, 0xCB6A, 0xCB6B, 0xCB6C, 0xCB6D, 0xCB6E, 0xCB6F, /* 0xB0 */
0xCB70, 0xDEBB, 0xCB71, 0xCB72, 0xCB73, 0xCB74, 0xCB75, 0xCB76, /* 0xC0 */
0xCB77, 0xBDE5, 0xCB78, 0xCB79, 0xCB7A, 0xCB7B, 0xCB7C, 0xB2D8, /* 0xC0 */
0xC3EA, 0xCB7D, 0xCB7E, 0xDEBA, 0xCB80, 0xC5BA, 0xCB81, 0xCB82, /* 0xD0 */
0xCB83, 0xCB84, 0xCB85, 0xCB86, 0xDEBC, 0xCB87, 0xCB88, 0xCB89, /* 0xD0 */
0xCB8A, 0xCB8B, 0xCB8C, 0xCB8D, 0xCCD9, 0xCB8E, 0xCB8F, 0xCB90, /* 0xE0 */
0xCB91, 0xB7AA, 0xCB92, 0xCB93, 0xCB94, 0xCB95, 0xCB96, 0xCB97, /* 0xE0 */
0xCB98, 0xCB99, 0xCB9A, 0xCB9B, 0xCB9C, 0xCB9D, 0xCB9E, 0xCB9F, /* 0xF0 */
0xCBA0, 0xCC40, 0xCC41, 0xD4E5, 0xCC42, 0xCC43, 0xCC44, 0xDEBD /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_86[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xCC45, 0xCC46, 0xCC47, 0xCC48, 0xCC49, 0xDEBF, 0xCC4A, 0xCC4B, /* 0x00 */
0xCC4C, 0xCC4D, 0xCC4E, 0xCC4F, 0xCC50, 0xCC51, 0xCC52, 0xCC53, /* 0x00 */
0xCC54, 0xC4A2, 0xCC55, 0xCC56, 0xCC57, 0xCC58, 0xDEC1, 0xCC59, /* 0x10 */
0xCC5A, 0xCC5B, 0xCC5C, 0xCC5D, 0xCC5E, 0xCC5F, 0xCC60, 0xCC61, /* 0x10 */
0xCC62, 0xCC63, 0xCC64, 0xCC65, 0xCC66, 0xCC67, 0xCC68, 0xDEBE, /* 0x20 */
0xCC69, 0xDEC0, 0xCC6A, 0xCC6B, 0xCC6C, 0xCC6D, 0xCC6E, 0xCC6F, /* 0x20 */
0xCC70, 0xCC71, 0xCC72, 0xCC73, 0xCC74, 0xCC75, 0xCC76, 0xCC77, /* 0x30 */
0xD5BA, 0xCC78, 0xCC79, 0xCC7A, 0xDEC2, 0xCC7B, 0xCC7C, 0xCC7D, /* 0x30 */
0xCC7E, 0xCC80, 0xCC81, 0xCC82, 0xCC83, 0xCC84, 0xCC85, 0xCC86, /* 0x40 */
0xCC87, 0xCC88, 0xCC89, 0xCC8A, 0xCC8B, 0xF2AE, 0xBBA2, 0xC2B2, /* 0x40 */
0xC5B0, 0xC2C7, 0xCC8C, 0xCC8D, 0xF2AF, 0xCC8E, 0xCC8F, 0xCC90, /* 0x50 */
0xCC91, 0xCC92, 0xD0E9, 0xCC93, 0xCC94, 0xCC95, 0xD3DD, 0xCC96, /* 0x50 */
0xCC97, 0xCC98, 0xEBBD, 0xCC99, 0xCC9A, 0xCC9B, 0xCC9C, 0xCC9D, /* 0x60 */
0xCC9E, 0xCC9F, 0xCCA0, 0xB3E6, 0xF2B0, 0xCD40, 0xF2B1, 0xCD41, /* 0x60 */
0xCD42, 0xCAAD, 0xCD43, 0xCD44, 0xCD45, 0xCD46, 0xCD47, 0xCD48, /* 0x70 */
0xCD49, 0xBAE7, 0xF2B3, 0xF2B5, 0xF2B4, 0xCBE4, 0xCFBA, 0xF2B2, /* 0x70 */
0xCAB4, 0xD2CF, 0xC2EC, 0xCD4A, 0xCD4B, 0xCD4C, 0xCD4D, 0xCD4E, /* 0x80 */
0xCD4F, 0xCD50, 0xCEC3, 0xF2B8, 0xB0F6, 0xF2B7, 0xCD51, 0xCD52, /* 0x80 */
0xCD53, 0xCD54, 0xCD55, 0xF2BE, 0xCD56, 0xB2CF, 0xCD57, 0xCD58, /* 0x90 */
0xCD59, 0xCD5A, 0xCD5B, 0xCD5C, 0xD1C1, 0xF2BA, 0xCD5D, 0xCD5E, /* 0x90 */
0xCD5F, 0xCD60, 0xCD61, 0xF2BC, 0xD4E9, 0xCD62, 0xCD63, 0xF2BB, /* 0xA0 */
0xF2B6, 0xF2BF, 0xF2BD, 0xCD64, 0xF2B9, 0xCD65, 0xCD66, 0xF2C7, /* 0xA0 */
0xF2C4, 0xF2C6, 0xCD67, 0xCD68, 0xF2CA, 0xF2C2, 0xF2C0, 0xCD69, /* 0xB0 */
0xCD6A, 0xCD6B, 0xF2C5, 0xCD6C, 0xCD6D, 0xCD6E, 0xCD6F, 0xCD70, /* 0xB0 */
0xD6FB, 0xCD71, 0xCD72, 0xCD73, 0xF2C1, 0xCD74, 0xC7F9, 0xC9DF, /* 0xC0 */
0xCD75, 0xF2C8, 0xB9C6, 0xB5B0, 0xCD76, 0xCD77, 0xF2C3, 0xF2C9, /* 0xC0 */
0xF2D0, 0xF2D6, 0xCD78, 0xCD79, 0xBBD7, 0xCD7A, 0xCD7B, 0xCD7C, /* 0xD0 */
0xF2D5, 0xCDDC, 0xCD7D, 0xD6EB, 0xCD7E, 0xCD80, 0xF2D2, 0xF2D4, /* 0xD0 */
0xCD81, 0xCD82, 0xCD83, 0xCD84, 0xB8F2, 0xCD85, 0xCD86, 0xCD87, /* 0xE0 */
0xCD88, 0xF2CB, 0xCD89, 0xCD8A, 0xCD8B, 0xF2CE, 0xC2F9, 0xCD8C, /* 0xE0 */
0xD5DD, 0xF2CC, 0xF2CD, 0xF2CF, 0xF2D3, 0xCD8D, 0xCD8E, 0xCD8F, /* 0xF0 */
0xF2D9, 0xD3BC, 0xCD90, 0xCD91, 0xCD92, 0xCD93, 0xB6EA, 0xCD94 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_87[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xCAF1, 0xCD95, 0xB7E4, 0xF2D7, 0xCD96, 0xCD97, 0xCD98, 0xF2D8, /* 0x00 */
0xF2DA, 0xF2DD, 0xF2DB, 0xCD99, 0xCD9A, 0xF2DC, 0xCD9B, 0xCD9C, /* 0x00 */
0xCD9D, 0xCD9E, 0xD1D1, 0xF2D1, 0xCD9F, 0xCDC9, 0xCDA0, 0xCECF, /* 0x10 */
0xD6A9, 0xCE40, 0xF2E3, 0xCE41, 0xC3DB, 0xCE42, 0xF2E0, 0xCE43, /* 0x10 */
0xCE44, 0xC0AF, 0xF2EC, 0xF2DE, 0xCE45, 0xF2E1, 0xCE46, 0xCE47, /* 0x20 */
0xCE48, 0xF2E8, 0xCE49, 0xCE4A, 0xCE4B, 0xCE4C, 0xF2E2, 0xCE4D, /* 0x20 */
0xCE4E, 0xF2E7, 0xCE4F, 0xCE50, 0xF2E6, 0xCE51, 0xCE52, 0xF2E9, /* 0x30 */
0xCE53, 0xCE54, 0xCE55, 0xF2DF, 0xCE56, 0xCE57, 0xF2E4, 0xF2EA, /* 0x30 */
0xCE58, 0xCE59, 0xCE5A, 0xCE5B, 0xCE5C, 0xCE5D, 0xCE5E, 0xD3AC, /* 0x40 */
0xF2E5, 0xB2F5, 0xCE5F, 0xCE60, 0xF2F2, 0xCE61, 0xD0AB, 0xCE62, /* 0x40 */
0xCE63, 0xCE64, 0xCE65, 0xF2F5, 0xCE66, 0xCE67, 0xCE68, 0xBBC8, /* 0x50 */
0xCE69, 0xF2F9, 0xCE6A, 0xCE6B, 0xCE6C, 0xCE6D, 0xCE6E, 0xCE6F, /* 0x50 */
0xF2F0, 0xCE70, 0xCE71, 0xF2F6, 0xF2F8, 0xF2FA, 0xCE72, 0xCE73, /* 0x60 */
0xCE74, 0xCE75, 0xCE76, 0xCE77, 0xCE78, 0xCE79, 0xF2F3, 0xCE7A, /* 0x60 */
0xF2F1, 0xCE7B, 0xCE7C, 0xCE7D, 0xBAFB, 0xCE7E, 0xB5FB, 0xCE80, /* 0x70 */
0xCE81, 0xCE82, 0xCE83, 0xF2EF, 0xF2F7, 0xF2ED, 0xF2EE, 0xCE84, /* 0x70 */
0xCE85, 0xCE86, 0xF2EB, 0xF3A6, 0xCE87, 0xF3A3, 0xCE88, 0xCE89, /* 0x80 */
0xF3A2, 0xCE8A, 0xCE8B, 0xF2F4, 0xCE8C, 0xC8DA, 0xCE8D, 0xCE8E, /* 0x80 */
0xCE8F, 0xCE90, 0xCE91, 0xF2FB, 0xCE92, 0xCE93, 0xCE94, 0xF3A5, /* 0x90 */
0xCE95, 0xCE96, 0xCE97, 0xCE98, 0xCE99, 0xCE9A, 0xCE9B, 0xC3F8, /* 0x90 */
0xCE9C, 0xCE9D, 0xCE9E, 0xCE9F, 0xCEA0, 0xCF40, 0xCF41, 0xCF42, /* 0xA0 */
0xF2FD, 0xCF43, 0xCF44, 0xF3A7, 0xF3A9, 0xF3A4, 0xCF45, 0xF2FC, /* 0xA0 */
0xCF46, 0xCF47, 0xCF48, 0xF3AB, 0xCF49, 0xF3AA, 0xCF4A, 0xCF4B, /* 0xB0 */
0xCF4C, 0xCF4D, 0xC2DD, 0xCF4E, 0xCF4F, 0xF3AE, 0xCF50, 0xCF51, /* 0xB0 */
0xF3B0, 0xCF52, 0xCF53, 0xCF54, 0xCF55, 0xCF56, 0xF3A1, 0xCF57, /* 0xC0 */
0xCF58, 0xCF59, 0xF3B1, 0xF3AC, 0xCF5A, 0xCF5B, 0xCF5C, 0xCF5D, /* 0xC0 */
0xCF5E, 0xF3AF, 0xF2FE, 0xF3AD, 0xCF5F, 0xCF60, 0xCF61, 0xCF62, /* 0xD0 */
0xCF63, 0xCF64, 0xCF65, 0xF3B2, 0xCF66, 0xCF67, 0xCF68, 0xCF69, /* 0xD0 */
0xF3B4, 0xCF6A, 0xCF6B, 0xCF6C, 0xCF6D, 0xF3A8, 0xCF6E, 0xCF6F, /* 0xE0 */
0xCF70, 0xCF71, 0xF3B3, 0xCF72, 0xCF73, 0xCF74, 0xF3B5, 0xCF75, /* 0xE0 */
0xCF76, 0xCF77, 0xCF78, 0xCF79, 0xCF7A, 0xCF7B, 0xCF7C, 0xCF7D, /* 0xF0 */
0xCF7E, 0xD0B7, 0xCF80, 0xCF81, 0xCF82, 0xCF83, 0xF3B8, 0xCF84 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_88[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xCF85, 0xCF86, 0xCF87, 0xD9F9, 0xCF88, 0xCF89, 0xCF8A, 0xCF8B, /* 0x00 */
0xCF8C, 0xCF8D, 0xF3B9, 0xCF8E, 0xCF8F, 0xCF90, 0xCF91, 0xCF92, /* 0x00 */
0xCF93, 0xCF94, 0xCF95, 0xF3B7, 0xCF96, 0xC8E4, 0xF3B6, 0xCF97, /* 0x10 */
0xCF98, 0xCF99, 0xCF9A, 0xF3BA, 0xCF9B, 0xCF9C, 0xCF9D, 0xCF9E, /* 0x10 */
0xCF9F, 0xF3BB, 0xB4C0, 0xCFA0, 0xD040, 0xD041, 0xD042, 0xD043, /* 0x20 */
0xD044, 0xD045, 0xD046, 0xD047, 0xD048, 0xD049, 0xD04A, 0xD04B, /* 0x20 */
0xD04C, 0xD04D, 0xEEC3, 0xD04E, 0xD04F, 0xD050, 0xD051, 0xD052, /* 0x30 */
0xD053, 0xF3BC, 0xD054, 0xD055, 0xF3BD, 0xD056, 0xD057, 0xD058, /* 0x30 */
0xD1AA, 0xD059, 0xD05A, 0xD05B, 0xF4AC, 0xD0C6, 0xD05C, 0xD05D, /* 0x40 */
0xD05E, 0xD05F, 0xD060, 0xD061, 0xD0D0, 0xD1DC, 0xD062, 0xD063, /* 0x40 */
0xD064, 0xD065, 0xD066, 0xD067, 0xCFCE, 0xD068, 0xD069, 0xBDD6, /* 0x50 */
0xD06A, 0xD1C3, 0xD06B, 0xD06C, 0xD06D, 0xD06E, 0xD06F, 0xD070, /* 0x50 */
0xD071, 0xBAE2, 0xE1E9, 0xD2C2, 0xF1C2, 0xB2B9, 0xD072, 0xD073, /* 0x60 */
0xB1ED, 0xF1C3, 0xD074, 0xC9C0, 0xB3C4, 0xD075, 0xD9F2, 0xD076, /* 0x60 */
0xCBA5, 0xD077, 0xF1C4, 0xD078, 0xD079, 0xD07A, 0xD07B, 0xD6D4, /* 0x70 */
0xD07C, 0xD07D, 0xD07E, 0xD080, 0xD081, 0xF1C5, 0xF4C0, 0xF1C6, /* 0x70 */
0xD082, 0xD4AC, 0xF1C7, 0xD083, 0xB0C0, 0xF4C1, 0xD084, 0xD085, /* 0x80 */
0xF4C2, 0xD086, 0xD087, 0xB4FC, 0xD088, 0xC5DB, 0xD089, 0xD08A, /* 0x80 */
0xD08B, 0xD08C, 0xCCBB, 0xD08D, 0xD08E, 0xD08F, 0xD0E4, 0xD090, /* 0x90 */
0xD091, 0xD092, 0xD093, 0xD094, 0xCDE0, 0xD095, 0xD096, 0xD097, /* 0x90 */
0xD098, 0xD099, 0xF1C8, 0xD09A, 0xD9F3, 0xD09B, 0xD09C, 0xD09D, /* 0xA0 */
0xD09E, 0xD09F, 0xD0A0, 0xB1BB, 0xD140, 0xCFAE, 0xD141, 0xD142, /* 0xA0 */
0xD143, 0xB8A4, 0xD144, 0xD145, 0xD146, 0xD147, 0xD148, 0xF1CA, /* 0xB0 */
0xD149, 0xD14A, 0xD14B, 0xD14C, 0xF1CB, 0xD14D, 0xD14E, 0xD14F, /* 0xB0 */
0xD150, 0xB2C3, 0xC1D1, 0xD151, 0xD152, 0xD7B0, 0xF1C9, 0xD153, /* 0xC0 */
0xD154, 0xF1CC, 0xD155, 0xD156, 0xD157, 0xD158, 0xF1CE, 0xD159, /* 0xC0 */
0xD15A, 0xD15B, 0xD9F6, 0xD15C, 0xD2E1, 0xD4A3, 0xD15D, 0xD15E, /* 0xD0 */
0xF4C3, 0xC8B9, 0xD15F, 0xD160, 0xD161, 0xD162, 0xD163, 0xF4C4, /* 0xD0 */
0xD164, 0xD165, 0xF1CD, 0xF1CF, 0xBFE3, 0xF1D0, 0xD166, 0xD167, /* 0xE0 */
0xF1D4, 0xD168, 0xD169, 0xD16A, 0xD16B, 0xD16C, 0xD16D, 0xD16E, /* 0xE0 */
0xF1D6, 0xF1D1, 0xD16F, 0xC9D1, 0xC5E1, 0xD170, 0xD171, 0xD172, /* 0xF0 */
0xC2E3, 0xB9FC, 0xD173, 0xD174, 0xF1D3, 0xD175, 0xF1D5, 0xD176 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_89[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD177, 0xD178, 0xB9D3, 0xD179, 0xD17A, 0xD17B, 0xD17C, 0xD17D, /* 0x00 */
0xD17E, 0xD180, 0xF1DB, 0xD181, 0xD182, 0xD183, 0xD184, 0xD185, /* 0x00 */
0xBAD6, 0xD186, 0xB0FD, 0xF1D9, 0xD187, 0xD188, 0xD189, 0xD18A, /* 0x10 */
0xD18B, 0xF1D8, 0xF1D2, 0xF1DA, 0xD18C, 0xD18D, 0xD18E, 0xD18F, /* 0x10 */
0xD190, 0xF1D7, 0xD191, 0xD192, 0xD193, 0xC8EC, 0xD194, 0xD195, /* 0x20 */
0xD196, 0xD197, 0xCDCA, 0xF1DD, 0xD198, 0xD199, 0xD19A, 0xD19B, /* 0x20 */
0xE5BD, 0xD19C, 0xD19D, 0xD19E, 0xF1DC, 0xD19F, 0xF1DE, 0xD1A0, /* 0x30 */
0xD240, 0xD241, 0xD242, 0xD243, 0xD244, 0xD245, 0xD246, 0xD247, /* 0x30 */
0xD248, 0xF1DF, 0xD249, 0xD24A, 0xCFE5, 0xD24B, 0xD24C, 0xD24D, /* 0x40 */
0xD24E, 0xD24F, 0xD250, 0xD251, 0xD252, 0xD253, 0xD254, 0xD255, /* 0x40 */
0xD256, 0xD257, 0xD258, 0xD259, 0xD25A, 0xD25B, 0xD25C, 0xD25D, /* 0x50 */
0xD25E, 0xD25F, 0xD260, 0xD261, 0xD262, 0xD263, 0xF4C5, 0xBDF3, /* 0x50 */
0xD264, 0xD265, 0xD266, 0xD267, 0xD268, 0xD269, 0xF1E0, 0xD26A, /* 0x60 */
0xD26B, 0xD26C, 0xD26D, 0xD26E, 0xD26F, 0xD270, 0xD271, 0xD272, /* 0x60 */
0xD273, 0xD274, 0xD275, 0xD276, 0xD277, 0xD278, 0xD279, 0xD27A, /* 0x70 */
0xD27B, 0xD27C, 0xD27D, 0xF1E1, 0xD27E, 0xD280, 0xD281, 0xCEF7, /* 0x70 */
0xD282, 0xD2AA, 0xD283, 0xF1FB, 0xD284, 0xD285, 0xB8B2, 0xD286, /* 0x80 */
0xD287, 0xD288, 0xD289, 0xD28A, 0xD28B, 0xD28C, 0xD28D, 0xD28E, /* 0x80 */
0xD28F, 0xD290, 0xD291, 0xD292, 0xD293, 0xD294, 0xD295, 0xD296, /* 0x90 */
0xD297, 0xD298, 0xD299, 0xD29A, 0xD29B, 0xD29C, 0xD29D, 0xD29E, /* 0x90 */
0xD29F, 0xD2A0, 0xD340, 0xD341, 0xD342, 0xD343, 0xD344, 0xD345, /* 0xA0 */
0xD346, 0xD347, 0xD348, 0xD349, 0xD34A, 0xD34B, 0xD34C, 0xD34D, /* 0xA0 */
0xD34E, 0xD34F, 0xD350, 0xD351, 0xD352, 0xD353, 0xD354, 0xD355, /* 0xB0 */
0xD356, 0xD357, 0xD358, 0xD359, 0xD35A, 0xD35B, 0xD35C, 0xD35D, /* 0xB0 */
0xD35E, 0xBCFB, 0xB9DB, 0xD35F, 0xB9E6, 0xC3D9, 0xCAD3, 0xEAE8, /* 0xC0 */
0xC0C0, 0xBEF5, 0xEAE9, 0xEAEA, 0xEAEB, 0xD360, 0xEAEC, 0xEAED, /* 0xC0 */
0xEAEE, 0xEAEF, 0xBDC7, 0xD361, 0xD362, 0xD363, 0xF5FB, 0xD364, /* 0xD0 */
0xD365, 0xD366, 0xF5FD, 0xD367, 0xF5FE, 0xD368, 0xF5FC, 0xD369, /* 0xD0 */
0xD36A, 0xD36B, 0xD36C, 0xBDE2, 0xD36D, 0xF6A1, 0xB4A5, 0xD36E, /* 0xE0 */
0xD36F, 0xD370, 0xD371, 0xF6A2, 0xD372, 0xD373, 0xD374, 0xF6A3, /* 0xE0 */
0xD375, 0xD376, 0xD377, 0xECB2, 0xD378, 0xD379, 0xD37A, 0xD37B, /* 0xF0 */
0xD37C, 0xD37D, 0xD37E, 0xD380, 0xD381, 0xD382, 0xD383, 0xD384 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_8A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD1D4, 0xD385, 0xD386, 0xD387, 0xD388, 0xD389, 0xD38A, 0xD9EA, /* 0x00 */
0xD38B, 0xD38C, 0xD38D, 0xD38E, 0xD38F, 0xD390, 0xD391, 0xD392, /* 0x00 */
0xD393, 0xD394, 0xD395, 0xD396, 0xD397, 0xD398, 0xD399, 0xD39A, /* 0x10 */
0xD39B, 0xD39C, 0xD39D, 0xD39E, 0xD39F, 0xD3A0, 0xD440, 0xD441, /* 0x10 */
0xD442, 0xD443, 0xD444, 0xD445, 0xD446, 0xD447, 0xD448, 0xD449, /* 0x20 */
0xD44A, 0xD44B, 0xD44C, 0xD44D, 0xD44E, 0xD44F, 0xD450, 0xD451, /* 0x20 */
0xD452, 0xD453, 0xD454, 0xD455, 0xD456, 0xD457, 0xD458, 0xD459, /* 0x30 */
0xD45A, 0xD45B, 0xD45C, 0xD45D, 0xD45E, 0xD45F, 0xF6A4, 0xD460, /* 0x30 */
0xD461, 0xD462, 0xD463, 0xD464, 0xD465, 0xD466, 0xD467, 0xD468, /* 0x40 */
0xEEBA, 0xD469, 0xD46A, 0xD46B, 0xD46C, 0xD46D, 0xD46E, 0xD46F, /* 0x40 */
0xD470, 0xD471, 0xD472, 0xD473, 0xD474, 0xD475, 0xD476, 0xD477, /* 0x50 */
0xD478, 0xD479, 0xD47A, 0xD47B, 0xD47C, 0xD47D, 0xD47E, 0xD480, /* 0x50 */
0xD481, 0xD482, 0xD483, 0xD484, 0xD485, 0xD486, 0xD487, 0xD488, /* 0x60 */
0xD489, 0xD48A, 0xD48B, 0xD48C, 0xD48D, 0xD48E, 0xD48F, 0xD490, /* 0x60 */
0xD491, 0xD492, 0xD493, 0xD494, 0xD495, 0xD496, 0xD497, 0xD498, /* 0x70 */
0xD499, 0xD5B2, 0xD49A, 0xD49B, 0xD49C, 0xD49D, 0xD49E, 0xD49F, /* 0x70 */
0xD4A0, 0xD540, 0xD541, 0xD542, 0xD543, 0xD544, 0xD545, 0xD546, /* 0x80 */
0xD547, 0xD3FE, 0xCCDC, 0xD548, 0xD549, 0xD54A, 0xD54B, 0xD54C, /* 0x80 */
0xD54D, 0xD54E, 0xD54F, 0xCAC4, 0xD550, 0xD551, 0xD552, 0xD553, /* 0x90 */
0xD554, 0xD555, 0xD556, 0xD557, 0xD558, 0xD559, 0xD55A, 0xD55B, /* 0x90 */
0xD55C, 0xD55D, 0xD55E, 0xD55F, 0xD560, 0xD561, 0xD562, 0xD563, /* 0xA0 */
0xD564, 0xD565, 0xD566, 0xD567, 0xD568, 0xD569, 0xD56A, 0xD56B, /* 0xA0 */
0xD56C, 0xD56D, 0xD56E, 0xD56F, 0xD570, 0xD571, 0xD572, 0xD573, /* 0xB0 */
0xD574, 0xD575, 0xD576, 0xD577, 0xD578, 0xD579, 0xD57A, 0xD57B, /* 0xB0 */
0xD57C, 0xD57D, 0xD57E, 0xD580, 0xD581, 0xD582, 0xD583, 0xD584, /* 0xC0 */
0xD585, 0xD586, 0xD587, 0xD588, 0xD589, 0xD58A, 0xD58B, 0xD58C, /* 0xC0 */
0xD58D, 0xD58E, 0xD58F, 0xD590, 0xD591, 0xD592, 0xD593, 0xD594, /* 0xD0 */
0xD595, 0xD596, 0xD597, 0xD598, 0xD599, 0xD59A, 0xD59B, 0xD59C, /* 0xD0 */
0xD59D, 0xD59E, 0xD59F, 0xD5A0, 0xD640, 0xD641, 0xD642, 0xD643, /* 0xE0 */
0xD644, 0xD645, 0xD646, 0xD647, 0xD648, 0xD649, 0xD64A, 0xD64B, /* 0xE0 */
0xD64C, 0xD64D, 0xD64E, 0xD64F, 0xD650, 0xD651, 0xD652, 0xD653, /* 0xF0 */
0xD654, 0xD655, 0xD656, 0xD657, 0xD658, 0xD659, 0xD65A, 0xD65B /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_8B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD65C, 0xD65D, 0xD65E, 0xD65F, 0xD660, 0xD661, 0xD662, 0xE5C0, /* 0x00 */
0xD663, 0xD664, 0xD665, 0xD666, 0xD667, 0xD668, 0xD669, 0xD66A, /* 0x00 */
0xD66B, 0xD66C, 0xD66D, 0xD66E, 0xD66F, 0xD670, 0xD671, 0xD672, /* 0x10 */
0xD673, 0xD674, 0xD675, 0xD676, 0xD677, 0xD678, 0xD679, 0xD67A, /* 0x10 */
0xD67B, 0xD67C, 0xD67D, 0xD67E, 0xD680, 0xD681, 0xF6A5, 0xD682, /* 0x20 */
0xD683, 0xD684, 0xD685, 0xD686, 0xD687, 0xD688, 0xD689, 0xD68A, /* 0x20 */
0xD68B, 0xD68C, 0xD68D, 0xD68E, 0xD68F, 0xD690, 0xD691, 0xD692, /* 0x30 */
0xD693, 0xD694, 0xD695, 0xD696, 0xD697, 0xD698, 0xD699, 0xD69A, /* 0x30 */
0xD69B, 0xD69C, 0xD69D, 0xD69E, 0xD69F, 0xD6A0, 0xD740, 0xD741, /* 0x40 */
0xD742, 0xD743, 0xD744, 0xD745, 0xD746, 0xD747, 0xD748, 0xD749, /* 0x40 */
0xD74A, 0xD74B, 0xD74C, 0xD74D, 0xD74E, 0xD74F, 0xD750, 0xD751, /* 0x50 */
0xD752, 0xD753, 0xD754, 0xD755, 0xD756, 0xD757, 0xD758, 0xD759, /* 0x50 */
0xD75A, 0xD75B, 0xD75C, 0xD75D, 0xD75E, 0xD75F, 0xBEAF, 0xD760, /* 0x60 */
0xD761, 0xD762, 0xD763, 0xD764, 0xC6A9, 0xD765, 0xD766, 0xD767, /* 0x60 */
0xD768, 0xD769, 0xD76A, 0xD76B, 0xD76C, 0xD76D, 0xD76E, 0xD76F, /* 0x70 */
0xD770, 0xD771, 0xD772, 0xD773, 0xD774, 0xD775, 0xD776, 0xD777, /* 0x70 */
0xD778, 0xD779, 0xD77A, 0xD77B, 0xD77C, 0xD77D, 0xD77E, 0xD780, /* 0x80 */
0xD781, 0xD782, 0xD783, 0xD784, 0xD785, 0xD786, 0xD787, 0xD788, /* 0x80 */
0xD789, 0xD78A, 0xD78B, 0xD78C, 0xD78D, 0xD78E, 0xD78F, 0xD790, /* 0x90 */
0xD791, 0xD792, 0xD793, 0xD794, 0xD795, 0xD796, 0xD797, 0xD798, /* 0x90 */
0xDAA5, 0xBCC6, 0xB6A9, 0xB8BC, 0xC8CF, 0xBCA5, 0xDAA6, 0xDAA7, /* 0xA0 */
0xCCD6, 0xC8C3, 0xDAA8, 0xC6FD, 0xD799, 0xD1B5, 0xD2E9, 0xD1B6, /* 0xA0 */
0xBCC7, 0xD79A, 0xBDB2, 0xBBE4, 0xDAA9, 0xDAAA, 0xD1C8, 0xDAAB, /* 0xB0 */
0xD0ED, 0xB6EF, 0xC2DB, 0xD79B, 0xCBCF, 0xB7ED, 0xC9E8, 0xB7C3, /* 0xB0 */
0xBEF7, 0xD6A4, 0xDAAC, 0xDAAD, 0xC6C0, 0xD7E7, 0xCAB6, 0xD79C, /* 0xC0 */
0xD5A9, 0xCBDF, 0xD5EF, 0xDAAE, 0xD6DF, 0xB4CA, 0xDAB0, 0xDAAF, /* 0xC0 */
0xD79D, 0xD2EB, 0xDAB1, 0xDAB2, 0xDAB3, 0xCAD4, 0xDAB4, 0xCAAB, /* 0xD0 */
0xDAB5, 0xDAB6, 0xB3CF, 0xD6EF, 0xDAB7, 0xBBB0, 0xB5AE, 0xDAB8, /* 0xD0 */
0xDAB9, 0xB9EE, 0xD1AF, 0xD2E8, 0xDABA, 0xB8C3, 0xCFEA, 0xB2EF, /* 0xE0 */
0xDABB, 0xDABC, 0xD79E, 0xBDEB, 0xCEDC, 0xD3EF, 0xDABD, 0xCEF3, /* 0xE0 */
0xDABE, 0xD3D5, 0xBBE5, 0xDABF, 0xCBB5, 0xCBD0, 0xDAC0, 0xC7EB, /* 0xF0 */
0xD6EE, 0xDAC1, 0xC5B5, 0xB6C1, 0xDAC2, 0xB7CC, 0xBFCE, 0xDAC3 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_8C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xDAC4, 0xCBAD, 0xDAC5, 0xB5F7, 0xDAC6, 0xC1C2, 0xD7BB, 0xDAC7, /* 0x00 */
0xCCB8, 0xD79F, 0xD2EA, 0xC4B1, 0xDAC8, 0xB5FD, 0xBBD1, 0xDAC9, /* 0x00 */
0xD0B3, 0xDACA, 0xDACB, 0xCEBD, 0xDACC, 0xDACD, 0xDACE, 0xB2F7, /* 0x10 */
0xDAD1, 0xDACF, 0xD1E8, 0xDAD0, 0xC3D5, 0xDAD2, 0xD7A0, 0xDAD3, /* 0x10 */
0xDAD4, 0xDAD5, 0xD0BB, 0xD2A5, 0xB0F9, 0xDAD6, 0xC7AB, 0xDAD7, /* 0x20 */
0xBDF7, 0xC3A1, 0xDAD8, 0xDAD9, 0xC3FD, 0xCCB7, 0xDADA, 0xDADB, /* 0x20 */
0xC0BE, 0xC6D7, 0xDADC, 0xDADD, 0xC7B4, 0xDADE, 0xDADF, 0xB9C8, /* 0x30 */
0xD840, 0xD841, 0xD842, 0xD843, 0xD844, 0xD845, 0xD846, 0xD847, /* 0x30 */
0xD848, 0xBBED, 0xD849, 0xD84A, 0xD84B, 0xD84C, 0xB6B9, 0xF4F8, /* 0x40 */
0xD84D, 0xF4F9, 0xD84E, 0xD84F, 0xCDE3, 0xD850, 0xD851, 0xD852, /* 0x40 */
0xD853, 0xD854, 0xD855, 0xD856, 0xD857, 0xF5B9, 0xD858, 0xD859, /* 0x50 */
0xD85A, 0xD85B, 0xEBE0, 0xD85C, 0xD85D, 0xD85E, 0xD85F, 0xD860, /* 0x50 */
0xD861, 0xCFF3, 0xBBBF, 0xD862, 0xD863, 0xD864, 0xD865, 0xD866, /* 0x60 */
0xD867, 0xD868, 0xBAC0, 0xD4A5, 0xD869, 0xD86A, 0xD86B, 0xD86C, /* 0x60 */
0xD86D, 0xD86E, 0xD86F, 0xE1D9, 0xD870, 0xD871, 0xD872, 0xD873, /* 0x70 */
0xF5F4, 0xB1AA, 0xB2F2, 0xD874, 0xD875, 0xD876, 0xD877, 0xD878, /* 0x70 */
0xD879, 0xD87A, 0xF5F5, 0xD87B, 0xD87C, 0xF5F7, 0xD87D, 0xD87E, /* 0x80 */
0xD880, 0xBAD1, 0xF5F6, 0xD881, 0xC3B2, 0xD882, 0xD883, 0xD884, /* 0x80 */
0xD885, 0xD886, 0xD887, 0xD888, 0xF5F9, 0xD889, 0xD88A, 0xD88B, /* 0x90 */
0xF5F8, 0xD88C, 0xD88D, 0xD88E, 0xD88F, 0xD890, 0xD891, 0xD892, /* 0x90 */
0xD893, 0xD894, 0xD895, 0xD896, 0xD897, 0xD898, 0xD899, 0xD89A, /* 0xA0 */
0xD89B, 0xD89C, 0xD89D, 0xD89E, 0xD89F, 0xD8A0, 0xD940, 0xD941, /* 0xA0 */
0xD942, 0xD943, 0xD944, 0xD945, 0xD946, 0xD947, 0xD948, 0xD949, /* 0xB0 */
0xD94A, 0xD94B, 0xD94C, 0xD94D, 0xD94E, 0xD94F, 0xD950, 0xD951, /* 0xB0 */
0xD952, 0xD953, 0xD954, 0xD955, 0xD956, 0xD957, 0xD958, 0xD959, /* 0xC0 */
0xD95A, 0xD95B, 0xD95C, 0xD95D, 0xD95E, 0xD95F, 0xD960, 0xD961, /* 0xC0 */
0xD962, 0xD963, 0xD964, 0xD965, 0xD966, 0xD967, 0xD968, 0xD969, /* 0xD0 */
0xD96A, 0xD96B, 0xD96C, 0xD96D, 0xD96E, 0xD96F, 0xD970, 0xD971, /* 0xD0 */
0xD972, 0xD973, 0xD974, 0xD975, 0xD976, 0xD977, 0xD978, 0xD979, /* 0xE0 */
0xD97A, 0xD97B, 0xD97C, 0xD97D, 0xD97E, 0xD980, 0xD981, 0xD982, /* 0xE0 */
0xD983, 0xD984, 0xD985, 0xD986, 0xD987, 0xD988, 0xD989, 0xD98A, /* 0xF0 */
0xD98B, 0xD98C, 0xD98D, 0xD98E, 0xD98F, 0xD990, 0xD991, 0xD992 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_8D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD993, 0xD994, 0xD995, 0xD996, 0xD997, 0xD998, 0xD999, 0xD99A, /* 0x00 */
0xD99B, 0xD99C, 0xD99D, 0xD99E, 0xD99F, 0xD9A0, 0xDA40, 0xDA41, /* 0x00 */
0xDA42, 0xDA43, 0xDA44, 0xDA45, 0xDA46, 0xDA47, 0xDA48, 0xDA49, /* 0x10 */
0xDA4A, 0xDA4B, 0xDA4C, 0xDA4D, 0xDA4E, 0xB1B4, 0xD5EA, 0xB8BA, /* 0x10 */
0xDA4F, 0xB9B1, 0xB2C6, 0xD4F0, 0xCFCD, 0xB0DC, 0xD5CB, 0xBBF5, /* 0x20 */
0xD6CA, 0xB7B7, 0xCCB0, 0xC6B6, 0xB1E1, 0xB9BA, 0xD6FC, 0xB9E1, /* 0x20 */
0xB7A1, 0xBCFA, 0xEADA, 0xEADB, 0xCCF9, 0xB9F3, 0xEADC, 0xB4FB, /* 0x30 */
0xC3B3, 0xB7D1, 0xBAD8, 0xEADD, 0xD4F4, 0xEADE, 0xBCD6, 0xBBDF, /* 0x30 */
0xEADF, 0xC1DE, 0xC2B8, 0xD4DF, 0xD7CA, 0xEAE0, 0xEAE1, 0xEAE4, /* 0x40 */
0xEAE2, 0xEAE3, 0xC9DE, 0xB8B3, 0xB6C4, 0xEAE5, 0xCAEA, 0xC9CD, /* 0x40 */
0xB4CD, 0xDA50, 0xDA51, 0xE2D9, 0xC5E2, 0xEAE6, 0xC0B5, 0xDA52, /* 0x50 */
0xD7B8, 0xEAE7, 0xD7AC, 0xC8FC, 0xD8D3, 0xD8CD, 0xD4DE, 0xDA53, /* 0x50 */
0xD4F9, 0xC9C4, 0xD3AE, 0xB8D3, 0xB3E0, 0xDA54, 0xC9E2, 0xF4F6, /* 0x60 */
0xDA55, 0xDA56, 0xDA57, 0xBAD5, 0xDA58, 0xF4F7, 0xDA59, 0xDA5A, /* 0x60 */
0xD7DF, 0xDA5B, 0xDA5C, 0xF4F1, 0xB8B0, 0xD5D4, 0xB8CF, 0xC6F0, /* 0x70 */
0xDA5D, 0xDA5E, 0xDA5F, 0xDA60, 0xDA61, 0xDA62, 0xDA63, 0xDA64, /* 0x70 */
0xDA65, 0xB3C3, 0xDA66, 0xDA67, 0xF4F2, 0xB3AC, 0xDA68, 0xDA69, /* 0x80 */
0xDA6A, 0xDA6B, 0xD4BD, 0xC7F7, 0xDA6C, 0xDA6D, 0xDA6E, 0xDA6F, /* 0x80 */
0xDA70, 0xF4F4, 0xDA71, 0xDA72, 0xF4F3, 0xDA73, 0xDA74, 0xDA75, /* 0x90 */
0xDA76, 0xDA77, 0xDA78, 0xDA79, 0xDA7A, 0xDA7B, 0xDA7C, 0xCCCB, /* 0x90 */
0xDA7D, 0xDA7E, 0xDA80, 0xC8A4, 0xDA81, 0xDA82, 0xDA83, 0xDA84, /* 0xA0 */
0xDA85, 0xDA86, 0xDA87, 0xDA88, 0xDA89, 0xDA8A, 0xDA8B, 0xDA8C, /* 0xA0 */
0xDA8D, 0xF4F5, 0xDA8E, 0xD7E3, 0xC5BF, 0xF5C0, 0xDA8F, 0xDA90, /* 0xB0 */
0xF5BB, 0xDA91, 0xF5C3, 0xDA92, 0xF5C2, 0xDA93, 0xD6BA, 0xF5C1, /* 0xB0 */
0xDA94, 0xDA95, 0xDA96, 0xD4BE, 0xF5C4, 0xDA97, 0xF5CC, 0xDA98, /* 0xC0 */
0xDA99, 0xDA9A, 0xDA9B, 0xB0CF, 0xB5F8, 0xDA9C, 0xF5C9, 0xF5CA, /* 0xC0 */
0xDA9D, 0xC5DC, 0xDA9E, 0xDA9F, 0xDAA0, 0xDB40, 0xF5C5, 0xF5C6, /* 0xD0 */
0xDB41, 0xDB42, 0xF5C7, 0xF5CB, 0xDB43, 0xBEE0, 0xF5C8, 0xB8FA, /* 0xD0 */
0xDB44, 0xDB45, 0xDB46, 0xF5D0, 0xF5D3, 0xDB47, 0xDB48, 0xDB49, /* 0xE0 */
0xBFE7, 0xDB4A, 0xB9F2, 0xF5BC, 0xF5CD, 0xDB4B, 0xDB4C, 0xC2B7, /* 0xE0 */
0xDB4D, 0xDB4E, 0xDB4F, 0xCCF8, 0xDB50, 0xBCF9, 0xDB51, 0xF5CE, /* 0xF0 */
0xF5CF, 0xF5D1, 0xB6E5, 0xF5D2, 0xDB52, 0xF5D5, 0xDB53, 0xDB54 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_8E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xDB55, 0xDB56, 0xDB57, 0xDB58, 0xDB59, 0xF5BD, 0xDB5A, 0xDB5B, /* 0x00 */
0xDB5C, 0xF5D4, 0xD3BB, 0xDB5D, 0xB3EC, 0xDB5E, 0xDB5F, 0xCCA4, /* 0x00 */
0xDB60, 0xDB61, 0xDB62, 0xDB63, 0xF5D6, 0xDB64, 0xDB65, 0xDB66, /* 0x10 */
0xDB67, 0xDB68, 0xDB69, 0xDB6A, 0xDB6B, 0xF5D7, 0xBEE1, 0xF5D8, /* 0x10 */
0xDB6C, 0xDB6D, 0xCCDF, 0xF5DB, 0xDB6E, 0xDB6F, 0xDB70, 0xDB71, /* 0x20 */
0xDB72, 0xB2C8, 0xD7D9, 0xDB73, 0xF5D9, 0xDB74, 0xF5DA, 0xF5DC, /* 0x20 */
0xDB75, 0xF5E2, 0xDB76, 0xDB77, 0xDB78, 0xF5E0, 0xDB79, 0xDB7A, /* 0x30 */
0xDB7B, 0xF5DF, 0xF5DD, 0xDB7C, 0xDB7D, 0xF5E1, 0xDB7E, 0xDB80, /* 0x30 */
0xF5DE, 0xF5E4, 0xF5E5, 0xDB81, 0xCCE3, 0xDB82, 0xDB83, 0xE5BF, /* 0x40 */
0xB5B8, 0xF5E3, 0xF5E8, 0xCCA3, 0xDB84, 0xDB85, 0xDB86, 0xDB87, /* 0x40 */
0xDB88, 0xF5E6, 0xF5E7, 0xDB89, 0xDB8A, 0xDB8B, 0xDB8C, 0xDB8D, /* 0x50 */
0xDB8E, 0xF5BE, 0xDB8F, 0xDB90, 0xDB91, 0xDB92, 0xDB93, 0xDB94, /* 0x50 */
0xDB95, 0xDB96, 0xDB97, 0xDB98, 0xDB99, 0xDB9A, 0xB1C4, 0xDB9B, /* 0x60 */
0xDB9C, 0xF5BF, 0xDB9D, 0xDB9E, 0xB5C5, 0xB2E4, 0xDB9F, 0xF5EC, /* 0x60 */
0xF5E9, 0xDBA0, 0xB6D7, 0xDC40, 0xF5ED, 0xDC41, 0xF5EA, 0xDC42, /* 0x70 */
0xDC43, 0xDC44, 0xDC45, 0xDC46, 0xF5EB, 0xDC47, 0xDC48, 0xB4DA, /* 0x70 */
0xDC49, 0xD4EA, 0xDC4A, 0xDC4B, 0xDC4C, 0xF5EE, 0xDC4D, 0xB3F9, /* 0x80 */
0xDC4E, 0xDC4F, 0xDC50, 0xDC51, 0xDC52, 0xDC53, 0xDC54, 0xF5EF, /* 0x80 */
0xF5F1, 0xDC55, 0xDC56, 0xDC57, 0xF5F0, 0xDC58, 0xDC59, 0xDC5A, /* 0x90 */
0xDC5B, 0xDC5C, 0xDC5D, 0xDC5E, 0xF5F2, 0xDC5F, 0xF5F3, 0xDC60, /* 0x90 */
0xDC61, 0xDC62, 0xDC63, 0xDC64, 0xDC65, 0xDC66, 0xDC67, 0xDC68, /* 0xA0 */
0xDC69, 0xDC6A, 0xDC6B, 0xC9ED, 0xB9AA, 0xDC6C, 0xDC6D, 0xC7FB, /* 0xA0 */
0xDC6E, 0xDC6F, 0xB6E3, 0xDC70, 0xDC71, 0xDC72, 0xDC73, 0xDC74, /* 0xB0 */
0xDC75, 0xDC76, 0xCCC9, 0xDC77, 0xDC78, 0xDC79, 0xDC7A, 0xDC7B, /* 0xB0 */
0xDC7C, 0xDC7D, 0xDC7E, 0xDC80, 0xDC81, 0xDC82, 0xDC83, 0xDC84, /* 0xC0 */
0xDC85, 0xDC86, 0xDC87, 0xDC88, 0xDC89, 0xDC8A, 0xEAA6, 0xDC8B, /* 0xC0 */
0xDC8C, 0xDC8D, 0xDC8E, 0xDC8F, 0xDC90, 0xDC91, 0xDC92, 0xDC93, /* 0xD0 */
0xDC94, 0xDC95, 0xDC96, 0xDC97, 0xDC98, 0xDC99, 0xDC9A, 0xDC9B, /* 0xD0 */
0xDC9C, 0xDC9D, 0xDC9E, 0xDC9F, 0xDCA0, 0xDD40, 0xDD41, 0xDD42, /* 0xE0 */
0xDD43, 0xDD44, 0xDD45, 0xDD46, 0xDD47, 0xDD48, 0xDD49, 0xDD4A, /* 0xE0 */
0xDD4B, 0xDD4C, 0xDD4D, 0xDD4E, 0xDD4F, 0xDD50, 0xDD51, 0xDD52, /* 0xF0 */
0xDD53, 0xDD54, 0xDD55, 0xDD56, 0xDD57, 0xDD58, 0xDD59, 0xDD5A /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_8F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xDD5B, 0xDD5C, 0xDD5D, 0xDD5E, 0xDD5F, 0xDD60, 0xDD61, 0xDD62, /* 0x00 */
0xDD63, 0xDD64, 0xDD65, 0xDD66, 0xDD67, 0xDD68, 0xDD69, 0xDD6A, /* 0x00 */
0xDD6B, 0xDD6C, 0xDD6D, 0xDD6E, 0xDD6F, 0xDD70, 0xDD71, 0xDD72, /* 0x10 */
0xDD73, 0xDD74, 0xDD75, 0xDD76, 0xDD77, 0xDD78, 0xDD79, 0xDD7A, /* 0x10 */
0xDD7B, 0xDD7C, 0xDD7D, 0xDD7E, 0xDD80, 0xDD81, 0xDD82, 0xDD83, /* 0x20 */
0xDD84, 0xDD85, 0xDD86, 0xDD87, 0xDD88, 0xDD89, 0xDD8A, 0xDD8B, /* 0x20 */
0xDD8C, 0xDD8D, 0xDD8E, 0xDD8F, 0xDD90, 0xDD91, 0xDD92, 0xDD93, /* 0x30 */
0xDD94, 0xDD95, 0xDD96, 0xDD97, 0xDD98, 0xDD99, 0xDD9A, 0xDD9B, /* 0x30 */
0xDD9C, 0xDD9D, 0xDD9E, 0xDD9F, 0xDDA0, 0xDE40, 0xDE41, 0xDE42, /* 0x40 */
0xDE43, 0xDE44, 0xDE45, 0xDE46, 0xDE47, 0xDE48, 0xDE49, 0xDE4A, /* 0x40 */
0xDE4B, 0xDE4C, 0xDE4D, 0xDE4E, 0xDE4F, 0xDE50, 0xDE51, 0xDE52, /* 0x50 */
0xDE53, 0xDE54, 0xDE55, 0xDE56, 0xDE57, 0xDE58, 0xDE59, 0xDE5A, /* 0x50 */
0xDE5B, 0xDE5C, 0xDE5D, 0xDE5E, 0xDE5F, 0xDE60, 0xB3B5, 0xD4FE, /* 0x60 */
0xB9EC, 0xD0F9, 0xDE61, 0xE9ED, 0xD7AA, 0xE9EE, 0xC2D6, 0xC8ED, /* 0x60 */
0xBAE4, 0xE9EF, 0xE9F0, 0xE9F1, 0xD6E1, 0xE9F2, 0xE9F3, 0xE9F5, /* 0x70 */
0xE9F4, 0xE9F6, 0xE9F7, 0xC7E1, 0xE9F8, 0xD4D8, 0xE9F9, 0xBDCE, /* 0x70 */
0xDE62, 0xE9FA, 0xE9FB, 0xBDCF, 0xE9FC, 0xB8A8, 0xC1BE, 0xE9FD, /* 0x80 */
0xB1B2, 0xBBD4, 0xB9F5, 0xE9FE, 0xDE63, 0xEAA1, 0xEAA2, 0xEAA3, /* 0x80 */
0xB7F8, 0xBCAD, 0xDE64, 0xCAE4, 0xE0CE, 0xD4AF, 0xCFBD, 0xD5B7, /* 0x90 */
0xEAA4, 0xD5DE, 0xEAA5, 0xD0C1, 0xB9BC, 0xDE65, 0xB4C7, 0xB1D9, /* 0x90 */
0xDE66, 0xDE67, 0xDE68, 0xC0B1, 0xDE69, 0xDE6A, 0xDE6B, 0xDE6C, /* 0xA0 */
0xB1E6, 0xB1E7, 0xDE6D, 0xB1E8, 0xDE6E, 0xDE6F, 0xDE70, 0xDE71, /* 0xA0 */
0xB3BD, 0xC8E8, 0xDE72, 0xDE73, 0xDE74, 0xDE75, 0xE5C1, 0xDE76, /* 0xB0 */
0xDE77, 0xB1DF, 0xDE78, 0xDE79, 0xDE7A, 0xC1C9, 0xB4EF, 0xDE7B, /* 0xB0 */
0xDE7C, 0xC7A8, 0xD3D8, 0xDE7D, 0xC6F9, 0xD1B8, 0xDE7E, 0xB9FD, /* 0xC0 */
0xC2F5, 0xDE80, 0xDE81, 0xDE82, 0xDE83, 0xDE84, 0xD3AD, 0xDE85, /* 0xC0 */
0xD4CB, 0xBDFC, 0xDE86, 0xE5C2, 0xB7B5, 0xE5C3, 0xDE87, 0xDE88, /* 0xD0 */
0xBBB9, 0xD5E2, 0xDE89, 0xBDF8, 0xD4B6, 0xCEA5, 0xC1AC, 0xB3D9, /* 0xD0 */
0xDE8A, 0xDE8B, 0xCCF6, 0xDE8C, 0xE5C6, 0xE5C4, 0xE5C8, 0xDE8D, /* 0xE0 */
0xE5CA, 0xE5C7, 0xB5CF, 0xC6C8, 0xDE8E, 0xB5FC, 0xE5C5, 0xDE8F, /* 0xE0 */
0xCAF6, 0xDE90, 0xDE91, 0xE5C9, 0xDE92, 0xDE93, 0xDE94, 0xC3D4, /* 0xF0 */
0xB1C5, 0xBCA3, 0xDE95, 0xDE96, 0xDE97, 0xD7B7, 0xDE98, 0xDE99 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_90[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xCDCB, 0xCBCD, 0xCACA, 0xCCD3, 0xE5CC, 0xE5CB, 0xC4E6, 0xDE9A, /* 0x00 */
0xDE9B, 0xD1A1, 0xD1B7, 0xE5CD, 0xDE9C, 0xE5D0, 0xDE9D, 0xCDB8, /* 0x00 */
0xD6F0, 0xE5CF, 0xB5DD, 0xDE9E, 0xCDBE, 0xDE9F, 0xE5D1, 0xB6BA, /* 0x10 */
0xDEA0, 0xDF40, 0xCDA8, 0xB9E4, 0xDF41, 0xCAC5, 0xB3D1, 0xCBD9, /* 0x10 */
0xD4EC, 0xE5D2, 0xB7EA, 0xDF42, 0xDF43, 0xDF44, 0xE5CE, 0xDF45, /* 0x20 */
0xDF46, 0xDF47, 0xDF48, 0xDF49, 0xDF4A, 0xE5D5, 0xB4FE, 0xE5D6, /* 0x20 */
0xDF4B, 0xDF4C, 0xDF4D, 0xDF4E, 0xDF4F, 0xE5D3, 0xE5D4, 0xDF50, /* 0x30 */
0xD2DD, 0xDF51, 0xDF52, 0xC2DF, 0xB1C6, 0xDF53, 0xD3E2, 0xDF54, /* 0x30 */
0xDF55, 0xB6DD, 0xCBEC, 0xDF56, 0xE5D7, 0xDF57, 0xDF58, 0xD3F6, /* 0x40 */
0xDF59, 0xDF5A, 0xDF5B, 0xDF5C, 0xDF5D, 0xB1E9, 0xDF5E, 0xB6F4, /* 0x40 */
0xE5DA, 0xE5D8, 0xE5D9, 0xB5C0, 0xDF5F, 0xDF60, 0xDF61, 0xD2C5, /* 0x50 */
0xE5DC, 0xDF62, 0xDF63, 0xE5DE, 0xDF64, 0xDF65, 0xDF66, 0xDF67, /* 0x50 */
0xDF68, 0xDF69, 0xE5DD, 0xC7B2, 0xDF6A, 0xD2A3, 0xDF6B, 0xDF6C, /* 0x60 */
0xE5DB, 0xDF6D, 0xDF6E, 0xDF6F, 0xDF70, 0xD4E2, 0xD5DA, 0xDF71, /* 0x60 */
0xDF72, 0xDF73, 0xDF74, 0xDF75, 0xE5E0, 0xD7F1, 0xDF76, 0xDF77, /* 0x70 */
0xDF78, 0xDF79, 0xDF7A, 0xDF7B, 0xDF7C, 0xE5E1, 0xDF7D, 0xB1DC, /* 0x70 */
0xD1FB, 0xDF7E, 0xE5E2, 0xE5E4, 0xDF80, 0xDF81, 0xDF82, 0xDF83, /* 0x80 */
0xE5E3, 0xDF84, 0xDF85, 0xE5E5, 0xDF86, 0xDF87, 0xDF88, 0xDF89, /* 0x80 */
0xDF8A, 0xD2D8, 0xDF8B, 0xB5CB, 0xDF8C, 0xE7DF, 0xDF8D, 0xDAF5, /* 0x90 */
0xDF8E, 0xDAF8, 0xDF8F, 0xDAF6, 0xDF90, 0xDAF7, 0xDF91, 0xDF92, /* 0x90 */
0xDF93, 0xDAFA, 0xD0CF, 0xC4C7, 0xDF94, 0xDF95, 0xB0EE, 0xDF96, /* 0xA0 */
0xDF97, 0xDF98, 0xD0B0, 0xDF99, 0xDAF9, 0xDF9A, 0xD3CA, 0xBAAA, /* 0xA0 */
0xDBA2, 0xC7F1, 0xDF9B, 0xDAFC, 0xDAFB, 0xC9DB, 0xDAFD, 0xDF9C, /* 0xB0 */
0xDBA1, 0xD7DE, 0xDAFE, 0xC1DA, 0xDF9D, 0xDF9E, 0xDBA5, 0xDF9F, /* 0xB0 */
0xDFA0, 0xD3F4, 0xE040, 0xE041, 0xDBA7, 0xDBA4, 0xE042, 0xDBA8, /* 0xC0 */
0xE043, 0xE044, 0xBDBC, 0xE045, 0xE046, 0xE047, 0xC0C9, 0xDBA3, /* 0xC0 */
0xDBA6, 0xD6A3, 0xE048, 0xDBA9, 0xE049, 0xE04A, 0xE04B, 0xDBAD, /* 0xD0 */
0xE04C, 0xE04D, 0xE04E, 0xDBAE, 0xDBAC, 0xBAC2, 0xE04F, 0xE050, /* 0xD0 */
0xE051, 0xBFA4, 0xDBAB, 0xE052, 0xE053, 0xE054, 0xDBAA, 0xD4C7, /* 0xE0 */
0xB2BF, 0xE055, 0xE056, 0xDBAF, 0xE057, 0xB9F9, 0xE058, 0xDBB0, /* 0xE0 */
0xE059, 0xE05A, 0xE05B, 0xE05C, 0xB3BB, 0xE05D, 0xE05E, 0xE05F, /* 0xF0 */
0xB5A6, 0xE060, 0xE061, 0xE062, 0xE063, 0xB6BC, 0xDBB1, 0xE064 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_91[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE065, 0xE066, 0xB6F5, 0xE067, 0xDBB2, 0xE068, 0xE069, 0xE06A, /* 0x00 */
0xE06B, 0xE06C, 0xE06D, 0xE06E, 0xE06F, 0xE070, 0xE071, 0xE072, /* 0x00 */
0xE073, 0xE074, 0xE075, 0xE076, 0xE077, 0xE078, 0xE079, 0xE07A, /* 0x10 */
0xE07B, 0xB1C9, 0xE07C, 0xE07D, 0xE07E, 0xE080, 0xDBB4, 0xE081, /* 0x10 */
0xE082, 0xE083, 0xDBB3, 0xDBB5, 0xE084, 0xE085, 0xE086, 0xE087, /* 0x20 */
0xE088, 0xE089, 0xE08A, 0xE08B, 0xE08C, 0xE08D, 0xE08E, 0xDBB7, /* 0x20 */
0xE08F, 0xDBB6, 0xE090, 0xE091, 0xE092, 0xE093, 0xE094, 0xE095, /* 0x30 */
0xE096, 0xDBB8, 0xE097, 0xE098, 0xE099, 0xE09A, 0xE09B, 0xE09C, /* 0x30 */
0xE09D, 0xE09E, 0xE09F, 0xDBB9, 0xE0A0, 0xE140, 0xDBBA, 0xE141, /* 0x40 */
0xE142, 0xD3CF, 0xF4FA, 0xC7F5, 0xD7C3, 0xC5E4, 0xF4FC, 0xF4FD, /* 0x40 */
0xF4FB, 0xE143, 0xBEC6, 0xE144, 0xE145, 0xE146, 0xE147, 0xD0EF, /* 0x50 */
0xE148, 0xE149, 0xB7D3, 0xE14A, 0xE14B, 0xD4CD, 0xCCAA, 0xE14C, /* 0x50 */
0xE14D, 0xF5A2, 0xF5A1, 0xBAA8, 0xF4FE, 0xCBD6, 0xE14E, 0xE14F, /* 0x60 */
0xE150, 0xF5A4, 0xC0D2, 0xE151, 0xB3EA, 0xE152, 0xCDAA, 0xF5A5, /* 0x60 */
0xF5A3, 0xBDB4, 0xF5A8, 0xE153, 0xF5A9, 0xBDCD, 0xC3B8, 0xBFE1, /* 0x70 */
0xCBE1, 0xF5AA, 0xE154, 0xE155, 0xE156, 0xF5A6, 0xF5A7, 0xC4F0, /* 0x70 */
0xE157, 0xE158, 0xE159, 0xE15A, 0xE15B, 0xF5AC, 0xE15C, 0xB4BC, /* 0x80 */
0xE15D, 0xD7ED, 0xE15E, 0xB4D7, 0xF5AB, 0xF5AE, 0xE15F, 0xE160, /* 0x80 */
0xF5AD, 0xF5AF, 0xD0D1, 0xE161, 0xE162, 0xE163, 0xE164, 0xE165, /* 0x90 */
0xE166, 0xE167, 0xC3D1, 0xC8A9, 0xE168, 0xE169, 0xE16A, 0xE16B, /* 0x90 */
0xE16C, 0xE16D, 0xF5B0, 0xF5B1, 0xE16E, 0xE16F, 0xE170, 0xE171, /* 0xA0 */
0xE172, 0xE173, 0xF5B2, 0xE174, 0xE175, 0xF5B3, 0xF5B4, 0xF5B5, /* 0xA0 */
0xE176, 0xE177, 0xE178, 0xE179, 0xF5B7, 0xF5B6, 0xE17A, 0xE17B, /* 0xB0 */
0xE17C, 0xE17D, 0xF5B8, 0xE17E, 0xE180, 0xE181, 0xE182, 0xE183, /* 0xB0 */
0xE184, 0xE185, 0xE186, 0xE187, 0xE188, 0xE189, 0xE18A, 0xB2C9, /* 0xC0 */
0xE18B, 0xD3D4, 0xCACD, 0xE18C, 0xC0EF, 0xD6D8, 0xD2B0, 0xC1BF, /* 0xC0 */
0xE18D, 0xBDF0, 0xE18E, 0xE18F, 0xE190, 0xE191, 0xE192, 0xE193, /* 0xD0 */
0xE194, 0xE195, 0xE196, 0xE197, 0xB8AA, 0xE198, 0xE199, 0xE19A, /* 0xD0 */
0xE19B, 0xE19C, 0xE19D, 0xE19E, 0xE19F, 0xE1A0, 0xE240, 0xE241, /* 0xE0 */
0xE242, 0xE243, 0xE244, 0xE245, 0xE246, 0xE247, 0xE248, 0xE249, /* 0xE0 */
0xE24A, 0xE24B, 0xE24C, 0xE24D, 0xE24E, 0xE24F, 0xE250, 0xE251, /* 0xF0 */
0xE252, 0xE253, 0xE254, 0xE255, 0xE256, 0xE257, 0xE258, 0xE259 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_92[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE25A, 0xE25B, 0xE25C, 0xE25D, 0xE25E, 0xE25F, 0xE260, 0xE261, /* 0x00 */
0xE262, 0xE263, 0xE264, 0xE265, 0xE266, 0xE267, 0xE268, 0xE269, /* 0x00 */
0xE26A, 0xE26B, 0xE26C, 0xE26D, 0xE26E, 0xE26F, 0xE270, 0xE271, /* 0x10 */
0xE272, 0xE273, 0xE274, 0xE275, 0xE276, 0xE277, 0xE278, 0xE279, /* 0x10 */
0xE27A, 0xE27B, 0xE27C, 0xE27D, 0xE27E, 0xE280, 0xE281, 0xE282, /* 0x20 */
0xE283, 0xE284, 0xE285, 0xE286, 0xE287, 0xE288, 0xE289, 0xE28A, /* 0x20 */
0xE28B, 0xE28C, 0xE28D, 0xE28E, 0xE28F, 0xE290, 0xE291, 0xE292, /* 0x30 */
0xE293, 0xE294, 0xE295, 0xE296, 0xE297, 0xE298, 0xE299, 0xE29A, /* 0x30 */
0xE29B, 0xE29C, 0xE29D, 0xE29E, 0xE29F, 0xE2A0, 0xE340, 0xE341, /* 0x40 */
0xE342, 0xE343, 0xE344, 0xE345, 0xE346, 0xE347, 0xE348, 0xE349, /* 0x40 */
0xE34A, 0xE34B, 0xE34C, 0xE34D, 0xE34E, 0xE34F, 0xE350, 0xE351, /* 0x50 */
0xE352, 0xE353, 0xE354, 0xE355, 0xE356, 0xE357, 0xE358, 0xE359, /* 0x50 */
0xE35A, 0xE35B, 0xE35C, 0xE35D, 0xE35E, 0xE35F, 0xE360, 0xE361, /* 0x60 */
0xE362, 0xE363, 0xE364, 0xE365, 0xE366, 0xE367, 0xE368, 0xE369, /* 0x60 */
0xE36A, 0xE36B, 0xE36C, 0xE36D, 0xBCF8, 0xE36E, 0xE36F, 0xE370, /* 0x70 */
0xE371, 0xE372, 0xE373, 0xE374, 0xE375, 0xE376, 0xE377, 0xE378, /* 0x70 */
0xE379, 0xE37A, 0xE37B, 0xE37C, 0xE37D, 0xE37E, 0xE380, 0xE381, /* 0x80 */
0xE382, 0xE383, 0xE384, 0xE385, 0xE386, 0xE387, 0xF6C6, 0xE388, /* 0x80 */
0xE389, 0xE38A, 0xE38B, 0xE38C, 0xE38D, 0xE38E, 0xE38F, 0xE390, /* 0x90 */
0xE391, 0xE392, 0xE393, 0xE394, 0xE395, 0xE396, 0xE397, 0xE398, /* 0x90 */
0xE399, 0xE39A, 0xE39B, 0xE39C, 0xE39D, 0xE39E, 0xE39F, 0xE3A0, /* 0xA0 */
0xE440, 0xE441, 0xE442, 0xE443, 0xE444, 0xE445, 0xF6C7, 0xE446, /* 0xA0 */
0xE447, 0xE448, 0xE449, 0xE44A, 0xE44B, 0xE44C, 0xE44D, 0xE44E, /* 0xB0 */
0xE44F, 0xE450, 0xE451, 0xE452, 0xE453, 0xE454, 0xE455, 0xE456, /* 0xB0 */
0xE457, 0xE458, 0xE459, 0xE45A, 0xE45B, 0xE45C, 0xE45D, 0xE45E, /* 0xC0 */
0xF6C8, 0xE45F, 0xE460, 0xE461, 0xE462, 0xE463, 0xE464, 0xE465, /* 0xC0 */
0xE466, 0xE467, 0xE468, 0xE469, 0xE46A, 0xE46B, 0xE46C, 0xE46D, /* 0xD0 */
0xE46E, 0xE46F, 0xE470, 0xE471, 0xE472, 0xE473, 0xE474, 0xE475, /* 0xD0 */
0xE476, 0xE477, 0xE478, 0xE479, 0xE47A, 0xE47B, 0xE47C, 0xE47D, /* 0xE0 */
0xE47E, 0xE480, 0xE481, 0xE482, 0xE483, 0xE484, 0xE485, 0xE486, /* 0xE0 */
0xE487, 0xE488, 0xE489, 0xE48A, 0xE48B, 0xE48C, 0xE48D, 0xE48E, /* 0xF0 */
0xE48F, 0xE490, 0xE491, 0xE492, 0xE493, 0xE494, 0xE495, 0xE496 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_93[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE497, 0xE498, 0xE499, 0xE49A, 0xE49B, 0xE49C, 0xE49D, 0xE49E, /* 0x00 */
0xE49F, 0xE4A0, 0xE540, 0xE541, 0xE542, 0xE543, 0xE544, 0xE545, /* 0x00 */
0xE546, 0xE547, 0xE548, 0xE549, 0xE54A, 0xE54B, 0xE54C, 0xE54D, /* 0x10 */
0xE54E, 0xE54F, 0xE550, 0xE551, 0xE552, 0xE553, 0xE554, 0xE555, /* 0x10 */
0xE556, 0xE557, 0xE558, 0xE559, 0xE55A, 0xE55B, 0xE55C, 0xE55D, /* 0x20 */
0xE55E, 0xE55F, 0xE560, 0xE561, 0xE562, 0xE563, 0xE564, 0xE565, /* 0x20 */
0xE566, 0xE567, 0xE568, 0xE569, 0xE56A, 0xE56B, 0xE56C, 0xE56D, /* 0x30 */
0xE56E, 0xE56F, 0xE570, 0xE571, 0xE572, 0xE573, 0xF6C9, 0xE574, /* 0x30 */
0xE575, 0xE576, 0xE577, 0xE578, 0xE579, 0xE57A, 0xE57B, 0xE57C, /* 0x40 */
0xE57D, 0xE57E, 0xE580, 0xE581, 0xE582, 0xE583, 0xE584, 0xE585, /* 0x40 */
0xE586, 0xE587, 0xE588, 0xE589, 0xE58A, 0xE58B, 0xE58C, 0xE58D, /* 0x50 */
0xE58E, 0xE58F, 0xE590, 0xE591, 0xE592, 0xE593, 0xE594, 0xE595, /* 0x50 */
0xE596, 0xE597, 0xE598, 0xE599, 0xE59A, 0xE59B, 0xE59C, 0xE59D, /* 0x60 */
0xE59E, 0xE59F, 0xF6CA, 0xE5A0, 0xE640, 0xE641, 0xE642, 0xE643, /* 0x60 */
0xE644, 0xE645, 0xE646, 0xE647, 0xE648, 0xE649, 0xE64A, 0xE64B, /* 0x70 */
0xE64C, 0xE64D, 0xE64E, 0xE64F, 0xE650, 0xE651, 0xE652, 0xE653, /* 0x70 */
0xE654, 0xE655, 0xE656, 0xE657, 0xE658, 0xE659, 0xE65A, 0xE65B, /* 0x80 */
0xE65C, 0xE65D, 0xE65E, 0xE65F, 0xE660, 0xE661, 0xE662, 0xF6CC, /* 0x80 */
0xE663, 0xE664, 0xE665, 0xE666, 0xE667, 0xE668, 0xE669, 0xE66A, /* 0x90 */
0xE66B, 0xE66C, 0xE66D, 0xE66E, 0xE66F, 0xE670, 0xE671, 0xE672, /* 0x90 */
0xE673, 0xE674, 0xE675, 0xE676, 0xE677, 0xE678, 0xE679, 0xE67A, /* 0xA0 */
0xE67B, 0xE67C, 0xE67D, 0xE67E, 0xE680, 0xE681, 0xE682, 0xE683, /* 0xA0 */
0xE684, 0xE685, 0xE686, 0xE687, 0xE688, 0xE689, 0xE68A, 0xE68B, /* 0xB0 */
0xE68C, 0xE68D, 0xE68E, 0xE68F, 0xE690, 0xE691, 0xE692, 0xE693, /* 0xB0 */
0xE694, 0xE695, 0xE696, 0xE697, 0xE698, 0xE699, 0xE69A, 0xE69B, /* 0xC0 */
0xE69C, 0xE69D, 0xF6CB, 0xE69E, 0xE69F, 0xE6A0, 0xE740, 0xE741, /* 0xC0 */
0xE742, 0xE743, 0xE744, 0xE745, 0xE746, 0xE747, 0xF7E9, 0xE748, /* 0xD0 */
0xE749, 0xE74A, 0xE74B, 0xE74C, 0xE74D, 0xE74E, 0xE74F, 0xE750, /* 0xD0 */
0xE751, 0xE752, 0xE753, 0xE754, 0xE755, 0xE756, 0xE757, 0xE758, /* 0xE0 */
0xE759, 0xE75A, 0xE75B, 0xE75C, 0xE75D, 0xE75E, 0xE75F, 0xE760, /* 0xE0 */
0xE761, 0xE762, 0xE763, 0xE764, 0xE765, 0xE766, 0xE767, 0xE768, /* 0xF0 */
0xE769, 0xE76A, 0xE76B, 0xE76C, 0xE76D, 0xE76E, 0xE76F, 0xE770 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_94[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xE771, 0xE772, 0xE773, 0xE774, 0xE775, 0xE776, 0xE777, 0xE778, /* 0x00 */
0xE779, 0xE77A, 0xE77B, 0xE77C, 0xE77D, 0xE77E, 0xE780, 0xE781, /* 0x00 */
0xE782, 0xE783, 0xE784, 0xE785, 0xE786, 0xE787, 0xE788, 0xE789, /* 0x10 */
0xE78A, 0xE78B, 0xE78C, 0xE78D, 0xE78E, 0xE78F, 0xE790, 0xE791, /* 0x10 */
0xE792, 0xE793, 0xE794, 0xE795, 0xE796, 0xE797, 0xE798, 0xE799, /* 0x20 */
0xE79A, 0xE79B, 0xE79C, 0xE79D, 0xE79E, 0xE79F, 0xE7A0, 0xE840, /* 0x20 */
0xE841, 0xE842, 0xE843, 0xE844, 0xE845, 0xE846, 0xE847, 0xE848, /* 0x30 */
0xE849, 0xE84A, 0xE84B, 0xE84C, 0xE84D, 0xE84E, 0xF6CD, 0xE84F, /* 0x30 */
0xE850, 0xE851, 0xE852, 0xE853, 0xE854, 0xE855, 0xE856, 0xE857, /* 0x40 */
0xE858, 0xE859, 0xE85A, 0xE85B, 0xE85C, 0xE85D, 0xE85E, 0xE85F, /* 0x40 */
0xE860, 0xE861, 0xE862, 0xE863, 0xE864, 0xE865, 0xE866, 0xE867, /* 0x50 */
0xE868, 0xE869, 0xE86A, 0xE86B, 0xE86C, 0xE86D, 0xE86E, 0xE86F, /* 0x50 */
0xE870, 0xE871, 0xE872, 0xE873, 0xE874, 0xE875, 0xE876, 0xE877, /* 0x60 */
0xE878, 0xE879, 0xE87A, 0xF6CE, 0xE87B, 0xE87C, 0xE87D, 0xE87E, /* 0x60 */
0xE880, 0xE881, 0xE882, 0xE883, 0xE884, 0xE885, 0xE886, 0xE887, /* 0x70 */
0xE888, 0xE889, 0xE88A, 0xE88B, 0xE88C, 0xE88D, 0xE88E, 0xE88F, /* 0x70 */
0xE890, 0xE891, 0xE892, 0xE893, 0xE894, 0xEEC4, 0xEEC5, 0xEEC6, /* 0x80 */
0xD5EB, 0xB6A4, 0xEEC8, 0xEEC7, 0xEEC9, 0xEECA, 0xC7A5, 0xEECB, /* 0x80 */
0xEECC, 0xE895, 0xB7B0, 0xB5F6, 0xEECD, 0xEECF, 0xE896, 0xEECE, /* 0x90 */
0xE897, 0xB8C6, 0xEED0, 0xEED1, 0xEED2, 0xB6DB, 0xB3AE, 0xD6D3, /* 0x90 */
0xC4C6, 0xB1B5, 0xB8D6, 0xEED3, 0xEED4, 0xD4BF, 0xC7D5, 0xBEFB, /* 0xA0 */
0xCED9, 0xB9B3, 0xEED6, 0xEED5, 0xEED8, 0xEED7, 0xC5A5, 0xEED9, /* 0xA0 */
0xEEDA, 0xC7AE, 0xEEDB, 0xC7AF, 0xEEDC, 0xB2A7, 0xEEDD, 0xEEDE, /* 0xB0 */
0xEEDF, 0xEEE0, 0xEEE1, 0xD7EA, 0xEEE2, 0xEEE3, 0xBCD8, 0xEEE4, /* 0xB0 */
0xD3CB, 0xCCFA, 0xB2AC, 0xC1E5, 0xEEE5, 0xC7A6, 0xC3AD, 0xE898, /* 0xC0 */
0xEEE6, 0xEEE7, 0xEEE8, 0xEEE9, 0xEEEA, 0xEEEB, 0xEEEC, 0xE899, /* 0xC0 */
0xEEED, 0xEEEE, 0xEEEF, 0xE89A, 0xE89B, 0xEEF0, 0xEEF1, 0xEEF2, /* 0xD0 */
0xEEF4, 0xEEF3, 0xE89C, 0xEEF5, 0xCDAD, 0xC2C1, 0xEEF6, 0xEEF7, /* 0xD0 */
0xEEF8, 0xD5A1, 0xEEF9, 0xCFB3, 0xEEFA, 0xEEFB, 0xE89D, 0xEEFC, /* 0xE0 */
0xEEFD, 0xEFA1, 0xEEFE, 0xEFA2, 0xB8F5, 0xC3FA, 0xEFA3, 0xEFA4, /* 0xE0 */
0xBDC2, 0xD2BF, 0xB2F9, 0xEFA5, 0xEFA6, 0xEFA7, 0xD2F8, 0xEFA8, /* 0xF0 */
0xD6FD, 0xEFA9, 0xC6CC, 0xE89E, 0xEFAA, 0xEFAB, 0xC1B4, 0xEFAC /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_95[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xCFFA, 0xCBF8, 0xEFAE, 0xEFAD, 0xB3FA, 0xB9F8, 0xEFAF, 0xEFB0, /* 0x00 */
0xD0E2, 0xEFB1, 0xEFB2, 0xB7E6, 0xD0BF, 0xEFB3, 0xEFB4, 0xEFB5, /* 0x00 */
0xC8F1, 0xCCE0, 0xEFB6, 0xEFB7, 0xEFB8, 0xEFB9, 0xEFBA, 0xD5E0, /* 0x10 */
0xEFBB, 0xB4ED, 0xC3AA, 0xEFBC, 0xE89F, 0xEFBD, 0xEFBE, 0xEFBF, /* 0x10 */
0xE8A0, 0xCEFD, 0xEFC0, 0xC2E0, 0xB4B8, 0xD7B6, 0xBDF5, 0xE940, /* 0x20 */
0xCFC7, 0xEFC3, 0xEFC1, 0xEFC2, 0xEFC4, 0xB6A7, 0xBCFC, 0xBEE2, /* 0x20 */
0xC3CC, 0xEFC5, 0xEFC6, 0xE941, 0xEFC7, 0xEFCF, 0xEFC8, 0xEFC9, /* 0x30 */
0xEFCA, 0xC7C2, 0xEFF1, 0xB6CD, 0xEFCB, 0xE942, 0xEFCC, 0xEFCD, /* 0x30 */
0xB6C6, 0xC3BE, 0xEFCE, 0xE943, 0xEFD0, 0xEFD1, 0xEFD2, 0xD5F2, /* 0x40 */
0xE944, 0xEFD3, 0xC4F7, 0xE945, 0xEFD4, 0xC4F8, 0xEFD5, 0xEFD6, /* 0x40 */
0xB8E4, 0xB0F7, 0xEFD7, 0xEFD8, 0xEFD9, 0xE946, 0xEFDA, 0xEFDB, /* 0x50 */
0xEFDC, 0xEFDD, 0xE947, 0xEFDE, 0xBEB5, 0xEFE1, 0xEFDF, 0xEFE0, /* 0x50 */
0xE948, 0xEFE2, 0xEFE3, 0xC1CD, 0xEFE4, 0xEFE5, 0xEFE6, 0xEFE7, /* 0x60 */
0xEFE8, 0xEFE9, 0xEFEA, 0xEFEB, 0xEFEC, 0xC0D8, 0xE949, 0xEFED, /* 0x60 */
0xC1AD, 0xEFEE, 0xEFEF, 0xEFF0, 0xE94A, 0xE94B, 0xCFE2, 0xE94C, /* 0x70 */
0xE94D, 0xE94E, 0xE94F, 0xE950, 0xE951, 0xE952, 0xE953, 0xB3A4, /* 0x70 */
0xE954, 0xE955, 0xE956, 0xE957, 0xE958, 0xE959, 0xE95A, 0xE95B, /* 0x80 */
0xE95C, 0xE95D, 0xE95E, 0xE95F, 0xE960, 0xE961, 0xE962, 0xE963, /* 0x80 */
0xE964, 0xE965, 0xE966, 0xE967, 0xE968, 0xE969, 0xE96A, 0xE96B, /* 0x90 */
0xE96C, 0xE96D, 0xE96E, 0xE96F, 0xE970, 0xE971, 0xE972, 0xE973, /* 0x90 */
0xE974, 0xE975, 0xE976, 0xE977, 0xE978, 0xE979, 0xE97A, 0xE97B, /* 0xA0 */
0xE97C, 0xE97D, 0xE97E, 0xE980, 0xE981, 0xE982, 0xE983, 0xE984, /* 0xA0 */
0xE985, 0xE986, 0xE987, 0xE988, 0xE989, 0xE98A, 0xE98B, 0xE98C, /* 0xB0 */
0xE98D, 0xE98E, 0xE98F, 0xE990, 0xE991, 0xE992, 0xE993, 0xE994, /* 0xB0 */
0xE995, 0xE996, 0xE997, 0xE998, 0xE999, 0xE99A, 0xE99B, 0xE99C, /* 0xC0 */
0xE99D, 0xE99E, 0xE99F, 0xE9A0, 0xEA40, 0xEA41, 0xEA42, 0xEA43, /* 0xC0 */
0xEA44, 0xEA45, 0xEA46, 0xEA47, 0xEA48, 0xEA49, 0xEA4A, 0xEA4B, /* 0xD0 */
0xEA4C, 0xEA4D, 0xEA4E, 0xEA4F, 0xEA50, 0xEA51, 0xEA52, 0xEA53, /* 0xD0 */
0xEA54, 0xEA55, 0xEA56, 0xEA57, 0xEA58, 0xEA59, 0xEA5A, 0xEA5B, /* 0xE0 */
0xC3C5, 0xE3C5, 0xC9C1, 0xE3C6, 0xEA5C, 0xB1D5, 0xCECA, 0xB4B3, /* 0xE0 */
0xC8F2, 0xE3C7, 0xCFD0, 0xE3C8, 0xBCE4, 0xE3C9, 0xE3CA, 0xC3C6, /* 0xF0 */
0xD5A2, 0xC4D6, 0xB9EB, 0xCEC5, 0xE3CB, 0xC3F6, 0xE3CC, 0xEA5D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_96[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xB7A7, 0xB8F3, 0xBAD2, 0xE3CD, 0xE3CE, 0xD4C4, 0xE3CF, 0xEA5E, /* 0x00 */
0xE3D0, 0xD1CB, 0xE3D1, 0xE3D2, 0xE3D3, 0xE3D4, 0xD1D6, 0xE3D5, /* 0x00 */
0xB2FB, 0xC0BB, 0xE3D6, 0xEA5F, 0xC0AB, 0xE3D7, 0xE3D8, 0xE3D9, /* 0x10 */
0xEA60, 0xE3DA, 0xE3DB, 0xEA61, 0xB8B7, 0xDAE2, 0xEA62, 0xB6D3, /* 0x10 */
0xEA63, 0xDAE4, 0xDAE3, 0xEA64, 0xEA65, 0xEA66, 0xEA67, 0xEA68, /* 0x20 */
0xEA69, 0xEA6A, 0xDAE6, 0xEA6B, 0xEA6C, 0xEA6D, 0xC8EE, 0xEA6E, /* 0x20 */
0xEA6F, 0xDAE5, 0xB7C0, 0xD1F4, 0xD2F5, 0xD5F3, 0xBDD7, 0xEA70, /* 0x30 */
0xEA71, 0xEA72, 0xEA73, 0xD7E8, 0xDAE8, 0xDAE7, 0xEA74, 0xB0A2, /* 0x30 */
0xCDD3, 0xEA75, 0xDAE9, 0xEA76, 0xB8BD, 0xBCCA, 0xC2BD, 0xC2A4, /* 0x40 */
0xB3C2, 0xDAEA, 0xEA77, 0xC2AA, 0xC4B0, 0xBDB5, 0xEA78, 0xEA79, /* 0x40 */
0xCFDE, 0xEA7A, 0xEA7B, 0xEA7C, 0xDAEB, 0xC9C2, 0xEA7D, 0xEA7E, /* 0x50 */
0xEA80, 0xEA81, 0xEA82, 0xB1DD, 0xEA83, 0xEA84, 0xEA85, 0xDAEC, /* 0x50 */
0xEA86, 0xB6B8, 0xD4BA, 0xEA87, 0xB3FD, 0xEA88, 0xEA89, 0xDAED, /* 0x60 */
0xD4C9, 0xCFD5, 0xC5E3, 0xEA8A, 0xDAEE, 0xEA8B, 0xEA8C, 0xEA8D, /* 0x60 */
0xEA8E, 0xEA8F, 0xDAEF, 0xEA90, 0xDAF0, 0xC1EA, 0xCCD5, 0xCFDD, /* 0x70 */
0xEA91, 0xEA92, 0xEA93, 0xEA94, 0xEA95, 0xEA96, 0xEA97, 0xEA98, /* 0x70 */
0xEA99, 0xEA9A, 0xEA9B, 0xEA9C, 0xEA9D, 0xD3E7, 0xC2A1, 0xEA9E, /* 0x80 */
0xDAF1, 0xEA9F, 0xEAA0, 0xCBE5, 0xEB40, 0xDAF2, 0xEB41, 0xCBE6, /* 0x80 */
0xD2FE, 0xEB42, 0xEB43, 0xEB44, 0xB8F4, 0xEB45, 0xEB46, 0xDAF3, /* 0x90 */
0xB0AF, 0xCFB6, 0xEB47, 0xEB48, 0xD5CF, 0xEB49, 0xEB4A, 0xEB4B, /* 0x90 */
0xEB4C, 0xEB4D, 0xEB4E, 0xEB4F, 0xEB50, 0xEB51, 0xEB52, 0xCBED, /* 0xA0 */
0xEB53, 0xEB54, 0xEB55, 0xEB56, 0xEB57, 0xEB58, 0xEB59, 0xEB5A, /* 0xA0 */
0xDAF4, 0xEB5B, 0xEB5C, 0xE3C4, 0xEB5D, 0xEB5E, 0xC1A5, 0xEB5F, /* 0xB0 */
0xEB60, 0xF6BF, 0xEB61, 0xEB62, 0xF6C0, 0xF6C1, 0xC4D1, 0xEB63, /* 0xB0 */
0xC8B8, 0xD1E3, 0xEB64, 0xEB65, 0xD0DB, 0xD1C5, 0xBCAF, 0xB9CD, /* 0xC0 */
0xEB66, 0xEFF4, 0xEB67, 0xEB68, 0xB4C6, 0xD3BA, 0xF6C2, 0xB3FB, /* 0xC0 */
0xEB69, 0xEB6A, 0xF6C3, 0xEB6B, 0xEB6C, 0xB5F1, 0xEB6D, 0xEB6E, /* 0xD0 */
0xEB6F, 0xEB70, 0xEB71, 0xEB72, 0xEB73, 0xEB74, 0xEB75, 0xEB76, /* 0xD0 */
0xF6C5, 0xEB77, 0xEB78, 0xEB79, 0xEB7A, 0xEB7B, 0xEB7C, 0xEB7D, /* 0xE0 */
0xD3EA, 0xF6A7, 0xD1A9, 0xEB7E, 0xEB80, 0xEB81, 0xEB82, 0xF6A9, /* 0xE0 */
0xEB83, 0xEB84, 0xEB85, 0xF6A8, 0xEB86, 0xEB87, 0xC1E3, 0xC0D7, /* 0xF0 */
0xEB88, 0xB1A2, 0xEB89, 0xEB8A, 0xEB8B, 0xEB8C, 0xCEED, 0xEB8D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_97[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xD0E8, 0xF6AB, 0xEB8E, 0xEB8F, 0xCFF6, 0xEB90, 0xF6AA, 0xD5F0, /* 0x00 */
0xF6AC, 0xC3B9, 0xEB91, 0xEB92, 0xEB93, 0xBBF4, 0xF6AE, 0xF6AD, /* 0x00 */
0xEB94, 0xEB95, 0xEB96, 0xC4DE, 0xEB97, 0xEB98, 0xC1D8, 0xEB99, /* 0x10 */
0xEB9A, 0xEB9B, 0xEB9C, 0xEB9D, 0xCBAA, 0xEB9E, 0xCFBC, 0xEB9F, /* 0x10 */
0xEBA0, 0xEC40, 0xEC41, 0xEC42, 0xEC43, 0xEC44, 0xEC45, 0xEC46, /* 0x20 */
0xEC47, 0xEC48, 0xF6AF, 0xEC49, 0xEC4A, 0xF6B0, 0xEC4B, 0xEC4C, /* 0x20 */
0xF6B1, 0xEC4D, 0xC2B6, 0xEC4E, 0xEC4F, 0xEC50, 0xEC51, 0xEC52, /* 0x30 */
0xB0D4, 0xC5F9, 0xEC53, 0xEC54, 0xEC55, 0xEC56, 0xF6B2, 0xEC57, /* 0x30 */
0xEC58, 0xEC59, 0xEC5A, 0xEC5B, 0xEC5C, 0xEC5D, 0xEC5E, 0xEC5F, /* 0x40 */
0xEC60, 0xEC61, 0xEC62, 0xEC63, 0xEC64, 0xEC65, 0xEC66, 0xEC67, /* 0x40 */
0xEC68, 0xEC69, 0xC7E0, 0xF6A6, 0xEC6A, 0xEC6B, 0xBEB8, 0xEC6C, /* 0x50 */
0xEC6D, 0xBEB2, 0xEC6E, 0xB5E5, 0xEC6F, 0xEC70, 0xB7C7, 0xEC71, /* 0x50 */
0xBFBF, 0xC3D2, 0xC3E6, 0xEC72, 0xEC73, 0xD8CC, 0xEC74, 0xEC75, /* 0x60 */
0xEC76, 0xB8EF, 0xEC77, 0xEC78, 0xEC79, 0xEC7A, 0xEC7B, 0xEC7C, /* 0x60 */
0xEC7D, 0xEC7E, 0xEC80, 0xBDF9, 0xD1A5, 0xEC81, 0xB0D0, 0xEC82, /* 0x70 */
0xEC83, 0xEC84, 0xEC85, 0xEC86, 0xF7B0, 0xEC87, 0xEC88, 0xEC89, /* 0x70 */
0xEC8A, 0xEC8B, 0xEC8C, 0xEC8D, 0xEC8E, 0xF7B1, 0xEC8F, 0xEC90, /* 0x80 */
0xEC91, 0xEC92, 0xEC93, 0xD0AC, 0xEC94, 0xB0B0, 0xEC95, 0xEC96, /* 0x80 */
0xEC97, 0xF7B2, 0xF7B3, 0xEC98, 0xF7B4, 0xEC99, 0xEC9A, 0xEC9B, /* 0x90 */
0xC7CA, 0xEC9C, 0xEC9D, 0xEC9E, 0xEC9F, 0xECA0, 0xED40, 0xED41, /* 0x90 */
0xBECF, 0xED42, 0xED43, 0xF7B7, 0xED44, 0xED45, 0xED46, 0xED47, /* 0xA0 */
0xED48, 0xED49, 0xED4A, 0xF7B6, 0xED4B, 0xB1DE, 0xED4C, 0xF7B5, /* 0xA0 */
0xED4D, 0xED4E, 0xF7B8, 0xED4F, 0xF7B9, 0xED50, 0xED51, 0xED52, /* 0xB0 */
0xED53, 0xED54, 0xED55, 0xED56, 0xED57, 0xED58, 0xED59, 0xED5A, /* 0xB0 */
0xED5B, 0xED5C, 0xED5D, 0xED5E, 0xED5F, 0xED60, 0xED61, 0xED62, /* 0xC0 */
0xED63, 0xED64, 0xED65, 0xED66, 0xED67, 0xED68, 0xED69, 0xED6A, /* 0xC0 */
0xED6B, 0xED6C, 0xED6D, 0xED6E, 0xED6F, 0xED70, 0xED71, 0xED72, /* 0xD0 */
0xED73, 0xED74, 0xED75, 0xED76, 0xED77, 0xED78, 0xED79, 0xED7A, /* 0xD0 */
0xED7B, 0xED7C, 0xED7D, 0xED7E, 0xED80, 0xED81, 0xCEA4, 0xC8CD, /* 0xE0 */
0xED82, 0xBAAB, 0xE8B8, 0xE8B9, 0xE8BA, 0xBEC2, 0xED83, 0xED84, /* 0xE0 */
0xED85, 0xED86, 0xED87, 0xD2F4, 0xED88, 0xD4CF, 0xC9D8, 0xED89, /* 0xF0 */
0xED8A, 0xED8B, 0xED8C, 0xED8D, 0xED8E, 0xED8F, 0xED90, 0xED91 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_98[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xED92, 0xED93, 0xED94, 0xED95, 0xED96, 0xED97, 0xED98, 0xED99, /* 0x00 */
0xED9A, 0xED9B, 0xED9C, 0xED9D, 0xED9E, 0xED9F, 0xEDA0, 0xEE40, /* 0x00 */
0xEE41, 0xEE42, 0xEE43, 0xEE44, 0xEE45, 0xEE46, 0xEE47, 0xEE48, /* 0x10 */
0xEE49, 0xEE4A, 0xEE4B, 0xEE4C, 0xEE4D, 0xEE4E, 0xEE4F, 0xEE50, /* 0x10 */
0xEE51, 0xEE52, 0xEE53, 0xEE54, 0xEE55, 0xEE56, 0xEE57, 0xEE58, /* 0x20 */
0xEE59, 0xEE5A, 0xEE5B, 0xEE5C, 0xEE5D, 0xEE5E, 0xEE5F, 0xEE60, /* 0x20 */
0xEE61, 0xEE62, 0xEE63, 0xEE64, 0xEE65, 0xEE66, 0xEE67, 0xEE68, /* 0x30 */
0xEE69, 0xEE6A, 0xEE6B, 0xEE6C, 0xEE6D, 0xEE6E, 0xEE6F, 0xEE70, /* 0x30 */
0xEE71, 0xEE72, 0xEE73, 0xEE74, 0xEE75, 0xEE76, 0xEE77, 0xEE78, /* 0x40 */
0xEE79, 0xEE7A, 0xEE7B, 0xEE7C, 0xEE7D, 0xEE7E, 0xEE80, 0xEE81, /* 0x40 */
0xEE82, 0xEE83, 0xEE84, 0xEE85, 0xEE86, 0xEE87, 0xEE88, 0xEE89, /* 0x50 */
0xEE8A, 0xEE8B, 0xEE8C, 0xEE8D, 0xEE8E, 0xEE8F, 0xEE90, 0xEE91, /* 0x50 */
0xEE92, 0xEE93, 0xEE94, 0xEE95, 0xEE96, 0xEE97, 0xEE98, 0xEE99, /* 0x60 */
0xEE9A, 0xEE9B, 0xEE9C, 0xEE9D, 0xEE9E, 0xEE9F, 0xEEA0, 0xEF40, /* 0x60 */
0xEF41, 0xEF42, 0xEF43, 0xEF44, 0xEF45, 0xD2B3, 0xB6A5, 0xC7EA, /* 0x70 */
0xF1FC, 0xCFEE, 0xCBB3, 0xD0EB, 0xE7EF, 0xCDE7, 0xB9CB, 0xB6D9, /* 0x70 */
0xF1FD, 0xB0E4, 0xCBCC, 0xF1FE, 0xD4A4, 0xC2AD, 0xC1EC, 0xC6C4, /* 0x80 */
0xBEB1, 0xF2A1, 0xBCD5, 0xEF46, 0xF2A2, 0xF2A3, 0xEF47, 0xF2A4, /* 0x80 */
0xD2C3, 0xC6B5, 0xEF48, 0xCDC7, 0xF2A5, 0xEF49, 0xD3B1, 0xBFC5, /* 0x90 */
0xCCE2, 0xEF4A, 0xF2A6, 0xF2A7, 0xD1D5, 0xB6EE, 0xF2A8, 0xF2A9, /* 0x90 */
0xB5DF, 0xF2AA, 0xF2AB, 0xEF4B, 0xB2FC, 0xF2AC, 0xF2AD, 0xC8A7, /* 0xA0 */
0xEF4C, 0xEF4D, 0xEF4E, 0xEF4F, 0xEF50, 0xEF51, 0xEF52, 0xEF53, /* 0xA0 */
0xEF54, 0xEF55, 0xEF56, 0xEF57, 0xEF58, 0xEF59, 0xEF5A, 0xEF5B, /* 0xB0 */
0xEF5C, 0xEF5D, 0xEF5E, 0xEF5F, 0xEF60, 0xEF61, 0xEF62, 0xEF63, /* 0xB0 */
0xEF64, 0xEF65, 0xEF66, 0xEF67, 0xEF68, 0xEF69, 0xEF6A, 0xEF6B, /* 0xC0 */
0xEF6C, 0xEF6D, 0xEF6E, 0xEF6F, 0xEF70, 0xEF71, 0xB7E7, 0xEF72, /* 0xC0 */
0xEF73, 0xECA9, 0xECAA, 0xECAB, 0xEF74, 0xECAC, 0xEF75, 0xEF76, /* 0xD0 */
0xC6AE, 0xECAD, 0xECAE, 0xEF77, 0xEF78, 0xEF79, 0xB7C9, 0xCAB3, /* 0xD0 */
0xEF7A, 0xEF7B, 0xEF7C, 0xEF7D, 0xEF7E, 0xEF80, 0xEF81, 0xE2B8, /* 0xE0 */
0xF7CF, 0xEF82, 0xEF83, 0xEF84, 0xEF85, 0xEF86, 0xEF87, 0xEF88, /* 0xE0 */
0xEF89, 0xEF8A, 0xEF8B, 0xEF8C, 0xEF8D, 0xEF8E, 0xEF8F, 0xEF90, /* 0xF0 */
0xEF91, 0xEF92, 0xEF93, 0xEF94, 0xEF95, 0xEF96, 0xEF97, 0xEF98 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_99[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xEF99, 0xEF9A, 0xEF9B, 0xEF9C, 0xEF9D, 0xEF9E, 0xEF9F, 0xEFA0, /* 0x00 */
0xF040, 0xF041, 0xF042, 0xF043, 0xF044, 0xF7D0, 0xF045, 0xF046, /* 0x00 */
0xB2CD, 0xF047, 0xF048, 0xF049, 0xF04A, 0xF04B, 0xF04C, 0xF04D, /* 0x10 */
0xF04E, 0xF04F, 0xF050, 0xF051, 0xF052, 0xF053, 0xF054, 0xF055, /* 0x10 */
0xF056, 0xF057, 0xF058, 0xF059, 0xF05A, 0xF05B, 0xF05C, 0xF05D, /* 0x20 */
0xF05E, 0xF05F, 0xF060, 0xF061, 0xF062, 0xF063, 0xF7D1, 0xF064, /* 0x20 */
0xF065, 0xF066, 0xF067, 0xF068, 0xF069, 0xF06A, 0xF06B, 0xF06C, /* 0x30 */
0xF06D, 0xF06E, 0xF06F, 0xF070, 0xF071, 0xF072, 0xF073, 0xF074, /* 0x30 */
0xF075, 0xF076, 0xF077, 0xF078, 0xF079, 0xF07A, 0xF07B, 0xF07C, /* 0x40 */
0xF07D, 0xF07E, 0xF080, 0xF081, 0xF082, 0xF083, 0xF084, 0xF085, /* 0x40 */
0xF086, 0xF087, 0xF088, 0xF089, 0xF7D3, 0xF7D2, 0xF08A, 0xF08B, /* 0x50 */
0xF08C, 0xF08D, 0xF08E, 0xF08F, 0xF090, 0xF091, 0xF092, 0xF093, /* 0x50 */
0xF094, 0xF095, 0xF096, 0xE2BB, 0xF097, 0xBCA2, 0xF098, 0xE2BC, /* 0x60 */
0xE2BD, 0xE2BE, 0xE2BF, 0xE2C0, 0xE2C1, 0xB7B9, 0xD2FB, 0xBDA4, /* 0x60 */
0xCACE, 0xB1A5, 0xCBC7, 0xF099, 0xE2C2, 0xB6FC, 0xC8C4, 0xE2C3, /* 0x70 */
0xF09A, 0xF09B, 0xBDC8, 0xF09C, 0xB1FD, 0xE2C4, 0xF09D, 0xB6F6, /* 0x70 */
0xE2C5, 0xC4D9, 0xF09E, 0xF09F, 0xE2C6, 0xCFDA, 0xB9DD, 0xE2C7, /* 0x80 */
0xC0A1, 0xF0A0, 0xE2C8, 0xB2F6, 0xF140, 0xE2C9, 0xF141, 0xC1F3, /* 0x80 */
0xE2CA, 0xE2CB, 0xC2F8, 0xE2CC, 0xE2CD, 0xE2CE, 0xCAD7, 0xD8B8, /* 0x90 */
0xD9E5, 0xCFE3, 0xF142, 0xF143, 0xF144, 0xF145, 0xF146, 0xF147, /* 0x90 */
0xF148, 0xF149, 0xF14A, 0xF14B, 0xF14C, 0xF0A5, 0xF14D, 0xF14E, /* 0xA0 */
0xDCB0, 0xF14F, 0xF150, 0xF151, 0xF152, 0xF153, 0xF154, 0xF155, /* 0xA0 */
0xF156, 0xF157, 0xF158, 0xF159, 0xF15A, 0xF15B, 0xF15C, 0xF15D, /* 0xB0 */
0xF15E, 0xF15F, 0xF160, 0xF161, 0xF162, 0xF163, 0xF164, 0xF165, /* 0xB0 */
0xF166, 0xF167, 0xF168, 0xF169, 0xF16A, 0xF16B, 0xF16C, 0xF16D, /* 0xC0 */
0xF16E, 0xF16F, 0xF170, 0xF171, 0xF172, 0xF173, 0xF174, 0xF175, /* 0xC0 */
0xF176, 0xF177, 0xF178, 0xF179, 0xF17A, 0xF17B, 0xF17C, 0xF17D, /* 0xD0 */
0xF17E, 0xF180, 0xF181, 0xF182, 0xF183, 0xF184, 0xF185, 0xF186, /* 0xD0 */
0xF187, 0xF188, 0xF189, 0xF18A, 0xF18B, 0xF18C, 0xF18D, 0xF18E, /* 0xE0 */
0xF18F, 0xF190, 0xF191, 0xF192, 0xF193, 0xF194, 0xF195, 0xF196, /* 0xE0 */
0xF197, 0xF198, 0xF199, 0xF19A, 0xF19B, 0xF19C, 0xF19D, 0xF19E, /* 0xF0 */
0xF19F, 0xF1A0, 0xF240, 0xF241, 0xF242, 0xF243, 0xF244, 0xF245 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_9A[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xF246, 0xF247, 0xF248, 0xF249, 0xF24A, 0xF24B, 0xF24C, 0xF24D, /* 0x00 */
0xF24E, 0xF24F, 0xF250, 0xF251, 0xF252, 0xF253, 0xF254, 0xF255, /* 0x00 */
0xF256, 0xF257, 0xF258, 0xF259, 0xF25A, 0xF25B, 0xF25C, 0xF25D, /* 0x10 */
0xF25E, 0xF25F, 0xF260, 0xF261, 0xF262, 0xF263, 0xF264, 0xF265, /* 0x10 */
0xF266, 0xF267, 0xF268, 0xF269, 0xF26A, 0xF26B, 0xF26C, 0xF26D, /* 0x20 */
0xF26E, 0xF26F, 0xF270, 0xF271, 0xF272, 0xF273, 0xF274, 0xF275, /* 0x20 */
0xF276, 0xF277, 0xF278, 0xF279, 0xF27A, 0xF27B, 0xF27C, 0xF27D, /* 0x30 */
0xF27E, 0xF280, 0xF281, 0xF282, 0xF283, 0xF284, 0xF285, 0xF286, /* 0x30 */
0xF287, 0xF288, 0xF289, 0xF28A, 0xF28B, 0xF28C, 0xF28D, 0xF28E, /* 0x40 */
0xF28F, 0xF290, 0xF291, 0xF292, 0xF293, 0xF294, 0xF295, 0xF296, /* 0x40 */
0xF297, 0xF298, 0xF299, 0xF29A, 0xF29B, 0xF29C, 0xF29D, 0xF29E, /* 0x50 */
0xF29F, 0xF2A0, 0xF340, 0xF341, 0xF342, 0xF343, 0xF344, 0xF345, /* 0x50 */
0xF346, 0xF347, 0xF348, 0xF349, 0xF34A, 0xF34B, 0xF34C, 0xF34D, /* 0x60 */
0xF34E, 0xF34F, 0xF350, 0xF351, 0xC2ED, 0xD4A6, 0xCDD4, 0xD1B1, /* 0x60 */
0xB3DB, 0xC7FD, 0xF352, 0xB2B5, 0xC2BF, 0xE6E0, 0xCABB, 0xE6E1, /* 0x70 */
0xE6E2, 0xBED4, 0xE6E3, 0xD7A4, 0xCDD5, 0xE6E5, 0xBCDD, 0xE6E4, /* 0x70 */
0xE6E6, 0xE6E7, 0xC2EE, 0xF353, 0xBDBE, 0xE6E8, 0xC2E6, 0xBAA7, /* 0x80 */
0xE6E9, 0xF354, 0xE6EA, 0xB3D2, 0xD1E9, 0xF355, 0xF356, 0xBFA5, /* 0x80 */
0xE6EB, 0xC6EF, 0xE6EC, 0xE6ED, 0xF357, 0xF358, 0xE6EE, 0xC6AD, /* 0x90 */
0xE6EF, 0xF359, 0xC9A7, 0xE6F0, 0xE6F1, 0xE6F2, 0xE5B9, 0xE6F3, /* 0x90 */
0xE6F4, 0xC2E2, 0xE6F5, 0xE6F6, 0xD6E8, 0xE6F7, 0xF35A, 0xE6F8, /* 0xA0 */
0xB9C7, 0xF35B, 0xF35C, 0xF35D, 0xF35E, 0xF35F, 0xF360, 0xF361, /* 0xA0 */
0xF7BB, 0xF7BA, 0xF362, 0xF363, 0xF364, 0xF365, 0xF7BE, 0xF7BC, /* 0xB0 */
0xBAA1, 0xF366, 0xF7BF, 0xF367, 0xF7C0, 0xF368, 0xF369, 0xF36A, /* 0xB0 */
0xF7C2, 0xF7C1, 0xF7C4, 0xF36B, 0xF36C, 0xF7C3, 0xF36D, 0xF36E, /* 0xC0 */
0xF36F, 0xF370, 0xF371, 0xF7C5, 0xF7C6, 0xF372, 0xF373, 0xF374, /* 0xC0 */
0xF375, 0xF7C7, 0xF376, 0xCBE8, 0xF377, 0xF378, 0xF379, 0xF37A, /* 0xD0 */
0xB8DF, 0xF37B, 0xF37C, 0xF37D, 0xF37E, 0xF380, 0xF381, 0xF7D4, /* 0xD0 */
0xF382, 0xF7D5, 0xF383, 0xF384, 0xF385, 0xF386, 0xF7D6, 0xF387, /* 0xE0 */
0xF388, 0xF389, 0xF38A, 0xF7D8, 0xF38B, 0xF7DA, 0xF38C, 0xF7D7, /* 0xE0 */
0xF38D, 0xF38E, 0xF38F, 0xF390, 0xF391, 0xF392, 0xF393, 0xF394, /* 0xF0 */
0xF395, 0xF7DB, 0xF396, 0xF7D9, 0xF397, 0xF398, 0xF399, 0xF39A /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_9B[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xF39B, 0xF39C, 0xF39D, 0xD7D7, 0xF39E, 0xF39F, 0xF3A0, 0xF440, /* 0x00 */
0xF7DC, 0xF441, 0xF442, 0xF443, 0xF444, 0xF445, 0xF446, 0xF7DD, /* 0x00 */
0xF447, 0xF448, 0xF449, 0xF7DE, 0xF44A, 0xF44B, 0xF44C, 0xF44D, /* 0x10 */
0xF44E, 0xF44F, 0xF450, 0xF451, 0xF452, 0xF453, 0xF454, 0xF7DF, /* 0x10 */
0xF455, 0xF456, 0xF457, 0xF7E0, 0xF458, 0xF459, 0xF45A, 0xF45B, /* 0x20 */
0xF45C, 0xF45D, 0xF45E, 0xF45F, 0xF460, 0xF461, 0xF462, 0xDBCB, /* 0x20 */
0xF463, 0xF464, 0xD8AA, 0xF465, 0xF466, 0xF467, 0xF468, 0xF469, /* 0x30 */
0xF46A, 0xF46B, 0xF46C, 0xE5F7, 0xB9ED, 0xF46D, 0xF46E, 0xF46F, /* 0x30 */
0xF470, 0xBFFD, 0xBBEA, 0xF7C9, 0xC6C7, 0xF7C8, 0xF471, 0xF7CA, /* 0x40 */
0xF7CC, 0xF7CB, 0xF472, 0xF473, 0xF474, 0xF7CD, 0xF475, 0xCEBA, /* 0x40 */
0xF476, 0xF7CE, 0xF477, 0xF478, 0xC4A7, 0xF479, 0xF47A, 0xF47B, /* 0x50 */
0xF47C, 0xF47D, 0xF47E, 0xF480, 0xF481, 0xF482, 0xF483, 0xF484, /* 0x50 */
0xF485, 0xF486, 0xF487, 0xF488, 0xF489, 0xF48A, 0xF48B, 0xF48C, /* 0x60 */
0xF48D, 0xF48E, 0xF48F, 0xF490, 0xF491, 0xF492, 0xF493, 0xF494, /* 0x60 */
0xF495, 0xF496, 0xF497, 0xF498, 0xF499, 0xF49A, 0xF49B, 0xF49C, /* 0x70 */
0xF49D, 0xF49E, 0xF49F, 0xF4A0, 0xF540, 0xF541, 0xF542, 0xF543, /* 0x70 */
0xF544, 0xF545, 0xF546, 0xF547, 0xF548, 0xF549, 0xF54A, 0xF54B, /* 0x80 */
0xF54C, 0xF54D, 0xF54E, 0xF54F, 0xF550, 0xF551, 0xF552, 0xF553, /* 0x80 */
0xF554, 0xF555, 0xF556, 0xF557, 0xF558, 0xF559, 0xF55A, 0xF55B, /* 0x90 */
0xF55C, 0xF55D, 0xF55E, 0xF55F, 0xF560, 0xF561, 0xF562, 0xF563, /* 0x90 */
0xF564, 0xF565, 0xF566, 0xF567, 0xF568, 0xF569, 0xF56A, 0xF56B, /* 0xA0 */
0xF56C, 0xF56D, 0xF56E, 0xF56F, 0xF570, 0xF571, 0xF572, 0xF573, /* 0xA0 */
0xF574, 0xF575, 0xF576, 0xF577, 0xF578, 0xF579, 0xF57A, 0xF57B, /* 0xB0 */
0xF57C, 0xF57D, 0xF57E, 0xF580, 0xF581, 0xF582, 0xF583, 0xF584, /* 0xB0 */
0xF585, 0xF586, 0xF587, 0xF588, 0xF589, 0xF58A, 0xF58B, 0xF58C, /* 0xC0 */
0xF58D, 0xF58E, 0xF58F, 0xF590, 0xF591, 0xF592, 0xF593, 0xF594, /* 0xC0 */
0xF595, 0xF596, 0xF597, 0xF598, 0xF599, 0xF59A, 0xF59B, 0xF59C, /* 0xD0 */
0xF59D, 0xF59E, 0xF59F, 0xF5A0, 0xF640, 0xF641, 0xF642, 0xF643, /* 0xD0 */
0xF644, 0xF645, 0xF646, 0xF647, 0xF648, 0xF649, 0xF64A, 0xF64B, /* 0xE0 */
0xF64C, 0xF64D, 0xF64E, 0xF64F, 0xF650, 0xF651, 0xF652, 0xF653, /* 0xE0 */
0xF654, 0xF655, 0xF656, 0xF657, 0xF658, 0xF659, 0xF65A, 0xF65B, /* 0xF0 */
0xF65C, 0xF65D, 0xF65E, 0xF65F, 0xF660, 0xF661, 0xF662, 0xF663 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_9C[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xF664, 0xF665, 0xF666, 0xF667, 0xF668, 0xF669, 0xF66A, 0xF66B, /* 0x00 */
0xF66C, 0xF66D, 0xF66E, 0xF66F, 0xF670, 0xF671, 0xF672, 0xF673, /* 0x00 */
0xF674, 0xF675, 0xF676, 0xF677, 0xF678, 0xF679, 0xF67A, 0xF67B, /* 0x10 */
0xF67C, 0xF67D, 0xF67E, 0xF680, 0xF681, 0xF682, 0xF683, 0xF684, /* 0x10 */
0xF685, 0xF686, 0xF687, 0xF688, 0xF689, 0xF68A, 0xF68B, 0xF68C, /* 0x20 */
0xF68D, 0xF68E, 0xF68F, 0xF690, 0xF691, 0xF692, 0xF693, 0xF694, /* 0x20 */
0xF695, 0xF696, 0xF697, 0xF698, 0xF699, 0xF69A, 0xF69B, 0xF69C, /* 0x30 */
0xF69D, 0xF69E, 0xF69F, 0xF6A0, 0xF740, 0xF741, 0xF742, 0xF743, /* 0x30 */
0xF744, 0xF745, 0xF746, 0xF747, 0xF748, 0xF749, 0xF74A, 0xF74B, /* 0x40 */
0xF74C, 0xF74D, 0xF74E, 0xF74F, 0xF750, 0xF751, 0xF752, 0xF753, /* 0x40 */
0xF754, 0xF755, 0xF756, 0xF757, 0xF758, 0xF759, 0xF75A, 0xF75B, /* 0x50 */
0xF75C, 0xF75D, 0xF75E, 0xF75F, 0xF760, 0xF761, 0xF762, 0xF763, /* 0x50 */
0xF764, 0xF765, 0xF766, 0xF767, 0xF768, 0xF769, 0xF76A, 0xF76B, /* 0x60 */
0xF76C, 0xF76D, 0xF76E, 0xF76F, 0xF770, 0xF771, 0xF772, 0xF773, /* 0x60 */
0xF774, 0xF775, 0xF776, 0xF777, 0xF778, 0xF779, 0xF77A, 0xF77B, /* 0x70 */
0xF77C, 0xF77D, 0xF77E, 0xF780, 0xD3E3, 0xF781, 0xF782, 0xF6CF, /* 0x70 */
0xF783, 0xC2B3, 0xF6D0, 0xF784, 0xF785, 0xF6D1, 0xF6D2, 0xF6D3, /* 0x80 */
0xF6D4, 0xF786, 0xF787, 0xF6D6, 0xF788, 0xB1AB, 0xF6D7, 0xF789, /* 0x80 */
0xF6D8, 0xF6D9, 0xF6DA, 0xF78A, 0xF6DB, 0xF6DC, 0xF78B, 0xF78C, /* 0x90 */
0xF78D, 0xF78E, 0xF6DD, 0xF6DE, 0xCFCA, 0xF78F, 0xF6DF, 0xF6E0, /* 0x90 */
0xF6E1, 0xF6E2, 0xF6E3, 0xF6E4, 0xC0F0, 0xF6E5, 0xF6E6, 0xF6E7, /* 0xA0 */
0xF6E8, 0xF6E9, 0xF790, 0xF6EA, 0xF791, 0xF6EB, 0xF6EC, 0xF792, /* 0xA0 */
0xF6ED, 0xF6EE, 0xF6EF, 0xF6F0, 0xF6F1, 0xF6F2, 0xF6F3, 0xF6F4, /* 0xB0 */
0xBEA8, 0xF793, 0xF6F5, 0xF6F6, 0xF6F7, 0xF6F8, 0xF794, 0xF795, /* 0xB0 */
0xF796, 0xF797, 0xF798, 0xC8FA, 0xF6F9, 0xF6FA, 0xF6FB, 0xF6FC, /* 0xC0 */
0xF799, 0xF79A, 0xF6FD, 0xF6FE, 0xF7A1, 0xF7A2, 0xF7A3, 0xF7A4, /* 0xC0 */
0xF7A5, 0xF79B, 0xF79C, 0xF7A6, 0xF7A7, 0xF7A8, 0xB1EE, 0xF7A9, /* 0xD0 */
0xF7AA, 0xF7AB, 0xF79D, 0xF79E, 0xF7AC, 0xF7AD, 0xC1DB, 0xF7AE, /* 0xD0 */
0xF79F, 0xF7A0, 0xF7AF, 0xF840, 0xF841, 0xF842, 0xF843, 0xF844, /* 0xE0 */
0xF845, 0xF846, 0xF847, 0xF848, 0xF849, 0xF84A, 0xF84B, 0xF84C, /* 0xE0 */
0xF84D, 0xF84E, 0xF84F, 0xF850, 0xF851, 0xF852, 0xF853, 0xF854, /* 0xF0 */
0xF855, 0xF856, 0xF857, 0xF858, 0xF859, 0xF85A, 0xF85B, 0xF85C /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_9D[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xF85D, 0xF85E, 0xF85F, 0xF860, 0xF861, 0xF862, 0xF863, 0xF864, /* 0x00 */
0xF865, 0xF866, 0xF867, 0xF868, 0xF869, 0xF86A, 0xF86B, 0xF86C, /* 0x00 */
0xF86D, 0xF86E, 0xF86F, 0xF870, 0xF871, 0xF872, 0xF873, 0xF874, /* 0x10 */
0xF875, 0xF876, 0xF877, 0xF878, 0xF879, 0xF87A, 0xF87B, 0xF87C, /* 0x10 */
0xF87D, 0xF87E, 0xF880, 0xF881, 0xF882, 0xF883, 0xF884, 0xF885, /* 0x20 */
0xF886, 0xF887, 0xF888, 0xF889, 0xF88A, 0xF88B, 0xF88C, 0xF88D, /* 0x20 */
0xF88E, 0xF88F, 0xF890, 0xF891, 0xF892, 0xF893, 0xF894, 0xF895, /* 0x30 */
0xF896, 0xF897, 0xF898, 0xF899, 0xF89A, 0xF89B, 0xF89C, 0xF89D, /* 0x30 */
0xF89E, 0xF89F, 0xF8A0, 0xF940, 0xF941, 0xF942, 0xF943, 0xF944, /* 0x40 */
0xF945, 0xF946, 0xF947, 0xF948, 0xF949, 0xF94A, 0xF94B, 0xF94C, /* 0x40 */
0xF94D, 0xF94E, 0xF94F, 0xF950, 0xF951, 0xF952, 0xF953, 0xF954, /* 0x50 */
0xF955, 0xF956, 0xF957, 0xF958, 0xF959, 0xF95A, 0xF95B, 0xF95C, /* 0x50 */
0xF95D, 0xF95E, 0xF95F, 0xF960, 0xF961, 0xF962, 0xF963, 0xF964, /* 0x60 */
0xF965, 0xF966, 0xF967, 0xF968, 0xF969, 0xF96A, 0xF96B, 0xF96C, /* 0x60 */
0xF96D, 0xF96E, 0xF96F, 0xF970, 0xF971, 0xF972, 0xF973, 0xF974, /* 0x70 */
0xF975, 0xF976, 0xF977, 0xF978, 0xF979, 0xF97A, 0xF97B, 0xF97C, /* 0x70 */
0xF97D, 0xF97E, 0xF980, 0xF981, 0xF982, 0xF983, 0xF984, 0xF985, /* 0x80 */
0xF986, 0xF987, 0xF988, 0xF989, 0xF98A, 0xF98B, 0xF98C, 0xF98D, /* 0x80 */
0xF98E, 0xF98F, 0xF990, 0xF991, 0xF992, 0xF993, 0xF994, 0xF995, /* 0x90 */
0xF996, 0xF997, 0xF998, 0xF999, 0xF99A, 0xF99B, 0xF99C, 0xF99D, /* 0x90 */
0xF99E, 0xF99F, 0xF9A0, 0xFA40, 0xFA41, 0xFA42, 0xFA43, 0xFA44, /* 0xA0 */
0xFA45, 0xFA46, 0xFA47, 0xFA48, 0xFA49, 0xFA4A, 0xFA4B, 0xFA4C, /* 0xA0 */
0xFA4D, 0xFA4E, 0xFA4F, 0xFA50, 0xFA51, 0xFA52, 0xFA53, 0xFA54, /* 0xB0 */
0xFA55, 0xFA56, 0xFA57, 0xFA58, 0xFA59, 0xFA5A, 0xFA5B, 0xFA5C, /* 0xB0 */
0xFA5D, 0xFA5E, 0xFA5F, 0xFA60, 0xFA61, 0xFA62, 0xFA63, 0xFA64, /* 0xC0 */
0xFA65, 0xFA66, 0xFA67, 0xFA68, 0xFA69, 0xFA6A, 0xFA6B, 0xFA6C, /* 0xC0 */
0xFA6D, 0xFA6E, 0xFA6F, 0xFA70, 0xFA71, 0xFA72, 0xFA73, 0xFA74, /* 0xD0 */
0xFA75, 0xFA76, 0xFA77, 0xFA78, 0xFA79, 0xFA7A, 0xFA7B, 0xFA7C, /* 0xD0 */
0xFA7D, 0xFA7E, 0xFA80, 0xFA81, 0xFA82, 0xFA83, 0xFA84, 0xFA85, /* 0xE0 */
0xFA86, 0xFA87, 0xFA88, 0xFA89, 0xFA8A, 0xFA8B, 0xFA8C, 0xFA8D, /* 0xE0 */
0xFA8E, 0xFA8F, 0xFA90, 0xFA91, 0xFA92, 0xFA93, 0xFA94, 0xFA95, /* 0xF0 */
0xFA96, 0xFA97, 0xFA98, 0xFA99, 0xFA9A, 0xFA9B, 0xFA9C, 0xFA9D /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_9E[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFA9E, 0xFA9F, 0xFAA0, 0xFB40, 0xFB41, 0xFB42, 0xFB43, 0xFB44, /* 0x00 */
0xFB45, 0xFB46, 0xFB47, 0xFB48, 0xFB49, 0xFB4A, 0xFB4B, 0xFB4C, /* 0x00 */
0xFB4D, 0xFB4E, 0xFB4F, 0xFB50, 0xFB51, 0xFB52, 0xFB53, 0xFB54, /* 0x10 */
0xFB55, 0xFB56, 0xFB57, 0xFB58, 0xFB59, 0xFB5A, 0xFB5B, 0xC4F1, /* 0x10 */
0xF0AF, 0xBCA6, 0xF0B0, 0xC3F9, 0xFB5C, 0xC5B8, 0xD1BB, 0xFB5D, /* 0x20 */
0xF0B1, 0xF0B2, 0xF0B3, 0xF0B4, 0xF0B5, 0xD1BC, 0xFB5E, 0xD1EC, /* 0x20 */
0xFB5F, 0xF0B7, 0xF0B6, 0xD4A7, 0xFB60, 0xCDD2, 0xF0B8, 0xF0BA, /* 0x30 */
0xF0B9, 0xF0BB, 0xF0BC, 0xFB61, 0xFB62, 0xB8EB, 0xF0BD, 0xBAE8, /* 0x30 */
0xFB63, 0xF0BE, 0xF0BF, 0xBEE9, 0xF0C0, 0xB6EC, 0xF0C1, 0xF0C2, /* 0x40 */
0xF0C3, 0xF0C4, 0xC8B5, 0xF0C5, 0xF0C6, 0xFB64, 0xF0C7, 0xC5F4, /* 0x40 */
0xFB65, 0xF0C8, 0xFB66, 0xFB67, 0xFB68, 0xF0C9, 0xFB69, 0xF0CA, /* 0x50 */
0xF7BD, 0xFB6A, 0xF0CB, 0xF0CC, 0xF0CD, 0xFB6B, 0xF0CE, 0xFB6C, /* 0x50 */
0xFB6D, 0xFB6E, 0xFB6F, 0xF0CF, 0xBAD7, 0xFB70, 0xF0D0, 0xF0D1, /* 0x60 */
0xF0D2, 0xF0D3, 0xF0D4, 0xF0D5, 0xF0D6, 0xF0D8, 0xFB71, 0xFB72, /* 0x60 */
0xD3A5, 0xF0D7, 0xFB73, 0xF0D9, 0xFB74, 0xFB75, 0xFB76, 0xFB77, /* 0x70 */
0xFB78, 0xFB79, 0xFB7A, 0xFB7B, 0xFB7C, 0xFB7D, 0xF5BA, 0xC2B9, /* 0x70 */
0xFB7E, 0xFB80, 0xF7E4, 0xFB81, 0xFB82, 0xFB83, 0xFB84, 0xF7E5, /* 0x80 */
0xF7E6, 0xFB85, 0xFB86, 0xF7E7, 0xFB87, 0xFB88, 0xFB89, 0xFB8A, /* 0x80 */
0xFB8B, 0xFB8C, 0xF7E8, 0xC2B4, 0xFB8D, 0xFB8E, 0xFB8F, 0xFB90, /* 0x90 */
0xFB91, 0xFB92, 0xFB93, 0xFB94, 0xFB95, 0xF7EA, 0xFB96, 0xF7EB, /* 0x90 */
0xFB97, 0xFB98, 0xFB99, 0xFB9A, 0xFB9B, 0xFB9C, 0xC2F3, 0xFB9D, /* 0xA0 */
0xFB9E, 0xFB9F, 0xFBA0, 0xFC40, 0xFC41, 0xFC42, 0xFC43, 0xFC44, /* 0xA0 */
0xFC45, 0xFC46, 0xFC47, 0xFC48, 0xF4F0, 0xFC49, 0xFC4A, 0xFC4B, /* 0xB0 */
0xF4EF, 0xFC4C, 0xFC4D, 0xC2E9, 0xFC4E, 0xF7E1, 0xF7E2, 0xFC4F, /* 0xB0 */
0xFC50, 0xFC51, 0xFC52, 0xFC53, 0xBBC6, 0xFC54, 0xFC55, 0xFC56, /* 0xC0 */
0xFC57, 0xD9E4, 0xFC58, 0xFC59, 0xFC5A, 0xCAF2, 0xC0E8, 0xF0A4, /* 0xC0 */
0xFC5B, 0xBADA, 0xFC5C, 0xFC5D, 0xC7AD, 0xFC5E, 0xFC5F, 0xFC60, /* 0xD0 */
0xC4AC, 0xFC61, 0xFC62, 0xF7EC, 0xF7ED, 0xF7EE, 0xFC63, 0xF7F0, /* 0xD0 */
0xF7EF, 0xFC64, 0xF7F1, 0xFC65, 0xFC66, 0xF7F4, 0xFC67, 0xF7F3, /* 0xE0 */
0xFC68, 0xF7F2, 0xF7F5, 0xFC69, 0xFC6A, 0xFC6B, 0xFC6C, 0xF7F6, /* 0xE0 */
0xFC6D, 0xFC6E, 0xFC6F, 0xFC70, 0xFC71, 0xFC72, 0xFC73, 0xFC74, /* 0xF0 */
0xFC75, 0xEDE9, 0xFC76, 0xEDEA, 0xEDEB, 0xFC77, 0xF6BC, 0xFC78 /* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_9F[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xFC79, 0xFC7A, 0xFC7B, 0xFC7C, 0xFC7D, 0xFC7E, 0xFC80, 0xFC81, /* 0x00 */
0xFC82, 0xFC83, 0xFC84, 0xF6BD, 0xFC85, 0xF6BE, 0xB6A6, 0xFC86, /* 0x00 */
0xD8BE, 0xFC87, 0xFC88, 0xB9C4, 0xFC89, 0xFC8A, 0xFC8B, 0xD8BB, /* 0x10 */
0xFC8C, 0xDCB1, 0xFC8D, 0xFC8E, 0xFC8F, 0xFC90, 0xFC91, 0xFC92, /* 0x10 */
0xCAF3, 0xFC93, 0xF7F7, 0xFC94, 0xFC95, 0xFC96, 0xFC97, 0xFC98, /* 0x20 */
0xFC99, 0xFC9A, 0xFC9B, 0xFC9C, 0xF7F8, 0xFC9D, 0xFC9E, 0xF7F9, /* 0x20 */
0xFC9F, 0xFCA0, 0xFD40, 0xFD41, 0xFD42, 0xFD43, 0xFD44, 0xF7FB, /* 0x30 */
0xFD45, 0xF7FA, 0xFD46, 0xB1C7, 0xFD47, 0xF7FC, 0xF7FD, 0xFD48, /* 0x30 */
0xFD49, 0xFD4A, 0xFD4B, 0xFD4C, 0xF7FE, 0xFD4D, 0xFD4E, 0xFD4F, /* 0x40 */
0xFD50, 0xFD51, 0xFD52, 0xFD53, 0xFD54, 0xFD55, 0xFD56, 0xFD57, /* 0x40 */
0xC6EB, 0xECB4, 0xFD58, 0xFD59, 0xFD5A, 0xFD5B, 0xFD5C, 0xFD5D, /* 0x50 */
0xFD5E, 0xFD5F, 0xFD60, 0xFD61, 0xFD62, 0xFD63, 0xFD64, 0xFD65, /* 0x50 */
0xFD66, 0xFD67, 0xFD68, 0xFD69, 0xFD6A, 0xFD6B, 0xFD6C, 0xFD6D, /* 0x60 */
0xFD6E, 0xFD6F, 0xFD70, 0xFD71, 0xFD72, 0xFD73, 0xFD74, 0xFD75, /* 0x60 */
0xFD76, 0xFD77, 0xFD78, 0xFD79, 0xFD7A, 0xFD7B, 0xFD7C, 0xFD7D, /* 0x70 */
0xFD7E, 0xFD80, 0xFD81, 0xFD82, 0xFD83, 0xFD84, 0xFD85, 0xB3DD, /* 0x70 */
0xF6B3, 0xFD86, 0xFD87, 0xF6B4, 0xC1E4, 0xF6B5, 0xF6B6, 0xF6B7, /* 0x80 */
0xF6B8, 0xF6B9, 0xF6BA, 0xC8A3, 0xF6BB, 0xFD88, 0xFD89, 0xFD8A, /* 0x80 */
0xFD8B, 0xFD8C, 0xFD8D, 0xFD8E, 0xFD8F, 0xFD90, 0xFD91, 0xFD92, /* 0x90 */
0xFD93, 0xC1FA, 0xB9A8, 0xEDE8, 0xFD94, 0xFD95, 0xFD96, 0xB9EA, /* 0x90 */
0xD9DF, 0xFD97, 0xFD98, 0xFD99, 0xFD9A, 0xFD9B /* 0xA0 */
/* 0xA0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_APPLECHINSIMP_F8[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0x0081, 0x0082 /* 0x80 */
/* 0x80 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_F9[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x20 */
0xFD9C, 0, 0, 0, /* 0x20 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0xFD9D, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0xFD9E, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0xFD9F, /* 0xE0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0 */
0, 0xFDA0 /* 0xF0 */
/* 0xF0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_FA[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
/* 0x00 */
0xFE40, 0xFE41, 0xFE42, 0xFE43, /* 0x00 */
0, 0xFE44, 0, 0xFE45, 0xFE46, 0, 0, 0, /* 0x10 */
0xFE47, 0, 0, 0, 0, 0, 0, 0xFE48, /* 0x10 */
0xFE49, 0xFE4A, 0, 0xFE4B, 0xFE4C, 0, 0, 0xFE4D, /* 0x20 */
0xFE4E, 0xFE4F /* 0x20 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_FE[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA955, 0xA6F2, 0, 0xA6F4, 0xA6F5, 0xA6E0, 0xA6E1, 0xA6F0, /* 0x30 */
0xA6F1, 0xA6E2, 0xA6E3, 0xA6EE, 0xA6EF, 0xA6E6, 0xA6E7, 0xA6E4, /* 0x30 */
0xA6E5, 0xA6E8, 0xA6E9, 0xA6EA, 0xA6EB, 0, 0, 0, /* 0x40 */
0, 0xA968, 0xA969, 0xA96A, 0xA96B, 0xA96C, 0xA96D, 0xA96E, /* 0x40 */
0xA96F, 0xA970, 0xA971, 0, 0xA972, 0xA973, 0xA974, 0xA975, /* 0x50 */
0, 0xA976, 0xA977, 0xA978, 0xA979, 0xA97A, 0xA97B, 0xA97C, /* 0x50 */
0xA97D, 0xA97E, 0xA980, 0xA981, 0xA982, 0xA983, 0xA984, 0, /* 0x60 */
0xA985, 0xA986, 0xA987, 0xA988 /* 0x60 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_FE[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA6F2, 0, 0xA6F4, 0xA6F5, 0xA6E0, 0xA6E1, 0xA6F0, /* 0x30 */
0xA6F1, 0xA6E2, 0xA6E3, 0xA6EE, 0xA6EF, 0xA6E6, 0xA6E7, 0xA6E4, /* 0x30 */
0xA6E5, 0xA6E8, 0xA6E9, 0xA6EA, 0xA6EB /* 0x40 */
/* 0x40 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GBK_FF[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA3A1, 0xA3A2, 0xA3A3, 0xA1E7, 0xA3A5, 0xA3A6, 0xA3A7, /* 0x00 */
0xA3A8, 0xA3A9, 0xA3AA, 0xA3AB, 0xA3AC, 0xA3AD, 0xA3AE, 0xA3AF, /* 0x00 */
0xA3B0, 0xA3B1, 0xA3B2, 0xA3B3, 0xA3B4, 0xA3B5, 0xA3B6, 0xA3B7, /* 0x10 */
0xA3B8, 0xA3B9, 0xA3BA, 0xA3BB, 0xA3BC, 0xA3BD, 0xA3BE, 0xA3BF, /* 0x10 */
0xA3C0, 0xA3C1, 0xA3C2, 0xA3C3, 0xA3C4, 0xA3C5, 0xA3C6, 0xA3C7, /* 0x20 */
0xA3C8, 0xA3C9, 0xA3CA, 0xA3CB, 0xA3CC, 0xA3CD, 0xA3CE, 0xA3CF, /* 0x20 */
0xA3D0, 0xA3D1, 0xA3D2, 0xA3D3, 0xA3D4, 0xA3D5, 0xA3D6, 0xA3D7, /* 0x30 */
0xA3D8, 0xA3D9, 0xA3DA, 0xA3DB, 0xA3DC, 0xA3DD, 0xA3DE, 0xA3DF, /* 0x30 */
0xA3E0, 0xA3E1, 0xA3E2, 0xA3E3, 0xA3E4, 0xA3E5, 0xA3E6, 0xA3E7, /* 0x40 */
0xA3E8, 0xA3E9, 0xA3EA, 0xA3EB, 0xA3EC, 0xA3ED, 0xA3EE, 0xA3EF, /* 0x40 */
0xA3F0, 0xA3F1, 0xA3F2, 0xA3F3, 0xA3F4, 0xA3F5, 0xA3F6, 0xA3F7, /* 0x50 */
0xA3F8, 0xA3F9, 0xA3FA, 0xA3FB, 0xA3FC, 0xA3FD, 0xA1AB, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0xA1E9, 0xA1EA, 0xA956, 0xA3FE, 0xA957, 0xA3A4 /* 0xE0 */
/* 0xE0 */
};
/* ----------------------------------------------------------------------- */
static sal_uInt16 const aImplUniToDBCSTab_GB_FF[] =
{
/* 0 1 2 3 4 5 6 7 */
/* 8 9 A B C D E F */
0xA3A1, 0xA3A2, 0xA3A3, 0xA1E7, 0xA3A5, 0xA3A6, 0xA3A7, /* 0x00 */
0xA3A8, 0xA3A9, 0xA3AA, 0xA3AB, 0xA3AC, 0xA3AD, 0xA3AE, 0xA3AF, /* 0x00 */
0xA3B0, 0xA3B1, 0xA3B2, 0xA3B3, 0xA3B4, 0xA3B5, 0xA3B6, 0xA3B7, /* 0x10 */
0xA3B8, 0xA3B9, 0xA3BA, 0xA3BB, 0xA3BC, 0xA3BD, 0xA3BE, 0xA3BF, /* 0x10 */
0xA3C0, 0xA3C1, 0xA3C2, 0xA3C3, 0xA3C4, 0xA3C5, 0xA3C6, 0xA3C7, /* 0x20 */
0xA3C8, 0xA3C9, 0xA3CA, 0xA3CB, 0xA3CC, 0xA3CD, 0xA3CE, 0xA3CF, /* 0x20 */
0xA3D0, 0xA3D1, 0xA3D2, 0xA3D3, 0xA3D4, 0xA3D5, 0xA3D6, 0xA3D7, /* 0x30 */
0xA3D8, 0xA3D9, 0xA3DA, 0xA3DB, 0xA3DC, 0xA3DD, 0xA3DE, 0xA3DF, /* 0x30 */
0xA3E0, 0xA3E1, 0xA3E2, 0xA3E3, 0xA3E4, 0xA3E5, 0xA3E6, 0xA3E7, /* 0x40 */
0xA3E8, 0xA3E9, 0xA3EA, 0xA3EB, 0xA3EC, 0xA3ED, 0xA3EE, 0xA3EF, /* 0x40 */
0xA3F0, 0xA3F1, 0xA3F2, 0xA3F3, 0xA3F4, 0xA3F5, 0xA3F6, 0xA3F7, /* 0x50 */
0xA3F8, 0xA3F9, 0xA3FA, 0xA3FB, 0xA3FC, 0xA3FD, 0xA1AB, 0, /* 0x50 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x80 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x90 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0 */
0xA1E9, 0xA1EA, 0, 0xA3FE, 0, 0xA3A4, /* 0xE0 */
/* 0xE0 */
}; | the_stack |
-- 2020-02-18T07:06:31.191Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsTranslateExcelHeaders,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('7',0,0,584655,'Y','N',TO_TIMESTAMP('2020-02-18 09:06:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','N','N','N','Y','Y',0,'SummaryAndBalanceListReport','N','N','Java',TO_TIMESTAMP('2020-02-18 09:06:30','YYYY-MM-DD HH24:MI:SS'),100,'SummaryAndBalanceListReport')
;
-- 2020-02-18T07:06:31.194Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_ID=584655 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2020-02-18T07:10:53.180Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Classname='de.metas.impexp.excel.process.ExportToExcelProcess', SQLStatement='select * from SummaryAndBalanceListReport(dateFrom, dateTo, c_acctschema_id, ad_org_id)
', Type='Excel',Updated=TO_TIMESTAMP('2020-02-18 09:10:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:11:19.046Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1581,0,584655,541725,15,'DateFrom',TO_TIMESTAMP('2020-02-18 09:11:18','YYYY-MM-DD HH24:MI:SS'),100,'Startdatum eines Abschnittes','D',0,'Datum von bezeichnet das Startdatum eines Abschnittes','Y','N','Y','N','N','N','Datum von',10,TO_TIMESTAMP('2020-02-18 09:11:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:11:19.049Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541725 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-02-18T07:11:31.581Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1582,0,584655,541726,15,'DateTo',TO_TIMESTAMP('2020-02-18 09:11:31','YYYY-MM-DD HH24:MI:SS'),100,'Enddatum eines Abschnittes','D',0,'Datum bis bezeichnet das Enddatum eines Abschnittes (inklusiv)','Y','N','Y','N','N','N','Datum bis',20,TO_TIMESTAMP('2020-02-18 09:11:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:11:31.582Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541726 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-02-18T07:12:02.906Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,181,0,584655,541727,18,'C_AcctSchema_ID',TO_TIMESTAMP('2020-02-18 09:12:02','YYYY-MM-DD HH24:MI:SS'),100,'Stammdaten für Buchhaltung','D',0,'Ein Kontenschema definiert eine Ausprägung von Stammdaten für die Buchhaltung wie verwendete Art der Kostenrechnung, Währung und Buchungsperiode.','Y','N','Y','N','N','N','Buchführungs-Schema',30,TO_TIMESTAMP('2020-02-18 09:12:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:12:02.907Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541727 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-02-18T07:12:20.352Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,113,0,584655,541728,18,'AD_Org_ID',TO_TIMESTAMP('2020-02-18 09:12:20','YYYY-MM-DD HH24:MI:SS'),100,'Organisatorische Einheit des Mandanten','D',0,'Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Y','N','Y','N','N','N','Sektion',40,TO_TIMESTAMP('2020-02-18 09:12:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:12:20.353Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541728 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-02-18T07:13:53.866Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577545,0,'SummaryAndBalanceListReport',TO_TIMESTAMP('2020-02-18 09:13:53','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Summary and Balance Report','Summary and Balance Report',TO_TIMESTAMP('2020-02-18 09:13:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:13:53.868Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577545 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-02-18T07:14:09.367Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Summen- und Saldenliste', PrintName='Summen- und Saldenliste',Updated=TO_TIMESTAMP('2020-02-18 09:14:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577545 AND AD_Language='de_CH'
;
-- 2020-02-18T07:14:09.403Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577545,'de_CH')
;
-- 2020-02-18T07:14:14.336Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-02-18 09:14:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577545 AND AD_Language='en_US'
;
-- 2020-02-18T07:14:14.338Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577545,'en_US')
;
-- 2020-02-18T07:14:18.815Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Summen- und Saldenliste', PrintName='Summen- und Saldenliste',Updated=TO_TIMESTAMP('2020-02-18 09:14:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577545 AND AD_Language='de_DE'
;
-- 2020-02-18T07:14:18.817Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577545,'de_DE')
;
-- 2020-02-18T07:14:18.822Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577545,'de_DE')
;
-- 2020-02-18T07:14:18.824Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='SummaryAndBalanceListReport', Name='Summen- und Saldenliste', Description=NULL, Help=NULL WHERE AD_Element_ID=577545
;
-- 2020-02-18T07:14:18.825Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='SummaryAndBalanceListReport', Name='Summen- und Saldenliste', Description=NULL, Help=NULL, AD_Element_ID=577545 WHERE UPPER(ColumnName)='SUMMARYANDBALANCELISTREPORT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-02-18T07:14:18.826Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='SummaryAndBalanceListReport', Name='Summen- und Saldenliste', Description=NULL, Help=NULL WHERE AD_Element_ID=577545 AND IsCentrallyMaintained='Y'
;
-- 2020-02-18T07:14:18.827Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Summen- und Saldenliste', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577545) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577545)
;
-- 2020-02-18T07:14:18.837Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Summen- und Saldenliste', Name='Summen- und Saldenliste' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577545)
;
-- 2020-02-18T07:14:18.838Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Summen- und Saldenliste', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577545
;
-- 2020-02-18T07:14:18.840Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Summen- und Saldenliste', Description=NULL, Help=NULL WHERE AD_Element_ID = 577545
;
-- 2020-02-18T07:14:18.841Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Summen- und Saldenliste', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577545
;
-- 2020-02-18T07:17:01.458Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Summary and Balance List Report', PrintName='Summary and Balance List Report',Updated=TO_TIMESTAMP('2020-02-18 09:17:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577545 AND AD_Language='en_US'
;
-- 2020-02-18T07:17:01.460Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577545,'en_US')
;
-- 2020-02-18T07:17:18.109Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Element_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('P',0,577545,541437,0,584655,TO_TIMESTAMP('2020-02-18 09:17:17','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','SummaryAndBalanceListReport','Y','N','N','N','N','Summen- und Saldenliste',TO_TIMESTAMP('2020-02-18 09:17:17','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:17:18.111Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Menu_ID=541437 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2020-02-18T07:17:18.114Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 541437, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=541437)
;
-- 2020-02-18T07:17:18.124Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_menu_translation_from_ad_element(577545)
;
-- 2020-02-18T07:17:18.723Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000087 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.725Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540970 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.726Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540728 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.727Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540783 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.728Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=541251 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.729Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=541250 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.730Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540841 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.731Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540868 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.732Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=541138 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.733Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540971 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.733Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540949 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.734Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540950 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.735Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540976 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.736Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=541395 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.737Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000060 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.738Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=541406 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.738Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000068 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.739Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000079 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:18.740Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000019, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=541437 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.447Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540905 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.448Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540814 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.449Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=541297 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.450Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540803 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.450Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=541377 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.451Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540904 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.452Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540749 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.453Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540779 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.454Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540910 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.455Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=541308 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.456Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=541313 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.457Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540758 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.458Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540759 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.458Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540806 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.459Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=540891 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.460Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=540896 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.461Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=540903 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.462Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=541405 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.463Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=540906 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.463Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=540907 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.464Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=540908 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.465Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=541015 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.466Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=541016 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.467Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=541042 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.468Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=315 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.468Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=541368 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.470Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=541120 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.470Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=541125 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.471Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=541433 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.472Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=29, Updated=now(), UpdatedBy=100 WHERE Node_ID=541434 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.473Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=30, Updated=now(), UpdatedBy=100 WHERE Node_ID=541437 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.473Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=31, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000056 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.474Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=32, Updated=now(), UpdatedBy=100 WHERE Node_ID=541304 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.475Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=33, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000064 AND AD_Tree_ID=10
;
-- 2020-02-18T07:17:30.476Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000015, SeqNo=34, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000072 AND AD_Tree_ID=10
;
-- 2020-02-18T07:18:14.060Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET EntityType='de.metas.printing', Name='SummaryAndBalanceListReport',Updated=TO_TIMESTAMP('2020-02-18 09:18:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=541437
;
-- 2020-02-18T07:22:13.482Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(@dateFrom@, @dateTo@, @c_acctschema_id@, @ad_org_id@, @C_account_id/null@)',Updated=TO_TIMESTAMP('2020-02-18 09:22:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:22:39.043Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,148,0,584655,541729,30,'Account_ID',TO_TIMESTAMP('2020-02-18 09:22:38','YYYY-MM-DD HH24:MI:SS'),100,'Verwendetes Konto','D',0,'Das verwendete (Standard-) Konto','Y','N','Y','N','N','N','Konto',50,TO_TIMESTAMP('2020-02-18 09:22:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:22:39.047Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_Process_Para_ID=541729 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2020-02-18T07:22:43.623Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(@dateFrom@, @dateTo@, @c_acctschema_id@, @ad_org_id@, @account_id/null@)',Updated=TO_TIMESTAMP('2020-02-18 09:22:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:23:03.888Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(@DateFrom@, @dateTo@, @c_acctschema_id@, @ad_org_id@, @account_id/null@)',Updated=TO_TIMESTAMP('2020-02-18 09:23:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:23:13.189Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(@DateFrom@, @DateTo@, @c_acctschema_id@, @ad_org_id@, @account_id/null@)',Updated=TO_TIMESTAMP('2020-02-18 09:23:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:23:49.826Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(@DateFrom@, @DateTo@, @C_AcctSchema_ID@, @AD_Org_ID@, @Account_ID/null@)',Updated=TO_TIMESTAMP('2020-02-18 09:23:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:24:13.335Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(''@DateFrom@''::date, ''@DateTo@''::date, @C_AcctSchema_ID@, @AD_Org_ID@, @Account_ID/null@)',Updated=TO_TIMESTAMP('2020-02-18 09:24:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:24:28.175Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(''@DateFrom@''::date, ''@DateTo@''::date, @C_AcctSchema_ID@, @AD_Org_ID@, @Account_ID/null@::NUMERIC)',Updated=TO_TIMESTAMP('2020-02-18 09:24:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:24:52.083Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(''@DateFrom@''::date, ''@DateTo@''::date, @C_AcctSchema_ID@::NUMERIC, @AD_Org_ID@::NUMERIC, @Account_ID/null@::NUMERIC)',Updated=TO_TIMESTAMP('2020-02-18 09:24:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
-- 2020-02-18T07:29:44.862Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577546,0,'Credit',TO_TIMESTAMP('2020-02-18 09:29:44','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Credit','Credit',TO_TIMESTAMP('2020-02-18 09:29:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:29:44.864Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577546 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-02-18T07:29:52.114Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Haben', PrintName='Haben',Updated=TO_TIMESTAMP('2020-02-18 09:29:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577546 AND AD_Language='de_CH'
;
-- 2020-02-18T07:29:52.115Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577546,'de_CH')
;
-- 2020-02-18T07:29:55.675Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Haben', PrintName='Haben',Updated=TO_TIMESTAMP('2020-02-18 09:29:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577546 AND AD_Language='de_DE'
;
-- 2020-02-18T07:29:55.677Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577546,'de_DE')
;
-- 2020-02-18T07:29:55.683Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577546,'de_DE')
;
-- 2020-02-18T07:29:55.685Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='Credit', Name='Haben', Description=NULL, Help=NULL WHERE AD_Element_ID=577546
;
-- 2020-02-18T07:29:55.686Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Credit', Name='Haben', Description=NULL, Help=NULL, AD_Element_ID=577546 WHERE UPPER(ColumnName)='CREDIT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-02-18T07:29:55.687Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Credit', Name='Haben', Description=NULL, Help=NULL WHERE AD_Element_ID=577546 AND IsCentrallyMaintained='Y'
;
-- 2020-02-18T07:29:55.688Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Haben', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577546) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577546)
;
-- 2020-02-18T07:29:55.699Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Haben', Name='Haben' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577546)
;
-- 2020-02-18T07:29:55.700Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Haben', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577546
;
-- 2020-02-18T07:29:55.702Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Haben', Description=NULL, Help=NULL WHERE AD_Element_ID = 577546
;
-- 2020-02-18T07:29:55.703Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Haben', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577546
;
-- 2020-02-18T07:29:57.665Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-02-18 09:29:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577546 AND AD_Language='en_US'
;
-- 2020-02-18T07:29:57.667Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577546,'en_US')
;
-- 2020-02-18T07:30:18.832Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,577547,0,'Debit',TO_TIMESTAMP('2020-02-18 09:30:18','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Debit','Debit',TO_TIMESTAMP('2020-02-18 09:30:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2020-02-18T07:30:18.833Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=577547 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2020-02-18T07:30:32.446Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Soll', PrintName='Soll',Updated=TO_TIMESTAMP('2020-02-18 09:30:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577547 AND AD_Language='de_CH'
;
-- 2020-02-18T07:30:32.447Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577547,'de_CH')
;
-- 2020-02-18T07:30:35.967Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Soll', PrintName='Soll',Updated=TO_TIMESTAMP('2020-02-18 09:30:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577547 AND AD_Language='de_DE'
;
-- 2020-02-18T07:30:35.968Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577547,'de_DE')
;
-- 2020-02-18T07:30:35.974Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(577547,'de_DE')
;
-- 2020-02-18T07:30:35.977Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='Debit', Name='Soll', Description=NULL, Help=NULL WHERE AD_Element_ID=577547
;
-- 2020-02-18T07:30:35.978Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Debit', Name='Soll', Description=NULL, Help=NULL, AD_Element_ID=577547 WHERE UPPER(ColumnName)='DEBIT' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2020-02-18T07:30:35.979Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Debit', Name='Soll', Description=NULL, Help=NULL WHERE AD_Element_ID=577547 AND IsCentrallyMaintained='Y'
;
-- 2020-02-18T07:30:35.980Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Soll', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=577547) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 577547)
;
-- 2020-02-18T07:30:35.989Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Soll', Name='Soll' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=577547)
;
-- 2020-02-18T07:30:35.991Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Soll', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 577547
;
-- 2020-02-18T07:30:35.992Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Soll', Description=NULL, Help=NULL WHERE AD_Element_ID = 577547
;
-- 2020-02-18T07:30:35.994Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Soll', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 577547
;
-- 2020-02-18T07:30:37.679Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2020-02-18 09:30:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577547 AND AD_Language='en_US'
;
-- 2020-02-18T07:30:37.681Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(577547,'en_US')
;
-- 2020-02-18T07:30:55.581Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='select * from SummaryAndBalanceListReport(''@DateFrom@''::date, ''@DateTo@''::date, @C_AcctSchema_ID@, @AD_Org_ID@, @Account_ID/null@)',Updated=TO_TIMESTAMP('2020-02-18 09:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=584655
;
DROP FUNCTION IF EXISTS de_metas_acct.acctBalanceToDate(p_Account_ID numeric, p_C_AcctSchema_ID numeric, p_DateAcct date, p_IncludePostingTypeStatistical char);
DROP FUNCTION IF EXISTS de_metas_acct.acctBalanceToDate(p_Account_ID numeric, p_C_AcctSchema_ID numeric, p_DateAcct date, ad_org_id numeric, p_IncludePostingTypeStatistical char(1));
DROP FUNCTION IF EXISTS de_metas_acct.acctBalanceToDate(p_Account_ID numeric, p_C_AcctSchema_ID numeric, p_DateAcct date, ad_org_id numeric, p_IncludePostingTypeStatistical char(1), p_ExcludePostingTypeYearEnd char(1));
/*
-- This type shall be already in the database. Do not create it again
CREATE TYPE de_metas_acct.BalanceAmt AS
(
Balance numeric
, Debit numeric
, Credit numeric
);
*/
CREATE OR REPLACE FUNCTION de_metas_acct.acctBalanceToDate(p_Account_ID numeric,
p_C_AcctSchema_ID numeric,
p_DateAcct date,
p_AD_Org_ID numeric(10, 0),
p_IncludePostingTypeStatistical char(1) = 'N',
p_ExcludePostingTypeYearEnd char(1) = 'N')
RETURNS de_metas_acct.BalanceAmt
AS
$BODY$
WITH filteredAndOrdered AS (
SELECT --
fas.PostingType,
ev.AccountType,
fas.AmtAcctCr,
fas.AmtAcctCr_YTD,
fas.AmtAcctDr,
fas.AmtAcctDr_YTD,
fas.DateAcct
FROM Fact_Acct_Summary fas
INNER JOIN C_ElementValue ev ON (ev.C_ElementValue_ID = fas.Account_ID) AND ev.isActive = 'Y'
WHERE TRUE
AND fas.Account_ID = $1 -- p_Account_ID
AND fas.C_AcctSchema_ID = $2 -- p_C_AcctSchema_ID
AND fas.PA_ReportCube_ID IS NULL
AND fas.DateAcct <= $3 -- p_DateAcct
AND fas.ad_org_id = $4 -- p_AD_Org_ID
AND fas.isActive = 'Y'
ORDER BY fas.DateAcct DESC
)
-- NOTE: we use COALESCE(SUM(..)) just to make sure we are not returning null
SELECT ROW (SUM((Balance).Balance), SUM((Balance).Debit), SUM((Balance).Credit))::de_metas_acct.BalanceAmt
FROM (
-- Include posting type Actual
(
SELECT (CASE
-- When the account is Expense/Revenue => we shall consider only the Year to Date amount
WHEN fo.AccountType IN ('E', 'R') AND fo.DateAcct >= date_trunc('year', $3) THEN ROW (fo.AmtAcctDr_YTD - fo.AmtAcctCr_YTD, fo.AmtAcctDr_YTD, fo.AmtAcctCr_YTD)::de_metas_acct.BalanceAmt
WHEN fo.AccountType IN ('E', 'R') THEN ROW (0, 0, 0)::de_metas_acct.BalanceAmt
-- For any other account => we consider from the beginning to Date amount
ELSE ROW (fo.AmtAcctDr - fo.AmtAcctCr, fo.AmtAcctDr, fo.AmtAcctCr)::de_metas_acct.BalanceAmt
END) AS Balance
FROM filteredAndOrdered fo
WHERE TRUE
AND fo.PostingType = 'A'
ORDER BY fo.DateAcct DESC
LIMIT 1
)
-- Include posting type Year End
UNION ALL
(
SELECT (CASE
-- When the account is Expense/Revenue => we shall consider only the Year to Date amount
WHEN fo.AccountType IN ('E', 'R') AND fo.DateAcct >= date_trunc('year', $3) THEN ROW (fo.AmtAcctDr_YTD - fo.AmtAcctCr_YTD, fo.AmtAcctDr_YTD, fo.AmtAcctCr_YTD)::de_metas_acct.BalanceAmt
WHEN fo.AccountType IN ('E', 'R') THEN ROW (0, 0, 0)::de_metas_acct.BalanceAmt
-- For any other account => we consider from the beginning to Date amount
ELSE ROW (fo.AmtAcctDr - fo.AmtAcctCr, fo.AmtAcctDr, fo.AmtAcctCr)::de_metas_acct.BalanceAmt
END) AS Balance
FROM filteredAndOrdered fo
WHERE TRUE
AND $6 = 'N' -- p_ExcludePostingTypeYearEnd
AND fo.PostingType = 'Y'
ORDER BY fo.DateAcct DESC
LIMIT 1
)
-- Include posting type Statistical
UNION ALL
(
SELECT (CASE
-- When the account is Expense/Revenue => we shall consider only the Year to Date amount
WHEN fo.AccountType IN ('E', 'R') AND fo.DateAcct >= date_trunc('year', $3) THEN ROW (fo.AmtAcctDr_YTD - fo.AmtAcctCr_YTD, fo.AmtAcctDr_YTD, fo.AmtAcctCr_YTD)::de_metas_acct.BalanceAmt
WHEN fo.AccountType IN ('E', 'R') THEN ROW (0, 0, 0)::de_metas_acct.BalanceAmt
-- For any other account => we consider from the beginning to Date amount
ELSE ROW (fo.AmtAcctDr - fo.AmtAcctCr, fo.AmtAcctDr, fo.AmtAcctCr)::de_metas_acct.BalanceAmt
END) AS Balance
FROM filteredAndOrdered fo
WHERE TRUE
AND $5 = 'Y' -- p_IncludePostingTypeStatistical
AND fo.PostingType = 'S'
ORDER BY fo.DateAcct DESC
LIMIT 1
)
-- Default value:
UNION ALL
(
SELECT ROW (0, 0, 0)::de_metas_acct.BalanceAmt
)
) t
$BODY$
LANGUAGE sql STABLE;
DROP FUNCTION IF EXISTS SummaryAndBalanceListReport(p_dateFrom date, p_dateTo date, p_c_acctschema_id NUMERIC, p_ad_org_id numeric, p_account_id NUMERIC, p_c_activity_id NUMERIC);
DROP FUNCTION IF EXISTS SummaryAndBalanceListReport(p_dateFrom date, p_dateTo date, p_c_acctschema_id NUMERIC, p_ad_org_id numeric, p_account_id NUMERIC);
CREATE OR REPLACE FUNCTION SummaryAndBalanceListReport(p_dateFrom date,
p_dateTo date,
p_c_acctschema_id NUMERIC,
p_ad_org_id numeric,
p_account_id NUMERIC=NULL)
RETURNS table
(
AccountValue text,
AccountName text,
beginningBalance numeric,
debit numeric,
credit numeric,
endingBalance numeric
)
AS
$$
WITH filteredElementValues AS
(
SELECT ev.c_elementvalue_id,
ev.name AccountName,
ev.value AccountValue
FROM c_elementvalue ev
WHERE TRUE
AND (p_account_id IS NULL OR ev.c_elementvalue_id = p_account_id)
ORDER BY ev.c_elementvalue_id
),
balances AS
(
SELECT --
(de_metas_acct.acctBalanceToDate(ev.c_elementvalue_id, p_c_acctschema_id, (p_dateFrom - INTERVAL '1 day')::date, p_ad_org_id)::de_metas_acct.BalanceAmt) begining,
(de_metas_acct.acctBalanceToDate(ev.c_elementvalue_id, p_c_acctschema_id, (p_dateTo)::date, p_ad_org_id)::de_metas_acct.BalanceAmt) ending,
ev.c_elementvalue_id,
ev.AccountName,
ev.AccountValue
FROM filteredElementValues ev
),
data AS
(
SELECT --
AccountValue,
AccountName,
(begining).balance beginningBalance,
(ending).debit - (begining).debit debit,
(ending).credit - (begining).credit credit,
(ending).balance endingBalance
FROM balances
)
SELECT *
FROM data
$$
LANGUAGE sql STABLE; | the_stack |
-- 11.08.2015 20:36
-- URL zum Konzept
UPDATE AD_Process SET Value='C_Invoice_DiscountAllocation_Process',Updated=TO_TIMESTAMP('2015-08-11 20:36:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540591
;
-- 11.08.2015 20:37
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,267,0,540591,540741,15,'DateInvoiced',TO_TIMESTAMP('2015-08-11 20:37:24','YYYY-MM-DD HH24:MI:SS'),100,'Datum auf der Rechnung','de.metas.invoice',0,'"Rechnungsdatum" bezeichnet das auf der Rechnung verwendete Datum.','Y','N','Y','N','N','Y','Rechnungsdatum',20,TO_TIMESTAMP('2015-08-11 20:37:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11.08.2015 20:37
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540741 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 11.08.2015 20:38
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1106,0,540591,540742,20,'IsSOTrx',TO_TIMESTAMP('2015-08-11 20:38:36','YYYY-MM-DD HH24:MI:SS'),100,'This is a Sales Transaction','de.metas.invoice',1,'The Sales Transaction checkbox indicates if this item is a Sales Transaction.','Y','N','N','N','N','N','Verkaufsrechnungen (SOTrx)',30,TO_TIMESTAMP('2015-08-11 20:38:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11.08.2015 20:38
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540742 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 11.08.2015 20:58
-- URL zum Konzept
UPDATE AD_Table_Process SET IsActive='N',Updated=TO_TIMESTAMP('2015-08-11 20:58:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540591 AND AD_Table_ID=318
;
-- 11.08.2015 20:59
-- URL zum Konzept
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('P',0,540642,0,540591,TO_TIMESTAMP('2015-08-11 20:59:39','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.invoice','C_Invoice_DiscountAllocation_Process','Y','N','N','N','5er Rappen Skonti',TO_TIMESTAMP('2015-08-11 20:59:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 11.08.2015 20:59
-- URL zum Konzept
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540642 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 11.08.2015 20:59
-- URL zum Konzept
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540642, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540642)
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=53324 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=241 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=288 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=432 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=243 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=413 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=538 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=462 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=505 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=235 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=511 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=245 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=251 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=246 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=509 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=510 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=496 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=497 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=304 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=255 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=286 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=287 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=438 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=234 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=244 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=53190 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=53187 AND AD_Tree_ID=10
;
-- 11.08.2015 20:59
-- URL zum Konzept
UPDATE AD_TreeNodeMM SET Parent_ID=236, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=540642 AND AD_Tree_ID=10
;
-- 11.08.2015 21:01
-- URL zum Konzept
UPDATE AD_Process SET Description='Erstellt zu Rechnungen mit geringen offenen Beträgen Skonto-Zuordnungen, und markiert sie als bezahlt.', Name='Offene Rechnung - Skonto Zuordnung',Updated=TO_TIMESTAMP('2015-08-11 21:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540591
;
-- 11.08.2015 21:01
-- URL zum Konzept
UPDATE AD_Process_Trl SET IsTranslated='N' WHERE AD_Process_ID=540591
;
-- 11.08.2015 21:01
-- URL zum Konzept
UPDATE AD_Menu SET Description='Erstellt zu Rechnungen mit geringen offenen Beträgen Skonto-Zuordnungen, und markiert sie als bezahlt.', IsActive='Y', Name='Offene Rechnung - Skonto Zuordnung',Updated=TO_TIMESTAMP('2015-08-11 21:01:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=540642
;
-- 11.08.2015 21:01
-- URL zum Konzept
UPDATE AD_Menu_Trl SET IsTranslated='N' WHERE AD_Menu_ID=540642
;
-- 11.08.2015 21:02
-- URL zum Konzept
UPDATE AD_Process_Para SET Description='Betrag in der Währung der jeweiligen Rechnung. Beispiel: 0.05', Name='Maximaler offener Betrag',Updated=TO_TIMESTAMP('2015-08-11 21:02:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540729
;
-- 11.08.2015 21:02
-- URL zum Konzept
UPDATE AD_Process_Para_Trl SET IsTranslated='N' WHERE AD_Process_Para_ID=540729
; | the_stack |
-- +migrate Up
CREATE TABLE schedules (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name TEXT NOT NULL UNIQUE,
description TEXT NOT NULL DEFAULT '',
time_zone TEXT NOT NULL
);
INSERT INTO schedules (id, name, description, time_zone)
SELECT id::UUID, name, description, 'America/Chicago' FROM schedule;
CREATE TYPE enum_rotation_type AS ENUM (
'weekly',
'daily',
'hourly'
);
CREATE TABLE rotations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
schedule_id UUID NOT NULL REFERENCES schedules (id) ON DELETE CASCADE,
name TEXT NOT NULL,
description TEXT NOT NULL DEFAULT '',
type enum_rotation_type NOT NULL,
start_time TIMESTAMPTZ NOT NULL DEFAULT now(),
shift_length BIGINT NOT NULL DEFAULT 1,
UNIQUE (schedule_id, name)
);
INSERT INTO rotations (id, start_time, name, type, description, shift_length, schedule_id)
SELECT id::UUID, effective_date, name, rotation_type::enum_rotation_type, description, shift_length, schedule_id::UUID FROM schedule_layer;
CREATE TABLE rotation_participants (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
rotation_id UUID NOT NULL REFERENCES rotations (id) ON DELETE CASCADE,
position INT NOT NULL,
user_id UUID NOT NULL REFERENCES users (id) ON DELETE CASCADE,
UNIQUE (rotation_id, position) DEFERRABLE INITIALLY DEFERRED
);
INSERT INTO rotation_participants (rotation_id, position, user_id)
SELECT schedule_layer_id::UUID, step_number-1, user_id FROM schedule_layer_user;
-- Update escalation_policy_actions references
ALTER TABLE escalation_policy_actions RENAME COLUMN schedule_id TO old_schedule_id;
ALTER TABLE escalation_policy_actions ADD COLUMN schedule_id UUID REFERENCES schedules (id) ON DELETE CASCADE;
UPDATE escalation_policy_actions SET schedule_id = old_schedule_id::UUID WHERE old_schedule_id IS NOT NULL;
ALTER TABLE escalation_policy_actions DROP COLUMN old_schedule_id;
ALTER TABLE escalation_policy_actions ADD UNIQUE(escalation_policy_step_id, schedule_id, user_id);
ALTER TABLE escalation_policy_actions ADD CHECK((schedule_id IS NOT NULL AND user_id IS NULL) OR (user_id IS NOT NULL AND schedule_id IS NULL));
DROP TABLE schedule_layer_user;
DROP TABLE schedule_layer;
DROP TABLE schedule;
CREATE VIEW on_call AS
WITH rotation_details AS (
SELECT
id,
schedule_id,
start_time,
(shift_length::TEXT||CASE
WHEN type='hourly'::enum_rotation_type THEN ' hours'
WHEN type='daily'::enum_rotation_type THEN ' days'
ELSE ' weeks'
END)::interval shift,
(CASE
WHEN type='hourly'::enum_rotation_type THEN extract(epoch from now()-start_time)/3600
WHEN type='daily'::enum_rotation_type THEN extract(days from now()-start_time)
ELSE extract(days from now()-start_time)/7
END/shift_length)::BIGINT shift_number
FROM rotations
), p_count AS (
SELECT count(rp.id)
FROM
rotation_participants rp,
rotation_details d
WHERE rp.rotation_id = d.id
),
current_participant AS (
SELECT user_id
FROM
rotation_participants rp,
rotation_details d,
p_count p
WHERE rp.rotation_id = d.id
AND rp.position = d.shift_number % p.count
LIMIT 1
),
next_participant AS (
SELECT user_id
FROM
rotation_participants rp,
rotation_details d,
p_count p
WHERE rp.rotation_id = d.id
AND rp.position = (d.shift_number+1) % p.count
LIMIT 1
)
SELECT
d.schedule_id,
d.id rotation_id,
c.user_id,
n.user_id next_user_id,
(d.shift*d.shift_number)+d.start_time start_time,
(d.shift*(d.shift_number+1))+d.start_time end_time,
d.shift_number
FROM
rotation_details d,
current_participant c,
next_participant n;
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION move_rotation_position(_id UUID, _new_pos INT) RETURNS VOID AS
$$
DECLARE
_old_pos INT;
_rid UUID;
BEGIN
SELECT position,rotation_id into _old_pos, _rid FROM rotation_participants WHERE id = _id;
IF _old_pos > _new_pos THEN
UPDATE rotation_participants SET position = position + 1 WHERE rotation_id = _rid AND position < _old_pos AND position >= _new_pos;
ELSE
UPDATE rotation_participants SET position = position - 1 WHERE rotation_id = _rid AND position > _old_pos AND position <= _new_pos;
END IF;
UPDATE rotation_participants SET position = _new_pos WHERE id = _id;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION remove_rotation_participant(_id UUID) RETURNS UUID AS
$$
DECLARE
_old_pos INT;
_rid UUID;
BEGIN
SELECT position,rotation_id into _old_pos, _rid FROM rotation_participants WHERE id = _id;
DELETE FROM rotation_participants WHERE id = _id;
UPDATE rotation_participants SET position = position - 1 WHERE rotation_id = _rid AND position > _old_pos;
RETURN _rid;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
CREATE OR REPLACE VIEW on_call_alert_users AS
WITH alert_users AS (
SELECT act.user_id, act.schedule_id, a.id as alert_id, a.status
FROM
alerts a,
service s,
alert_escalation_levels lvl,
escalation_policy_step step,
escalation_policy_actions act
WHERE s.id = a.service_id
AND step.escalation_policy_id = s.escalation_policy_id
AND step.step_number = lvl.relative_level
AND a.status != 'closed'::enum_alert_status
AND act.escalation_policy_step_id = step.id
GROUP BY user_id, schedule_id, a.id
)
SELECT
au.alert_id,
au.status,
CASE WHEN au.user_id IS NULL THEN oc.user_id
ELSE au.user_id
END
FROM alert_users au, on_call oc
WHERE oc.schedule_id = au.schedule_id OR au.schedule_id IS NULL;
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION update_notifications() RETURNS VOID AS
$$
BEGIN
INSERT INTO notifications (user_id)
SELECT user_id FROM on_call_alert_users
WHERE status = 'triggered'::enum_alert_status
GROUP BY user_id
ON CONFLICT DO NOTHING;
DELETE FROM notifications WHERE user_id NOT IN (SELECT user_id FROM on_call_alert_users WHERE status = 'triggered'::enum_alert_status AND user_id = user_id);
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
-- +migrate StatementBegin
CREATE OR REPLACE FUNCTION add_notifications() RETURNS TRIGGER AS
$$
BEGIN
INSERT INTO notifications (user_id)
SELECT user_id FROM on_call_alert_users
WHERE alert_id = NEW.id AND status = 'triggered'::enum_alert_status
LIMIT 1
ON CONFLICT DO NOTHING;
DELETE FROM notifications WHERE user_id NOT IN (SELECT user_id FROM on_call_alert_users WHERE status = 'triggered'::enum_alert_status AND user_id = user_id);
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
-- +migrate StatementEnd
CREATE OR REPLACE VIEW needs_notification_sent AS
SELECT trig.alert_id, acm.contact_method_id, cm.type, cm.value, a.description, s.name as service_name
FROM active_contact_methods acm, on_call_alert_users trig, user_contact_methods cm, alerts a, service s
WHERE acm.user_id = trig.user_id
AND acm.user_id = trig.user_id
AND cm.id = acm.contact_method_id
AND cm.disabled = FALSE
AND a.id = trig.alert_id
AND trig.status = 'triggered'::enum_alert_status
AND s.id = a.service_id
AND NOT EXISTS (
SELECT id
FROM sent_notifications
WHERE alert_id = trig.alert_id
AND contact_method_id = acm.contact_method_id
AND sent_at IS NOT NULL
);
DROP VIEW triggered_alert_users;
CREATE OR REPLACE VIEW on_call_next_rotation AS
WITH
p_count AS (
SELECT rotation_id, count(rp.position)
FROM
rotations r,
rotation_participants rp
WHERE r.id = rp.rotation_id
GROUP BY rotation_id
)
SELECT
oc.schedule_id,
rp.rotation_id,
rp.user_id,
oc.next_user_id,
(
CASE WHEN oc.shift_number % p.count < rp.position
THEN rp.position-(oc.shift_number % p.count)
ELSE rp.position-(oc.shift_number % p.count)+p.count
END
) * (oc.end_time-oc.start_time) + oc.start_time start_time,
(
CASE WHEN oc.shift_number % p.count < rp.position
THEN rp.position-(oc.shift_number % p.count)
ELSE rp.position-(oc.shift_number % p.count)+p.count
END
) * (oc.end_time-oc.start_time) + oc.end_time end_time,
(
CASE WHEN oc.shift_number % p.count < rp.position
THEN rp.position-(oc.shift_number % p.count)
ELSE rp.position-(oc.shift_number % p.count)+p.count
END
) + oc.shift_number shift_number
FROM
rotations r,
rotation_participants rp,
p_count p,
on_call oc
WHERE p.rotation_id = r.id
AND rp.rotation_id = r.id
AND oc.rotation_id = r.id
GROUP BY
rp.user_id,
rp.rotation_id,
oc.shift_number,
p.count,
shift_length,
type,
oc.start_time,
oc.end_time,
rp.position,
oc.schedule_id,
oc.next_user_id;
-- +migrate Down
CREATE TABLE schedule (
id TEXT PRIMARY KEY,
created_at TIMESTAMP DEFAULT now(),
name TEXT,
description TEXT,
time_zone INT
);
INSERT INTO schedule (id, name, description, time_zone)
SELECT s.id::TEXT, s.name, s.description, date_part('hour', tz.utc_offset)
FROM schedules s, pg_timezone_names tz
WHERE tz.name = s.time_zone;
CREATE TABLE schedule_layer (
id UUID PRIMARY KEY,
created_at TIMESTAMP DEFAULT now(),
effective_date TIMESTAMP,
description TEXT,
handoff_day INT,
handoff_time TEXT,
name TEXT,
rotation_type TEXT,
shift_length INT,
shift_length_unit,
schedule_id TEXT REFERENCES schedule (id)
);
INSERT INTO schedule_layer (id, effective_date, description, handoff_day, handoff_time, name, rotation_type, shift_length, shift_length_unit, schedule_id)
SELECT id::TEXT, start, description, EXTRACT(DOW FROM TIMESTAMP start), date_part('hour', start)::TEXT|':'|date_part('minute', start), name, type::TEXT, shift_length, 'hour', schedule_id::TEXT
FROM rotations;
CREATE TABLE schedule_layer_user (
id TEXT PRIMARY KEY DEFAULT gen_random_uuid(),
created_at TIMESTAMP DEFAULT now(),
step_number INT,
user_id UUID REFERENCES users (id),
schedule_layer_id TEXT REFERENCES schedule_layer (id)
);
INSERT INTO schedule_layer_user (step_number, user_id, schedule_layer_id)
SELECT position+1, user_id, rotation_id::TEXT;
ALTER TABLE escalation_policy_actions RENAME COLUMN schedule_id TO old_schedule_id;
ALTER TABLE escalation_policy_actions ADD COLUMN schedule_id UUID REFERENCES schedules (id) ON DELETE CASCADE;
UPDATE escalation_policy_actions SET schedule_id = old_schedule_id::TEXT WHERE old_schedule_id IS NOT NULL;
ALTER TABLE escalation_policy_actions DROP COLUMN old_schedule_id;
ALTER TABLE escalation_policy_actions ADD UNIQUE(escalation_policy_step_id, schedule_id, user_id);
ALTER TABLE escalation_policy_actions ADD CHECK((schedule_id IS NOT NULL AND user_id IS NULL) OR (user_id IS NOT NULL AND schedule_id IS NULL));
DROP TABLE shift_creation_locks;
DROP TABLE on_call;
DROP TABLE rotation_participants;
DROP TABLE rotations;
DROP TYPE enum_rotation_type;
DROP TABLE schedules; | the_stack |
-- 2018-06-19T12:27:57.461
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Direktbezugsnachweis erforderlich',Updated=TO_TIMESTAMP('2018-06-19 12:27:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=562082
;
-- 2018-06-19T12:29:02.361
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=550593
;
-- 2018-06-19T13:00:28.640
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,558399,564747,0,541014,0,TO_TIMESTAMP('2018-06-19 13:00:28','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','IsSourceSupplyCert',440,430,0,1,1,TO_TIMESTAMP('2018-06-19 13:00:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-06-19T13:00:28.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=564747 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-06-19T13:01:23.378
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Direktbezugsnachweis erforderlich',Updated=TO_TIMESTAMP('2018-06-19 13:01:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=564747
;
-- 2018-06-19T13:01:54.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564747,0,541014,541433,552278,'F',TO_TIMESTAMP('2018-06-19 13:01:54','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Direktbezugsnachweis erforderlich',390,0,0,TO_TIMESTAMP('2018-06-19 13:01:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-06-19T13:02:59.403
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-06-19 13:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552278
;
-- 2018-06-19T13:02:59.408
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-06-19 13:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550651
;
-- 2018-06-19T13:02:59.412
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-06-19 13:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550652
;
-- 2018-06-19T13:02:59.416
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2018-06-19 13:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550650
;
-- 2018-06-19T13:02:59.420
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2018-06-19 13:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550653
;
-- 2018-06-19T13:02:59.423
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2018-06-19 13:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550656
;
-- 2018-06-19T13:02:59.425
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2018-06-19 13:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550667
;
-- 2018-06-19T13:02:59.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2018-06-19 13:02:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550642
;
-- 2018-06-19T13:12:42.819
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=550602
;
-- 2018-06-19T13:13:08.471
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,Description,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,557879,564748,0,541014,0,TO_TIMESTAMP('2018-06-19 13:13:08','YYYY-MM-DD HH24:MI:SS'),100,'',0,'D',0,'Y','Y','Y','N','N','N','N','N','SEPA Signed',450,440,0,1,1,TO_TIMESTAMP('2018-06-19 13:13:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-06-19T13:13:08.478
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=564748 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-06-19T13:13:12.272
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='SEPA Mandat erteilt',Updated=TO_TIMESTAMP('2018-06-19 13:13:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=564748
;
-- 2018-06-19T13:13:47.983
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564748,0,541014,541433,552279,'F',TO_TIMESTAMP('2018-06-19 13:13:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','SEPA Mandat erteilt',400,0,0,TO_TIMESTAMP('2018-06-19 13:13:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-06-19T13:13:57.344
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-06-19 13:13:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552279
;
-- 2018-06-19T13:13:57.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-06-19 13:13:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550651
;
-- 2018-06-19T13:13:57.353
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2018-06-19 13:13:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550652
;
-- 2018-06-19T13:13:57.357
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2018-06-19 13:13:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550650
;
-- 2018-06-19T13:13:57.362
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2018-06-19 13:13:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550653
;
-- 2018-06-19T13:13:57.368
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2018-06-19 13:13:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550656
;
-- 2018-06-19T13:13:57.373
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2018-06-19 13:13:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550667
;
-- 2018-06-19T13:13:57.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=180,Updated=TO_TIMESTAMP('2018-06-19 13:13:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550642
;
-- 2018-06-19T13:18:27.162
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540848,541657,TO_TIMESTAMP('2018-06-19 13:18:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','div',20,TO_TIMESTAMP('2018-06-19 13:18:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-06-19T13:18:30.192
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=30,Updated=TO_TIMESTAMP('2018-06-19 13:18:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=541443
;
-- 2018-06-19T13:18:54.940
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541657, SeqNo=10,Updated=TO_TIMESTAMP('2018-06-19 13:18:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550587
;
-- 2018-06-19T13:19:02.135
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541657, SeqNo=20,Updated=TO_TIMESTAMP('2018-06-19 13:19:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550591
;
-- 2018-06-19T13:19:21.221
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541657, SeqNo=30,Updated=TO_TIMESTAMP('2018-06-19 13:19:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550581
;
-- 2018-06-19T13:19:56.351
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541657, SeqNo=40,Updated=TO_TIMESTAMP('2018-06-19 13:19:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550583
;
-- 2018-06-19T15:37:07.897
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,560219,564771,0,541015,0,TO_TIMESTAMP('2018-06-19 15:37:07','YYYY-MM-DD HH24:MI:SS'),100,'Produkt-Kategorie des Geschäftspartner',0,'D','"Produkt-Kategorie Geschäftspartner" gibt die Produktkategorie an, die der Geschäftspartner für dieses Produkt verwendet.',0,'Y','Y','Y','N','N','N','N','N','Produkt-Kategorie Geschäftspartner',220,200,0,1,1,TO_TIMESTAMP('2018-06-19 15:37:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-06-19T15:37:07.901
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=564771 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2018-06-19T15:37:33.544
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Description='', Help='', Name='Lieferant Kategorie',Updated=TO_TIMESTAMP('2018-06-19 15:37:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=564771
;
-- 2018-06-19T15:38:47.122
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,564771,0,541015,541434,552280,'F',TO_TIMESTAMP('2018-06-19 15:38:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Lieferant Kategorie',110,0,0,TO_TIMESTAMP('2018-06-19 15:38:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-06-19T15:39:04.043
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-06-19 15:39:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=552280
;
-- 2018-06-19T15:39:04.047
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-06-19 15:39:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=550674
; | the_stack |
CREATE SCHEMA IF NOT EXISTS metric_helpers AUTHORIZATION postgres;
GRANT USAGE ON SCHEMA metric_helpers TO admin;
GRANT USAGE ON SCHEMA metric_helpers TO robot_zmon;
SET search_path TO metric_helpers;
-- table and btree bloat estimation queries are borrowed from https://github.com/ioguix/pgsql-bloat-estimation
CREATE OR REPLACE FUNCTION get_table_bloat_approx (
OUT t_database name,
OUT t_schema_name name,
OUT t_table_name name,
OUT t_real_size numeric,
OUT t_extra_size double precision,
OUT t_extra_ratio double precision,
OUT t_fill_factor integer,
OUT t_bloat_size double precision,
OUT t_bloat_ratio double precision,
OUT t_is_na boolean
) RETURNS SETOF record AS
$_$
SELECT
current_database(),
schemaname,
tblname,
(bs*tblpages) AS real_size,
((tblpages-est_tblpages)*bs) AS extra_size,
CASE WHEN tblpages - est_tblpages > 0
THEN 100 * (tblpages - est_tblpages)/tblpages::float
ELSE 0
END AS extra_ratio,
fillfactor,
CASE WHEN tblpages - est_tblpages_ff > 0
THEN (tblpages-est_tblpages_ff)*bs
ELSE 0
END AS bloat_size,
CASE WHEN tblpages - est_tblpages_ff > 0
THEN 100 * (tblpages - est_tblpages_ff)/tblpages::float
ELSE 0
END AS bloat_ratio,
is_na
FROM (
SELECT ceil( reltuples / ( (bs-page_hdr)/tpl_size ) ) + ceil( toasttuples / 4 ) AS est_tblpages,
ceil( reltuples / ( (bs-page_hdr)*fillfactor/(tpl_size*100) ) ) + ceil( toasttuples / 4 ) AS est_tblpages_ff,
tblpages, fillfactor, bs, tblid, schemaname, tblname, heappages, toastpages, is_na
-- , tpl_hdr_size, tpl_data_size, pgstattuple(tblid) AS pst -- (DEBUG INFO)
FROM (
SELECT
( 4 + tpl_hdr_size + tpl_data_size + (2*ma)
- CASE WHEN tpl_hdr_size%ma = 0 THEN ma ELSE tpl_hdr_size%ma END
- CASE WHEN ceil(tpl_data_size)::int%ma = 0 THEN ma ELSE ceil(tpl_data_size)::int%ma END
) AS tpl_size, bs - page_hdr AS size_per_block, (heappages + toastpages) AS tblpages, heappages,
toastpages, reltuples, toasttuples, bs, page_hdr, tblid, schemaname, tblname, fillfactor, is_na
-- , tpl_hdr_size, tpl_data_size
FROM (
SELECT
tbl.oid AS tblid, ns.nspname AS schemaname, tbl.relname AS tblname, tbl.reltuples,
tbl.relpages AS heappages, coalesce(toast.relpages, 0) AS toastpages,
coalesce(toast.reltuples, 0) AS toasttuples,
coalesce(substring(
array_to_string(tbl.reloptions, ' ')
FROM 'fillfactor=([0-9]+)')::smallint, 100) AS fillfactor,
current_setting('block_size')::numeric AS bs,
CASE WHEN version()~'mingw32' OR version()~'64-bit|x86_64|ppc64|ia64|amd64' THEN 8 ELSE 4 END AS ma,
24 AS page_hdr,
23 + CASE WHEN MAX(coalesce(s.null_frac,0)) > 0 THEN ( 7 + count(s.attname) ) / 8 ELSE 0::int END
+ CASE WHEN bool_or(att.attname = 'oid' and att.attnum < 0) THEN 4 ELSE 0 END AS tpl_hdr_size,
sum( (1-coalesce(s.null_frac, 0)) * coalesce(s.avg_width, 0) ) AS tpl_data_size,
bool_or(att.atttypid = 'pg_catalog.name'::regtype)
OR sum(CASE WHEN att.attnum > 0 THEN 1 ELSE 0 END) <> count(s.attname) AS is_na
FROM pg_attribute AS att
JOIN pg_class AS tbl ON att.attrelid = tbl.oid
JOIN pg_namespace AS ns ON ns.oid = tbl.relnamespace
LEFT JOIN pg_stats AS s ON s.schemaname=ns.nspname
AND s.tablename = tbl.relname AND s.inherited=false AND s.attname=att.attname
LEFT JOIN pg_class AS toast ON tbl.reltoastrelid = toast.oid
WHERE NOT att.attisdropped
AND tbl.relkind = 'r'
GROUP BY 1,2,3,4,5,6,7,8,9,10
ORDER BY 2,3
) AS s
) AS s2
) AS s3 WHERE schemaname NOT LIKE 'information_schema';
$_$ LANGUAGE sql SECURITY DEFINER IMMUTABLE STRICT SET search_path to 'pg_catalog';
REVOKE ALL ON FUNCTION get_table_bloat_approx() FROM public;
GRANT EXECUTE ON FUNCTION get_table_bloat_approx() TO admin;
GRANT EXECUTE ON FUNCTION get_table_bloat_approx() TO robot_zmon;
CREATE OR REPLACE VIEW table_bloat AS SELECT * FROM get_table_bloat_approx();
REVOKE ALL ON TABLE table_bloat FROM public;
GRANT SELECT ON TABLE table_bloat TO admin;
GRANT SELECT ON TABLE table_bloat TO robot_zmon;
CREATE OR REPLACE FUNCTION get_btree_bloat_approx (
OUT i_database name,
OUT i_schema_name name,
OUT i_table_name name,
OUT i_index_name name,
OUT i_real_size numeric,
OUT i_extra_size numeric,
OUT i_extra_ratio double precision,
OUT i_fill_factor integer,
OUT i_bloat_size double precision,
OUT i_bloat_ratio double precision,
OUT i_is_na boolean
) RETURNS SETOF record AS
$_$
SELECT current_database(), nspname AS schemaname, tblname, idxname, bs*(relpages)::bigint AS real_size,
bs*(relpages-est_pages)::bigint AS extra_size,
100 * (relpages-est_pages)::float / relpages AS extra_ratio,
fillfactor,
CASE WHEN relpages > est_pages_ff
THEN bs*(relpages-est_pages_ff)
ELSE 0
END AS bloat_size,
100 * (relpages-est_pages_ff)::float / relpages AS bloat_ratio,
is_na
-- , 100-(pst).avg_leaf_density AS pst_avg_bloat, est_pages, index_tuple_hdr_bm, maxalign, pagehdr, nulldatawidth, nulldatahdrwidth, reltuples, relpages -- (DEBUG INFO)
FROM (
SELECT coalesce(1 +
ceil(reltuples/floor((bs-pageopqdata-pagehdr)/(4+nulldatahdrwidth)::float)), 0 -- ItemIdData size + computed avg size of a tuple (nulldatahdrwidth)
) AS est_pages,
coalesce(1 +
ceil(reltuples/floor((bs-pageopqdata-pagehdr)*fillfactor/(100*(4+nulldatahdrwidth)::float))), 0
) AS est_pages_ff,
bs, nspname, tblname, idxname, relpages, fillfactor, is_na
-- , pgstatindex(idxoid) AS pst, index_tuple_hdr_bm, maxalign, pagehdr, nulldatawidth, nulldatahdrwidth, reltuples -- (DEBUG INFO)
FROM (
SELECT maxalign, bs, nspname, tblname, idxname, reltuples, relpages, idxoid, fillfactor,
( index_tuple_hdr_bm +
maxalign - CASE -- Add padding to the index tuple header to align on MAXALIGN
WHEN index_tuple_hdr_bm%maxalign = 0 THEN maxalign
ELSE index_tuple_hdr_bm%maxalign
END
+ nulldatawidth + maxalign - CASE -- Add padding to the data to align on MAXALIGN
WHEN nulldatawidth = 0 THEN 0
WHEN nulldatawidth::integer%maxalign = 0 THEN maxalign
ELSE nulldatawidth::integer%maxalign
END
)::numeric AS nulldatahdrwidth, pagehdr, pageopqdata, is_na
-- , index_tuple_hdr_bm, nulldatawidth -- (DEBUG INFO)
FROM (
SELECT n.nspname, ct.relname AS tblname, i.idxname, i.reltuples, i.relpages,
i.idxoid, i.fillfactor, current_setting('block_size')::numeric AS bs,
CASE -- MAXALIGN: 4 on 32bits, 8 on 64bits (and mingw32 ?)
WHEN version() ~ 'mingw32' OR version() ~ '64-bit|x86_64|ppc64|ia64|amd64' THEN 8
ELSE 4
END AS maxalign,
/* per page header, fixed size: 20 for 7.X, 24 for others */
24 AS pagehdr,
/* per page btree opaque data */
16 AS pageopqdata,
/* per tuple header: add IndexAttributeBitMapData if some cols are null-able */
CASE WHEN max(coalesce(s.stanullfrac,0)) = 0
THEN 2 -- IndexTupleData size
ELSE 2 + (( 32 + 8 - 1 ) / 8) -- IndexTupleData size + IndexAttributeBitMapData size ( max num filed per index + 8 - 1 /8)
END AS index_tuple_hdr_bm,
/* data len: we remove null values save space using it fractionnal part from stats */
sum( (1-coalesce(s.stanullfrac, 0)) * coalesce(s.stawidth, 1024)) AS nulldatawidth,
max( CASE WHEN a.atttypid = 'pg_catalog.name'::regtype THEN 1 ELSE 0 END ) > 0 AS is_na
FROM (
SELECT idxname, reltuples, relpages, tbloid, idxoid, fillfactor,
CASE WHEN indkey[i]=0 THEN idxoid ELSE tbloid END AS att_rel,
CASE WHEN indkey[i]=0 THEN i ELSE indkey[i] END AS att_pos
FROM (
SELECT idxname, reltuples, relpages, tbloid, idxoid, fillfactor, indkey, generate_series(1,indnatts) AS i
FROM (
SELECT ci.relname AS idxname, ci.reltuples, ci.relpages, i.indrelid AS tbloid,
i.indexrelid AS idxoid,
coalesce(substring(
array_to_string(ci.reloptions, ' ')
from 'fillfactor=([0-9]+)')::smallint, 90) AS fillfactor,
i.indnatts,
string_to_array(textin(int2vectorout(i.indkey)),' ')::int[] AS indkey
FROM pg_index i
JOIN pg_class ci ON ci.oid=i.indexrelid
WHERE ci.relam=(SELECT oid FROM pg_am WHERE amname = 'btree')
AND ci.relpages > 0
) AS idx_data
) AS idx_data_cross
) i
JOIN pg_attribute a ON a.attrelid = i.att_rel
AND a.attnum = i.att_pos
JOIN pg_statistic s ON s.starelid = i.att_rel
AND s.staattnum = i.att_pos
JOIN pg_class ct ON ct.oid = i.tbloid
JOIN pg_namespace n ON ct.relnamespace = n.oid
GROUP BY 1,2,3,4,5,6,7,8,9,10
) AS rows_data_stats
) AS rows_hdr_pdg_stats
) AS relation_stats;
$_$ LANGUAGE sql SECURITY DEFINER IMMUTABLE STRICT SET search_path to 'pg_catalog';
REVOKE ALL ON FUNCTION get_btree_bloat_approx() FROM public;
GRANT EXECUTE ON FUNCTION get_btree_bloat_approx() TO admin;
GRANT EXECUTE ON FUNCTION get_btree_bloat_approx() TO robot_zmon;
CREATE OR REPLACE VIEW index_bloat AS SELECT * FROM get_btree_bloat_approx();
REVOKE ALL ON TABLE index_bloat FROM public;
GRANT SELECT ON TABLE index_bloat TO admin;
GRANT SELECT ON TABLE index_bloat TO robot_zmon;
CREATE OR REPLACE FUNCTION pg_stat_statements(showtext boolean) RETURNS SETOF public.pg_stat_statements AS
$$
SELECT * FROM public.pg_stat_statements(showtext);
$$ LANGUAGE sql IMMUTABLE SECURITY DEFINER STRICT;
REVOKE ALL ON FUNCTION pg_stat_statements(boolean) FROM public;
GRANT EXECUTE ON FUNCTION pg_stat_statements(boolean) TO admin;
GRANT EXECUTE ON FUNCTION pg_stat_statements(boolean) TO robot_zmon;
CREATE OR REPLACE VIEW pg_stat_statements AS SELECT * FROM pg_stat_statements(true);
REVOKE ALL ON TABLE pg_stat_statements FROM public;
GRANT SELECT ON TABLE pg_stat_statements TO admin;
GRANT SELECT ON TABLE pg_stat_statements TO robot_zmon;
RESET search_path; | the_stack |
-- 2017-04-21T14:02:54.334
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543313,0,'PlanningStatus',TO_TIMESTAMP('2017-04-21 14:02:54','YYYY-MM-DD HH24:MI:SS'),100,'EE01','Y','Planning status','Planning status',TO_TIMESTAMP('2017-04-21 14:02:54','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-21T14:02:54.348
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=543313 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2017-04-21T14:03:22.248
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540714,TO_TIMESTAMP('2017-04-21 14:03:22','YYYY-MM-DD HH24:MI:SS'),100,'EE01','Y','N','PP_Order_PlanningStatus',TO_TIMESTAMP('2017-04-21 14:03:22','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-04-21T14:03:22.255
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540714 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-04-21T14:06:56.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541264,540714,TO_TIMESTAMP('2017-04-21 14:06:56','YYYY-MM-DD HH24:MI:SS'),100,'EE01','Y','Planning',TO_TIMESTAMP('2017-04-21 14:06:56','YYYY-MM-DD HH24:MI:SS'),100,'P','Planning')
;
-- 2017-04-21T14:06:56.461
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541264 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-04-21T14:07:12.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541265,540714,TO_TIMESTAMP('2017-04-21 14:07:12','YYYY-MM-DD HH24:MI:SS'),100,'EE01','Y','Review',TO_TIMESTAMP('2017-04-21 14:07:12','YYYY-MM-DD HH24:MI:SS'),100,'R','Review')
;
-- 2017-04-21T14:07:12.884
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541265 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-04-21T14:07:47.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541266,540714,TO_TIMESTAMP('2017-04-21 14:07:47','YYYY-MM-DD HH24:MI:SS'),100,'EE01','Y','Complete',TO_TIMESTAMP('2017-04-21 14:07:47','YYYY-MM-DD HH24:MI:SS'),100,'C','Complete')
;
-- 2017-04-21T14:07:47.466
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541266 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-04-21T14:08:22.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AllowZoomTo,CacheInvalidateParent,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsDLMPartitionBoundary,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,556488,543313,0,17,540714,53027,'N','N','PlanningStatus',TO_TIMESTAMP('2017-04-21 14:08:22','YYYY-MM-DD HH24:MI:SS'),100,'N','P','EE01',1,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','Planning status',0,TO_TIMESTAMP('2017-04-21 14:08:22','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 2017-04-21T14:08:22.140
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=556488 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 2017-04-21T14:08:28.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('pp_order','ALTER TABLE public.PP_Order ADD COLUMN PlanningStatus CHAR(1) DEFAULT ''P'' NOT NULL')
;
-- 2017-04-25T17:12:23.560
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,UpdatedBy) VALUES (0,556488,558144,0,53054,TO_TIMESTAMP('2017-04-25 17:12:23','YYYY-MM-DD HH24:MI:SS'),100,1,'EE01','Y','Y','Y','N','N','N','N','N','Planning status',TO_TIMESTAMP('2017-04-25 17:12:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-25T17:12:23.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=558144 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2017-04-25T17:12:55.433
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='N', IsDisplayedGrid='N',Updated=TO_TIMESTAMP('2017-04-25 17:12:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558144
;
-- 2017-04-25T18:50:28.808
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,540781,'N','de.metas.ui.web.pporder.process.WEBUI_PP_Order_ChangePlanningStatus_Planning','N',TO_TIMESTAMP('2017-04-25 18:50:28','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y','N','N','N','N','N','N','Y',0,'Status: Planning','N','Y','Java',TO_TIMESTAMP('2017-04-25 18:50:28','YYYY-MM-DD HH24:MI:SS'),100,'WEBUI_PP_Order_ChangePlanningStatus_Planning')
;
-- 2017-04-25T18:50:28.815
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540781 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2017-04-25T18:50:47.400
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_QuickAction,WEBUI_QuickAction_Default) VALUES (0,0,540781,53027,TO_TIMESTAMP('2017-04-25 18:50:47','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y',TO_TIMESTAMP('2017-04-25 18:50:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','N')
;
-- 2017-04-25T18:51:25.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,540782,'N','de.metas.ui.web.pporder.process.WEBUI_PP_Order_ChangePlanningStatus_Review','N',TO_TIMESTAMP('2017-04-25 18:51:25','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y','N','N','N','N','N','N','Y',0,'Status: Review','N','Y','Java',TO_TIMESTAMP('2017-04-25 18:51:25','YYYY-MM-DD HH24:MI:SS'),100,'WEBUI_PP_Order_ChangePlanningStatus_Review')
;
-- 2017-04-25T18:51:25.742
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540782 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2017-04-25T18:51:40.608
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_QuickAction,WEBUI_QuickAction_Default) VALUES (0,0,540782,53027,TO_TIMESTAMP('2017-04-25 18:51:40','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y',TO_TIMESTAMP('2017-04-25 18:51:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','N')
;
-- 2017-04-25T18:52:16.583
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsUseBPartnerLanguage,LockWaitTimeout,Name,RefreshAllAfterExecution,ShowHelp,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,540783,'N','de.metas.ui.web.pporder.process.WEBUI_PP_Order_ChangePlanningStatus_Complete','N',TO_TIMESTAMP('2017-04-25 18:52:16','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','N','N','N','N','N','N','Y',0,'Status: Planning complete','N','Y','Java',TO_TIMESTAMP('2017-04-25 18:52:16','YYYY-MM-DD HH24:MI:SS'),100,'WEBUI_PP_Order_ChangePlanningStatus_Complete')
;
-- 2017-04-25T18:52:16.588
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540783 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2017-04-25T18:52:32.993
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_QuickAction,WEBUI_QuickAction_Default) VALUES (0,0,540783,53027,TO_TIMESTAMP('2017-04-25 18:52:32','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.ui.web','Y',TO_TIMESTAMP('2017-04-25 18:52:32','YYYY-MM-DD HH24:MI:SS'),100,'N','N')
;
-- 2017-04-25T18:52:36.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET WEBUI_QuickAction='Y',Updated=TO_TIMESTAMP('2017-04-25 18:52:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540783 AND AD_Table_ID=53027
;
-- 2017-04-25T19:08:34.408
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Message_Trl WHERE AD_Message_ID=544301
;
-- 2017-04-25T19:08:34.415
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Message WHERE AD_Message_ID=544301
;
-- 2017-04-25T20:16:16.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET IsActive='N',Updated=TO_TIMESTAMP('2017-04-25 20:16:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540783 AND AD_Table_ID=53027
;
-- 2017-04-25T20:16:28.376
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET IsActive='N',Updated=TO_TIMESTAMP('2017-04-25 20:16:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540782 AND AD_Table_ID=53027
;
-- 2017-04-25T20:16:34.597
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table_Process SET IsActive='N',Updated=TO_TIMESTAMP('2017-04-25 20:16:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540781 AND AD_Table_ID=53027
; | the_stack |
-- SETTINGS
SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES
('modules', 'bx_convos', '_bx_cnv', 'bx_convos@modules/boonex/convos/|std-icon.svg', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
SET @iTypeId = LAST_INSERT_ID();
INSERT INTO `sys_options_categories` (`type_id`, `name`, `caption`, `order`)
VALUES (@iTypeId, 'bx_convos', '_bx_cnv', 1);
SET @iCategId = LAST_INSERT_ID();
INSERT INTO `sys_options` (`name`, `value`, `category_id`, `caption`, `type`, `check`, `check_error`, `extra`, `order`) VALUES
('bx_convos_preview_messages_num', '3', @iCategId, '_bx_cnv_option_preview_messages_num', 'digit', '', '', '', 1);
-- PAGE: dash
SET @iPBCellDashboard = 3;
SET @iPBOrderDashboard = 0;
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
('sys_dashboard', @iPBCellDashboard, 'bx_convos', '_bx_cnv_page_block_title_convos', 11, 2147483644, 'service', 'a:3:{s:6:"module";s:9:"bx_convos";s:6:"method";s:17:"messages_previews";s:6:"params";a:2:{i:0;i:0;i:1;b:0;}}', 0, 1, 0, @iPBOrderDashboard);
-- PAGE: create entry
INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_convos_create_entry', '_bx_cnv_page_title_sys_create_entry', '_bx_cnv_page_title_create_entry', 'bx_convos', 5, 2147483647, 1, 'start-convo', 'page.php?i=start-convo', '', '', '', 0, 1, 0, 'BxCnvPageBrowse', 'modules/boonex/convos/classes/BxCnvPageBrowse.php');
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_convos_create_entry', 1, 'bx_convos', '_bx_cnv_page_block_title_create_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:13:"entity_create";}', 0, 1, 1);
-- PAGE: edit entry
INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_convos_edit_entry', '_bx_cnv_page_title_sys_edit_entry', '_bx_cnv_page_title_edit_entry', 'bx_convos', 5, 2147483647, 0, 'edit-convo', '', '', '', '', 0, 0, 0, 'BxCnvPageBrowse', 'modules/boonex/convos/classes/BxCnvPageBrowse.php');
INSERT INTO `sys_pages_blocks` (`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_convos_edit_entry', 1, 'bx_convos', '_bx_cnv_page_block_title_edit_entry', 11, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:11:"entity_edit";}', 0, 0, 0);
-- PAGE: view entry
INSERT INTO `sys_objects_page`(`object`, `uri`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_convos_view_entry', 'view-convo', '_bx_cnv_page_title_sys_view_entry', '_bx_cnv_page_title_view_entry', 'bx_convos', 10, 2147483647, 1, '', '', '', '', 0, 1, 0, 'BxCnvPageEntry', 'modules/boonex/convos/classes/BxCnvPageEntry.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `active`, `order`) VALUES
('bx_convos_view_entry', 1, 'bx_convos', '_bx_cnv_page_block_title_entry_breadcrumb', 13, 2147483647, 'service', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:17:"entity_breadcrumb";}', 0, 0, 1, 0),
('bx_convos_view_entry', 4, 'bx_convos', '_bx_cnv_page_block_title_entry_text', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:17:\"entity_text_block\";}', 0, 0, 1, 0),
('bx_convos_view_entry', 3, 'bx_convos', '_bx_cnv_page_block_title_entry_collaborators', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:20:\"entity_collaborators\";}', 0, 0, 1, 0),
('bx_convos_view_entry', 2, 'bx_convos', '_bx_cnv_page_block_title_entry_author', 13, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:13:\"entity_author\";}', 0, 0, 1, 0),
('bx_convos_view_entry', 4, 'bx_convos', '_bx_cnv_page_block_title_entry_attachments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:18:\"entity_attachments\";}', 0, 0, 1, 1),
('bx_convos_view_entry', 4, 'bx_convos', '_bx_cnv_page_block_title_entry_comments', 11, 2147483647, 'service', 'a:2:{s:6:\"module\";s:9:\"bx_convos\";s:6:\"method\";s:15:\"entity_comments\";}', 0, 0, 1, 2);
-- PAGE: module home
INSERT INTO `sys_objects_page`(`object`, `title_system`, `title`, `module`, `layout_id`, `visible_for_levels`, `visible_for_levels_editable`, `uri`, `url`, `meta_description`, `meta_keywords`, `meta_robots`, `cache_lifetime`, `cache_editable`, `deletable`, `override_class_name`, `override_class_file`) VALUES
('bx_convos_home', '_bx_cnv_page_title_sys_folder', '_bx_cnv_page_title_folder', 'bx_convos', 5, 2147483647, 1, 'convos-folder', 'modules/?r=convos/folder/1', '', '', '', 0, 1, 0, 'BxCnvPageBrowse', 'modules/boonex/convos/classes/BxCnvPageBrowse.php');
INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title`, `designbox_id`, `visible_for_levels`, `type`, `content`, `deletable`, `copyable`, `order`) VALUES
('bx_convos_home', 1, 'bx_convos', '_bx_cnv_page_block_title_folder', 11, 2147483647, 'service', 'a:3:{s:6:"module";s:9:"bx_convos";s:6:"method";s:23:"conversations_in_folder";s:6:"params";a:1:{i:0;s:11:"{folder_id}";}}', 0, 1, 0);
-- MENU: actions menu for view entry
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_convos_view', '_bx_cnv_menu_title_view_entry', 'bx_convos_view', 'bx_convos', 9, 0, 1, 'BxCnvMenuView', 'modules/boonex/convos/classes/BxCnvMenuView.php');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_convos_view', 'bx_convos', '_bx_cnv_menu_set_title_view_entry', 0);
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('bx_convos_view', 'bx_convos', 'edit-convo', '_bx_cnv_menu_item_title_system_edit_entry', '_bx_cnv_menu_item_title_edit_entry', 'page.php?i=edit-convo&id={content_id}', '', '', 'pencil', '', 2147483647, 1, 0, 1),
('bx_convos_view', 'bx_convos', 'delete-convo', '_bx_cnv_menu_item_title_system_delete_entry', '_bx_cnv_menu_item_title_delete_entry', 'javascript:void(0);', 'bx_cnv_delete(this, \'{content_id}\')', '', 'remove', '', 2147483647, 1, 0, 2),
('bx_convos_view', 'bx_convos', 'mark-unread-convo', '_bx_cnv_menu_item_title_system_mark_unread_entry', '_bx_cnv_menu_item_title_mark_unread_entry', 'javascript:void(0);', 'bx_cnv_mark_unread(this, \'{content_id}\')', '', 'check', '', 2147483647, 1, 0, 3);
-- MENU: module sub-menu
INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
('bx_convos_submenu', '_bx_cnv_menu_title_submenu', 'bx_convos_submenu', 'bx_convos', 8, 0, 1, '', '');
INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
('bx_convos_submenu', 'bx_convos', '_bx_cnv_menu_set_title_submenu', 0);
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('bx_convos_submenu', 'bx_convos', 'convos-folder-inbox', '_bx_cnv_menu_item_title_system_folder_inbox', '_bx_cnv_menu_item_title_folder_inbox', 'modules/?r=convos/folder/1', '', '', '', '', 2147483647, 1, 1, 1),
('bx_convos_submenu', 'bx_convos', 'convos-drafts', '_bx_cnv_menu_item_title_system_folder_drafts', '_bx_cnv_menu_item_title_folder_drafts', 'modules/?r=convos/folder/2', '', '', '', '', 2147483647, 1, 1, 2),
('bx_convos_submenu', 'bx_convos', 'convos-spam', '_bx_cnv_menu_item_title_system_folder_spam', '_bx_cnv_menu_item_title_folder_spam', 'modules/?r=convos/folder/3', '', '', '', '', 2147483647, 1, 1, 3),
('bx_convos_submenu', 'bx_convos', 'convos-trash', '_bx_cnv_menu_item_title_system_folder_trash', '_bx_cnv_menu_item_title_folder_trash', 'modules/?r=convos/folder/4', '', '', '', '', 2147483647, 1, 1, 4);
-- ('bx_convos_submenu', 'bx_convos', 'convos-folder-more', '_bx_cnv_menu_item_title_system_folder_more', '_bx_cnv_menu_item_title_folder_more', 'javascript:void(0);', 'bx_menu_popup(''bx_convos_menu_folders_more'', this);', '', '', '', 2147483647, 1, 1, 5)
-- TODO: Remove it completely if 'more' menu item isn't needed.
-- MENU: more folders
-- INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES
-- ('bx_convos_menu_folders_more', '_bx_cnv_menu_title_folders_more', 'bx_convos_menu_folders_more', 'bx_convos', 4, 0, 1, '', '');
-- INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
-- ('bx_convos_menu_folders_more', 'bx_convos', '_bx_cnv_menu_set_title_folders_more', 0);
-- INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
-- ('bx_convos_menu_folders_more', 'bx_convos', 'convos-drafts', '_bx_cnv_menu_item_title_system_folder_drafts', '_bx_cnv_menu_item_title_folder_drafts', 'modules/?r=convos/folder/2', '', '', '', '', 2147483647, 1, 1, 1);
-- MENU: notifications
SET @iMIOrder = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name` = 'sys_account_notifications' AND `order` < 9999);
INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('sys_account_notifications', 'bx_convos', 'notifications-convos', '_bx_cnv_menu_item_title_system_convos', '_bx_cnv_menu_item_title_convos', 'modules/?r=convos/folder/1', '', '', 'comments col-red1', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:23:"get_unread_messages_num";}', '', 2147483646, 1, 0, @iMIOrder + 1);
-- MENU: profile stats
INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('sys_profile_stats', 'bx_convos', 'profile-stats-unread-messages', '_bx_cnv_menu_item_title_system_unread_messages', '_bx_cnv_menu_item_title_unread_messages', 'modules/?r=convos/folder/1', '', '', 'comments col-red1', 'a:2:{s:6:"module";s:9:"bx_convos";s:6:"method";s:23:"get_unread_messages_num";}', '', 2147483646, 1, 0, 2);
-- MENU: add menu item to profiles modules actions menu (trigger* menu sets are processed separately upon modules enable/disable)
INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
('trigger_profile_view_actions', 'bx_convos', 'convos-compose', '_bx_cnv_menu_item_title_system_message', '_bx_cnv_menu_item_title_message', 'page.php?i=start-convo&profiles={profile_id}', '', '', 'envelope', '', 2147483646, 1, 0, 0),
('trigger_group_view_actions', 'bx_convos', 'convos-compose', '_bx_cnv_menu_item_title_system_message_group', '_bx_cnv_menu_item_title_message_group', 'page.php?i=start-convo&profiles={recipients}', '', '', 'envelope', '', 2147483646, 1, 0, 0);
-- GRID
INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `field_id`, `field_order`, `paginate_url`, `paginate_per_page`, `paginate_simple`, `paginate_get_start`, `paginate_get_per_page`, `filter_fields`, `filter_mode`, `sorting_fields`, `visible_for_levels`, `override_class_name`, `override_class_file`) VALUES
('bx_convos', 'Sql', 'SELECT `c`.`id`, `c`.`author`, `c`.`text`, `c`.`added`, `c`.`comments`, `f`.`read_comments`, `last_reply_timestamp`, `last_reply_profile_id`, `cmt`.`cmt_text` FROM `bx_convos_conversations` AS `c` INNER JOIN `bx_convos_conv2folder` AS `f` ON (`c`.`id` = `f`.`conv_id` AND `f`.`folder_id` = {folder_id} AND `f`.`collaborator` = {profile_id}) LEFT JOIN `bx_convos_cmts` AS `cmt` ON (`cmt`.`cmt_id` = `c`.`last_reply_comment_id`)', 'bx_convos_conversations', 'id', 'last_reply_timestamp', '', 10, NULL, 'start', '', 'text', 'auto', 'comments,last_reply_timestamp', 2147483646, 'BxCnvGrid', 'modules/boonex/convos/classes/BxCnvGrid.php');
INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
('bx_convos', 'checkbox', '_sys_select', '2%', '', 1),
('bx_convos', 'collaborators', '_bx_cnv_field_collaborators', '25%', '', 2),
('bx_convos', 'last_reply_timestamp', '_bx_cnv_field_preview', '68%', '', 3),
('bx_convos', 'comments', '_bx_cnv_field_comments', '5%', '', 4);
INSERT INTO `sys_grid_actions` (`object`, `type`, `name`, `title`, `icon`, `confirm`, `order`) VALUES
('bx_convos', 'bulk', 'delete', '_bx_cnv_grid_action_delete', '', 1, 1),
('bx_convos', 'independent', 'add', '_bx_cnv_grid_action_compose', '', 0, 1);
-- ACL
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_convos', 'create entry', NULL, '_bx_cnv_acl_action_create_entry', '', 1, 3);
SET @iIdActionEntryCreate = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_convos', 'delete entry', NULL, '_bx_cnv_acl_action_delete_entry', '', 1, 3);
SET @iIdActionEntryDelete = LAST_INSERT_ID();
INSERT INTO `sys_acl_actions` (`Module`, `Name`, `AdditionalParamName`, `Title`, `Desc`, `Countable`, `DisabledForLevels`) VALUES
('bx_convos', 'view entry', NULL, '_bx_cnv_acl_action_view_entry', '', 1, 0);
SET @iIdActionEntryView = LAST_INSERT_ID();
SET @iUnauthenticated = 1;
SET @iAccount = 2;
SET @iStandard = 3;
SET @iUnconfirmed = 4;
SET @iPending = 5;
SET @iSuspended = 6;
SET @iModerator = 7;
SET @iAdministrator = 8;
SET @iPremium = 9;
INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES
-- entry create
(@iStandard, @iIdActionEntryCreate),
(@iModerator, @iIdActionEntryCreate),
(@iAdministrator, @iIdActionEntryCreate),
(@iPremium, @iIdActionEntryCreate),
-- entry delete
(@iStandard, @iIdActionEntryDelete),
(@iModerator, @iIdActionEntryDelete),
(@iAdministrator, @iIdActionEntryDelete),
(@iPremium, @iIdActionEntryDelete),
-- entry view
(@iUnauthenticated, @iIdActionEntryView),
(@iAccount, @iIdActionEntryView),
(@iStandard, @iIdActionEntryView),
(@iUnconfirmed, @iIdActionEntryView),
(@iPending, @iIdActionEntryView),
(@iModerator, @iIdActionEntryView),
(@iAdministrator, @iIdActionEntryView),
(@iPremium, @iIdActionEntryView);
-- COMMENTS
INSERT INTO `sys_objects_cmts` (`Name`, `Module`, `Table`, `CharsPostMin`, `CharsPostMax`, `CharsDisplayMax`, `Nl2br`, `PerView`, `PerViewReplies`, `BrowseType`, `IsBrowseSwitch`, `PostFormPosition`, `NumberOfLevels`, `IsDisplaySwitch`, `IsRatable`, `ViewingThreshold`, `IsOn`, `RootStylePrefix`, `BaseUrl`, `ObjectVote`, `TriggerTable`, `TriggerFieldId`, `TriggerFieldAuthor`, `TriggerFieldTitle`, `TriggerFieldComments`, `ClassName`, `ClassFile`) VALUES
('bx_convos', 'bx_convos', 'bx_convos_cmts', 1, 5000, 1000, 1, 5, 3, 'tail', 1, 'bottom', 1, 1, 1, -3, 1, 'cmt', 'page.php?i=view-convo&id={object_id}', '', 'bx_convos_conversations', 'id', 'author', 'text', 'comments', 'BxCnvCmts', 'modules/boonex/convos/classes/BxCnvCmts.php');
-- VIEWS
INSERT INTO `sys_objects_view` (`name`, `table_track`, `period`, `is_on`, `trigger_table`, `trigger_field_id`, `trigger_field_author`, `trigger_field_count`, `class_name`, `class_file`) VALUES
('bx_convos', 'bx_convos_views_track', '86400', '1', 'bx_convos_conversations', 'id', 'author', 'views', '', '');
-- LIVE UPDATES
INSERT INTO `sys_objects_live_updates`(`name`, `frequency`, `service_call`, `active`) VALUES
('bx_convos', 1, 'a:3:{s:6:"module";s:9:"bx_convos";s:6:"method";s:16:"get_live_updates";s:6:"params";a:3:{i:0;a:2:{s:11:"menu_object";s:18:"sys_toolbar_member";s:9:"menu_item";s:7:"account";}i:1;a:2:{s:11:"menu_object";s:25:"sys_account_notifications";s:9:"menu_item";s:20:"notifications-convos";}i:2;s:7:"{count}";}}', 1);
-- ALERTS
INSERT INTO `sys_alerts_handlers` (`name`, `class`, `file`, `service_call`) VALUES
('bx_convos', 'BxCnvAlertsResponse', 'modules/boonex/convos/classes/BxCnvAlertsResponse.php', '');
SET @iHandler := LAST_INSERT_ID();
INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES
('bx_convos', 'commentPost', @iHandler),
('bx_convos', 'commentRemoved', @iHandler),
('profile', 'delete', @iHandler);
-- EMAIL TEMPLATES
INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `Body`) VALUES
('bx_convos', '_bx_cnv_email_new_message', 'bx_cnv_new_message', '_bx_cnv_email_new_message_subject', '_bx_cnv_email_new_message_body'),
('bx_convos', '_bx_cnv_email_new_reply', 'bx_cnv_new_reply', '_bx_cnv_email_new_reply_subject', '_bx_cnv_email_new_reply_body'); | the_stack |
elapsedtime on;
--set spark.sql.shuffle.partitions=29;
SELECT * FROM Categories;
SELECT * FROM Customers;
SELECT * FROM Orders;
----- SELECTing Specific Columns
SELECT FirstName, LastName FROM Employees;
----- Sorting By Multiple Columns
SELECT FirstName, LastName FROM Employees ORDER BY LastName;
----- Sorting By Column Position
SELECT Title, FirstName, LastName FROM Employees ORDER BY 1,3;
----- Ascending and Descending Sorts
SELECT Title, FirstName, LastName FROM Employees ORDER BY Title ASC, LastName DESC;
----- Checking for Equality
SELECT Title, FirstName, LastName FROM Employees WHERE Title = 'Sales Representative';
----- Checking for Inequality
SELECT FirstName, LastName FROM Employees WHERE Title <> 'Sales Representative';
----- Checking for Greater or Less Than
SELECT FirstName, LastName FROM Employees WHERE LastName >= 'N';
----- Checking for NULL
SELECT FirstName, LastName FROM Employees WHERE Region IS NULL;
----- WHERE and ORDER BY
SELECT FirstName, LastName FROM Employees WHERE LastName >= 'N' ORDER BY LastName DESC;
----- Using the WHERE clause to check for equality or inequality
SELECT OrderDate, ShippedDate, CustomerID, Freight FROM Orders WHERE OrderDate = Cast('1997-05-19' as TIMESTAMP);
----- Using WHERE and ORDER BY Together
SELECT CompanyName, ContactName, Fax FROM Customers WHERE Fax IS NOT NULL ORDER BY CompanyName;
----- The IN Operator
SELECT TitleOfCourtesy, FirstName, LastName FROM Employees WHERE TitleOfCourtesy IN ('Ms.','Mrs.');
----- The LIKE Operator
SELECT TitleOfCourtesy, FirstName, LastName FROM Employees WHERE TitleOfCourtesy LIKE 'M%';
SELECT FirstName, LastName, BirthDate FROM Employees WHERE BirthDate BETWEEN Cast('1950-01-01' as TIMESTAMP) AND Cast('1959-12-31 23:59:59' as TIMESTAMP);
SELECT CONCAT(FirstName, ' ', LastName) FROM Employees;
SELECT OrderDate, count(1) from Orders group by OrderDate order by OrderDate asc;
SELECT OrderDate, count(1) from Orders group by OrderDate order by OrderDate;
SELECT OrderID, Freight, Freight * 1.1 AS FreightTotal FROM Orders WHERE Freight >= 500;
SELECT SUM(Quantity) AS TotalUnits FROM Order_Details WHERE ProductID=3;
SELECT MIN(HireDate) AS FirstHireDate, MAX(HireDate) AS LastHireDate FROM Employees;
SELECT City, COUNT(EmployeeID) AS NumEmployees FROM Employees WHERE Title = 'Sales Representative' GROUP BY City HAVING COUNT(EmployeeID) > 1 ORDER BY NumEmployees;
SELECT COUNT(DISTINCT City) AS NumCities FROM Employees;
SELECT ProductID, AVG(UnitPrice) AS AveragePrice FROM Products GROUP BY ProductID HAVING AVG(UnitPrice) > 70 ORDER BY AveragePrice;
SELECT CompanyName FROM Customers WHERE CustomerID = (SELECT CustomerID FROM Orders WHERE OrderID = 10290) --GEMFIREXD-PROPERTIES executionEngine=Spark
;
SELECT CompanyName FROM Customers WHERE CustomerID IN (SELECT CustomerID FROM Orders WHERE OrderDate BETWEEN Cast('1997-01-01' as TIMESTAMP) AND Cast('1997-12-31' as TIMESTAMP));
SELECT ProductName, SupplierID FROM Products WHERE SupplierID IN (SELECT SupplierID FROM Suppliers WHERE CompanyName IN ('Exotic Liquids', 'Grandma Kelly''s Homestead', 'Tokyo Traders'));
SELECT ProductName FROM Products WHERE CategoryID = (SELECT CategoryID FROM Categories WHERE CategoryName = 'Seafood') --GEMFIREXD-PROPERTIES executionEngine=Spark
;
SELECT CompanyName FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Products WHERE CategoryID = 8) --GEMFIREXD-PROPERTIES executionEngine=Spark
;
SELECT CompanyName FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Products WHERE CategoryID = (SELECT CategoryID FROM Categories WHERE CategoryName = 'Seafood')) --GEMFIREXD-PROPERTIES executionEngine=Spark
;
SELECT Employees.EmployeeID, Employees.FirstName, Employees.LastName, Orders.OrderID, Orders.OrderDate FROM Employees JOIN Orders ON (Employees.EmployeeID = Orders.EmployeeID) ORDER BY Orders.OrderDate;
SELECT o.OrderID, c.CompanyName, e.FirstName, e.LastName FROM Orders o JOIN Employees e ON (e.EmployeeID = o.EmployeeID) JOIN Customers c ON (c.CustomerID = o.CustomerID) WHERE o.ShippedDate > o.RequiredDate AND o.OrderDate > Cast ('1998-01-01' as TIMESTAMP) ORDER BY c.CompanyName;
SELECT e.FirstName, e.LastName, o.OrderID FROM Employees e JOIN Orders o ON (e.EmployeeID = o.EmployeeID) WHERE o.RequiredDate < o.ShippedDate ORDER BY e.LastName, e.FirstName;
SELECT p.ProductName, SUM(od.Quantity) AS TotalUnits FROM Order_Details od JOIN Products p ON (p.ProductID = od.ProductID) GROUP BY p.ProductName HAVING SUM(Quantity) < 200;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City, c.City FROM Employees e JOIN Customers c ON (e.City = c.City) GROUP BY e.City, c.City ORDER BY numEmployees DESC;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City, c.City FROM Employees e LEFT JOIN Customers c ON (e.City = c.City) GROUP BY e.City, c.City ORDER BY numEmployees DESC;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City, c.City FROM Employees e RIGHT JOIN Customers c ON (e.City = c.City) GROUP BY e.City, c.City ORDER BY numEmployees DESC;
SELECT COUNT(DISTINCT e.EmployeeID) AS numEmployees, COUNT(DISTINCT c.CustomerID) AS numCompanies, e.City, c.City FROM Employees e FULL JOIN Customers c ON (e.City = c.City) GROUP BY e.City, c.City ORDER BY numEmployees DESC;
select s.supplierid,s.companyname,p.productid,p.productname from suppliers s join products p on(s.supplierid= p.supplierid) and s.companyname IN('Grandma Kelly''s Homestead','Tokyo Traders','Exotic Liquids');
SELECT c.customerID, o.orderID FROM customers c INNER JOIN orders o ON c.CustomerID = o.CustomerID;
SELECT order_details.OrderID,ShipCountry,UnitPrice,Quantity,Discount FROM orders INNER JOIN Order_Details ON Orders.OrderID = Order_Details.OrderID;
SELECT ShipCountry, Sum(Order_Details.UnitPrice * Quantity * Discount) AS ProductSales FROM Orders INNER JOIN Order_Details ON Orders.OrderID = Order_Details.OrderID GROUP BY ShipCountry;
SELECT * FROM orders LEFT SEMI JOIN order_details ON orders.OrderID = order_details.OrderId;
select distinct (a.ShippedDate) as ShippedDate, a.OrderID, b.Subtotal, year(a.ShippedDate) as Year from Orders a
inner join ( select distinct OrderID, sum(UnitPrice * Quantity * (1 - Discount)) as Subtotal
from order_details group by OrderID ) b on a.OrderID = b.OrderID
where a.ShippedDate is not null and a.ShippedDate > Cast('1996-12-24' as TIMESTAMP) and a.ShippedDate < Cast('1997-09-30' as TIMESTAMP)
order by ShippedDate;
select distinct a.CategoryID, a.CategoryName, b.ProductName, sum(c.ExtendedPrice) as ProductSales
from Categories a
inner join Products b on a.CategoryID = b.CategoryID
inner join ( select distinct y.OrderID, y.ProductID, x.ProductName, y.UnitPrice, y.Quantity, y.Discount,
round(y.UnitPrice * y.Quantity * (1 - y.Discount), 2) as ExtendedPrice
from Products x
inner join Order_Details y on x.ProductID = y.ProductID
order by y.OrderID
) c on c.ProductID = b.ProductID
inner join Orders d on d.OrderID = c.OrderID
where d.OrderDate > Cast('1997-01-01' as TIMESTAMP) and d.OrderDate < Cast('1997-12-31' as TIMESTAMP)
group by a.CategoryID, a.CategoryName, b.ProductName
order by a.CategoryName, b.ProductName, ProductSales;
select c.CategoryName as Product_Category, case when s.Country in ('UK','Spain','Sweden','Germany','Norway','Denmark','Netherlands','Finland','Italy','France')
then 'Europe' when s.Country in ('USA','Canada','Brazil') then 'America' else 'Asia-Pacific' end as Supplier_Continent, sum(p.UnitsInStock)
as UnitsInStock from Suppliers s inner join Products p on p.SupplierID=s.SupplierID inner join Categories c on c.CategoryID=p.CategoryID
group by c.CategoryName, case when s.Country in ('UK','Spain','Sweden','Germany','Norway', 'Denmark','Netherlands','Finland','Italy','France')
then 'Europe' when s.Country in ('USA','Canada','Brazil') then 'America' else 'Asia-Pacific'
end --GEMFIREXD-PROPERTIES executionEngine=Spark
;
select CategoryName, format_number(sum(ProductSales), 2) as CategorySales from (select distinct a.CategoryName, b.ProductName,
format_number(sum(c.UnitPrice * c.Quantity * (1 - c.Discount)), 2) as ProductSales, concat('Qtr ', quarter(d.ShippedDate))
as ShippedQuarter from Categories as a inner join Products as b on a.CategoryID = b.CategoryID inner join Order_Details
as c on b.ProductID = c.ProductID inner join Orders as d on d.OrderID = c.OrderID where d.ShippedDate > Cast('1997-01-01' as TIMESTAMP) and d.ShippedDate < Cast('1997-12-31' as TIMESTAMP)
group by a.CategoryName, b.ProductName, concat('Qtr ', quarter(d.ShippedDate)) order by a.CategoryName, b.ProductName, ShippedQuarter )
as x group by CategoryName order by CategoryName;
set spark.sql.crossJoin.enabled=true;
SELECT * FROM orders LEFT SEMI JOIN order_details;
SELECT count(*) FROM orders JOIN order_details;
SELECT count(*) FROM orders LEFT JOIN order_details;
SELECT count(*) FROM orders RIGHT JOIN order_details;
SELECT count(*) FROM orders FULL OUTER JOIN order_details;
SELECT count(*) FROM orders FULL JOIN order_details;
SELECT * FROM orders JOIN order_details ON Orders.OrderID = Order_Details.OrderID;
SELECT * FROM orders LEFT JOIN order_details ON Orders.OrderID = Order_Details.OrderID;
SELECT * FROM orders RIGHT JOIN order_details ON Orders.OrderID = Order_Details.OrderID;
SELECT * FROM orders FULL OUTER JOIN order_details ON Orders.OrderID = Order_Details.OrderID;
SELECT * FROM orders FULL JOIN order_details ON Orders.OrderID = Order_Details.OrderID;
select distinct b.ShipName, b.ShipAddress, b.ShipCity, b.ShipRegion, b.ShipPostalCode, b.ShipCountry, b.CustomerID,
c.CompanyName, c.Address, c.City, c.Region, c.PostalCode, c.Country, concat(d.FirstName, ' ', d.LastName) as Salesperson,
b.OrderID, b.OrderDate, b.RequiredDate, b.ShippedDate, a.CompanyName, e.ProductID, f.ProductName, e.UnitPrice, e.Quantity,
e.Discount, e.UnitPrice * e.Quantity * (1 - e.Discount) as ExtendedPrice, b.Freight
from Shippers a
inner join Orders b on a.ShipperID = b.ShipVia
inner join Customers c on c.CustomerID = b.CustomerID
inner join Employees d on d.EmployeeID = b.EmployeeID
inner join Order_Details e on b.OrderID = e.OrderID
inner join Products f on f.ProductID = e.ProductID
order by b.ShipName;
--This query shows how to use UNION to merge Customers and Suppliers into one result set by
--identifying them as having different relationships to Northwind Traders - Customers and Suppliers.
select City, CompanyName, ContactName, 'Customers' as Relationship
from Customers
union
select City, CompanyName, ContactName, 'Suppliers'
from Suppliers
order by City, CompanyName;
--In the query below, we have two sub-queries in the FROM clause and each sub-query returns a single
-- value. Because the results of the two sub-queries are basically temporary tables, we can join
--them like joining two real tables. In the SELECT clause, we simply list the two counts.
select a.CustomersCount, b.SuppliersCount
from
(select count(CustomerID) as CustomersCount from customers) as a
join
(select count(SupplierID) as SuppliersCount from suppliers) as b;
-- The second query below uses the two values again but this time it calculates the ratio
--between customers count and suppliers count. The round and concat function are used to
--the result.
select concat(round(a.CustomersCount / b.SuppliersCount), ':1') as Customer_vs_Supplier_Ratio
from
(select count(CustomerID) as CustomersCount from customers) as a
join
(select count(SupplierID) as SuppliersCount from suppliers) as b;
-- This query shows how to convert order dates to the corresponding quarters. It also
--demonstrates how SUM function is used together with CASE statement to get sales for each
--quarter, where quarters are converted from OrderDate column.
--This query is commented due to SNAP-1434
select a.ProductName,
d.CompanyName,
year(OrderDate) as OrderYear,
format_number(sum(case quarter(c.OrderDate) when '1'
then b.UnitPrice*b.Quantity*(1-b.Discount) else 0 end), 0) "Qtr_1",
format_number(sum(case quarter(c.OrderDate) when '2'
then b.UnitPrice*b.Quantity*(1-b.Discount) else 0 end), 0) "Qtr_2",
format_number(sum(case quarter(c.OrderDate) when '3'
then b.UnitPrice*b.Quantity*(1-b.Discount) else 0 end), 0) "Qtr_3",
format_number(sum(case quarter(c.OrderDate) when '4'
then b.UnitPrice*b.Quantity*(1-b.Discount) else 0 end), 0) "Qtr_4"
from Products a
inner join Order_Details b on a.ProductID = b.ProductID
inner join Orders c on c.OrderID = b.OrderID
inner join Customers d on d.CustomerID = c.CustomerID
where c.OrderDate between Cast('1997-01-01' as TIMESTAMP) and Cast('1997-12-31' as TIMESTAMP)
group by a.ProductName,
d.CompanyName,
year(OrderDate)
order by a.ProductName, d.CompanyName; | the_stack |
-- 2018-03-26T18:33:21.366
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsUseBPartnerLanguage,JasperReport,Name,RefreshAllAfterExecution,ShowHelp,SQLStatement,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,540946,'Y','org.compiere.report.ReportStarter',TO_TIMESTAMP('2018-03-26 18:33:21','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','N','N','Y','N','Y','N','Y','@PREFIX@de/metas/reports/revenue_po_report/report.xls','Revenue PO Excel','N','Y','','Java',TO_TIMESTAMP('2018-03-26 18:33:21','YYYY-MM-DD HH24:MI:SS'),100,'Revenue PO Excel (Jasper)')
;
-- 2018-03-26T18:33:21.375
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540946 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2018-03-26T18:34:32.865
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,ReadOnlyLogic,SeqNo,Updated,UpdatedBy) VALUES (0,113,0,540946,541274,19,'AD_Org_ID',TO_TIMESTAMP('2018-03-26 18:34:32','YYYY-MM-DD HH24:MI:SS'),100,'@AD_Org_ID@','Organisatorische Einheit des Mandanten','de.metas.fresh',0,'Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Y','N','Y','N','N','N','Sektion','1=1',10,TO_TIMESTAMP('2018-03-26 18:34:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-03-26T18:34:32.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541274 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2018-03-26T18:35:01.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540946,541275,15,'Base_Period_Start',TO_TIMESTAMP('2018-03-26 18:35:01','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh',0,'Y','N','Y','N','N','N','Zeitperiode von',20,TO_TIMESTAMP('2018-03-26 18:35:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-03-26T18:35:01.301
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541275 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2018-03-26T18:35:29.992
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540946,541277,15,'Base_Period_End',TO_TIMESTAMP('2018-03-26 18:35:29','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh',0,'Y','N','Y','N','Y','N','Zeitperiode bis',30,TO_TIMESTAMP('2018-03-26 18:35:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-03-26T18:35:29.996
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541277 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2018-03-26T18:35:32.772
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2018-03-26 18:35:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541275
;
-- 2018-03-26T18:37:55.494
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540946,541278,15,'Comp_Period_Start',TO_TIMESTAMP('2018-03-26 18:37:55','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh',0,'Y','N','Y','N','N','N','Vergleichsperiode von',40,TO_TIMESTAMP('2018-03-26 18:37:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-03-26T18:37:55.497
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541278 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2018-03-26T18:38:17.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540946,541279,15,'Comp_Period_End',TO_TIMESTAMP('2018-03-26 18:38:17','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh',0,'Y','N','Y','N','N','N','Vergleichsperiode bis',50,TO_TIMESTAMP('2018-03-26 18:38:17','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-03-26T18:38:17.159
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541279 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2018-03-26T18:39:15.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,1383,0,540946,541280,19,'C_BP_Group_ID',TO_TIMESTAMP('2018-03-26 18:39:14','YYYY-MM-DD HH24:MI:SS'),100,'Geschäftspartnergruppe','de.metas.fresh',0,'Eine Geschäftspartner-Gruppe bietet Ihnen die Möglichkeit, Standard-Werte für einzelne Geschäftspartner zu verwenden.','Y','N','Y','N','N','N','Geschäftspartnergruppe',60,TO_TIMESTAMP('2018-03-26 18:39:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-03-26T18:39:15.107
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=541280 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2018-03-26T18:43:46.088
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='SELECT * FROM report.revenue_PO_report (@Base_Period_Start@, @Base_Period_End@, @Comp_Period_Start/NULL@, @Comp_Period_End/NULL@, ''N'', NULL, NULL, NULL, NULL, NULL, @AD_Org_ID@, NULL, @C_BP_Group_ID/NULL@);',Updated=TO_TIMESTAMP('2018-03-26 18:43:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540946
;
-- 2018-03-26T18:47:18.614
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('R',0,541064,0,540946,TO_TIMESTAMP('2018-03-26 18:47:18','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Revenue PO Excel (Jasper)','Y','N','N','N','N','Revenue PO Excel',TO_TIMESTAMP('2018-03-26 18:47:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-03-26T18:47:18.617
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=541064 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2018-03-26T18:47:18.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 541064, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=541064)
;
-- 2018-03-26T18:47:19.213
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540614 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.215
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540750 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.216
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540616 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.216
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540681 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.217
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=540617 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.217
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540742 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540618 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540619 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540632 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.220
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540635 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.220
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540698 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.221
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540637 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.221
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540638 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.222
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540648 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.223
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=540674 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.223
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=540709 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.224
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=540708 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.224
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=540679 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.225
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=540678 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.225
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=19, Updated=now(), UpdatedBy=100 WHERE Node_ID=540684 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.226
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=20, Updated=now(), UpdatedBy=100 WHERE Node_ID=540686 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.226
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=21, Updated=now(), UpdatedBy=100 WHERE Node_ID=540706 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.227
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=22, Updated=now(), UpdatedBy=100 WHERE Node_ID=540701 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.227
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=23, Updated=now(), UpdatedBy=100 WHERE Node_ID=540712 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.228
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=24, Updated=now(), UpdatedBy=100 WHERE Node_ID=540722 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.228
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=25, Updated=now(), UpdatedBy=100 WHERE Node_ID=540723 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.229
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=26, Updated=now(), UpdatedBy=100 WHERE Node_ID=540725 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=27, Updated=now(), UpdatedBy=100 WHERE Node_ID=540739 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=28, Updated=now(), UpdatedBy=100 WHERE Node_ID=540740 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=29, Updated=now(), UpdatedBy=100 WHERE Node_ID=540741 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=30, Updated=now(), UpdatedBy=100 WHERE Node_ID=540968 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=31, Updated=now(), UpdatedBy=100 WHERE Node_ID=541059 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.233
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=32, Updated=now(), UpdatedBy=100 WHERE Node_ID=541058 AND AD_Tree_ID=10
;
-- 2018-03-26T18:47:19.233
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=33, Updated=now(), UpdatedBy=100 WHERE Node_ID=541064 AND AD_Tree_ID=10
;
-- 2018-03-26T18:49:50.872
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='SELECT * FROM report.revenue_PO_report (@Base_Period_Start@::date, @Base_Period_End@::date, @Comp_Period_Start/NULL@::date, @Comp_Period_End/NULL@::date, ''N'', NULL, NULL, NULL, NULL, NULL, @AD_Org_ID@, NULL, @C_BP_Group_ID/NULL@);',Updated=TO_TIMESTAMP('2018-03-26 18:49:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540946
;
-- 2018-03-26T18:51:58.407
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET SQLStatement='SELECT * FROM report.revenue_PO_report (''@Base_Period_Start@''::date, ''@Base_Period_End@''::date, ''@Comp_Period_Start/NULL@''::date, ''@Comp_Period_End/NULL@''::date, ''N'', NULL, NULL, NULL, NULL, NULL, @AD_Org_ID@, NULL, @C_BP_Group_ID/NULL@);',Updated=TO_TIMESTAMP('2018-03-26 18:51:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540946
; | the_stack |
-- Aggregates defined in the 4.0 Catalog:
--
-- Derived via the following SQL run within a 4.0 catalog
/*
\o /tmp/aggregates
SELECT 'CREATE AGGREGATE upg_catalog.' || quote_ident(p.proname) || '('
|| coalesce(array_to_string(array(
select 'upg_catalog.' || quote_ident(typname)
from pg_type t, generate_series(1, p.pronargs) i
where t.oid = p.proargtypes[i-1]
order by i), ', '), '')
|| ') ('
|| E'\n SFUNC = ' || quote_ident(sfunc.proname)
|| E',\n STYPE = upg_catalog.' || quote_ident(stype.typname)
|| case when prefunc.oid is not null then E',\n PREFUNC = ' || quote_ident(prefunc.proname) else '' end
|| case when finfunc.oid is not null then E',\n FINALFUNC = ' || quote_ident(finfunc.proname) else '' end
|| case when agginitval is not null then E',\n INITCOND = ''' || agginitval || '''' else '' end
|| case when sortop.oid is not null then E',\n SORTOP = ' || quote_ident(sortop.oprname) else '' end
|| E'\n);'
FROM pg_aggregate a
join pg_proc p on (a.aggfnoid = p.oid)
join pg_proc sfunc on (a.aggtransfn = sfunc.oid)
join pg_type stype on (a.aggtranstype = stype.oid)
left join pg_proc prefunc on (a.aggprelimfn = prefunc.oid)
left join pg_proc finfunc on (a.aggfinalfn = finfunc.oid)
left join pg_operator sortop on (a.aggsortop = sortop.oid)
ORDER BY 1;
*/
CREATE AGGREGATE upg_catalog."every"(upg_catalog.bool) (
SFUNC = booland_statefunc,
STYPE = upg_catalog.bool,
PREFUNC = booland_statefunc
);
CREATE AGGREGATE upg_catalog.array_sum(upg_catalog._int4) (
SFUNC = array_add,
STYPE = upg_catalog._int4,
PREFUNC = array_add,
INITCOND = '{}'
);
CREATE AGGREGATE upg_catalog.avg(upg_catalog."interval") (
SFUNC = interval_accum,
STYPE = upg_catalog._interval,
PREFUNC = interval_amalg,
FINALFUNC = interval_avg,
INITCOND = '{0 second,0 second}'
);
CREATE AGGREGATE upg_catalog.avg(upg_catalog."numeric") (
SFUNC = numeric_avg_accum,
STYPE = upg_catalog.bytea,
PREFUNC = numeric_avg_amalg,
FINALFUNC = numeric_avg,
INITCOND = ''
);
CREATE AGGREGATE upg_catalog.avg(upg_catalog.float4) (
SFUNC = float4_avg_accum,
STYPE = upg_catalog.bytea,
PREFUNC = float8_avg_amalg,
FINALFUNC = float8_avg,
INITCOND = ''
);
CREATE AGGREGATE upg_catalog.avg(upg_catalog.float8) (
SFUNC = float8_avg_accum,
STYPE = upg_catalog.bytea,
PREFUNC = float8_avg_amalg,
FINALFUNC = float8_avg,
INITCOND = ''
);
CREATE AGGREGATE upg_catalog.avg(upg_catalog.int2) (
SFUNC = int2_avg_accum,
STYPE = upg_catalog.bytea,
PREFUNC = int8_avg_amalg,
FINALFUNC = int8_avg,
INITCOND = ''
);
CREATE AGGREGATE upg_catalog.avg(upg_catalog.int4) (
SFUNC = int4_avg_accum,
STYPE = upg_catalog.bytea,
PREFUNC = int8_avg_amalg,
FINALFUNC = int8_avg,
INITCOND = ''
);
CREATE AGGREGATE upg_catalog.avg(upg_catalog.int8) (
SFUNC = int8_avg_accum,
STYPE = upg_catalog.bytea,
PREFUNC = int8_avg_amalg,
FINALFUNC = int8_avg,
INITCOND = ''
);
CREATE AGGREGATE upg_catalog.bit_and(upg_catalog."bit") (
SFUNC = bitand,
STYPE = upg_catalog."bit",
PREFUNC = bitand
);
CREATE AGGREGATE upg_catalog.bit_and(upg_catalog.int2) (
SFUNC = int2and,
STYPE = upg_catalog.int2,
PREFUNC = int2and
);
CREATE AGGREGATE upg_catalog.bit_and(upg_catalog.int4) (
SFUNC = int4and,
STYPE = upg_catalog.int4,
PREFUNC = int4and
);
CREATE AGGREGATE upg_catalog.bit_and(upg_catalog.int8) (
SFUNC = int8and,
STYPE = upg_catalog.int8,
PREFUNC = int8and
);
CREATE AGGREGATE upg_catalog.bit_or(upg_catalog."bit") (
SFUNC = bitor,
STYPE = upg_catalog."bit",
PREFUNC = bitor
);
CREATE AGGREGATE upg_catalog.bit_or(upg_catalog.int2) (
SFUNC = int2or,
STYPE = upg_catalog.int2,
PREFUNC = int2or
);
CREATE AGGREGATE upg_catalog.bit_or(upg_catalog.int4) (
SFUNC = int4or,
STYPE = upg_catalog.int4,
PREFUNC = int4or
);
CREATE AGGREGATE upg_catalog.bit_or(upg_catalog.int8) (
SFUNC = int8or,
STYPE = upg_catalog.int8,
PREFUNC = int8or
);
CREATE AGGREGATE upg_catalog.bool_and(upg_catalog.bool) (
SFUNC = booland_statefunc,
STYPE = upg_catalog.bool,
PREFUNC = booland_statefunc
);
CREATE AGGREGATE upg_catalog.bool_or(upg_catalog.bool) (
SFUNC = boolor_statefunc,
STYPE = upg_catalog.bool,
PREFUNC = boolor_statefunc
);
CREATE AGGREGATE upg_catalog.corr(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_corr,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.count() (
SFUNC = int8inc,
STYPE = upg_catalog.int8,
PREFUNC = int8pl,
INITCOND = '0'
);
CREATE AGGREGATE upg_catalog.count(upg_catalog."any") (
SFUNC = int8inc_any,
STYPE = upg_catalog.int8,
PREFUNC = int8pl,
INITCOND = '0'
);
CREATE AGGREGATE upg_catalog.covar_pop(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_covar_pop,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.covar_samp(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_covar_samp,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.max(upg_catalog."interval") (
SFUNC = interval_larger,
STYPE = upg_catalog."interval",
PREFUNC = interval_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog."numeric") (
SFUNC = numeric_larger,
STYPE = upg_catalog."numeric",
PREFUNC = numeric_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog."time") (
SFUNC = time_larger,
STYPE = upg_catalog."time",
PREFUNC = time_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog."timestamp") (
SFUNC = timestamp_larger,
STYPE = upg_catalog."timestamp",
PREFUNC = timestamp_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.abstime) (
SFUNC = int4larger,
STYPE = upg_catalog.abstime,
PREFUNC = int4larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.anyarray) (
SFUNC = array_larger,
STYPE = upg_catalog.anyarray,
PREFUNC = array_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.bpchar) (
SFUNC = bpchar_larger,
STYPE = upg_catalog.bpchar,
PREFUNC = bpchar_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.date) (
SFUNC = date_larger,
STYPE = upg_catalog.date,
PREFUNC = date_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.float4) (
SFUNC = float4larger,
STYPE = upg_catalog.float4,
PREFUNC = float4larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.float8) (
SFUNC = float8larger,
STYPE = upg_catalog.float8,
PREFUNC = float8larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.gpxlogloc) (
SFUNC = gpxlogloclarger,
STYPE = upg_catalog.gpxlogloc,
PREFUNC = gpxlogloclarger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.int2) (
SFUNC = int2larger,
STYPE = upg_catalog.int2,
PREFUNC = int2larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.int4) (
SFUNC = int4larger,
STYPE = upg_catalog.int4,
PREFUNC = int4larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.int8) (
SFUNC = int8larger,
STYPE = upg_catalog.int8,
PREFUNC = int8larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.money) (
SFUNC = cashlarger,
STYPE = upg_catalog.money,
PREFUNC = cashlarger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.oid) (
SFUNC = oidlarger,
STYPE = upg_catalog.oid,
PREFUNC = oidlarger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.text) (
SFUNC = text_larger,
STYPE = upg_catalog.text,
PREFUNC = text_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.tid) (
SFUNC = tidlarger,
STYPE = upg_catalog.tid,
PREFUNC = tidlarger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.timestamptz) (
SFUNC = timestamptz_larger,
STYPE = upg_catalog.timestamptz,
PREFUNC = timestamptz_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.max(upg_catalog.timetz) (
SFUNC = timetz_larger,
STYPE = upg_catalog.timetz,
PREFUNC = timetz_larger,
SORTOP = ">"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog."interval") (
SFUNC = interval_smaller,
STYPE = upg_catalog."interval",
PREFUNC = interval_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog."numeric") (
SFUNC = numeric_smaller,
STYPE = upg_catalog."numeric",
PREFUNC = numeric_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog."time") (
SFUNC = time_smaller,
STYPE = upg_catalog."time",
PREFUNC = time_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog."timestamp") (
SFUNC = timestamp_smaller,
STYPE = upg_catalog."timestamp",
PREFUNC = timestamp_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.abstime) (
SFUNC = int4smaller,
STYPE = upg_catalog.abstime,
PREFUNC = int4smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.anyarray) (
SFUNC = array_smaller,
STYPE = upg_catalog.anyarray,
PREFUNC = array_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.bpchar) (
SFUNC = bpchar_smaller,
STYPE = upg_catalog.bpchar,
PREFUNC = bpchar_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.date) (
SFUNC = date_smaller,
STYPE = upg_catalog.date,
PREFUNC = date_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.float4) (
SFUNC = float4smaller,
STYPE = upg_catalog.float4,
PREFUNC = float4smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.float8) (
SFUNC = float8smaller,
STYPE = upg_catalog.float8,
PREFUNC = float8smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.gpxlogloc) (
SFUNC = gpxloglocsmaller,
STYPE = upg_catalog.gpxlogloc,
PREFUNC = gpxloglocsmaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.int2) (
SFUNC = int2smaller,
STYPE = upg_catalog.int2,
PREFUNC = int2smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.int4) (
SFUNC = int4smaller,
STYPE = upg_catalog.int4,
PREFUNC = int4smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.int8) (
SFUNC = int8smaller,
STYPE = upg_catalog.int8,
PREFUNC = int8smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.money) (
SFUNC = cashsmaller,
STYPE = upg_catalog.money,
PREFUNC = cashsmaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.oid) (
SFUNC = oidsmaller,
STYPE = upg_catalog.oid,
PREFUNC = oidsmaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.text) (
SFUNC = text_smaller,
STYPE = upg_catalog.text,
PREFUNC = text_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.tid) (
SFUNC = tidsmaller,
STYPE = upg_catalog.tid,
PREFUNC = tidsmaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.timestamptz) (
SFUNC = timestamptz_smaller,
STYPE = upg_catalog.timestamptz,
PREFUNC = timestamptz_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.min(upg_catalog.timetz) (
SFUNC = timetz_smaller,
STYPE = upg_catalog.timetz,
PREFUNC = timetz_smaller,
SORTOP = "<"
);
CREATE AGGREGATE upg_catalog.mregr_coef(upg_catalog.float8, upg_catalog._float8) (
SFUNC = float8_mregr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_mregr_combine,
FINALFUNC = float8_mregr_coef,
INITCOND = '{0}'
);
CREATE AGGREGATE upg_catalog.mregr_r2(upg_catalog.float8, upg_catalog._float8) (
SFUNC = float8_mregr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_mregr_combine,
FINALFUNC = float8_mregr_r2,
INITCOND = '{0}'
);
CREATE AGGREGATE upg_catalog.nb_classify(upg_catalog._text, upg_catalog.int8, upg_catalog._int8, upg_catalog._int8) (
SFUNC = nb_classify_accum,
STYPE = upg_catalog.nb_classification,
PREFUNC = nb_classify_combine,
FINALFUNC = nb_classify_final
);
CREATE AGGREGATE upg_catalog.pivot_sum(upg_catalog._text, upg_catalog.text, upg_catalog.float8) (
SFUNC = float8_pivot_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_matrix_accum
);
CREATE AGGREGATE upg_catalog.pivot_sum(upg_catalog._text, upg_catalog.text, upg_catalog.int4) (
SFUNC = int4_pivot_accum,
STYPE = upg_catalog._int4,
PREFUNC = int8_matrix_accum
);
CREATE AGGREGATE upg_catalog.pivot_sum(upg_catalog._text, upg_catalog.text, upg_catalog.int8) (
SFUNC = int8_pivot_accum,
STYPE = upg_catalog._int8,
PREFUNC = int8_matrix_accum
);
CREATE AGGREGATE upg_catalog.regr_avgx(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_regr_avgx,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.regr_avgy(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_regr_avgy,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.regr_count(upg_catalog.float8, upg_catalog.float8) (
SFUNC = int8inc_float8_float8,
STYPE = upg_catalog.int8,
PREFUNC = int8pl,
INITCOND = '0'
);
CREATE AGGREGATE upg_catalog.regr_intercept(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_regr_intercept,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.regr_r2(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_regr_r2,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.regr_slope(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_regr_slope,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.regr_sxx(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_regr_sxx,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.regr_sxy(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_regr_sxy,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.regr_syy(upg_catalog.float8, upg_catalog.float8) (
SFUNC = float8_regr_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_regr_amalg,
FINALFUNC = float8_regr_syy,
INITCOND = '{0,0,0,0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev(upg_catalog."numeric") (
SFUNC = numeric_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev(upg_catalog.float4) (
SFUNC = float4_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev(upg_catalog.float8) (
SFUNC = float8_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev(upg_catalog.int2) (
SFUNC = int2_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev(upg_catalog.int4) (
SFUNC = int4_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev(upg_catalog.int8) (
SFUNC = int8_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_pop(upg_catalog."numeric") (
SFUNC = numeric_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_pop(upg_catalog.float4) (
SFUNC = float4_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_stddev_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_pop(upg_catalog.float8) (
SFUNC = float8_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_stddev_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_pop(upg_catalog.int2) (
SFUNC = int2_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_pop(upg_catalog.int4) (
SFUNC = int4_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_pop(upg_catalog.int8) (
SFUNC = int8_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_samp(upg_catalog."numeric") (
SFUNC = numeric_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_samp(upg_catalog.float4) (
SFUNC = float4_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_samp(upg_catalog.float8) (
SFUNC = float8_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_samp(upg_catalog.int2) (
SFUNC = int2_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_samp(upg_catalog.int4) (
SFUNC = int4_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.stddev_samp(upg_catalog.int8) (
SFUNC = int8_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_stddev_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog."interval") (
SFUNC = interval_pl,
STYPE = upg_catalog."interval",
PREFUNC = interval_pl
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog."numeric") (
SFUNC = numeric_add,
STYPE = upg_catalog."numeric",
PREFUNC = numeric_add
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog._float8) (
SFUNC = float8_matrix_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_matrix_accum
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog._int2) (
SFUNC = int2_matrix_accum,
STYPE = upg_catalog._int8,
PREFUNC = int8_matrix_accum
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog._int4) (
SFUNC = int4_matrix_accum,
STYPE = upg_catalog._int8,
PREFUNC = int8_matrix_accum
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog._int8) (
SFUNC = int8_matrix_accum,
STYPE = upg_catalog._int8,
PREFUNC = int8_matrix_accum
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog.float4) (
SFUNC = float4pl,
STYPE = upg_catalog.float4,
PREFUNC = float4pl
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog.float8) (
SFUNC = float8pl,
STYPE = upg_catalog.float8,
PREFUNC = float8pl
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog.int2) (
SFUNC = int2_sum,
STYPE = upg_catalog.int8,
PREFUNC = int8pl
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog.int4) (
SFUNC = int4_sum,
STYPE = upg_catalog.int8,
PREFUNC = int8pl
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog.int8) (
SFUNC = int8_sum,
STYPE = upg_catalog."numeric",
PREFUNC = numeric_add
);
CREATE AGGREGATE upg_catalog.sum(upg_catalog.money) (
SFUNC = cash_pl,
STYPE = upg_catalog.money,
PREFUNC = cash_pl
);
CREATE AGGREGATE upg_catalog.var_pop(upg_catalog."numeric") (
SFUNC = numeric_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_pop(upg_catalog.float4) (
SFUNC = float4_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_var_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_pop(upg_catalog.float8) (
SFUNC = float8_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_var_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_pop(upg_catalog.int2) (
SFUNC = int2_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_pop(upg_catalog.int4) (
SFUNC = int4_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_pop(upg_catalog.int8) (
SFUNC = int8_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_pop,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_samp(upg_catalog."numeric") (
SFUNC = numeric_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_samp(upg_catalog.float4) (
SFUNC = float4_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_samp(upg_catalog.float8) (
SFUNC = float8_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_samp(upg_catalog.int2) (
SFUNC = int2_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_samp(upg_catalog.int4) (
SFUNC = int4_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.var_samp(upg_catalog.int8) (
SFUNC = int8_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.variance(upg_catalog."numeric") (
SFUNC = numeric_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.variance(upg_catalog.float4) (
SFUNC = float4_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.variance(upg_catalog.float8) (
SFUNC = float8_accum,
STYPE = upg_catalog._float8,
PREFUNC = float8_amalg,
FINALFUNC = float8_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.variance(upg_catalog.int2) (
SFUNC = int2_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.variance(upg_catalog.int4) (
SFUNC = int4_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_samp,
INITCOND = '{0,0,0}'
);
CREATE AGGREGATE upg_catalog.variance(upg_catalog.int8) (
SFUNC = int8_accum,
STYPE = upg_catalog._numeric,
PREFUNC = numeric_amalg,
FINALFUNC = numeric_var_samp,
INITCOND = '{0,0,0}'
); | the_stack |
-- 12.02.2017 15:16
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-02-12 15:16:55','YYYY-MM-DD HH24:MI:SS'),Name='Invoice' WHERE AD_Field_ID=557237 AND AD_Language='en_US'
;
-- 12.02.2017 15:17
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-02-12 15:17:10','YYYY-MM-DD HH24:MI:SS'),Name='Payment',Description='',Help='' WHERE AD_Field_ID=557238 AND AD_Language='en_US'
;
-- 12.02.2017 15:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-02-12 15:18:11','YYYY-MM-DD HH24:MI:SS'),Name='Cost Unit',Description='',Help='Identifier of the Cost Unit.' WHERE AD_Field_ID=557240 AND AD_Language='en_US'
;
-- 12.02.2017 15:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-02-12 15:18:42','YYYY-MM-DD HH24:MI:SS'),Name='Organisation',Description='Organisational entity within client',Help='An organisation is a unit of your client or legal entity - examples are store, department. You can share data between organizations.' WHERE AD_Field_ID=5168 AND AD_Language='en_US'
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540840
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540842
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540843
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540844
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540845
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540846
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540847
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540848
;
-- 12.02.2017 15:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-02-12 15:19:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540841
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540872
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540873
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540870
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540856
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540849
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540862
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540864
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540855
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540863
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540877
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540879
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540875
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540871
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540878
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540874
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540867
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540866
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540865
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540857
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540861
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540860
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540876
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540852
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540853
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540854
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540869
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540868
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540859
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540858
;
-- 12.02.2017 15:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-02-12 15:21:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540850
;
-- 12.02.2017 15:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-02-12 15:22:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540857
;
-- 12.02.2017 15:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-02-12 15:22:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540850
;
-- 12.02.2017 15:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-02-12 15:22:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540864
;
-- 12.02.2017 15:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-02-12 15:22:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540850
;
-- 12.02.2017 15:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-02-12 15:23:09','YYYY-MM-DD HH24:MI:SS'),Name='Cost Unit',Description='' WHERE AD_Field_ID=11467 AND AD_Language='en_US'
;
-- 12.02.2017 15:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-02-12 15:23:28','YYYY-MM-DD HH24:MI:SS'),Name='Organisation',Description='Organisational entity within client' WHERE AD_Field_ID=5209 AND AD_Language='en_US'
;
-- 12.02.2017 15:24
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-12 15:24:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540880
;
-- 12.02.2017 15:24
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-02-12 15:24:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540882
;
-- 12.02.2017 15:24
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-02-12 15:24:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540883
;
-- 12.02.2017 15:24
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-02-12 15:24:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540885
;
-- 12.02.2017 15:24
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-02-12 15:24:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540884
;
-- 12.02.2017 15:24
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-02-12 15:24:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=540881
;
-- 12.02.2017 15:25
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-02-12 15:25:04','YYYY-MM-DD HH24:MI:SS'),Name='Organisation',Description='Organisational entity within client',Help='An organisation is a unit of your client or legal entity - examples are store, department. You can share data between organisations.' WHERE AD_Field_ID=11660 AND AD_Language='en_US'
;
-- 12.02.2017 15:26
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-02-12 15:26:28','YYYY-MM-DD HH24:MI:SS'),Name='Organisation',Description='Organisational entity within client',Help='An organisation is a unit of your client or legal entity - examples are store, department. You can share data between organisations.' WHERE AD_Field_ID=11990 AND AD_Language='en_US'
; | the_stack |
----------------------------------------------------------------
-- [vm_pools] Table
--
CREATE OR REPLACE FUNCTION InsertVm_pools (
v_vm_pool_description VARCHAR(4000),
v_vm_pool_comment TEXT,
v_vm_pool_id UUID,
v_vm_pool_name VARCHAR(255),
v_vm_pool_type INT,
v_stateful BOOLEAN,
v_parameters VARCHAR(200),
v_prestarted_vms INT,
v_cluster_id UUID,
v_max_assigned_vms_per_user SMALLINT,
v_spice_proxy VARCHAR(255),
v_is_auto_storage_select BOOLEAN
)
RETURNS VOID AS $PROCEDURE$
BEGIN
INSERT INTO vm_pools (
vm_pool_id,
vm_pool_description,
vm_pool_comment,
vm_pool_name,
vm_pool_type,
stateful,
parameters,
prestarted_vms,
cluster_id,
max_assigned_vms_per_user,
spice_proxy,
is_auto_storage_select
)
VALUES (
v_vm_pool_id,
v_vm_pool_description,
v_vm_pool_comment,
v_vm_pool_name,
v_vm_pool_type,
v_stateful,
v_parameters,
v_prestarted_vms,
v_cluster_id,
v_max_assigned_vms_per_user,
v_spice_proxy,
v_is_auto_storage_select
);
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION UpdateVm_pools (
v_vm_pool_description VARCHAR(4000),
v_vm_pool_comment TEXT,
v_vm_pool_id UUID,
v_vm_pool_name VARCHAR(255),
v_vm_pool_type INT,
v_stateful BOOLEAN,
v_parameters VARCHAR(200),
v_prestarted_vms INT,
v_cluster_id UUID,
v_max_assigned_vms_per_user SMALLINT,
v_spice_proxy VARCHAR(255),
v_is_auto_storage_select BOOLEAN
)
RETURNS VOID
--The [vm_pools] table doesn't have a timestamp column. Optimistic concurrency logic cannot be generated
AS $PROCEDURE$
BEGIN
UPDATE vm_pools
SET vm_pool_description = v_vm_pool_description,
vm_pool_comment = v_vm_pool_comment,
vm_pool_name = v_vm_pool_name,
vm_pool_type = v_vm_pool_type,
stateful = v_stateful,
parameters = v_parameters,
prestarted_vms = v_prestarted_vms,
cluster_id = v_cluster_id,
max_assigned_vms_per_user = v_max_assigned_vms_per_user,
spice_proxy = v_spice_proxy,
is_auto_storage_select = v_is_auto_storage_select
WHERE vm_pool_id = v_vm_pool_id;
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION DeleteVm_pools (v_vm_pool_id UUID)
RETURNS VOID AS $PROCEDURE$
DECLARE v_val UUID;
BEGIN
-- Get (and keep) a shared lock with "right to upgrade to exclusive"
-- in order to force locking parent before children
SELECT vm_pool_id
INTO v_val
FROM vm_pools
WHERE vm_pool_id = v_vm_pool_id
FOR
UPDATE;
DELETE
FROM vm_pools
WHERE vm_pool_id = v_vm_pool_id;
-- delete VmPool permissions --
PERFORM DeletePermissionsByEntityId(v_vm_pool_id);
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION SetVmPoolBeingDestroyed (
v_vm_pool_id UUID,
v_is_being_destroyed BOOLEAN
)
RETURNS VOID AS $PROCEDURE$
BEGIN
UPDATE vm_pools
SET is_being_destroyed = v_is_being_destroyed
WHERE vm_pool_id = v_vm_pool_id;
END;$PROCEDURE$
LANGUAGE plpgsql;
DROP TYPE IF EXISTS GetAllFromVm_pools_rs CASCADE;
CREATE type GetAllFromVm_pools_rs AS (
vm_pool_id UUID,
assigned_vm_count INT,
vm_running_count INT,
vm_pool_description VARCHAR(4000),
vm_pool_comment TEXT,
vm_pool_name VARCHAR(255),
vm_pool_type INT,
stateful BOOLEAN,
parameters VARCHAR(200),
prestarted_vms INT,
cluster_id UUID,
cluster_name VARCHAR(40),
max_assigned_vms_per_user SMALLINT,
spice_proxy VARCHAR(255),
is_being_destroyed BOOLEAN,
is_auto_storage_select BOOLEAN
);
CREATE OR REPLACE FUNCTION GetAllFromVm_pools ()
RETURNS SETOF GetAllFromVm_pools_rs AS $PROCEDURE$
BEGIN
-- BEGIN TRAN
BEGIN
CREATE TEMPORARY TABLE tt_VM_POOL_GROUP (
vm_pool_id UUID,
assigned_vm_count INT
) ON COMMIT DROP;
exception when others then
TRUNCATE TABLE tt_VM_POOL_GROUP;
END;
INSERT INTO tt_VM_POOL_GROUP (
vm_pool_id,
assigned_vm_count
)
SELECT vm_pools_view.vm_pool_id,
count(vm_pool_map.vm_pool_id)
FROM vm_pools_view
LEFT JOIN vm_pool_map
ON vm_pools_view.vm_pool_id = vm_pool_map.vm_pool_id
GROUP BY vm_pools_view.vm_pool_id,
vm_pool_map.vm_pool_id;
BEGIN
CREATE TEMPORARY TABLE tt_VM_POOL_RUNNING (
vm_pool_id UUID,
vm_running_count INT
) ON COMMIT DROP;
exception when others then
TRUNCATE TABLE tt_VM_POOL_RUNNING;
END;
INSERT INTO tt_VM_POOL_RUNNING (
vm_pool_id,
vm_running_count
)
SELECT vm_pools_view.vm_pool_id,
count(vm_pools_view.vm_pool_id)
FROM vm_pools_view
LEFT JOIN vm_pool_map
ON vm_pools_view.vm_pool_id = vm_pool_map.vm_pool_id
LEFT JOIN vm_dynamic
ON vm_pool_map.vm_guid = vm_dynamic.vm_guid
WHERE vm_dynamic.status > 0
GROUP BY vm_pools_view.vm_pool_id;
BEGIN
CREATE TEMPORARY TABLE tt_VM_POOL_PRERESULT (
vm_pool_id UUID,
assigned_vm_count INT,
vm_running_count INT
) ON COMMIT DROP;
exception when others then
TRUNCATE TABLE tt_VM_POOL_PRERESULT;
END;
INSERT INTO tt_VM_POOL_PRERESULT (
vm_pool_id,
assigned_vm_count,
vm_running_count
)
SELECT pg.vm_pool_id,
pg.assigned_vm_count,
pr.vm_running_count
FROM tt_VM_POOL_GROUP pg
LEFT JOIN tt_VM_POOL_RUNNING pr
ON pg.vm_pool_id = pr.vm_pool_id;
UPDATE tt_VM_POOL_PRERESULT
SET vm_running_count = 0
WHERE vm_running_count IS NULL;
BEGIN
CREATE TEMPORARY TABLE tt_VM_POOL_RESULT (
vm_pool_id UUID,
assigned_vm_count INT,
vm_running_count INT,
vm_pool_description VARCHAR(4000),
vm_pool_comment TEXT,
vm_pool_name VARCHAR(255),
vm_pool_type INT,
stateful BOOLEAN,
parameters VARCHAR(200),
prestarted_vms INT,
cluster_id UUID,
cluster_name VARCHAR(40),
max_assigned_vms_per_user SMALLINT,
spice_proxy VARCHAR(255),
is_being_destroyed BOOLEAN,
is_auto_storage_select BOOLEAN
) ON COMMIT DROP;
exception when others then
TRUNCATE TABLE tt_VM_POOL_RESULT;
END;
INSERT INTO tt_VM_POOL_RESULT (
vm_pool_id,
assigned_vm_count,
vm_running_count,
vm_pool_description,
vm_pool_comment,
vm_pool_name,
vm_pool_type,
stateful,
parameters,
prestarted_vms,
cluster_id,
cluster_name,
max_assigned_vms_per_user,
spice_proxy,
is_being_destroyed,
is_auto_storage_select
)
SELECT ppr.vm_pool_id,
ppr.assigned_vm_count,
ppr.vm_running_count,
p.vm_pool_description,
p.vm_pool_comment,
p.vm_pool_name,
p.vm_pool_type,
p.stateful,
p.parameters,
p.prestarted_vms,
p.cluster_id,
p.cluster_name,
p.max_assigned_vms_per_user,
p.spice_proxy,
p.is_being_destroyed,
p.is_auto_storage_select
FROM tt_VM_POOL_PRERESULT ppr
INNER JOIN vm_pools_view p
ON ppr.vm_pool_id = p.vm_pool_id;
RETURN QUERY
SELECT *
FROM tt_VM_POOL_RESULT;
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION GetVm_poolsByvm_pool_id (
v_vm_pool_id UUID,
v_user_id UUID,
v_is_filtered BOOLEAN
)
RETURNS SETOF vm_pools_full_view STABLE AS $PROCEDURE$
BEGIN
RETURN QUERY
SELECT vm_pools_full_view.*
FROM vm_pools_full_view
WHERE vm_pool_id = v_vm_pool_id
AND (
NOT v_is_filtered
OR EXISTS (
SELECT 1
FROM user_vm_pool_permissions_view
WHERE user_id = v_user_id
AND entity_id = v_vm_pool_id
)
);
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION GetVm_poolsByvm_pool_name (v_vm_pool_name VARCHAR(255))
RETURNS SETOF vm_pools_view STABLE AS $PROCEDURE$
BEGIN
RETURN QUERY
SELECT vm_pools_view.*
FROM vm_pools_view
WHERE vm_pool_name = v_vm_pool_name;
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION GetAllVm_poolsByUser_id (v_user_id UUID)
RETURNS SETOF vm_pools_view STABLE AS $PROCEDURE$
BEGIN
RETURN QUERY
SELECT DISTINCT vm_pools_view.*
FROM users_and_groups_to_vm_pool_map_view
INNER JOIN vm_pools_view
ON users_and_groups_to_vm_pool_map_view.vm_pool_id = vm_pools_view.vm_pool_id
WHERE (users_and_groups_to_vm_pool_map_view.user_id = v_user_id);
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION GetAllFromVmPoolsFilteredAndSorted (v_user_id UUID, v_offset int, v_limit int)
RETURNS SETOF vm_pools_view STABLE AS $PROCEDURE$
BEGIN
RETURN QUERY
SELECT DISTINCT pools.*
FROM vm_pools_view pools
INNER JOIN user_vm_pool_permissions_view
ON user_id = v_user_id
AND entity_id = pools.vm_pool_id
ORDER BY pools.vm_pool_name ASC
LIMIT v_limit OFFSET v_offset;
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION GetVm_poolsByAdGroup_names (v_ad_group_names VARCHAR(4000))
RETURNS SETOF vm_pools_view STABLE AS $PROCEDURE$
BEGIN
RETURN QUERY
SELECT DISTINCT vm_pools_view.*
FROM ad_groups
INNER JOIN users_and_groups_to_vm_pool_map_view
ON ad_groups.id = users_and_groups_to_vm_pool_map_view.user_id
INNER JOIN vm_pools_view
ON users_and_groups_to_vm_pool_map_view.vm_pool_id = vm_pools_view.vm_pool_id
WHERE (
ad_groups.name IN (
SELECT Id
FROM fnSplitter(v_ad_group_names)
)
);
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION GetVmDataFromPoolByPoolId (
v_pool_id uuid,
v_user_id uuid,
v_is_filtered boolean
)
RETURNS SETOF vms STABLE AS $PROCEDURE$
BEGIN
RETURN QUERY
SELECT vms.*
FROM vms
WHERE vm_pool_id = v_pool_id
AND (
NOT v_is_filtered
OR EXISTS (
SELECT 1
FROM user_vm_pool_permissions_view
WHERE user_id = v_user_id
AND entity_id = v_pool_id
)
)
-- Limiting results to 1 since we only need a single VM from the pool to retrieve the pool data
LIMIT 1;
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION GetAllVm_poolsByUser_id_with_groups_and_UserRoles (v_user_id UUID)
RETURNS SETOF vm_pools_view STABLE AS $PROCEDURE$
BEGIN
RETURN QUERY
SELECT DISTINCT pools.*
FROM vm_pools_view pools
INNER JOIN user_vm_pool_permissions_view
ON user_id = v_user_id
AND entity_id = pools.vm_pool_id;
END;$PROCEDURE$
LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION BoundVmPoolPrestartedVms (v_vm_pool_id UUID)
RETURNS VOID AS $PROCEDURE$
BEGIN
UPDATE vm_pools
SET prestarted_vms = LEAST (
prestarted_vms, (
SELECT COUNT (*)
FROM vm_pool_map
WHERE vm_pool_id = v_vm_pool_id
)
)
WHERE vm_pool_id = v_vm_pool_id;
END;$PROCEDURE$
LANGUAGE plpgsql; | the_stack |
-- 26.10.2015 18:16
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_RelationType (AD_Client_ID,AD_Org_ID,AD_RelationType_ID,Created,CreatedBy,EntityType,IsActive,IsDirected,IsExplicit,Name,Updated,UpdatedBy) VALUES (0,0,540132,TO_TIMESTAMP('2015-10-26 18:16:30','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','N','C_Printing_Queue -> C_Order_MFGWarehouse_Report',TO_TIMESTAMP('2015-10-26 18:16:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 26.10.2015 18:17
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540589,TO_TIMESTAMP('2015-10-26 18:17:19','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','N','C_Printing_Queue -> C_Order_MFGWarehouse_Report',TO_TIMESTAMP('2015-10-26 18:17:19','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 26.10.2015 18:17
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540589 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 26.10.2015 18:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,548048,0,540589,540435,TO_TIMESTAMP('2015-10-26 18:18:14','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','N',TO_TIMESTAMP('2015-10-26 18:18:14','YYYY-MM-DD HH24:MI:SS'),100,'exists
(
select 1
from C_Printing_Queue pq
join AD_Archive a on pq.AD_Archive_ID = a.AD_Archive_ID and a.isActive = ''Y'' and pq.isActive = ''Y''
join C_Order_MFGWarehouse_Report mfg on
(
a.AD_Table_ID = (select ad_table_ID from ad_Table where tablename = ''C_Order_MFGWarehouse_Report'')
)
and a.Record_ID = mfg.C_Order_MFGWarehouse_Report_ID
and mfg.isActive = ''Y''
WHERE
C_Printing_Queue.C_Printing_Queue_ID = pq.C_Printing_Queue_ID
pq.C_Printing_Queue_ID = @C_Printing_Queue_ID/-1@
or
mfg.C_Order_MFGWarehouse_Report_ID = @C_Order_MFGWarehouse_Report_ID/-1@
)')
;
-- 26.10.2015 18:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Source_ID=540589,Updated=TO_TIMESTAMP('2015-10-26 18:18:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540132
;
-- 26.10.2015 18:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540590,TO_TIMESTAMP('2015-10-26 18:21:56','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','N','RelType C_Printing_Queue -> C_Order_MFGWarehouse_Report',TO_TIMESTAMP('2015-10-26 18:21:56','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 26.10.2015 18:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540590 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 26.10.2015 18:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy) VALUES (0,552733,0,540590,540683,TO_TIMESTAMP('2015-10-26 18:22:25','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','N',TO_TIMESTAMP('2015-10-26 18:22:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 26.10.2015 18:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='
exists
(
select 1
from C_Printing_Queue pq
join AD_Archive a on pq.AD_Archive_ID = a.AD_Archive_ID and a.isActive = ''Y'' and pq.isActive = ''Y''
join C_Order_MFGWarehouse_Report mfg on
(
a.AD_Table_ID = (select ad_table_ID from ad_Table where tablename = ''C_Order_MFGWarehouse_Report'')
)
and a.Record_ID = mfg.C_Order_MFGWarehouse_Report_ID
and mfg.isActive = ''Y''
WHERE
C_Printing_Queue.C_Printing_Queue_ID = pq.C_Printing_Queue_ID
pq.C_Printing_Queue_ID = @C_Printing_Queue_ID/-1@
or
mfg.C_Order_MFGWarehouse_Report_ID = @C_Order_MFGWarehouse_Report_ID/-1@
)
',Updated=TO_TIMESTAMP('2015-10-26 18:23:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540590
;
-- 26.10.2015 18:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET AD_Window_ID=540274,Updated=TO_TIMESTAMP('2015-10-26 18:23:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540590
;
-- 26.10.2015 18:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_RelationType SET AD_Reference_Target_ID=540590, EntityType='de.metas.fresh',Updated=TO_TIMESTAMP('2015-10-26 18:23:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540132
;
-- 27.10.2015 11:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='exists
(
select 1
from C_Printing_Queue pq
join AD_Archive a on pq.AD_Archive_ID = a.AD_Archive_ID and a.isActive = ''Y'' and pq.isActive = ''Y''
join C_Order_MFGWarehouse_Report mfg on
(
a.AD_Table_ID = (select ad_table_ID from ad_Table where tablename = ''C_Order_MFGWarehouse_Report'')
)
and a.Record_ID = mfg.C_Order_MFGWarehouse_Report_ID
and mfg.isActive = ''Y''
WHERE
C_Printing_Queue.C_Printing_Queue_ID = pq.C_Printing_Queue_ID and
(pq.C_Printing_Queue_ID = @C_Printing_Queue_ID/-1@
or
mfg.C_Order_MFGWarehouse_Report_ID = @C_Order_MFGWarehouse_Report_ID/-1@)
)',Updated=TO_TIMESTAMP('2015-10-27 11:06:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540589
;
-- 27.10.2015 11:06
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='
exists
(
select 1
from C_Printing_Queue pq
join AD_Archive a on pq.AD_Archive_ID = a.AD_Archive_ID and a.isActive = ''Y'' and pq.isActive = ''Y''
join C_Order_MFGWarehouse_Report mfg on
(
a.AD_Table_ID = (select ad_table_ID from ad_Table where tablename = ''C_Order_MFGWarehouse_Report'')
)
and a.Record_ID = mfg.C_Order_MFGWarehouse_Report_ID
and mfg.isActive = ''Y''
WHERE
C_Printing_Queue.C_Printing_Queue_ID = pq.C_Printing_Queue_ID and
(pq.C_Printing_Queue_ID = @C_Printing_Queue_ID/-1@
or
mfg.C_Order_MFGWarehouse_Report_ID = @C_Order_MFGWarehouse_Report_ID/-1@)
)
',Updated=TO_TIMESTAMP('2015-10-27 11:06:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540590
;
-- 27.10.2015 11:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='
exists
(
select 1
from C_Printing_Queue pq
join AD_Archive a on pq.AD_Archive_ID = a.AD_Archive_ID and a.isActive = ''Y'' and pq.isActive = ''Y''
join C_Order_MFGWarehouse_Report mfg on
(
a.AD_Table_ID = (select ad_table_ID from ad_Table where tablename = ''C_Order_MFGWarehouse_Report'')
)
and a.Record_ID = mfg.C_Order_MFGWarehouse_Report_ID
and mfg.isActive = ''Y''
WHERE
C_Order_MFGWarehouse_Report.C__Order_MFGWarehouse_Report_ID = mfg.C__Order_MFGWarehouse_Report_ID and
(pq.C_Printing_Queue_ID = @C_Printing_Queue_ID/-1@
or
mfg.C_Order_MFGWarehouse_Report_ID = @C_Order_MFGWarehouse_Report_ID/-1@)
)
',Updated=TO_TIMESTAMP('2015-10-27 11:08:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540590
;
-- 27.10.2015 11:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='
exists
(
select 1
from C_Printing_Queue pq
join AD_Archive a on pq.AD_Archive_ID = a.AD_Archive_ID and a.isActive = ''Y'' and pq.isActive = ''Y''
join C_Order_MFGWarehouse_Report mfg on
(
a.AD_Table_ID = (select ad_table_ID from ad_Table where tablename = ''C_Order_MFGWarehouse_Report'')
)
and a.Record_ID = mfg.C_Order_MFGWarehouse_Report_ID
and mfg.isActive = ''Y''
WHERE
C_Order_MFGWarehouse_Report.C__Order_MFGWarehouse_Report_ID = mfg.C_Order_MFGWarehouse_Report_ID and
(pq.C_Printing_Queue_ID = @C_Printing_Queue_ID/-1@
or
mfg.C_Order_MFGWarehouse_Report_ID = @C_Order_MFGWarehouse_Report_ID/-1@)
)
',Updated=TO_TIMESTAMP('2015-10-27 11:08:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540590
;
-- 27.10.2015 11:09
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Ref_Table SET WhereClause='
exists
(
select 1
from C_Printing_Queue pq
join AD_Archive a on pq.AD_Archive_ID = a.AD_Archive_ID and a.isActive = ''Y'' and pq.isActive = ''Y''
join C_Order_MFGWarehouse_Report mfg on
(
a.AD_Table_ID = (select ad_table_ID from ad_Table where tablename = ''C_Order_MFGWarehouse_Report'')
)
and a.Record_ID = mfg.C_Order_MFGWarehouse_Report_ID
and mfg.isActive = ''Y''
WHERE
C_Order_MFGWarehouse_Report.C_Order_MFGWarehouse_Report_ID = mfg.C_Order_MFGWarehouse_Report_ID and
(pq.C_Printing_Queue_ID = @C_Printing_Queue_ID/-1@
or
mfg.C_Order_MFGWarehouse_Report_ID = @C_Order_MFGWarehouse_Report_ID/-1@)
)
',Updated=TO_TIMESTAMP('2015-10-27 11:09:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540590
; | the_stack |
-- sanity check of system catalog
SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE attgenerated NOT IN ('', 's');
CREATE TABLE gtest0 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (55) STORED);
CREATE TABLE gtest1 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED);
SELECT table_name, column_name, column_default, is_nullable, is_generated, generation_expression FROM information_schema.columns WHERE table_name LIKE 'gtest_' ORDER BY 1, 2;
SELECT table_name, column_name, dependent_column FROM information_schema.column_column_usage ORDER BY 1, 2, 3;
\d gtest1
-- duplicate generated
CREATE TABLE gtest_err_1 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED GENERATED ALWAYS AS (a * 3) STORED);
-- references to other generated columns, including self-references
CREATE TABLE gtest_err_2a (a int PRIMARY KEY, b int GENERATED ALWAYS AS (b * 2) STORED);
CREATE TABLE gtest_err_2b (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED, c int GENERATED ALWAYS AS (b * 3) STORED);
-- invalid reference
CREATE TABLE gtest_err_3 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (c * 2) STORED);
-- generation expression must be immutable
CREATE TABLE gtest_err_4 (a int PRIMARY KEY, b double precision GENERATED ALWAYS AS (random()) STORED);
-- cannot have default/identity and generated
CREATE TABLE gtest_err_5a (a int PRIMARY KEY, b int DEFAULT 5 GENERATED ALWAYS AS (a * 2) STORED);
CREATE TABLE gtest_err_5b (a int PRIMARY KEY, b int GENERATED ALWAYS AS identity GENERATED ALWAYS AS (a * 2) STORED);
-- reference to system column not allowed in generated column
CREATE TABLE gtest_err_6a (a int PRIMARY KEY, b bool GENERATED ALWAYS AS (xmin <> 37) STORED);
-- various prohibited constructs
CREATE TABLE gtest_err_7a (a int PRIMARY KEY, b int GENERATED ALWAYS AS (avg(a)) STORED);
CREATE TABLE gtest_err_7b (a int PRIMARY KEY, b int GENERATED ALWAYS AS (row_number() OVER (ORDER BY a)) STORED);
CREATE TABLE gtest_err_7c (a int PRIMARY KEY, b int GENERATED ALWAYS AS ((SELECT a)) STORED);
CREATE TABLE gtest_err_7d (a int PRIMARY KEY, b int GENERATED ALWAYS AS (generate_series(1, a)) STORED);
-- GENERATED BY DEFAULT not allowed
CREATE TABLE gtest_err_8 (a int PRIMARY KEY, b int GENERATED BY DEFAULT AS (a * 2) STORED);
INSERT INTO gtest1 VALUES (1);
INSERT INTO gtest1 VALUES (2, DEFAULT);
INSERT INTO gtest1 VALUES (3, 33); -- error
SELECT * FROM gtest1 ORDER BY a;
UPDATE gtest1 SET b = DEFAULT WHERE a = 1;
UPDATE gtest1 SET b = 11 WHERE a = 1; -- error
SELECT * FROM gtest1 ORDER BY a;
SELECT a, b, b * 2 AS b2 FROM gtest1 ORDER BY a;
SELECT a, b FROM gtest1 WHERE b = 4 ORDER BY a;
-- test that overflow error happens on write
INSERT INTO gtest1 VALUES (2000000000);
SELECT * FROM gtest1;
DELETE FROM gtest1 WHERE a = 2000000000;
-- test with joins
CREATE TABLE gtestx (x int, y int);
INSERT INTO gtestx VALUES (11, 1), (22, 2), (33, 3);
SELECT * FROM gtestx, gtest1 WHERE gtestx.y = gtest1.a;
DROP TABLE gtestx;
-- test UPDATE/DELETE quals
SELECT * FROM gtest1 ORDER BY a;
UPDATE gtest1 SET a = 3 WHERE b = 4;
SELECT * FROM gtest1 ORDER BY a;
DELETE FROM gtest1 WHERE b = 2;
SELECT * FROM gtest1 ORDER BY a;
-- views
CREATE VIEW gtest1v AS SELECT * FROM gtest1;
SELECT * FROM gtest1v;
INSERT INTO gtest1v VALUES (4, 8); -- fails
DROP VIEW gtest1v;
-- CTEs
WITH foo AS (SELECT * FROM gtest1) SELECT * FROM foo;
-- inheritance
CREATE TABLE gtest1_1 () INHERITS (gtest1);
SELECT * FROM gtest1_1;
\d gtest1_1
INSERT INTO gtest1_1 VALUES (4);
SELECT * FROM gtest1_1;
SELECT * FROM gtest1;
-- test inheritance mismatch
CREATE TABLE gtesty (x int, b int);
CREATE TABLE gtest1_2 () INHERITS (gtest1, gtesty); -- error
DROP TABLE gtesty;
-- test stored update
CREATE TABLE gtest3 (a int, b int GENERATED ALWAYS AS (a * 3) STORED);
INSERT INTO gtest3 (a) VALUES (1), (2), (3), (NULL);
SELECT * FROM gtest3 ORDER BY a;
UPDATE gtest3 SET a = 22 WHERE a = 2;
SELECT * FROM gtest3 ORDER BY a;
CREATE TABLE gtest3a (a text, b text GENERATED ALWAYS AS (a || '+' || a) STORED);
INSERT INTO gtest3a (a) VALUES ('a'), ('b'), ('c'), (NULL);
SELECT * FROM gtest3a ORDER BY a;
UPDATE gtest3a SET a = 'bb' WHERE a = 'b';
SELECT * FROM gtest3a ORDER BY a;
-- COPY
TRUNCATE gtest1;
INSERT INTO gtest1 (a) VALUES (1), (2);
COPY gtest1 TO stdout;
COPY gtest1 (a, b) TO stdout;
COPY gtest1 FROM stdin;
3
4
\.
COPY gtest1 (a, b) FROM stdin;
SELECT * FROM gtest1 ORDER BY a;
TRUNCATE gtest3;
INSERT INTO gtest3 (a) VALUES (1), (2);
COPY gtest3 TO stdout;
COPY gtest3 (a, b) TO stdout;
COPY gtest3 FROM stdin;
3
4
\.
COPY gtest3 (a, b) FROM stdin;
SELECT * FROM gtest3 ORDER BY a;
-- null values
CREATE TABLE gtest2 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (NULL) STORED);
INSERT INTO gtest2 VALUES (1);
SELECT * FROM gtest2;
-- composite types
CREATE TYPE double_int as (a int, b int);
CREATE TABLE gtest4 (
a int,
b double_int GENERATED ALWAYS AS ((a * 2, a * 3)) STORED
);
INSERT INTO gtest4 VALUES (1), (6);
SELECT * FROM gtest4;
DROP TABLE gtest4;
DROP TYPE double_int;
-- using tableoid is allowed
CREATE TABLE gtest_tableoid (
a int PRIMARY KEY,
b bool GENERATED ALWAYS AS (tableoid <> 0) STORED
);
INSERT INTO gtest_tableoid VALUES (1), (2);
SELECT * FROM gtest_tableoid;
-- drop column behavior
CREATE TABLE gtest10 (a int PRIMARY KEY, b int, c int GENERATED ALWAYS AS (b * 2) STORED);
ALTER TABLE gtest10 DROP COLUMN b;
\d gtest10
CREATE TABLE gtest10a (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED);
ALTER TABLE gtest10a DROP COLUMN b;
INSERT INTO gtest10a (a) VALUES (1);
-- privileges
CREATE USER regress_user11;
CREATE TABLE gtest11s (a int PRIMARY KEY, b int, c int GENERATED ALWAYS AS (b * 2) STORED);
INSERT INTO gtest11s VALUES (1, 10), (2, 20);
GRANT SELECT (a, c) ON gtest11s TO regress_user11;
CREATE FUNCTION gf1(a int) RETURNS int AS $$ SELECT a * 3 $$ IMMUTABLE LANGUAGE SQL;
REVOKE ALL ON FUNCTION gf1(int) FROM PUBLIC;
CREATE TABLE gtest12s (a int PRIMARY KEY, b int, c int GENERATED ALWAYS AS (gf1(b)) STORED);
INSERT INTO gtest12s VALUES (1, 10), (2, 20);
GRANT SELECT (a, c) ON gtest12s TO regress_user11;
SET ROLE regress_user11;
SELECT a, b FROM gtest11s; -- not allowed
SELECT a, c FROM gtest11s; -- allowed
SELECT gf1(10); -- not allowed
SELECT a, c FROM gtest12s; -- allowed
RESET ROLE;
DROP TABLE gtest11s, gtest12s;
DROP FUNCTION gf1(int);
DROP USER regress_user11;
-- check constraints
CREATE TABLE gtest20 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED CHECK (b < 50));
INSERT INTO gtest20 (a) VALUES (10); -- ok
INSERT INTO gtest20 (a) VALUES (30); -- violates constraint
CREATE TABLE gtest20a (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED);
INSERT INTO gtest20a (a) VALUES (10);
INSERT INTO gtest20a (a) VALUES (30);
ALTER TABLE gtest20a ADD CHECK (b < 50); -- fails on existing row
CREATE TABLE gtest20b (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED);
INSERT INTO gtest20b (a) VALUES (10);
INSERT INTO gtest20b (a) VALUES (30);
ALTER TABLE gtest20b ADD CONSTRAINT chk CHECK (b < 50) NOT VALID;
ALTER TABLE gtest20b VALIDATE CONSTRAINT chk; -- fails on existing row
-- not-null constraints
CREATE TABLE gtest21a (a int PRIMARY KEY, b int GENERATED ALWAYS AS (nullif(a, 0)) STORED NOT NULL);
INSERT INTO gtest21a (a) VALUES (1); -- ok
INSERT INTO gtest21a (a) VALUES (0); -- violates constraint
CREATE TABLE gtest21b (a int PRIMARY KEY, b int GENERATED ALWAYS AS (nullif(a, 0)) STORED);
ALTER TABLE gtest21b ALTER COLUMN b SET NOT NULL;
INSERT INTO gtest21b (a) VALUES (1); -- ok
INSERT INTO gtest21b (a) VALUES (0); -- violates constraint
ALTER TABLE gtest21b ALTER COLUMN b DROP NOT NULL;
INSERT INTO gtest21b (a) VALUES (0); -- ok now
-- index constraints
CREATE TABLE gtest22a (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a / 2) STORED UNIQUE);
INSERT INTO gtest22a VALUES (2);
INSERT INTO gtest22a VALUES (3);
INSERT INTO gtest22a VALUES (4);
CREATE TABLE gtest22b (a int, b int GENERATED ALWAYS AS (a / 2) STORED, PRIMARY KEY (a, b));
INSERT INTO gtest22b VALUES (2);
INSERT INTO gtest22b VALUES (2);
-- indexes
CREATE TABLE gtest22c (a int, b int GENERATED ALWAYS AS (a * 2) STORED);
CREATE INDEX gtest22c_b_idx ON gtest22c (b);
CREATE INDEX gtest22c_expr_idx ON gtest22c ((b * 3));
CREATE INDEX gtest22c_pred_idx ON gtest22c (a) WHERE b > 0;
\d gtest22c
INSERT INTO gtest22c VALUES (1), (2), (3);
SET enable_seqscan TO off;
SET enable_bitmapscan TO off;
EXPLAIN (COSTS OFF) SELECT * FROM gtest22c WHERE b = 4;
SELECT * FROM gtest22c WHERE b = 4;
EXPLAIN (COSTS OFF) SELECT * FROM gtest22c WHERE b * 3 = 6;
SELECT * FROM gtest22c WHERE b * 3 = 6;
EXPLAIN (COSTS OFF) SELECT * FROM gtest22c WHERE a = 1 AND b > 0;
SELECT * FROM gtest22c WHERE a = 1 AND b > 0;
RESET enable_seqscan;
RESET enable_bitmapscan;
-- foreign keys
CREATE TABLE gtest23a (x int PRIMARY KEY, y int);
INSERT INTO gtest23a VALUES (1, 11), (2, 22), (3, 33);
CREATE TABLE gtest23x (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED REFERENCES gtest23a (x) ON UPDATE CASCADE); -- error
CREATE TABLE gtest23x (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED REFERENCES gtest23a (x) ON DELETE SET NULL); -- error
CREATE TABLE gtest23b (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED REFERENCES gtest23a (x));
\d gtest23b
INSERT INTO gtest23b VALUES (1); -- ok
INSERT INTO gtest23b VALUES (5); -- error
DROP TABLE gtest23b;
DROP TABLE gtest23a;
CREATE TABLE gtest23p (x int, y int GENERATED ALWAYS AS (x * 2) STORED, PRIMARY KEY (y));
INSERT INTO gtest23p VALUES (1), (2), (3);
CREATE TABLE gtest23q (a int PRIMARY KEY, b int REFERENCES gtest23p (y));
INSERT INTO gtest23q VALUES (1, 2); -- ok
INSERT INTO gtest23q VALUES (2, 5); -- error
-- domains
CREATE DOMAIN gtestdomain1 AS int CHECK (VALUE < 10);
CREATE TABLE gtest24 (a int PRIMARY KEY, b gtestdomain1 GENERATED ALWAYS AS (a * 2) STORED);
INSERT INTO gtest24 (a) VALUES (4); -- ok
INSERT INTO gtest24 (a) VALUES (6); -- error
-- typed tables (currently not supported)
CREATE TYPE gtest_type AS (f1 integer, f2 text, f3 bigint);
CREATE TABLE gtest28 OF gtest_type (f1 WITH OPTIONS GENERATED ALWAYS AS (f2 *2) STORED);
DROP TYPE gtest_type CASCADE;
-- table partitions (currently not supported)
CREATE TABLE gtest_parent (f1 date NOT NULL, f2 text, f3 bigint) PARTITION BY RANGE (f1);
CREATE TABLE gtest_child PARTITION OF gtest_parent (
f3 WITH OPTIONS GENERATED ALWAYS AS (f2 * 2) STORED
) FOR VALUES FROM ('2016-07-01') TO ('2016-08-01'); -- error
DROP TABLE gtest_parent;
-- partitioned table
CREATE TABLE gtest_parent (f1 date NOT NULL, f2 bigint, f3 bigint GENERATED ALWAYS AS (f2 * 2) STORED) PARTITION BY RANGE (f1);
CREATE TABLE gtest_child PARTITION OF gtest_parent FOR VALUES FROM ('2016-07-01') TO ('2016-08-01');
INSERT INTO gtest_parent (f1, f2) VALUES ('2016-07-15', 1);
SELECT * FROM gtest_parent;
SELECT * FROM gtest_child;
DROP TABLE gtest_parent;
-- generated columns in partition key (not allowed)
CREATE TABLE gtest_parent (f1 date NOT NULL, f2 bigint, f3 bigint GENERATED ALWAYS AS (f2 * 2) STORED) PARTITION BY RANGE (f3);
CREATE TABLE gtest_parent (f1 date NOT NULL, f2 bigint, f3 bigint GENERATED ALWAYS AS (f2 * 2) STORED) PARTITION BY RANGE ((f3 * 3));
-- ALTER TABLE ... ADD COLUMN
CREATE TABLE gtest25 (a int PRIMARY KEY);
INSERT INTO gtest25 VALUES (3), (4);
ALTER TABLE gtest25 ADD COLUMN b int GENERATED ALWAYS AS (a * 3) STORED;
SELECT * FROM gtest25 ORDER BY a;
ALTER TABLE gtest25 ADD COLUMN x int GENERATED ALWAYS AS (b * 4) STORED; -- error
ALTER TABLE gtest25 ADD COLUMN x int GENERATED ALWAYS AS (z * 4) STORED; -- error
-- ALTER TABLE ... ALTER COLUMN
CREATE TABLE gtest27 (
a int,
b int GENERATED ALWAYS AS (a * 2) STORED
);
INSERT INTO gtest27 (a) VALUES (3), (4);
ALTER TABLE gtest27 ALTER COLUMN a TYPE text; -- error
ALTER TABLE gtest27 ALTER COLUMN b TYPE numeric;
\d gtest27
SELECT * FROM gtest27;
ALTER TABLE gtest27 ALTER COLUMN b TYPE boolean USING b <> 0; -- error
ALTER TABLE gtest27 ALTER COLUMN b DROP DEFAULT; -- error
\d gtest27
-- triggers
CREATE TABLE gtest26 (
a int PRIMARY KEY,
b int GENERATED ALWAYS AS (a * 2) STORED
);
CREATE FUNCTION gtest_trigger_func() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
IF tg_op IN ('DELETE', 'UPDATE') THEN
RAISE INFO '%: %: old = %', TG_NAME, TG_WHEN, OLD;
END IF;
IF tg_op IN ('INSERT', 'UPDATE') THEN
RAISE INFO '%: %: new = %', TG_NAME, TG_WHEN, NEW;
END IF;
IF tg_op = 'DELETE' THEN
RETURN OLD;
ELSE
RETURN NEW;
END IF;
END
$$;
CREATE TRIGGER gtest1 BEFORE DELETE OR UPDATE ON gtest26
FOR EACH ROW
WHEN (OLD.b < 0) -- ok
EXECUTE PROCEDURE gtest_trigger_func();
CREATE TRIGGER gtest2a BEFORE INSERT OR UPDATE ON gtest26
FOR EACH ROW
WHEN (NEW.b < 0) -- error
EXECUTE PROCEDURE gtest_trigger_func();
CREATE TRIGGER gtest2b BEFORE INSERT OR UPDATE ON gtest26
FOR EACH ROW
WHEN (NEW.* IS NOT NULL) -- error
EXECUTE PROCEDURE gtest_trigger_func();
CREATE TRIGGER gtest2 BEFORE INSERT ON gtest26
FOR EACH ROW
WHEN (NEW.a < 0)
EXECUTE PROCEDURE gtest_trigger_func();
CREATE TRIGGER gtest3 AFTER DELETE OR UPDATE ON gtest26
FOR EACH ROW
WHEN (OLD.b < 0) -- ok
EXECUTE PROCEDURE gtest_trigger_func();
CREATE TRIGGER gtest4 AFTER INSERT OR UPDATE ON gtest26
FOR EACH ROW
WHEN (NEW.b < 0) -- ok
EXECUTE PROCEDURE gtest_trigger_func();
INSERT INTO gtest26 (a) VALUES (-2), (0), (3);
SELECT * FROM gtest26 ORDER BY a;
UPDATE gtest26 SET a = a * -2;
SELECT * FROM gtest26 ORDER BY a;
DELETE FROM gtest26 WHERE a = -6;
SELECT * FROM gtest26 ORDER BY a;
DROP TRIGGER gtest1 ON gtest26;
DROP TRIGGER gtest2 ON gtest26;
DROP TRIGGER gtest3 ON gtest26;
-- Check that an UPDATE of "a" fires the trigger for UPDATE OF b, per
-- SQL standard.
CREATE FUNCTION gtest_trigger_func3() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
RAISE NOTICE 'OK';
RETURN NEW;
END
$$;
CREATE TRIGGER gtest11 BEFORE UPDATE OF b ON gtest26
FOR EACH ROW
EXECUTE PROCEDURE gtest_trigger_func3();
UPDATE gtest26 SET a = 1 WHERE a = 0;
DROP TRIGGER gtest11 ON gtest26;
TRUNCATE gtest26;
-- check that modifications of stored generated columns in triggers do
-- not get propagated
CREATE FUNCTION gtest_trigger_func4() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW.a = 10;
NEW.b = 300;
RETURN NEW;
END;
$$;
CREATE TRIGGER gtest12_01 BEFORE UPDATE ON gtest26
FOR EACH ROW
EXECUTE PROCEDURE gtest_trigger_func();
CREATE TRIGGER gtest12_02 BEFORE UPDATE ON gtest26
FOR EACH ROW
EXECUTE PROCEDURE gtest_trigger_func4();
CREATE TRIGGER gtest12_03 BEFORE UPDATE ON gtest26
FOR EACH ROW
EXECUTE PROCEDURE gtest_trigger_func();
INSERT INTO gtest26 (a) VALUES (1);
UPDATE gtest26 SET a = 11 WHERE a = 1;
SELECT * FROM gtest26 ORDER BY a;
-- LIKE INCLUDING GENERATED and dropped column handling
CREATE TABLE gtest28a (
a int,
b int,
c int,
x int GENERATED ALWAYS AS (b * 2) STORED
);
ALTER TABLE gtest28a DROP COLUMN a;
CREATE TABLE gtest28b (LIKE gtest28a INCLUDING GENERATED);
\d gtest28* | the_stack |
set enable_global_stats = true;
create schema analyze_schema;
set current_schema=analyze_schema;
--set enable_global_stats=off;
---test data store on delta
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--test for analyze sample table on Delta
set default_statistics_target=-2;
analyze dfs_tbl;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
reset default_statistics_target;
---test data store on HDFS
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--test for analyze sample table on HDFS
set default_statistics_target=-2;
analyze dfs_tbl;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
reset default_statistics_target;
--test data store on HDFS and Delta
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
create table dfs_tbl_rep(a int, b int) tablespace hdfs_ts distribute by replication;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
insert into dfs_tbl_rep select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
insert into dfs_tbl_rep select * from temp;
analyze dfs_tbl_rep;
select count(*) from pg_stats where tablename='dfs_tbl_rep';
select count(*) from pg_stats where tablename in (select b.relname from pg_class a, pg_class b where a.relname='dfs_tbl_rep' and b.oid=a.reldeltarelid);
vacuum deltamerge dfs_tbl_rep;
analyze dfs_tbl_rep;
select count(*) from pg_stats where tablename='dfs_tbl_rep';
select count(*) from pg_stats where tablename in (select b.relname from pg_class a, pg_class b where a.relname='dfs_tbl_rep' and b.oid=a.reldeltarelid);
truncate table dfs_tbl_rep;
analyze dfs_tbl_rep;
set cstore_insert_mode=delta;
insert into dfs_tbl_rep select * from temp;
vacuum deltamerge dfs_tbl_rep;
analyze dfs_tbl_rep;
select count(*) from pg_stats where tablename='dfs_tbl_rep';
select count(*) from pg_stats where tablename in (select b.relname from pg_class a, pg_class b where a.relname='dfs_tbl_rep' and b.oid=a.reldeltarelid);
drop table dfs_tbl_rep;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--test for analyze sample table on HDFS and Delta
set default_statistics_target=-2;
analyze dfs_tbl;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
reset default_statistics_target;
--test data store on HDFS and Delta, the ratio of HDFS's row count with complex table less than 0.01, using complex's stats as Delta's stats
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,300),generate_series(1,300));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(1,2),(3,4);
insert into dfs_tbl select * from temp;
set default_statistics_target=-2;
analyze dfs_tbl;
select count(*) from dfs_tbl;
select count(*) from cstore.pg_delta_dfs_tbl;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
reset default_statistics_target;
--test data store on HDFS and Delta, the ratio of Delta's row count with complex table less than 0.01, using complex's stats as HDFS's stats
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,300),generate_series(1,300));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(1,2),(3,4);
insert into dfs_tbl select * from temp;
set default_statistics_target=-2;
analyze dfs_tbl;
select count(*) from dfs_tbl;
select count(*) from cstore.pg_delta_dfs_tbl;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
reset default_statistics_target;
--test no data
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--test insert data after analyze
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,50),generate_series(1,50));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,50),generate_series(1,50));
insert into dfs_tbl select * from temp;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--test update data alter analyze
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
update dfs_tbl set b = 30 where b <= 60;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--test delete after analyze
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
delete from dfs_tbl where b<= 60;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--test delete all data after analyze
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
delete from dfs_tbl;
--analyze
analyze dfs_tbl;
execute direct on (datanode1) 'select count(*) from dfs_tbl';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
----test analyze column
---test data store on Delta
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
--analyze
analyze dfs_tbl (b);
execute direct on (datanode1) 'select count(*) from dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
---test data store on HDFS
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
--analyze
analyze dfs_tbl (b);
execute direct on (datanode1) 'select count(*) from dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
----test data on HDFS and Delta
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
analyze dfs_tbl (b);
execute direct on (datanode1) 'select count(*) from dfs_tbl';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
--test no data
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
analyze dfs_tbl (b);
execute direct on (datanode1) 'select count(*) from dfs_tbl';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2;
----------------------------------------------------test distinct
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
analyze dfs_tbl (b);
execute direct on (datanode1) 'select count(distinct(b)) from dfs_tbl';
execute direct on (datanode1) 'select count(distinct(b)) from cstore.pg_delta_dfs_tbl';
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2, 3;
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2, 3;
--test data in Delta
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
analyze dfs_tbl;
execute direct on (datanode1) 'select count(distinct(b)) from dfs_tbl';
execute direct on (datanode1) 'select count(distinct(b)) from cstore.pg_delta_dfs_tbl';
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2, 3;
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2, 3;
--test data in HDFS
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
analyze dfs_tbl;
execute direct on (datanode1) 'select count(distinct(b)) from dfs_tbl';
execute direct on (datanode1) 'select count(distinct(b)) from cstore.pg_delta_dfs_tbl';
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl') order by 1, 2, 3;
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl') order by 1, 2, 3;
-----------------------------------------test analyze all tables
drop table if exists dfs_tbl;
create table dfs_tbl(a int, b int) tablespace hdfs_ts;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl select * from temp;
drop table if exists row_tbl;
create table row_tbl(a int, b int);
insert into row_tbl values(generate_series(1,100),generate_series(1,100));
drop table if exists col_tbl;
create table col_tbl(a int, b int) with (orientation=column);
insert into col_tbl select * from row_tbl;
-------------------------------------------------------------------HDFS partition table analyze
--set enable_global_stats=off;
---test data store on delta
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
---test data store on HDFS
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--test data store on HDFS and Delta
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--test no data
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--test insert data after analyze
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,50),generate_series(1,50));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,50),generate_series(1,50));
insert into dfs_tbl_p select * from temp;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--test update data alter analyze
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
update dfs_tbl_p set b = 30 where b <= 60;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--test delete after analyze
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
delete from dfs_tbl_p where b<= 60;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--test delete all data after analyze
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
delete from dfs_tbl_p;
--analyze
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
----test analyze column
---test data store on Delta
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
--analyze
analyze dfs_tbl_p (b);
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
---test data store on HDFS
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
--analyze
analyze dfs_tbl_p (b);
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
----test data on HDFS and Delta
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
analyze dfs_tbl_p (b);
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
execute direct on (datanode1) 'select count(*) from cstore.pg_delta_dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
--test no data
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
analyze dfs_tbl_p (b);
execute direct on (datanode1) 'select count(*) from dfs_tbl_p';
select relname , relpages, reltuples from pg_class where relname='dfs_tbl_p';
select relname , relpages, reltuples from pg_class where oid in ( select reldeltarelid from pg_class where relname='dfs_tbl_p');
select staattnum, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2;
select staattnum, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2;
----------------------------------------------------test distinct
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
analyze dfs_tbl_p (b);
execute direct on (datanode1) 'select count(distinct(b)) from dfs_tbl_p';
execute direct on (datanode1) 'select count(distinct(b)) from cstore.pg_delta_dfs_tbl_p';
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2, 3;
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2, 3;
--test data in Delta
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(distinct(b)) from dfs_tbl_p';
execute direct on (datanode1) 'select count(distinct(b)) from cstore.pg_delta_dfs_tbl_p';
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2, 3;
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2, 3;
--test data in HDFS
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
analyze dfs_tbl_p;
execute direct on (datanode1) 'select count(distinct(b)) from dfs_tbl_p';
execute direct on (datanode1) 'select count(distinct(b)) from cstore.pg_delta_dfs_tbl_p';
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select oid from pg_class where relname='dfs_tbl_p') order by 1, 2, 3;
select staattnum, stadistinct, stainherit from pg_statistic where starelid in (select reldeltarelid from pg_class where relname='dfs_tbl_p') order by 1, 2, 3;
-----------------------------------------test analyze all tables
drop table if exists dfs_tbl_p;
create table dfs_tbl_p(a int, b int) tablespace hdfs_ts partition by values (b);
set cstore_insert_mode=main;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
set cstore_insert_mode=delta;
drop table if exists temp;
create table temp (a int, b int);
insert into temp values(generate_series(1,100),generate_series(1,100));
insert into dfs_tbl_p select * from temp;
drop table if exists row_tbl;
create table row_tbl(a int, b int);
insert into row_tbl values(generate_series(1,100),generate_series(1,100));
drop table if exists col_tbl;
create table col_tbl(a int, b int) with (orientation=column);
insert into col_tbl select * from row_tbl;
--analyze after delete column with index
DROP TABLE IF exists HDFS_ADD_DROP_COLUMN_TABLE_005;
CREATE TABLE HDFS_ADD_DROP_COLUMN_TABLE_005 (sn int)
WITH(orientation = 'orc',version = 0.12) TABLESPACE hdfs_ts DISTRIBUTE BY HASH(sn);
SET cstore_insert_mode=delta;
INSERT INTO HDFS_ADD_DROP_COLUMN_TABLE_005 VALUES(generate_series(1,100));
ALTER TABLE HDFS_ADD_DROP_COLUMN_TABLE_005 ADD COLUMN c_tinyint tinyint null;
CREATE INDEX index_drop_005 ON HDFS_ADD_DROP_COLUMN_TABLE_005(c_tinyint);
INSERT INTO HDFS_ADD_DROP_COLUMN_TABLE_005(sn) VALUES(generate_series(101,200));
analyze hdfs_add_drop_column_table_005;
DELETE FROM HDFS_ADD_DROP_COLUMN_TABLE_005 ;
ALTER TABLE HDFS_ADD_DROP_COLUMN_TABLE_005 DROP COLUMN c_tinyint;
set cstore_insert_mode=main;
INSERT INTO HDFS_ADD_DROP_COLUMN_TABLE_005 VALUES(generate_series(1,100));
VACUUM FULL HDFS_ADD_DROP_COLUMN_TABLE_005;
ANALYZE HDFS_ADD_DROP_COLUMN_TABLE_005;
drop table if exists tt;
create table tt(a int, b int);
insert into tt values(1, generate_series(1, 6000));
insert into tt select *from tt;
insert into tt select *from tt;
insert into tt select *from tt;
select count(*) from tt;
drop table if exists dfstbl002;
create table dfstbl002(a int, b int) tablespace hdfs_ts;
insert into dfstbl002 select *from tt;
set default_statistics_target=-100;
set enable_global_stats=off;
analyze dfstbl002;
drop table if exists tt;
drop table if exists dfstbl002;
drop schema analyze_schema cascade; | the_stack |
create function binary_coercible_2(oid, oid) returns bool as $$
SELECT ($1 = $2) OR
EXISTS(select 1 from pg_catalog.pg_cast where
castsource = $1 and casttarget = $2 and
castmethod = 'b' and castcontext = 'i') OR
($2 = 'pg_catalog.anyarray'::pg_catalog.regtype AND
EXISTS(select 1 from pg_catalog.pg_type where
oid = $1 and typelem != 0 and typlen = -1))
$$ language sql strict stable;
create function binary_coercible_3(oid, oid) returns bool as $$
SELECT ($1 = $2) OR
EXISTS(select 1 from pg_catalog.pg_cast where
castsource = $1 and casttarget = $2 and
castmethod = 'b' and castcontext = 'i') OR
($2 = 'pg_catalog.any'::pg_catalog.regtype) OR
($2 = 'pg_catalog.anyarray'::pg_catalog.regtype AND
EXISTS(select 1 from pg_catalog.pg_type where
oid = $1 and typelem != 0 and typlen = -1)) OR
($2 = 'pg_catalog.anyrange'::pg_catalog.regtype AND
(select typtype from pg_catalog.pg_type where oid = $1) = 'r')
$$ language sql strict stable;
create function physically_coercible_2(oid, oid) returns bool as $$
SELECT ($1 = $2) OR
EXISTS(select 1 from pg_catalog.pg_cast where
castsource = $1 and casttarget = $2 and
castmethod = 'b') OR
($2 = 'pg_catalog.any'::pg_catalog.regtype) OR
($2 = 'pg_catalog.anyarray'::pg_catalog.regtype AND
EXISTS(select 1 from pg_catalog.pg_type where
oid = $1 and typelem != 0 and typlen = -1)) OR
($2 = 'pg_catalog.anyrange'::pg_catalog.regtype AND
(select typtype from pg_catalog.pg_type where oid = $1) = 'r')
$$ language sql strict stable;
-- **************** pg_operator ****************
-- Look for illegal values in pg_operator fields.
SELECT p1.oid, p1.oprname
FROM pg_operator as p1
WHERE (p1.oprkind != 'b' AND p1.oprkind != 'l' AND p1.oprkind != 'r') OR
p1.oprresult = 0 OR p1.oprcode = 0;
-- Look for missing or unwanted operand types
SELECT p1.oid, p1.oprname
FROM pg_operator as p1
WHERE (p1.oprleft = 0 and p1.oprkind != 'l') OR
(p1.oprleft != 0 and p1.oprkind = 'l') OR
(p1.oprright = 0 and p1.oprkind != 'r') OR
(p1.oprright != 0 and p1.oprkind = 'r');
-- Look for conflicting operator definitions (same names and input datatypes).
SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oid != p2.oid AND
p1.oprname = p2.oprname AND
p1.oprkind = p2.oprkind AND
p1.oprleft = p2.oprleft AND
p1.oprright = p2.oprright;
-- Look for commutative operators that don't commute.
-- DEFINITIONAL NOTE: If A.oprcom = B, then x A y has the same result as y B x.
-- We expect that B will always say that B.oprcom = A as well; that's not
-- inherently essential, but it would be inefficient not to mark it so.
SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oprcom = p2.oid AND
(p1.oprkind != 'b' OR
p1.oprleft != p2.oprright OR
p1.oprright != p2.oprleft OR
p1.oprresult != p2.oprresult OR
p1.oid != p2.oprcom);
-- Look for negatory operators that don't agree.
-- DEFINITIONAL NOTE: If A.oprnegate = B, then both A and B must yield
-- boolean results, and (x A y) == ! (x B y), or the equivalent for
-- single-operand operators.
-- We expect that B will always say that B.oprnegate = A as well; that's not
-- inherently essential, but it would be inefficient not to mark it so.
-- Also, A and B had better not be the same operator.
SELECT p1.oid, p1.oprcode, p2.oid, p2.oprcode
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oprnegate = p2.oid AND
(p1.oprkind != p2.oprkind OR
p1.oprleft != p2.oprleft OR
p1.oprright != p2.oprright OR
p1.oprresult != 'bool'::regtype OR
p2.oprresult != 'bool'::regtype OR
p1.oid != p2.oprnegate OR
p1.oid = p2.oid);
-- A mergejoinable or hashjoinable operator must be binary, must return
-- boolean, and must have a commutator (itself, unless it's a cross-type
-- operator).
SELECT p1.oid, p1.oprname FROM pg_operator AS p1
WHERE (p1.oprcanmerge OR p1.oprcanhash) AND NOT
(p1.oprkind = 'b' AND p1.oprresult = 'bool'::regtype AND p1.oprcom != 0);
-- What's more, the commutator had better be mergejoinable/hashjoinable too.
SELECT p1.oid, p1.oprname, p2.oid, p2.oprname
FROM pg_operator AS p1, pg_operator AS p2
WHERE p1.oprcom = p2.oid AND
(p1.oprcanmerge != p2.oprcanmerge OR
p1.oprcanhash != p2.oprcanhash);
-- Mergejoinable operators should appear as equality members of btree index
-- opfamilies.
SELECT p1.oid, p1.oprname
FROM pg_operator AS p1
WHERE p1.oprcanmerge AND NOT EXISTS
(SELECT 1 FROM pg_amop
WHERE amopmethod = (SELECT oid FROM pg_am WHERE amname = 'btree') AND
amopopr = p1.oid AND amopstrategy = 3);
-- And the converse.
SELECT p1.oid, p1.oprname, p.amopfamily
FROM pg_operator AS p1, pg_amop p
WHERE amopopr = p1.oid
AND amopmethod = (SELECT oid FROM pg_am WHERE amname = 'btree')
AND amopstrategy = 3
AND NOT p1.oprcanmerge;
-- Hashable operators should appear as members of hash index opfamilies.
SELECT p1.oid, p1.oprname
FROM pg_operator AS p1
WHERE p1.oprcanhash AND NOT EXISTS
(SELECT 1 FROM pg_amop
WHERE amopmethod = (SELECT oid FROM pg_am WHERE amname = 'hash') AND
amopopr = p1.oid AND amopstrategy = 1);
-- And the converse.
SELECT p1.oid, p1.oprname, p.amopfamily
FROM pg_operator AS p1, pg_amop p
WHERE amopopr = p1.oid
AND amopmethod = (SELECT oid FROM pg_am WHERE amname = 'hash')
AND NOT p1.oprcanhash;
-- Check that each operator defined in pg_operator matches its oprcode entry
-- in pg_proc. Easiest to do this separately for each oprkind.
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprcode = p2.oid AND
p1.oprkind = 'b' AND
(p2.pronargs != 2
OR NOT binary_coercible_2(p2.prorettype, p1.oprresult)
OR NOT binary_coercible_2(p1.oprleft, p2.proargtypes[0])
OR NOT binary_coercible_2(p1.oprright, p2.proargtypes[1]));
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprcode = p2.oid AND
p1.oprkind = 'l' AND
(p2.pronargs != 1
OR NOT binary_coercible_2(p2.prorettype, p1.oprresult)
OR NOT binary_coercible_2(p1.oprright, p2.proargtypes[0])
OR p1.oprleft != 0);
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprcode = p2.oid AND
p1.oprkind = 'r' AND
(p2.pronargs != 1
OR NOT binary_coercible_2(p2.prorettype, p1.oprresult)
OR NOT binary_coercible_2(p1.oprleft, p2.proargtypes[0])
OR p1.oprright != 0);
-- If the operator is mergejoinable or hashjoinable, its underlying function
-- should not be volatile.
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprcode = p2.oid AND
(p1.oprcanmerge OR p1.oprcanhash) AND
p2.provolatile = 'v';
-- If oprrest is set, the operator must return boolean,
-- and it must link to a proc with the right signature
-- to be a restriction selectivity estimator.
-- The proc signature we want is: float8 proc(internal, oid, internal, int4)
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprrest = p2.oid AND
(p1.oprresult != 'bool'::regtype OR
p2.prorettype != 'float8'::regtype OR p2.proretset OR
p2.pronargs != 4 OR
p2.proargtypes[0] != 'internal'::regtype OR
p2.proargtypes[1] != 'oid'::regtype OR
p2.proargtypes[2] != 'internal'::regtype OR
p2.proargtypes[3] != 'int4'::regtype);
-- If oprjoin is set, the operator must be a binary boolean op,
-- and it must link to a proc with the right signature
-- to be a join selectivity estimator.
-- The proc signature we want is: float8 proc(internal, oid, internal, int2, internal)
-- (Note: the old signature with only 4 args is still allowed, but no core
-- estimator should be using it.)
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprjoin = p2.oid AND
(p1.oprkind != 'b' OR p1.oprresult != 'bool'::regtype OR
p2.prorettype != 'float8'::regtype OR p2.proretset OR
p2.pronargs != 5 OR
p2.proargtypes[0] != 'internal'::regtype OR
p2.proargtypes[1] != 'oid'::regtype OR
p2.proargtypes[2] != 'internal'::regtype OR
p2.proargtypes[3] != 'int2'::regtype OR
p2.proargtypes[4] != 'internal'::regtype);
-- Insist that all built-in pg_operator entries have descriptions
SELECT p1.oid, p1.oprname
FROM pg_operator as p1 LEFT JOIN pg_description as d
ON p1.tableoid = d.classoid and p1.oid = d.objoid and d.objsubid = 0
WHERE d.classoid IS NULL AND p1.oid <= 9999;
-- Check that operators' underlying functions have suitable comments,
-- namely 'implementation of XXX operator'. In some cases involving legacy
-- names for operators, there are multiple operators referencing the same
-- pg_proc entry, so ignore operators whose comments say they are deprecated.
-- We also have a few functions that are both operator support and meant to
-- be called directly; those should have comments matching their operator.
WITH funcdescs AS (
SELECT p.oid as p_oid, proname, o.oid as o_oid,
obj_description(p.oid, 'pg_proc') as prodesc,
'implementation of ' || oprname || ' operator' as expecteddesc,
obj_description(o.oid, 'pg_operator') as oprdesc
FROM pg_proc p JOIN pg_operator o ON oprcode = p.oid
WHERE o.oid <= 9999
)
SELECT * FROM funcdescs
WHERE prodesc IS DISTINCT FROM expecteddesc
AND oprdesc NOT LIKE 'deprecated%'
AND prodesc IS DISTINCT FROM oprdesc;
-- **************** pg_aggregate ****************
-- Look for illegal values in pg_aggregate fields.
SELECT ctid, aggfnoid::oid
FROM pg_aggregate as p1
WHERE aggfnoid = 0 OR aggtransfn = 0 OR aggtranstype = 0;
-- Make sure the matching pg_proc entry is sensible, too.
SELECT a.aggfnoid::oid, p.proname
FROM pg_aggregate as a, pg_proc as p
WHERE a.aggfnoid = p.oid AND
(NOT p.proisagg OR p.proretset);
-- Make sure there are no proisagg pg_proc entries without matches.
SELECT oid, proname
FROM pg_proc as p
WHERE p.proisagg AND
NOT EXISTS (SELECT 1 FROM pg_aggregate a WHERE a.aggfnoid = p.oid);
-- If there is no finalfn then the output type must be the transtype.
SELECT a.aggfnoid::oid, p.proname
FROM pg_aggregate as a, pg_proc as p
WHERE a.aggfnoid = p.oid AND
a.aggfinalfn = 0 AND p.prorettype != a.aggtranstype;
-- Cross-check transfn against its entry in pg_proc.
-- NOTE: use physically_coercible_2 here, not binary_coercible_2, because
-- max and min on abstime are implemented using int4larger/int4smaller.
SELECT a.aggfnoid::oid, p.proname, ptr.oid, ptr.proname
FROM pg_aggregate AS a, pg_proc AS p, pg_proc AS ptr
WHERE a.aggfnoid = p.oid AND
a.aggtransfn = ptr.oid AND
(ptr.proretset
OR NOT (ptr.pronargs =
CASE WHEN a.aggkind = 'n' THEN p.pronargs + 1
ELSE greatest(p.pronargs - a.aggnumdirectargs, 1) + 1 END)
OR NOT physically_coercible_2(ptr.prorettype, a.aggtranstype)
OR NOT physically_coercible_2(a.aggtranstype, ptr.proargtypes[0])
OR (p.pronargs > 0 AND
NOT physically_coercible_2(p.proargtypes[0], ptr.proargtypes[1]))
OR (p.pronargs > 1 AND
NOT physically_coercible_2(p.proargtypes[1], ptr.proargtypes[2]))
OR (p.pronargs > 2 AND
NOT physically_coercible_2(p.proargtypes[2], ptr.proargtypes[3]))
-- we could carry the check further, but that's enough for now
);
-- Cross-check finalfn (if present) against its entry in pg_proc.
SELECT a.aggfnoid::oid, p.proname, pfn.oid, pfn.proname
FROM pg_aggregate AS a, pg_proc AS p, pg_proc AS pfn
WHERE a.aggfnoid = p.oid AND
a.aggfinalfn = pfn.oid AND
(pfn.proretset OR
NOT binary_coercible_3(pfn.prorettype, p.prorettype) OR
NOT binary_coercible_3(a.aggtranstype, pfn.proargtypes[0])
OR (pfn.pronargs > 1 AND
NOT binary_coercible_3(p.proargtypes[0], pfn.proargtypes[1]))
OR (pfn.pronargs > 2 AND
NOT binary_coercible_3(p.proargtypes[1], pfn.proargtypes[2]))
OR (pfn.pronargs > 3 AND
NOT binary_coercible_3(p.proargtypes[2], pfn.proargtypes[3]))
-- we could carry the check further, but 3 args is enough for now
);
-- If transfn is strict then either initval should be non-NULL, or
-- input type should match transtype so that the first non-null input
-- can be assigned as the state value.
SELECT a.aggfnoid::oid, p.proname, ptr.oid, ptr.proname
FROM pg_aggregate AS a, pg_proc AS p, pg_proc AS ptr
WHERE a.aggfnoid = p.oid AND
a.aggtransfn = ptr.oid AND ptr.proisstrict AND
a.agginitval IS NULL AND
NOT binary_coercible_2(p.proargtypes[0], a.aggtranstype);
-- Cross-check aggsortop (if present) against pg_operator.
-- We expect to find entries for bool_and, bool_or, every, max, and min.
SELECT DISTINCT proname, oprname
FROM pg_operator AS o, pg_aggregate AS a, pg_proc AS p
WHERE a.aggfnoid = p.oid AND a.aggsortop = o.oid
ORDER BY 1, 2;
-- Check datatypes match
SELECT a.aggfnoid::oid, o.oid
FROM pg_operator AS o, pg_aggregate AS a, pg_proc AS p
WHERE a.aggfnoid = p.oid AND a.aggsortop = o.oid AND
(oprkind != 'b' OR oprresult != 'boolean'::regtype
OR oprleft != p.proargtypes[0] OR oprright != p.proargtypes[0]);
-- Check operator is a suitable btree opfamily member
SELECT a.aggfnoid::oid, o.oid
FROM pg_operator AS o, pg_aggregate AS a, pg_proc AS p
WHERE a.aggfnoid = p.oid AND a.aggsortop = o.oid AND
NOT EXISTS(SELECT 1 FROM pg_amop
WHERE amopmethod = (SELECT oid FROM pg_am WHERE amname = 'btree')
AND amopopr = o.oid
AND amoplefttype = o.oprleft
AND amoprighttype = o.oprright);
-- Check correspondence of btree strategies and names
SELECT DISTINCT proname, oprname, amopstrategy
FROM pg_operator AS o, pg_aggregate AS a, pg_proc AS p,
pg_amop as ao
WHERE a.aggfnoid = p.oid AND a.aggsortop = o.oid AND
amopopr = o.oid AND
amopmethod = (SELECT oid FROM pg_am WHERE amname = 'btree')
ORDER BY 1, 2;
-- Check that there are not aggregates with the same name and different
-- numbers of arguments. While not technically wrong, we have a project policy
-- to avoid this because it opens the door for confusion in connection with
-- ORDER BY: novices frequently put the ORDER BY in the wrong place.
-- See the fate of the single-argument form of string_agg() for history.
-- The only aggregates that should show up here are count(x) and count(*).
SELECT p1.oid::regprocedure, p2.oid::regprocedure
FROM pg_proc AS p1, pg_proc AS p2
WHERE p1.oid < p2.oid AND p1.proname = p2.proname AND
p1.proisagg AND p2.proisagg AND
array_dims(p1.proargtypes) != array_dims(p2.proargtypes) AND
p1.proname != 'listagg'
ORDER BY 1;
-- For the same reason, aggregates with default arguments are no good.
SELECT oid, proname
FROM pg_proc AS p
WHERE proisagg AND proargdefaults IS NOT NULL; | the_stack |
-- TABLE: sys_accounts
ALTER TABLE `sys_accounts` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_accounts` CHANGE `name` `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_accounts` CHANGE `email` `email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_accounts` CHANGE `password` `password` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_accounts` CHANGE `salt` `salt` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_accounts`;
OPTIMIZE TABLE `sys_accounts`;
-- TABLE: sys_acl_actions
ALTER TABLE `sys_acl_actions` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_actions` CHANGE `Module` `Module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_actions` CHANGE `Name` `Name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_actions` CHANGE `AdditionalParamName` `AdditionalParamName` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_actions` CHANGE `Title` `Title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_actions` CHANGE `Desc` `Desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_acl_actions`;
OPTIMIZE TABLE `sys_acl_actions`;
-- TABLE: sys_acl_actions_track
ALTER TABLE `sys_acl_actions_track` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_acl_actions_track`;
OPTIMIZE TABLE `sys_acl_actions_track`;
-- TABLE: sys_acl_levels
ALTER TABLE `sys_acl_levels` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_levels` CHANGE `Name` `Name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_levels` CHANGE `Icon` `Icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_levels` CHANGE `Description` `Description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_acl_levels`;
OPTIMIZE TABLE `sys_acl_levels`;
-- TABLE: sys_acl_levels_members
ALTER TABLE `sys_acl_levels_members` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_levels_members` CHANGE `TransactionID` `TransactionID` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_acl_levels_members`;
OPTIMIZE TABLE `sys_acl_levels_members`;
-- TABLE: sys_acl_matrix
ALTER TABLE `sys_acl_matrix` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_acl_matrix` CHANGE `AdditionalParamValue` `AdditionalParamValue` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_acl_matrix`;
OPTIMIZE TABLE `sys_acl_matrix`;
-- TABLE: sys_alerts
ALTER TABLE `sys_alerts` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_alerts` CHANGE `unit` `unit` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_alerts` CHANGE `action` `action` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_alerts`;
OPTIMIZE TABLE `sys_alerts`;
-- TABLE: sys_alerts_handlers
ALTER TABLE `sys_alerts_handlers` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_alerts_handlers` CHANGE `name` `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_alerts_handlers` CHANGE `class` `class` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_alerts_handlers` CHANGE `file` `file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_alerts_handlers` CHANGE `service_call` `service_call` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_alerts_handlers`;
OPTIMIZE TABLE `sys_alerts_handlers`;
-- TABLE: sys_cmts_ids
ALTER TABLE `sys_cmts_ids` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cmts_ids`;
OPTIMIZE TABLE `sys_cmts_ids`;
-- TABLE: sys_cmts_images
ALTER TABLE `sys_cmts_images` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images` CHANGE `remote_id` `remote_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images` CHANGE `path` `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images` CHANGE `file_name` `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images` CHANGE `mime_type` `mime_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images` CHANGE `ext` `ext` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cmts_images`;
OPTIMIZE TABLE `sys_cmts_images`;
-- TABLE: sys_cmts_images2entries
ALTER TABLE `sys_cmts_images2entries` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cmts_images2entries`;
OPTIMIZE TABLE `sys_cmts_images2entries`;
-- TABLE: sys_cmts_images_preview
ALTER TABLE `sys_cmts_images_preview` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images_preview` CHANGE `remote_id` `remote_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images_preview` CHANGE `path` `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images_preview` CHANGE `file_name` `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images_preview` CHANGE `mime_type` `mime_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_images_preview` CHANGE `ext` `ext` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cmts_images_preview`;
OPTIMIZE TABLE `sys_cmts_images_preview`;
-- TABLE: sys_cmts_meta_keywords
ALTER TABLE `sys_cmts_meta_keywords` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cmts_meta_keywords` CHANGE `keyword` `keyword` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cmts_meta_keywords`;
OPTIMIZE TABLE `sys_cmts_meta_keywords`;
-- TABLE: sys_cmts_meta_mentions
ALTER TABLE `sys_cmts_meta_mentions` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cmts_meta_mentions`;
OPTIMIZE TABLE `sys_cmts_meta_mentions`;
-- TABLE: sys_cmts_votes
ALTER TABLE `sys_cmts_votes` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cmts_votes`;
OPTIMIZE TABLE `sys_cmts_votes`;
-- TABLE: sys_cmts_votes_track
ALTER TABLE `sys_cmts_votes_track` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cmts_votes_track`;
OPTIMIZE TABLE `sys_cmts_votes_track`;
-- TABLE: sys_content_info_grids
ALTER TABLE `sys_content_info_grids` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_content_info_grids` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_content_info_grids` CHANGE `grid_object` `grid_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_content_info_grids` CHANGE `grid_field_id` `grid_field_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_content_info_grids` CHANGE `condition` `condition` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_content_info_grids` CHANGE `selection` `selection` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_content_info_grids`;
OPTIMIZE TABLE `sys_content_info_grids`;
-- TABLE: sys_cron_jobs
ALTER TABLE `sys_cron_jobs` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cron_jobs` CHANGE `name` `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cron_jobs` CHANGE `time` `time` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cron_jobs` CHANGE `class` `class` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cron_jobs` CHANGE `file` `file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_cron_jobs` CHANGE `service_call` `service_call` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_cron_jobs`;
OPTIMIZE TABLE `sys_cron_jobs`;
-- TABLE: sys_email_templates
ALTER TABLE `sys_email_templates` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_email_templates` CHANGE `Module` `Module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_email_templates` CHANGE `NameSystem` `NameSystem` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_email_templates` CHANGE `Name` `Name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_email_templates` CHANGE `Subject` `Subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_email_templates` CHANGE `Body` `Body` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_email_templates`;
OPTIMIZE TABLE `sys_email_templates`;
-- TABLE: sys_files
ALTER TABLE `sys_files` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_files` CHANGE `remote_id` `remote_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_files` CHANGE `path` `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_files` CHANGE `file_name` `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_files` CHANGE `mime_type` `mime_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_files` CHANGE `ext` `ext` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_files`;
OPTIMIZE TABLE `sys_files`;
-- TABLE: sys_form_display_inputs
ALTER TABLE `sys_form_display_inputs` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_display_inputs` CHANGE `display_name` `display_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_display_inputs` CHANGE `input_name` `input_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_form_display_inputs`;
OPTIMIZE TABLE `sys_form_display_inputs`;
-- TABLE: sys_form_displays
ALTER TABLE `sys_form_displays` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_displays` CHANGE `display_name` `display_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_displays` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_displays` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_displays` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_form_displays`;
OPTIMIZE TABLE `sys_form_displays`;
-- TABLE: sys_form_inputs
ALTER TABLE `sys_form_inputs` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `name` `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `value` `value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `values` `values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `type` `type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `caption_system` `caption_system` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `caption` `caption` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `info` `info` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `attrs` `attrs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `attrs_tr` `attrs_tr` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `attrs_wrapper` `attrs_wrapper` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `checker_func` `checker_func` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `checker_params` `checker_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `checker_error` `checker_error` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `db_pass` `db_pass` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_inputs` CHANGE `db_params` `db_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_form_inputs`;
OPTIMIZE TABLE `sys_form_inputs`;
-- TABLE: sys_form_pre_lists
ALTER TABLE `sys_form_pre_lists` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_pre_lists` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_pre_lists` CHANGE `key` `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_pre_lists` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_form_pre_lists`;
OPTIMIZE TABLE `sys_form_pre_lists`;
-- TABLE: sys_form_pre_values
ALTER TABLE `sys_form_pre_values` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_pre_values` CHANGE `Key` `Key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_pre_values` CHANGE `Value` `Value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_pre_values` CHANGE `LKey` `LKey` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_form_pre_values` CHANGE `LKey2` `LKey2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_form_pre_values`;
OPTIMIZE TABLE `sys_form_pre_values`;
-- TABLE: sys_grid_actions
ALTER TABLE `sys_grid_actions` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_actions` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_actions` CHANGE `name` `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_actions` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_actions` CHANGE `icon` `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_grid_actions`;
OPTIMIZE TABLE `sys_grid_actions`;
-- TABLE: sys_grid_fields
ALTER TABLE `sys_grid_fields` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_fields` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_fields` CHANGE `name` `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_fields` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_fields` CHANGE `width` `width` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_grid_fields` CHANGE `params` `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_grid_fields`;
OPTIMIZE TABLE `sys_grid_fields`;
-- TABLE: sys_images
ALTER TABLE `sys_images` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images` CHANGE `remote_id` `remote_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images` CHANGE `path` `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images` CHANGE `file_name` `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images` CHANGE `mime_type` `mime_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images` CHANGE `ext` `ext` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_images`;
OPTIMIZE TABLE `sys_images`;
-- TABLE: sys_images_custom
ALTER TABLE `sys_images_custom` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_custom` CHANGE `remote_id` `remote_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_custom` CHANGE `path` `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_custom` CHANGE `file_name` `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_custom` CHANGE `mime_type` `mime_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_custom` CHANGE `ext` `ext` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_images_custom`;
OPTIMIZE TABLE `sys_images_custom`;
-- TABLE: sys_images_resized
ALTER TABLE `sys_images_resized` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_resized` CHANGE `remote_id` `remote_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_resized` CHANGE `path` `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_resized` CHANGE `file_name` `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_resized` CHANGE `mime_type` `mime_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_images_resized` CHANGE `ext` `ext` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_images_resized`;
OPTIMIZE TABLE `sys_images_resized`;
-- TABLE: sys_injections
ALTER TABLE `sys_injections` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_injections` CHANGE `name` `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_injections` CHANGE `key` `key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_injections` CHANGE `data` `data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_injections`;
OPTIMIZE TABLE `sys_injections`;
-- TABLE: sys_injections_admin
ALTER TABLE `sys_injections_admin` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_injections_admin` CHANGE `name` `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_injections_admin` CHANGE `key` `key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_injections_admin` CHANGE `data` `data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_injections_admin`;
OPTIMIZE TABLE `sys_injections_admin`;
-- TABLE: sys_keys
ALTER TABLE `sys_keys` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_keys` CHANGE `key` `key` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_keys` CHANGE `data` `data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_keys`;
OPTIMIZE TABLE `sys_keys`;
-- TABLE: sys_localization_categories
ALTER TABLE `sys_localization_categories` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_localization_categories` CHANGE `Name` `Name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_localization_categories`;
OPTIMIZE TABLE `sys_localization_categories`;
-- TABLE: sys_localization_keys
ALTER TABLE `sys_localization_keys` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ALTER TABLE `sys_localization_keys` CHANGE `Key` `Key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
REPAIR TABLE `sys_localization_keys`;
OPTIMIZE TABLE `sys_localization_keys`;
-- TABLE: sys_localization_languages
ALTER TABLE `sys_localization_languages` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_localization_languages` CHANGE `Name` `Name` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_localization_languages` CHANGE `Flag` `Flag` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_localization_languages` CHANGE `Title` `Title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_localization_languages` CHANGE `LanguageCountry` `LanguageCountry` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_localization_languages`;
OPTIMIZE TABLE `sys_localization_languages`;
-- TABLE: sys_localization_strings
ALTER TABLE `sys_localization_strings` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_localization_strings` CHANGE `String` `String` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_localization_strings`;
OPTIMIZE TABLE `sys_localization_strings`;
-- TABLE: sys_menu_items
ALTER TABLE `sys_menu_items` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `set_name` `set_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `name` `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `title_system` `title_system` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `link` `link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `onclick` `onclick` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `target` `target` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `icon` `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `addon` `addon` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_items` CHANGE `submenu_object` `submenu_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_menu_items`;
OPTIMIZE TABLE `sys_menu_items`;
-- TABLE: sys_menu_sets
ALTER TABLE `sys_menu_sets` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_sets` CHANGE `set_name` `set_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_sets` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_sets` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_menu_sets`;
OPTIMIZE TABLE `sys_menu_sets`;
-- TABLE: sys_menu_templates
ALTER TABLE `sys_menu_templates` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_templates` CHANGE `template` `template` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_menu_templates` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_menu_templates`;
OPTIMIZE TABLE `sys_menu_templates`;
-- TABLE: sys_modules
ALTER TABLE `sys_modules` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `type` `type` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `name` `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `vendor` `vendor` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `version` `version` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `help_url` `help_url` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `path` `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `uri` `uri` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `class_prefix` `class_prefix` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `db_prefix` `db_prefix` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `lang_category` `lang_category` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `dependencies` `dependencies` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules` CHANGE `hash` `hash` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_modules`;
OPTIMIZE TABLE `sys_modules`;
-- TABLE: sys_modules_file_tracks
ALTER TABLE `sys_modules_file_tracks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules_file_tracks` CHANGE `file` `file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules_file_tracks` CHANGE `hash` `hash` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_modules_file_tracks`;
OPTIMIZE TABLE `sys_modules_file_tracks`;
-- TABLE: sys_modules_relations
ALTER TABLE `sys_modules_relations` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules_relations` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules_relations` CHANGE `on_install` `on_install` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules_relations` CHANGE `on_uninstall` `on_uninstall` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules_relations` CHANGE `on_enable` `on_enable` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_modules_relations` CHANGE `on_disable` `on_disable` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_modules_relations`;
OPTIMIZE TABLE `sys_modules_relations`;
-- TABLE: sys_objects_auths
ALTER TABLE `sys_objects_auths` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_auths` CHANGE `Name` `Name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_auths` CHANGE `Title` `Title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_auths` CHANGE `Link` `Link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_auths` CHANGE `OnClick` `OnClick` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_auths` CHANGE `Icon` `Icon` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_auths`;
OPTIMIZE TABLE `sys_objects_auths`;
-- TABLE: sys_objects_captcha
ALTER TABLE `sys_objects_captcha` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_captcha` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_captcha` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_captcha` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_captcha` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_captcha`;
OPTIMIZE TABLE `sys_objects_captcha`;
-- TABLE: sys_objects_category
ALTER TABLE `sys_objects_category` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `search_object` `search_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `form_object` `form_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `list_name` `list_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `table` `table` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `field` `field` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `join` `join` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `where` `where` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_category` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_category`;
OPTIMIZE TABLE `sys_objects_category`;
-- TABLE: sys_objects_chart
ALTER TABLE `sys_objects_chart` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `object` `object` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `table` `table` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `field_date_ts` `field_date_ts` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `field_date_dt` `field_date_dt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `field_status` `field_status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `type` `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `options` `options` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `query` `query` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `class_name` `class_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_chart` CHANGE `class_file` `class_file` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_chart`;
OPTIMIZE TABLE `sys_objects_chart`;
-- TABLE: sys_objects_cmts
ALTER TABLE `sys_objects_cmts` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `Name` `Name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `Module` `Module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `Table` `Table` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `BrowseType` `BrowseType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `PostFormPosition` `PostFormPosition` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `RootStylePrefix` `RootStylePrefix` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `BaseUrl` `BaseUrl` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `ObjectVote` `ObjectVote` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `TriggerTable` `TriggerTable` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `TriggerFieldId` `TriggerFieldId` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `TriggerFieldAuthor` `TriggerFieldAuthor` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `TriggerFieldTitle` `TriggerFieldTitle` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `TriggerFieldComments` `TriggerFieldComments` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `ClassName` `ClassName` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_cmts` CHANGE `ClassFile` `ClassFile` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_cmts`;
OPTIMIZE TABLE `sys_objects_cmts`;
-- TABLE: sys_objects_connection
ALTER TABLE `sys_objects_connection` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_connection` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_connection` CHANGE `table` `table` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_connection` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_connection` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_connection`;
OPTIMIZE TABLE `sys_objects_connection`;
-- TABLE: sys_objects_content_info
ALTER TABLE `sys_objects_content_info` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_content_info` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_content_info` CHANGE `title` `title` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_content_info` CHANGE `alert_unit` `alert_unit` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_content_info` CHANGE `alert_action_add` `alert_action_add` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_content_info` CHANGE `alert_action_update` `alert_action_update` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_content_info` CHANGE `alert_action_delete` `alert_action_delete` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_content_info` CHANGE `class_name` `class_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_content_info` CHANGE `class_file` `class_file` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_content_info`;
OPTIMIZE TABLE `sys_objects_content_info`;
-- TABLE: sys_objects_editor
ALTER TABLE `sys_objects_editor` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_editor` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_editor` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_editor` CHANGE `skin` `skin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_editor` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_editor` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_editor`;
OPTIMIZE TABLE `sys_objects_editor`;
-- TABLE: sys_objects_favorite
ALTER TABLE `sys_objects_favorite` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `table_track` `table_track` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `base_url` `base_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `trigger_table` `trigger_table` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `trigger_field_id` `trigger_field_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `trigger_field_author` `trigger_field_author` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `trigger_field_count` `trigger_field_count` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `class_name` `class_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_favorite` CHANGE `class_file` `class_file` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_favorite`;
OPTIMIZE TABLE `sys_objects_favorite`;
-- TABLE: sys_objects_feature
ALTER TABLE `sys_objects_feature` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_feature` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_feature` CHANGE `base_url` `base_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_feature` CHANGE `trigger_table` `trigger_table` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_feature` CHANGE `trigger_field_id` `trigger_field_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_feature` CHANGE `trigger_field_author` `trigger_field_author` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_feature` CHANGE `trigger_field_flag` `trigger_field_flag` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_feature` CHANGE `class_name` `class_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_feature` CHANGE `class_file` `class_file` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_feature`;
OPTIMIZE TABLE `sys_objects_feature`;
-- TABLE: sys_objects_file_handlers
ALTER TABLE `sys_objects_file_handlers` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_file_handlers` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_file_handlers` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_file_handlers` CHANGE `preg_ext` `preg_ext` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_file_handlers` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_file_handlers` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_file_handlers`;
OPTIMIZE TABLE `sys_objects_file_handlers`;
-- TABLE: sys_objects_form
ALTER TABLE `sys_objects_form` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `action` `action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `form_attrs` `form_attrs` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `submit_name` `submit_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `table` `table` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `key` `key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `uri` `uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `uri_title` `uri_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `params` `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_form` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_form`;
OPTIMIZE TABLE `sys_objects_form`;
-- TABLE: sys_objects_grid
ALTER TABLE `sys_objects_grid` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `source` `source` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `table` `table` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `field_id` `field_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `field_order` `field_order` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `field_active` `field_active` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `order_get_field` `order_get_field` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `order_get_dir` `order_get_dir` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `paginate_url` `paginate_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `paginate_simple` `paginate_simple` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `paginate_get_start` `paginate_get_start` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `paginate_get_per_page` `paginate_get_per_page` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `filter_fields` `filter_fields` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `filter_fields_translatable` `filter_fields_translatable` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `filter_get` `filter_get` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `sorting_fields` `sorting_fields` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `sorting_fields_translatable` `sorting_fields_translatable` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_grid` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_grid`;
OPTIMIZE TABLE `sys_objects_grid`;
-- TABLE: sys_objects_live_updates
ALTER TABLE `sys_objects_live_updates` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_live_updates` CHANGE `name` `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_live_updates` CHANGE `service_call` `service_call` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_live_updates`;
OPTIMIZE TABLE `sys_objects_live_updates`;
-- TABLE: sys_objects_menu
ALTER TABLE `sys_objects_menu` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_menu` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_menu` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_menu` CHANGE `set_name` `set_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_menu` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_menu` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_menu` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_menu`;
OPTIMIZE TABLE `sys_objects_menu`;
-- TABLE: sys_objects_metatags
ALTER TABLE `sys_objects_metatags` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_metatags` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_metatags` CHANGE `table_keywords` `table_keywords` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_metatags` CHANGE `table_locations` `table_locations` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_metatags` CHANGE `table_mentions` `table_mentions` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_metatags` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_metatags` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_metatags`;
OPTIMIZE TABLE `sys_objects_metatags`;
-- TABLE: sys_objects_page
ALTER TABLE `sys_objects_page` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `uri` `uri` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `title_system` `title_system` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `url` `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `meta_description` `meta_description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `meta_keywords` `meta_keywords` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `meta_robots` `meta_robots` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_page` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_page`;
OPTIMIZE TABLE `sys_objects_page`;
-- TABLE: sys_objects_payments
ALTER TABLE `sys_objects_payments` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_payments` CHANGE `object` `object` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_payments` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_payments` CHANGE `uri` `uri` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_payments`;
OPTIMIZE TABLE `sys_objects_payments`;
-- TABLE: sys_objects_privacy
ALTER TABLE `sys_objects_privacy` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `module` `module` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `action` `action` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `default_group` `default_group` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `table` `table` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `table_field_id` `table_field_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `table_field_author` `table_field_author` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_privacy` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_privacy`;
OPTIMIZE TABLE `sys_objects_privacy`;
-- TABLE: sys_objects_report
ALTER TABLE `sys_objects_report` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `table_main` `table_main` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `table_track` `table_track` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `base_url` `base_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `trigger_table` `trigger_table` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `trigger_field_id` `trigger_field_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `trigger_field_author` `trigger_field_author` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `trigger_field_count` `trigger_field_count` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `class_name` `class_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_report` CHANGE `class_file` `class_file` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_report`;
OPTIMIZE TABLE `sys_objects_report`;
-- TABLE: sys_objects_rss
ALTER TABLE `sys_objects_rss` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_rss` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_rss` CHANGE `class_name` `class_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_rss` CHANGE `class_file` `class_file` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_rss`;
OPTIMIZE TABLE `sys_objects_rss`;
-- TABLE: sys_objects_search
ALTER TABLE `sys_objects_search` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search` CHANGE `ObjectName` `ObjectName` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search` CHANGE `Title` `Title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search` CHANGE `ClassName` `ClassName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search` CHANGE `ClassPath` `ClassPath` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_search`;
OPTIMIZE TABLE `sys_objects_search`;
-- TABLE: sys_objects_search_extended
ALTER TABLE `sys_objects_search_extended` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search_extended` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search_extended` CHANGE `object_content_info` `object_content_info` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search_extended` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search_extended` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search_extended` CHANGE `class_name` `class_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_search_extended` CHANGE `class_file` `class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_search_extended`;
OPTIMIZE TABLE `sys_objects_search_extended`;
-- TABLE: sys_objects_storage
ALTER TABLE `sys_objects_storage` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_storage` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_storage` CHANGE `engine` `engine` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_storage` CHANGE `params` `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_storage` CHANGE `table_files` `table_files` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_storage` CHANGE `ext_allow` `ext_allow` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_storage` CHANGE `ext_deny` `ext_deny` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_storage`;
OPTIMIZE TABLE `sys_objects_storage`;
-- TABLE: sys_objects_transcoder
ALTER TABLE `sys_objects_transcoder` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_transcoder` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_transcoder` CHANGE `storage_object` `storage_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_transcoder` CHANGE `source_params` `source_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_transcoder` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_transcoder` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_transcoder`;
OPTIMIZE TABLE `sys_objects_transcoder`;
-- TABLE: sys_objects_uploader
ALTER TABLE `sys_objects_uploader` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_uploader` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_uploader` CHANGE `override_class_name` `override_class_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_uploader` CHANGE `override_class_file` `override_class_file` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_uploader`;
OPTIMIZE TABLE `sys_objects_uploader`;
-- TABLE: sys_objects_view
ALTER TABLE `sys_objects_view` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_view` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_view` CHANGE `table_track` `table_track` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_view` CHANGE `trigger_table` `trigger_table` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_view` CHANGE `trigger_field_id` `trigger_field_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_view` CHANGE `trigger_field_author` `trigger_field_author` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_view` CHANGE `trigger_field_count` `trigger_field_count` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_view` CHANGE `class_name` `class_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_view` CHANGE `class_file` `class_file` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_view`;
OPTIMIZE TABLE `sys_objects_view`;
-- TABLE: sys_objects_vote
ALTER TABLE `sys_objects_vote` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `Name` `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `TableMain` `TableMain` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `TableTrack` `TableTrack` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `TriggerTable` `TriggerTable` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `TriggerFieldId` `TriggerFieldId` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `TriggerFieldAuthor` `TriggerFieldAuthor` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `TriggerFieldRate` `TriggerFieldRate` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `TriggerFieldRateCount` `TriggerFieldRateCount` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `ClassName` `ClassName` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_objects_vote` CHANGE `ClassFile` `ClassFile` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_objects_vote`;
OPTIMIZE TABLE `sys_objects_vote`;
-- TABLE: sys_options
ALTER TABLE `sys_options` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options` CHANGE `caption` `caption` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options` CHANGE `value` `value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options` CHANGE `extra` `extra` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options` CHANGE `check` `check` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options` CHANGE `check_params` `check_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options` CHANGE `check_error` `check_error` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_options`;
OPTIMIZE TABLE `sys_options`;
-- TABLE: sys_options_categories
ALTER TABLE `sys_options_categories` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_categories` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_categories` CHANGE `caption` `caption` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_options_categories`;
OPTIMIZE TABLE `sys_options_categories`;
-- TABLE: sys_options_mixes
ALTER TABLE `sys_options_mixes` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_mixes` CHANGE `type` `type` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_mixes` CHANGE `category` `category` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_mixes` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_mixes` CHANGE `title` `title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_options_mixes`;
OPTIMIZE TABLE `sys_options_mixes`;
-- TABLE: sys_options_mixes2options
ALTER TABLE `sys_options_mixes2options` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_mixes2options` CHANGE `option` `option` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_mixes2options` CHANGE `value` `value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_options_mixes2options`;
OPTIMIZE TABLE `sys_options_mixes2options`;
-- TABLE: sys_options_types
ALTER TABLE `sys_options_types` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_types` CHANGE `group` `group` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_types` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_types` CHANGE `caption` `caption` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_options_types` CHANGE `icon` `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_options_types`;
OPTIMIZE TABLE `sys_options_types`;
-- TABLE: sys_pages_blocks
ALTER TABLE `sys_pages_blocks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_blocks` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_blocks` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_blocks` CHANGE `title_system` `title_system` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_blocks` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_blocks` CHANGE `hidden_on` `hidden_on` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_blocks` CHANGE `content` `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_pages_blocks`;
OPTIMIZE TABLE `sys_pages_blocks`;
-- TABLE: sys_pages_design_boxes
ALTER TABLE `sys_pages_design_boxes` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_design_boxes` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_design_boxes` CHANGE `template` `template` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_pages_design_boxes`;
OPTIMIZE TABLE `sys_pages_design_boxes`;
-- TABLE: sys_pages_layouts
ALTER TABLE `sys_pages_layouts` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_layouts` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_layouts` CHANGE `icon` `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_layouts` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_pages_layouts` CHANGE `template` `template` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_pages_layouts`;
OPTIMIZE TABLE `sys_pages_layouts`;
-- TABLE: sys_permalinks
ALTER TABLE `sys_permalinks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_permalinks` CHANGE `standard` `standard` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_permalinks` CHANGE `permalink` `permalink` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_permalinks` CHANGE `check` `check` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_permalinks`;
OPTIMIZE TABLE `sys_permalinks`;
-- TABLE: sys_privacy_defaults
ALTER TABLE `sys_privacy_defaults` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_privacy_defaults`;
OPTIMIZE TABLE `sys_privacy_defaults`;
-- TABLE: sys_privacy_groups
ALTER TABLE `sys_privacy_groups` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_privacy_groups` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_privacy_groups` CHANGE `check` `check` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_privacy_groups`;
OPTIMIZE TABLE `sys_privacy_groups`;
-- TABLE: sys_profiles
ALTER TABLE `sys_profiles` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_profiles` CHANGE `type` `type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_profiles`;
OPTIMIZE TABLE `sys_profiles`;
-- TABLE: sys_profiles_conn_friends
ALTER TABLE `sys_profiles_conn_friends` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_profiles_conn_friends`;
OPTIMIZE TABLE `sys_profiles_conn_friends`;
-- TABLE: sys_profiles_conn_subscriptions
ALTER TABLE `sys_profiles_conn_subscriptions` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_profiles_conn_subscriptions`;
OPTIMIZE TABLE `sys_profiles_conn_subscriptions`;
-- TABLE: sys_queue_email
ALTER TABLE `sys_queue_email` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_queue_email` CHANGE `email` `email` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_queue_email` CHANGE `subject` `subject` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_queue_email` CHANGE `body` `body` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_queue_email` CHANGE `headers` `headers` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_queue_email` CHANGE `params` `params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_queue_email`;
OPTIMIZE TABLE `sys_queue_email`;
-- TABLE: sys_queue_push
ALTER TABLE `sys_queue_push` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_queue_push` CHANGE `message` `message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_queue_push`;
OPTIMIZE TABLE `sys_queue_push`;
-- TABLE: sys_search_extended_fields
ALTER TABLE `sys_search_extended_fields` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `name` `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `type` `type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `caption` `caption` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `values` `values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `pass` `pass` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `search_type` `search_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `search_value` `search_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_search_extended_fields` CHANGE `search_operator` `search_operator` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_search_extended_fields`;
OPTIMIZE TABLE `sys_search_extended_fields`;
-- TABLE: sys_sessions
ALTER TABLE `sys_sessions` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_sessions` CHANGE `id` `id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_sessions` CHANGE `data` `data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_sessions`;
OPTIMIZE TABLE `sys_sessions`;
-- TABLE: sys_statistics
ALTER TABLE `sys_statistics` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_statistics` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_statistics` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_statistics` CHANGE `title` `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_statistics` CHANGE `link` `link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_statistics` CHANGE `icon` `icon` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_statistics` CHANGE `query` `query` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_statistics`;
OPTIMIZE TABLE `sys_statistics`;
-- TABLE: sys_std_pages
ALTER TABLE `sys_std_pages` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_pages` CHANGE `name` `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_pages` CHANGE `header` `header` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_pages` CHANGE `caption` `caption` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_pages` CHANGE `icon` `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_std_pages`;
OPTIMIZE TABLE `sys_std_pages`;
-- TABLE: sys_std_pages_widgets
ALTER TABLE `sys_std_pages_widgets` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_std_pages_widgets`;
OPTIMIZE TABLE `sys_std_pages_widgets`;
-- TABLE: sys_std_widgets
ALTER TABLE `sys_std_widgets` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_widgets` CHANGE `page_id` `page_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_widgets` CHANGE `module` `module` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_widgets` CHANGE `url` `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_widgets` CHANGE `click` `click` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_widgets` CHANGE `icon` `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_widgets` CHANGE `caption` `caption` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_widgets` CHANGE `cnt_notices` `cnt_notices` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_std_widgets` CHANGE `cnt_actions` `cnt_actions` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_std_widgets`;
OPTIMIZE TABLE `sys_std_widgets`;
-- TABLE: sys_storage_deletions
ALTER TABLE `sys_storage_deletions` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_storage_deletions` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_storage_deletions`;
OPTIMIZE TABLE `sys_storage_deletions`;
-- TABLE: sys_storage_ghosts
ALTER TABLE `sys_storage_ghosts` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_storage_ghosts` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_storage_ghosts`;
OPTIMIZE TABLE `sys_storage_ghosts`;
-- TABLE: sys_storage_mime_types
ALTER TABLE `sys_storage_mime_types` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_storage_mime_types` CHANGE `ext` `ext` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_storage_mime_types` CHANGE `mime_type` `mime_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_storage_mime_types` CHANGE `icon` `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_storage_mime_types` CHANGE `icon_font` `icon_font` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_storage_mime_types`;
OPTIMIZE TABLE `sys_storage_mime_types`;
-- TABLE: sys_storage_tokens
ALTER TABLE `sys_storage_tokens` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_storage_tokens` CHANGE `object` `object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_storage_tokens` CHANGE `hash` `hash` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_storage_tokens`;
OPTIMIZE TABLE `sys_storage_tokens`;
-- TABLE: sys_storage_user_quotas
ALTER TABLE `sys_storage_user_quotas` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_storage_user_quotas`;
OPTIMIZE TABLE `sys_storage_user_quotas`;
-- TABLE: sys_transcoder_filters
ALTER TABLE `sys_transcoder_filters` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_filters` CHANGE `transcoder_object` `transcoder_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_filters` CHANGE `filter` `filter` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_filters` CHANGE `filter_params` `filter_params` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_transcoder_filters`;
OPTIMIZE TABLE `sys_transcoder_filters`;
-- TABLE: sys_transcoder_images_files
ALTER TABLE `sys_transcoder_images_files` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_images_files` CHANGE `transcoder_object` `transcoder_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_images_files` CHANGE `handler` `handler` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_images_files` CHANGE `data` `data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_transcoder_images_files`;
OPTIMIZE TABLE `sys_transcoder_images_files`;
-- TABLE: sys_transcoder_queue
ALTER TABLE `sys_transcoder_queue` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue` CHANGE `transcoder_object` `transcoder_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue` CHANGE `file_url_source` `file_url_source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue` CHANGE `file_id_source` `file_id_source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue` CHANGE `file_url_result` `file_url_result` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue` CHANGE `file_ext_result` `file_ext_result` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue` CHANGE `server` `server` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue` CHANGE `log` `log` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_transcoder_queue`;
OPTIMIZE TABLE `sys_transcoder_queue`;
-- TABLE: sys_transcoder_queue_files
ALTER TABLE `sys_transcoder_queue_files` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue_files` CHANGE `remote_id` `remote_id` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue_files` CHANGE `path` `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue_files` CHANGE `file_name` `file_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue_files` CHANGE `mime_type` `mime_type` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_queue_files` CHANGE `ext` `ext` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_transcoder_queue_files`;
OPTIMIZE TABLE `sys_transcoder_queue_files`;
-- TABLE: sys_transcoder_videos_files
ALTER TABLE `sys_transcoder_videos_files` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_videos_files` CHANGE `transcoder_object` `transcoder_object` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `sys_transcoder_videos_files` CHANGE `handler` `handler` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
REPAIR TABLE `sys_transcoder_videos_files`;
OPTIMIZE TABLE `sys_transcoder_videos_files`; | the_stack |
INSERT INTO [dbo].[BugNet_Languages] ([CultureCode], [CultureName], [FallbackCulture]) VALUES('ru-RU', 'Russian (Russia)', 'en-US')
GO
/****** Object: View [dbo].[BugNet_IssuesView] Script Date: 1/26/2013 10:21:37 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[BugNet_IssuesView]
AS
SELECT dbo.BugNet_Issues.IssueId, dbo.BugNet_Issues.IssueTitle, dbo.BugNet_Issues.IssueDescription, dbo.BugNet_Issues.IssueStatusId,
dbo.BugNet_Issues.IssuePriorityId, dbo.BugNet_Issues.IssueTypeId, dbo.BugNet_Issues.IssueCategoryId, dbo.BugNet_Issues.ProjectId,
dbo.BugNet_Issues.IssueResolutionId, dbo.BugNet_Issues.IssueCreatorUserId, dbo.BugNet_Issues.IssueAssignedUserId, dbo.BugNet_Issues.IssueOwnerUserId,
dbo.BugNet_Issues.IssueDueDate, dbo.BugNet_Issues.IssueMilestoneId, dbo.BugNet_Issues.IssueAffectedMilestoneId, dbo.BugNet_Issues.IssueVisibility,
dbo.BugNet_Issues.IssueEstimation, dbo.BugNet_Issues.DateCreated, dbo.BugNet_Issues.LastUpdate, dbo.BugNet_Issues.LastUpdateUserId,
dbo.BugNet_Projects.ProjectName, dbo.BugNet_Projects.ProjectCode, ISNULL(dbo.BugNet_ProjectPriorities.PriorityName, N'Unassigned') AS PriorityName,
ISNULL(dbo.BugNet_ProjectIssueTypes.IssueTypeName, N'Unassigned') AS IssueTypeName, ISNULL(dbo.BugNet_ProjectCategories.CategoryName, N'Unassigned')
AS CategoryName, ISNULL(dbo.BugNet_ProjectStatus.StatusName, N'Unassigned') AS StatusName, ISNULL(dbo.BugNet_ProjectMilestones.MilestoneName,
N'Unassigned') AS MilestoneName, ISNULL(AffectedMilestone.MilestoneName, N'Unassigned') AS AffectedMilestoneName,
ISNULL(dbo.BugNet_ProjectResolutions.ResolutionName, 'Unassigned') AS ResolutionName, LastUpdateUsers.UserName AS LastUpdateUserName,
ISNULL(AssignedUsers.UserName, N'Unassigned') AS AssignedUsername, ISNULL(AssignedUsersProfile.DisplayName, N'Unassigned') AS AssignedDisplayName,
CreatorUsers.UserName AS CreatorUserName, ISNULL(CreatorUsersProfile.DisplayName, N'Unassigned') AS CreatorDisplayName, ISNULL(OwnerUsers.UserName,
'Unassigned') AS OwnerUserName, ISNULL(OwnerUsersProfile.DisplayName, N'Unassigned') AS OwnerDisplayName, ISNULL(LastUpdateUsersProfile.DisplayName,
'Unassigned') AS LastUpdateDisplayName, ISNULL(dbo.BugNet_ProjectPriorities.PriorityImageUrl, '') AS PriorityImageUrl,
ISNULL(dbo.BugNet_ProjectIssueTypes.IssueTypeImageUrl, '') AS IssueTypeImageUrl, ISNULL(dbo.BugNet_ProjectStatus.StatusImageUrl, '') AS StatusImageUrl,
ISNULL(dbo.BugNet_ProjectMilestones.MilestoneImageUrl, '') AS MilestoneImageUrl, ISNULL(dbo.BugNet_ProjectResolutions.ResolutionImageUrl, '')
AS ResolutionImageUrl, ISNULL(AffectedMilestone.MilestoneImageUrl, '') AS AffectedMilestoneImageUrl, ISNULL
((SELECT SUM(Duration) AS Expr1
FROM dbo.BugNet_IssueWorkReports AS WR
WHERE (IssueId = dbo.BugNet_Issues.IssueId)), 0.00) AS TimeLogged, ISNULL
((SELECT COUNT(IssueId) AS Expr1
FROM dbo.BugNet_IssueVotes AS V
WHERE (IssueId = dbo.BugNet_Issues.IssueId)), 0) AS IssueVotes, dbo.BugNet_Issues.Disabled, dbo.BugNet_Issues.IssueProgress,
dbo.BugNet_ProjectMilestones.MilestoneDueDate, dbo.BugNet_Projects.ProjectDisabled, CAST(COALESCE (dbo.BugNet_ProjectStatus.IsClosedState, 0) AS BIT)
AS IsClosed, CAST(CONVERT(VARCHAR(8), dbo.BugNet_Issues.LastUpdate, 112) AS DATETIME) AS LastUpdateAsDate,
CAST(CONVERT(VARCHAR(8), dbo.BugNet_Issues.DateCreated, 112) AS DATETIME) AS DateCreatedAsDate
FROM dbo.BugNet_Issues LEFT OUTER JOIN
dbo.BugNet_ProjectIssueTypes ON dbo.BugNet_Issues.IssueTypeId = dbo.BugNet_ProjectIssueTypes.IssueTypeId LEFT OUTER JOIN
dbo.BugNet_ProjectPriorities ON dbo.BugNet_Issues.IssuePriorityId = dbo.BugNet_ProjectPriorities.PriorityId LEFT OUTER JOIN
dbo.BugNet_ProjectCategories ON dbo.BugNet_Issues.IssueCategoryId = dbo.BugNet_ProjectCategories.CategoryId LEFT OUTER JOIN
dbo.BugNet_ProjectStatus ON dbo.BugNet_Issues.IssueStatusId = dbo.BugNet_ProjectStatus.StatusId LEFT OUTER JOIN
dbo.BugNet_ProjectMilestones AS AffectedMilestone ON dbo.BugNet_Issues.IssueAffectedMilestoneId = AffectedMilestone.MilestoneId LEFT OUTER JOIN
dbo.BugNet_ProjectMilestones ON dbo.BugNet_Issues.IssueMilestoneId = dbo.BugNet_ProjectMilestones.MilestoneId LEFT OUTER JOIN
dbo.BugNet_ProjectResolutions ON dbo.BugNet_Issues.IssueResolutionId = dbo.BugNet_ProjectResolutions.ResolutionId LEFT OUTER JOIN
dbo.aspnet_Users AS AssignedUsers ON dbo.BugNet_Issues.IssueAssignedUserId = AssignedUsers.UserId LEFT OUTER JOIN
dbo.aspnet_Users AS LastUpdateUsers ON dbo.BugNet_Issues.LastUpdateUserId = LastUpdateUsers.UserId LEFT OUTER JOIN
dbo.aspnet_Users AS CreatorUsers ON dbo.BugNet_Issues.IssueCreatorUserId = CreatorUsers.UserId LEFT OUTER JOIN
dbo.aspnet_Users AS OwnerUsers ON dbo.BugNet_Issues.IssueOwnerUserId = OwnerUsers.UserId LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS CreatorUsersProfile ON CreatorUsers.UserName = CreatorUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS AssignedUsersProfile ON AssignedUsers.UserName = AssignedUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS OwnerUsersProfile ON OwnerUsers.UserName = OwnerUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_UserProfiles AS LastUpdateUsersProfile ON LastUpdateUsers.UserName = LastUpdateUsersProfile.UserName LEFT OUTER JOIN
dbo.BugNet_Projects ON dbo.BugNet_Issues.ProjectId = dbo.BugNet_Projects.ProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_Project_CloneProject] Script Date: 1/26/2013 11:03:42 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[BugNet_Project_CloneProject]
(
@ProjectId INT,
@ProjectName NVarChar(256),
@CloningUsername VARCHAR(75) = NULL
)
AS
DECLARE
@CreatorUserId UNIQUEIDENTIFIER
SET NOCOUNT OFF
SET @CreatorUserId = (SELECT ProjectCreatorUserId FROM BugNet_Projects WHERE ProjectId = @ProjectId)
IF(@CloningUsername IS NOT NULL OR LTRIM(RTRIM(@CloningUsername)) != '')
EXEC dbo.BugNet_User_GetUserIdByUserName @UserName = @CloningUsername, @UserId = @CreatorUserId OUTPUT
-- Copy Project
INSERT BugNet_Projects
(
ProjectName,
ProjectCode,
ProjectDescription,
AttachmentUploadPath,
DateCreated,
ProjectDisabled,
ProjectAccessType,
ProjectManagerUserId,
ProjectCreatorUserId,
AllowAttachments,
AttachmentStorageType,
SvnRepositoryUrl
)
SELECT
@ProjectName,
ProjectCode,
ProjectDescription,
AttachmentUploadPath,
GetDate(),
ProjectDisabled,
ProjectAccessType,
ProjectManagerUserId,
@CreatorUserId,
AllowAttachments,
AttachmentStorageType,
SvnRepositoryUrl
FROM
BugNet_Projects
WHERE
ProjectId = @ProjectId
DECLARE @NewProjectId INT
SET @NewProjectId = SCOPE_IDENTITY()
-- Copy Milestones
INSERT BugNet_ProjectMilestones
(
ProjectId,
MilestoneName,
MilestoneImageUrl,
SortOrder,
DateCreated
)
SELECT
@NewProjectId,
MilestoneName,
MilestoneImageUrl,
SortOrder,
GetDate()
FROM
BugNet_ProjectMilestones
WHERE
ProjectId = @ProjectId
-- Copy Project Members
INSERT BugNet_UserProjects
(
UserId,
ProjectId,
DateCreated
)
SELECT
UserId,
@NewProjectId,
GetDate()
FROM
BugNet_UserProjects
WHERE
ProjectId = @ProjectId
-- Copy Project Roles
INSERT BugNet_Roles
(
ProjectId,
RoleName,
RoleDescription,
AutoAssign
)
SELECT
@NewProjectId,
RoleName,
RoleDescription,
AutoAssign
FROM
BugNet_Roles
WHERE
ProjectId = @ProjectId
CREATE TABLE #OldRoles
(
OldRowNumber INT IDENTITY,
OldRoleId INT,
)
INSERT #OldRoles
(
OldRoleId
)
SELECT
RoleId
FROM
BugNet_Roles
WHERE
ProjectId = @ProjectId
ORDER BY
RoleId
CREATE TABLE #NewRoles
(
NewRowNumber INT IDENTITY,
NewRoleId INT,
)
INSERT #NewRoles
(
NewRoleId
)
SELECT
RoleId
FROM
BugNet_Roles
WHERE
ProjectId = @NewProjectId
ORDER BY
RoleId
INSERT BugNet_UserRoles
(
UserId,
RoleId
)
SELECT
UserId,
RoleId = NewRoleId
FROM
#OldRoles
INNER JOIN #NewRoles ON OldRowNumber = NewRowNumber
INNER JOIN BugNet_UserRoles UR ON UR.RoleId = OldRoleId
-- Copy Role Permissions
INSERT BugNet_RolePermissions
(
PermissionId,
RoleId
)
SELECT Perm.PermissionId, NewRoles.RoleId
FROM BugNet_RolePermissions Perm
INNER JOIN BugNet_Roles OldRoles ON Perm.RoleId = OldRoles.RoleID
INNER JOIN BugNet_Roles NewRoles ON NewRoles.RoleName = OldRoles.RoleName
WHERE OldRoles.ProjectId = @ProjectId
and NewRoles.ProjectId = @NewProjectId
-- Copy Custom Fields
INSERT BugNet_ProjectCustomFields
(
ProjectId,
CustomFieldName,
CustomFieldRequired,
CustomFieldDataType,
CustomFieldTypeId
)
SELECT
@NewProjectId,
CustomFieldName,
CustomFieldRequired,
CustomFieldDataType,
CustomFieldTypeId
FROM
BugNet_ProjectCustomFields
WHERE
ProjectId = @ProjectId
-- Copy Custom Field Selections
CREATE TABLE #OldCustomFields
(
OldRowNumber INT IDENTITY,
OldCustomFieldId INT,
)
INSERT #OldCustomFields
(
OldCustomFieldId
)
SELECT
CustomFieldId
FROM
BugNet_ProjectCustomFields
WHERE
ProjectId = @ProjectId
ORDER BY CustomFieldId
CREATE TABLE #NewCustomFields
(
NewRowNumber INT IDENTITY,
NewCustomFieldId INT,
)
INSERT #NewCustomFields
(
NewCustomFieldId
)
SELECT
CustomFieldId
FROM
BugNet_ProjectCustomFields
WHERE
ProjectId = @NewProjectId
ORDER BY CustomFieldId
INSERT BugNet_ProjectCustomFieldSelections
(
CustomFieldId,
CustomFieldSelectionValue,
CustomFieldSelectionName,
CustomFieldSelectionSortOrder
)
SELECT
CustomFieldId = NewCustomFieldId,
CustomFieldSelectionValue,
CustomFieldSelectionName,
CustomFieldSelectionSortOrder
FROM
#OldCustomFields
INNER JOIN #NewCustomFields ON OldRowNumber = NewRowNumber
INNER JOIN BugNet_ProjectCustomFieldSelections CFS ON CFS.CustomFieldId = OldCustomFieldId
-- Copy Project Mailboxes
INSERT BugNet_ProjectMailBoxes
(
MailBox,
ProjectId,
AssignToUserId,
IssueTypeId
)
SELECT
Mailbox,
@NewProjectId,
AssignToUserId,
IssueTypeId
FROM
BugNet_ProjectMailBoxes
WHERE
ProjectId = @ProjectId
-- Copy Categories
INSERT BugNet_ProjectCategories
(
ProjectId,
CategoryName,
ParentCategoryId
)
SELECT
@NewProjectId,
CategoryName,
ParentCategoryId
FROM
BugNet_ProjectCategories
WHERE
ProjectId = @ProjectId AND Disabled = 0
CREATE TABLE #OldCategories
(
OldRowNumber INT IDENTITY,
OldCategoryId INT,
)
INSERT #OldCategories
(
OldCategoryId
)
SELECT
CategoryId
FROM
BugNet_ProjectCategories
WHERE
ProjectId = @ProjectId
ORDER BY CategoryId
CREATE TABLE #NewCategories
(
NewRowNumber INT IDENTITY,
NewCategoryId INT,
)
INSERT #NewCategories
(
NewCategoryId
)
SELECT
CategoryId
FROM
BugNet_ProjectCategories
WHERE
ProjectId = @NewProjectId
ORDER BY CategoryId
UPDATE BugNet_ProjectCategories SET
ParentCategoryId = NewCategoryId
FROM
#OldCategories INNER JOIN #NewCategories ON OldRowNumber = NewRowNumber
WHERE
ProjectId = @NewProjectId
And ParentCategoryID = OldCategoryId
-- Copy Status's
INSERT BugNet_ProjectStatus
(
ProjectId,
StatusName,
StatusImageUrl,
SortOrder,
IsClosedState
)
SELECT
@NewProjectId,
StatusName,
StatusImageUrl,
SortOrder,
IsClosedState
FROM
BugNet_ProjectStatus
WHERE
ProjectId = @ProjectId
-- Copy Priorities
INSERT BugNet_ProjectPriorities
(
ProjectId,
PriorityName,
PriorityImageUrl,
SortOrder
)
SELECT
@NewProjectId,
PriorityName,
PriorityImageUrl,
SortOrder
FROM
BugNet_ProjectPriorities
WHERE
ProjectId = @ProjectId
-- Copy Resolutions
INSERT BugNet_ProjectResolutions
(
ProjectId,
ResolutionName,
ResolutionImageUrl,
SortOrder
)
SELECT
@NewProjectId,
ResolutionName,
ResolutionImageUrl,
SortOrder
FROM
BugNet_ProjectResolutions
WHERE
ProjectId = @ProjectId
-- Copy Issue Types
INSERT BugNet_ProjectIssueTypes
(
ProjectId,
IssueTypeName,
IssueTypeImageUrl,
SortOrder
)
SELECT
@NewProjectId,
IssueTypeName,
IssueTypeImageUrl,
SortOrder
FROM
BugNet_ProjectIssueTypes
WHERE
ProjectId = @ProjectId
-- Copy Project Notifications
INSERT BugNet_ProjectNotifications
(
ProjectId,
UserId
)
SELECT
@NewProjectId,
UserId
FROM
BugNet_ProjectNotifications
WHERE
ProjectId = @ProjectId
RETURN @NewProjectId
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueNotification_GetIssueNotificationsByIssueId] Script Date: 2/2/2013 11:43:18 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[BugNet_IssueNotification_GetIssueNotificationsByIssueId]
@IssueId Int
AS
/* This will return multiple results if the user is
subscribed at the project level and issue level
*/
SET NOCOUNT ON
DECLARE
@DefaultCulture NVARCHAR(50)
SET @DefaultCulture = (SELECT ISNULL(SettingValue, 'en-US') FROM BugNet_HostSettings WHERE SettingName = 'ApplicationDefaultLanguage')
SELECT
IssueNotificationId,
IssueId,
U.UserId AS NotificationUserId,
U.UserName AS NotificationUsername,
ISNULL(DisplayName,'') AS NotificationDisplayName,
M.Email AS NotificationEmail,
ISNULL(UP.PreferredLocale, @DefaultCulture) AS NotificationCulture
FROM
BugNet_IssueNotifications
INNER JOIN aspnet_Users U ON BugNet_IssueNotifications.UserId = U.UserId
INNER JOIN aspnet_Membership M ON BugNet_IssueNotifications.UserId = M.UserId
LEFT OUTER JOIN BugNet_UserProfiles UP ON U.UserName = UP.UserName
WHERE
IssueId = @IssueId
ORDER BY
DisplayName
GO
/****** Object: StoredProcedure [dbo].[BugNet_IssueRevision_CreateNewIssueRevision] Script Date: 2/3/2013 1:24:10 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[BugNet_IssueRevision_CreateNewIssueRevision]
@IssueId int,
@Revision int,
@Repository nvarchar(400),
@RevisionDate nvarchar(100),
@RevisionAuthor nvarchar(100),
@RevisionMessage ntext,
@Changeset nvarchar(100),
@Branch nvarchar(255)
AS
INSERT BugNet_IssueRevisions
(
Revision,
IssueId,
Repository,
RevisionAuthor,
RevisionDate,
RevisionMessage,
Changeset,
Branch,
DateCreated
)
VALUES
(
@Revision,
@IssueId,
@Repository,
@RevisionAuthor,
@RevisionDate,
@RevisionMessage,
@Changeset,
@Branch,
GetDate()
)
RETURN scope_identity()
GO | the_stack |
-----------------------------------------
-- Tables Used in this Section
-----------------------------------------
@@&&fc_table_loader. 'OCI360_USAGECOSTS_TAGGED_DAILY'
@@&&fc_table_loader. 'OCI360_USAGECOSTS'
@@&&fc_table_loader. 'OCI360_SERV_RESOURCES'
-----------------------------------------
--- Get some Billing info before starting
@@&&fc_def_empty_var. oci360_billing_currency
@@&&fc_def_empty_var. oci360_billing_date_from
@@&&fc_def_empty_var. oci360_billing_date_to
@@&&fc_def_empty_var. oci360_billing_period
COL oci360_billing_currency NEW_V oci360_billing_currency NOPRI
SELECT distinct CURRENCY oci360_billing_currency
from OCI360_USAGECOSTS_TAGGED_DAILY;
COL oci360_billing_currency CLEAR
COL oci360_billing_date_from NEW_V oci360_billing_date_from NOPRI
COL oci360_billing_date_to NEW_V oci360_billing_date_to NOPRI
COL oci360_billing_period NEW_V oci360_billing_period NOPRI
SELECT TO_CHAR(min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'YYYY-MM-DD') oci360_billing_date_from,
TO_CHAR(max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'YYYY-MM-DD') oci360_billing_date_to,
EXTRACT(DAY FROM (max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')) - min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')))) oci360_billing_period
from OCI360_USAGECOSTS_TAGGED_DAILY;
COL oci360_billing_date_from CLEAR
COL oci360_billing_date_to CLEAR
COL oci360_billing_period CLEAR
DEF oci360_billing_between = ', between &&oci360_billing_date_from. and &&oci360_billing_date_to.'
-----------------------------------------
VAR sql_text_backup CLOB
BEGIN
:sql_text_backup := q'{
WITH t1 AS (
SELECT SUM(COSTS$COMPUTEDAMOUNT) COMPUTEDAMOUNT,
TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.') ENDTIMEUTC
FROM @main_table@
WHERE @filter_predicate@
GROUP BY TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')
),
trange as (
select trunc(min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'HH24') min,
trunc(max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'HH24') max
FROM @main_table@
),
alldays as ( -- Will generate all days between Min and Max Start Time
SELECT trunc(trange.min,'DD') + (rownum - 1) vdate,
rownum seq
FROM trange
WHERE trange.min + (rownum - 1) <= trange.max - 1 -- Skip last entry as may be incomplete.
CONNECT BY LEVEL <= (trange.max - trange.min) + 1
),
result as (
select seq snap_id,
TO_CHAR(vdate, 'YYYY-MM-DD HH24:MI') begin_time,
TO_CHAR(vdate+1,'YYYY-MM-DD HH24:MI') end_time,
TO_CHAR(NVL(CEIL(SUM(COMPUTEDAMOUNT)*100)/100,0),'99999990D00') line1
from t1, alldays
where ENDTIMEUTC(+) >= vdate and ENDTIMEUTC(+) < vdate+1
group by seq, vdate
),
statistics as (
select REGR_SLOPE(line1,snap_id) slope,
REGR_INTERCEPT(line1,snap_id) intercept
from result
)
select snap_id,
begin_time,
end_time,
line1,
TO_CHAR(CEIL((slope*snap_id+intercept)*100)/100,'99999990D00') line2,
0 dummy_03,
0 dummy_04,
0 dummy_05,
0 dummy_06,
0 dummy_07,
0 dummy_08,
0 dummy_09,
0 dummy_10,
0 dummy_11,
0 dummy_12,
0 dummy_13,
0 dummy_14,
0 dummy_15
from result, statistics
order by snap_id
}';
END;
/
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_tag_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Tag: ' || TAG || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS_TAGGED_DAILY''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS_TAGGED_DAILY]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[TAG = ''' || TAG || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost per Day''' || CHR(10) ||
'DEF tit_02 = ''Linear Regression Trend''' || CHR(10) ||
'DEF chartype = ''LineChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.TAG
FROM OCI360_USAGECOSTS_TAGGED_DAILY t1
WHERE EXISTS (SELECT 1 FROM OCI360_USAGECOSTS_TAGGED_DAILY t3 WHERE t3.TAG = t1.TAG HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
AND t1.TAG not like 'ORCL:%'
ORDER BY t1.TAG);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Custom Tags - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_comp_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Compartment: ' || TAG || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS_TAGGED_DAILY''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS_TAGGED_DAILY]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[TAG = ''' || TAG || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost per Day''' || CHR(10) ||
'DEF tit_02 = ''Linear Regression Trend''' || CHR(10) ||
'DEF chartype = ''LineChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.TAG
FROM OCI360_USAGECOSTS_TAGGED_DAILY t1
WHERE EXISTS (SELECT 1 FROM OCI360_USAGECOSTS_TAGGED_DAILY t3 WHERE t3.TAG = t1.TAG HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
AND t1.TAG like 'ORCL:OCICompartmentPath=%'
ORDER BY t1.TAG);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Compartments - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_srvgrp_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Service Group: ' || TAG || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS_TAGGED_DAILY''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS_TAGGED_DAILY]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[TAG = ''' || TAG || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost per Day''' || CHR(10) ||
'DEF tit_02 = ''Linear Regression Trend''' || CHR(10) ||
'DEF chartype = ''LineChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.TAG
FROM OCI360_USAGECOSTS_TAGGED_DAILY t1
WHERE EXISTS (SELECT 1 FROM OCI360_USAGECOSTS_TAGGED_DAILY t3 WHERE t3.TAG = t1.TAG HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
AND t1.TAG like 'ORCL:OCIService=%'
ORDER BY t1.TAG);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Service Groups - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_srv_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Service Name: ' || SERVICENAME || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[SERVICENAME = ''' || SERVICENAME || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost per Day''' || CHR(10) ||
'DEF tit_02 = ''Linear Regression Trend''' || CHR(10) ||
'DEF chartype = ''LineChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.SERVICENAME
FROM OCI360_USAGECOSTS t1
WHERE EXISTS (SELECT 1 FROM OCI360_USAGECOSTS t3 WHERE t3.SERVICENAME = t1.SERVICENAME HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
ORDER BY t1.SERVICENAME);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Services - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
@@&&oci360_list_subsec_start.
@@&&fc_def_output_file. oci360_loop_section 'oci360_5e_rsr_section.sql'
@@&&fc_spool_start.
SPO &&oci360_loop_section.
SELECT 'DEF title = ''Resource: ' || NVL(DISPLAYNAME,RESOURCENAME) || '''' || CHR(10) ||
'DEF title_suffix = ''&&oci360_billing_between.''' || CHR(10) ||
'DEF main_table = ''OCI360_USAGECOSTS''' || CHR(10) ||
'DEF vaxis = ''Cost (&&oci360_billing_currency.)''' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text_backup, ''@main_table@'', q''[OCI360_USAGECOSTS]'');' || CHR(10) ||
'EXEC :sql_text := REPLACE(:sql_text, ''@filter_predicate@'', q''[RESOURCENAME = ''' || RESOURCENAME || ''']'');' || CHR(10) ||
'DEF tit_01 = ''Total Cost per Day''' || CHR(10) ||
'DEF tit_02 = ''Linear Regression Trend''' || CHR(10) ||
'DEF chartype = ''LineChart''' || CHR(10) ||
'DEF skip_lch = ''''' || CHR(10) ||
'@@&&9a_pre_one.'
FROM ( SELECT DISTINCT t1.RESOURCENAME, t2.DISPLAYNAME
FROM OCI360_USAGECOSTS t1, OCI360_SERV_RESOURCES t2
WHERE t1.RESOURCENAME = t2.NAME
AND EXISTS (SELECT 1 FROM OCI360_USAGECOSTS t3 WHERE t3.RESOURCENAME = t1.RESOURCENAME HAVING SUM(COSTS$COMPUTEDAMOUNT) > 0)
ORDER BY t1.RESOURCENAME);
SPO OFF
@@&&fc_spool_end.
@@&&oci360_loop_section.
@@&&fc_zip_driver_files. &&oci360_loop_section.
UNDEF oci360_loop_section
DEF title = 'Resources - Total Costs'
@@&&oci360_list_subsec_stop.
-----------------------------------------
DEF title = 'Total per day'
DEF title_suffix = '&&oci360_billing_between.'
DEF main_table = 'OCI360_USAGECOSTS'
DEF vaxis = 'Cost (&&oci360_billing_currency.)'
EXEC :sql_text := REPLACE(:sql_text_backup, '@main_table@', q'[OCI360_USAGECOSTS]');
EXEC :sql_text := REPLACE(:sql_text, '@filter_predicate@', q'[1 = 1]');
DEF tit_01 = 'Total Cost per Day'
DEF tit_02 = 'Linear Regression Trend'
DEF chartype = 'AreaChart'
DEF skip_lch = ''
@@&&9a_pre_one.
-----------------------------------------
DEF gc_lin_1 = ''
DEF gc_lin_2 = ''
DEF gc_lin_3 = ''
DEF gc_lin_4 = ''
DEF gc_lin_5 = ''
DEF gc_lin_6 = ''
DEF gc_lin_7 = ''
DEF gc_lin_8 = ''
DEF gc_lin_9 = ''
DEF gc_lin_10 = ''
DEF gc_lin_11 = ''
DEF gc_lin_12 = ''
DEF gc_lin_13 = ''
DEF gc_lin_14 = ''
DEF gc_lin_15 = ''
COL gc_lin_1 NEW_V gc_lin_1 NOPRI
COL gc_lin_2 NEW_V gc_lin_2 NOPRI
COL gc_lin_3 NEW_V gc_lin_3 NOPRI
COL gc_lin_4 NEW_V gc_lin_4 NOPRI
COL gc_lin_5 NEW_V gc_lin_5 NOPRI
COL gc_lin_6 NEW_V gc_lin_6 NOPRI
COL gc_lin_7 NEW_V gc_lin_7 NOPRI
COL gc_lin_8 NEW_V gc_lin_8 NOPRI
COL gc_lin_9 NEW_V gc_lin_9 NOPRI
COL gc_lin_10 NEW_V gc_lin_10 NOPRI
COL gc_lin_11 NEW_V gc_lin_11 NOPRI
COL gc_lin_12 NEW_V gc_lin_12 NOPRI
COL gc_lin_13 NEW_V gc_lin_13 NOPRI
COL gc_lin_14 NEW_V gc_lin_14 NOPRI
COL gc_lin_15 NEW_V gc_lin_15 NOPRI
DEF gc_flt_1 = ''
DEF gc_flt_2 = ''
DEF gc_flt_3 = ''
DEF gc_flt_4 = ''
DEF gc_flt_5 = ''
DEF gc_flt_6 = ''
DEF gc_flt_7 = ''
DEF gc_flt_8 = ''
DEF gc_flt_9 = ''
DEF gc_flt_10 = ''
DEF gc_flt_11 = ''
DEF gc_flt_12 = ''
DEF gc_flt_13 = ''
DEF gc_flt_14 = ''
DEF gc_flt_15 = ''
COL gc_flt_1 NEW_V gc_flt_1 NOPRI
COL gc_flt_2 NEW_V gc_flt_2 NOPRI
COL gc_flt_3 NEW_V gc_flt_3 NOPRI
COL gc_flt_4 NEW_V gc_flt_4 NOPRI
COL gc_flt_5 NEW_V gc_flt_5 NOPRI
COL gc_flt_6 NEW_V gc_flt_6 NOPRI
COL gc_flt_7 NEW_V gc_flt_7 NOPRI
COL gc_flt_8 NEW_V gc_flt_8 NOPRI
COL gc_flt_9 NEW_V gc_flt_9 NOPRI
COL gc_flt_10 NEW_V gc_flt_10 NOPRI
COL gc_flt_11 NEW_V gc_flt_11 NOPRI
COL gc_flt_12 NEW_V gc_flt_12 NOPRI
COL gc_flt_13 NEW_V gc_flt_13 NOPRI
COL gc_flt_14 NEW_V gc_flt_14 NOPRI
COL gc_flt_15 NEW_V gc_flt_15 NOPRI
WITH t1 AS (
SELECT SUM(COSTS$COMPUTEDAMOUNT) COMPUTEDAMOUNT,
RESOURCENAME
FROM OCI360_USAGECOSTS
GROUP BY RESOURCENAME
), t2 as (
SELECT /*+ materialize */
t1.RESOURCENAME,
nvl(o2.DISPLAYNAME,t1.RESOURCENAME) DISPLAYNAME,
rank() over (order by t1.COMPUTEDAMOUNT desc, t1.RESOURCENAME) ord
FROM t1, (select distinct NAME, DISPLAYNAME from OCI360_SERV_RESOURCES) o2
where t1.RESOURCENAME = o2.NAME (+)
)
SELECT
-- Define filters
(select RESOURCENAME FROM t2 where ord = 1) gc_flt_1,
(select RESOURCENAME FROM t2 where ord = 2) gc_flt_2,
(select RESOURCENAME FROM t2 where ord = 3) gc_flt_3,
(select RESOURCENAME FROM t2 where ord = 4) gc_flt_4,
(select RESOURCENAME FROM t2 where ord = 5) gc_flt_5,
(select RESOURCENAME FROM t2 where ord = 6) gc_flt_6,
(select RESOURCENAME FROM t2 where ord = 7) gc_flt_7,
(select RESOURCENAME FROM t2 where ord = 8) gc_flt_8,
(select RESOURCENAME FROM t2 where ord = 9) gc_flt_9,
(select RESOURCENAME FROM t2 where ord = 10) gc_flt_10,
(select RESOURCENAME FROM t2 where ord = 11) gc_flt_11,
(select RESOURCENAME FROM t2 where ord = 12) gc_flt_12,
(select RESOURCENAME FROM t2 where ord = 13) gc_flt_13,
(select RESOURCENAME FROM t2 where ord = 14) gc_flt_14,
(select RESOURCENAME FROM t2 where ord = 15) gc_flt_15,
-- Define names
(select DISPLAYNAME FROM t2 where ord = 1) gc_lin_1,
(select DISPLAYNAME FROM t2 where ord = 2) gc_lin_2,
(select DISPLAYNAME FROM t2 where ord = 3) gc_lin_3,
(select DISPLAYNAME FROM t2 where ord = 4) gc_lin_4,
(select DISPLAYNAME FROM t2 where ord = 5) gc_lin_5,
(select DISPLAYNAME FROM t2 where ord = 6) gc_lin_6,
(select DISPLAYNAME FROM t2 where ord = 7) gc_lin_7,
(select DISPLAYNAME FROM t2 where ord = 8) gc_lin_8,
(select DISPLAYNAME FROM t2 where ord = 9) gc_lin_9,
(select DISPLAYNAME FROM t2 where ord = 10) gc_lin_10,
(select DISPLAYNAME FROM t2 where ord = 11) gc_lin_11,
(select DISPLAYNAME FROM t2 where ord = 12) gc_lin_12,
(select DISPLAYNAME FROM t2 where ord = 13) gc_lin_13,
(select DISPLAYNAME FROM t2 where ord = 14) gc_lin_14,
(select DISPLAYNAME FROM t2 where ord = 15) gc_lin_15
FROM DUAL;
COL gc_lin_1 CLEAR
COL gc_lin_2 CLEAR
COL gc_lin_3 CLEAR
COL gc_lin_4 CLEAR
COL gc_lin_5 CLEAR
COL gc_lin_6 CLEAR
COL gc_lin_7 CLEAR
COL gc_lin_8 CLEAR
COL gc_lin_9 CLEAR
COL gc_lin_10 CLEAR
COL gc_lin_11 CLEAR
COL gc_lin_12 CLEAR
COL gc_lin_13 CLEAR
COL gc_lin_14 CLEAR
COL gc_lin_15 CLEAR
COL gc_flt_1 CLEAR
COL gc_flt_2 CLEAR
COL gc_flt_3 CLEAR
COL gc_flt_4 CLEAR
COL gc_flt_5 CLEAR
COL gc_flt_6 CLEAR
COL gc_flt_7 CLEAR
COL gc_flt_8 CLEAR
COL gc_flt_9 CLEAR
COL gc_flt_10 CLEAR
COL gc_flt_11 CLEAR
COL gc_flt_12 CLEAR
COL gc_flt_13 CLEAR
COL gc_flt_14 CLEAR
COL gc_flt_15 CLEAR
BEGIN
:sql_text := q'{
WITH t1 AS (
SELECT SUM(COSTS$COMPUTEDAMOUNT) COMPUTEDAMOUNT,
TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.') ENDTIMEUTC,
RESOURCENAME
FROM OCI360_USAGECOSTS
GROUP BY TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.'), RESOURCENAME
),
trange as (
select trunc(min(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'HH24') min,
trunc(max(TO_TIMESTAMP(ENDTIMEUTC,'&&oci360_tzcolformat.')),'HH24') max
FROM OCI360_USAGECOSTS
),
alldays as ( -- Will generate all days between Min and Max Start Time
SELECT trunc(trange.min,'DD') + (rownum - 1) vdate,
rownum seq
FROM trange
WHERE trange.min + (rownum - 1) <= trange.max - 1 -- Skip last entry as may be incomplete.
CONNECT BY LEVEL <= (trange.max - trange.min) + 1
)
select seq snap_id,
TO_CHAR(vdate, 'YYYY-MM-DD HH24:MI') begin_time,
TO_CHAR(vdate+1,'YYYY-MM-DD HH24:MI') end_time,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_1.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line1,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_2.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line2,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_3.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line3,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_4.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line4,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_5.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line5,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_6.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line6,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_7.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line7,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_8.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line8,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_9.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line9,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_10.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line10,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_11.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line11,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_12.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line12,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_13.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line13,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_14.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line14,
TO_CHAR(NVL(CEIL(SUM(DECODE(RESOURCENAME,'&&gc_flt_15.',COMPUTEDAMOUNT,0))*100)/100,0),'99999990D00') line15
from t1, alldays
where ENDTIMEUTC(+) >= vdate and ENDTIMEUTC(+) < vdate+1
group by seq, vdate
order by seq
}';
END;
/
DEF tit_01 = '&&gc_lin_1.'
DEF tit_02 = '&&gc_lin_2.'
DEF tit_03 = '&&gc_lin_3.'
DEF tit_04 = '&&gc_lin_4.'
DEF tit_05 = '&&gc_lin_5.'
DEF tit_06 = '&&gc_lin_6.'
DEF tit_07 = '&&gc_lin_7.'
DEF tit_08 = '&&gc_lin_8.'
DEF tit_09 = '&&gc_lin_9.'
DEF tit_10 = '&&gc_lin_10.'
DEF tit_11 = '&&gc_lin_11.'
DEF tit_12 = '&&gc_lin_12.'
DEF tit_13 = '&&gc_lin_13.'
DEF tit_14 = '&&gc_lin_14.'
DEF tit_15 = '&&gc_lin_15.'
DEF title = 'Top 15 Resources - Total per day'
DEF title_suffix = '&&oci360_billing_between.'
DEF main_table = 'OCI360_USAGECOSTS'
DEF vaxis = 'Cost (&&oci360_billing_currency.)'
DEF chartype = 'AreaChart'
DEF stacked = 'isStacked: true,';
DEF skip_lch = ''
@@&&9a_pre_one.
UNDEF gc_lin_1 gc_lin_2 gc_lin_3 gc_lin_4 gc_lin_5 gc_lin_6 gc_lin_7 gc_lin_8 gc_lin_9 gc_lin_10 gc_lin_11 gc_lin_12 gc_lin_13 gc_lin_14 gc_lin_15
UNDEF gc_flt_1 gc_flt_2 gc_flt_3 gc_flt_4 gc_flt_5 gc_flt_6 gc_flt_7 gc_flt_8 gc_flt_9 gc_flt_10 gc_flt_11 gc_flt_12 gc_flt_13 gc_flt_14 gc_flt_15
-----------------------------------------
UNDEF oci360_billing_currency oci360_billing_date_from oci360_billing_date_to oci360_billing_period
UNDEF oci360_billing_between | the_stack |
CREATE TABLE lending.collateral_change (
project text NOT NULL, version text, block_time timestamptz NOT NULL,
block_number numeric NOT NULL, tx_hash bytea, evt_index integer,
trace_address integer[], borrower bytea, tx_from bytea,
asset_address bytea, asset_symbol text, token_amount numeric,
usd_value numeric);
CREATE OR REPLACE FUNCTION lending.insert_collateral_changes (
start_ts timestamptz, end_ts timestamptz = now (), start_block numeric = 0,
end_block numeric
= 9e18) RETURNS integer LANGUAGE plpgsql AS $function$ DECLARE r integer;
BEGIN
WITH collateral_change
AS (SELECT project, version, collateral.block_number, collateral.block_time,
tx_hash, evt_index, trace_address, tx."from" AS tx_from, borrower,
t.symbol AS asset_symbol, asset_address,
asset_amount / 10 ^ t.decimals AS token_amount,
asset_amount / 10
^ t.decimals
* p.price AS usd_value FROM (
--Aave add collateral SELECT 'Aave' AS project,
'1' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
"_user" AS borrower,
CASE-- Use WETH instead of Aave
"mock" address WHEN _reserve
= '\xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' THEN '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ELSE
_reserve END AS asset_address,
_amount AS asset_amount FROM aave
."LendingPool_evt_Deposit" WHERE evt_block_time
>= start_ts AND evt_block_time < end_ts
UNION ALL
-- Aave remove collateral SELECT 'Aave' AS project,
'1' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
"_user" AS borrower,
CASE-- Use WETH instead of Aave
"mock" address WHEN _reserve
= '\xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE' THEN '\xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' ELSE
_reserve END AS asset_address,
-"_amount" AS asset_amount FROM
aave."LendingPool_evt_RedeemUnderlying" WHERE
evt_block_time
>= start_ts AND evt_block_time < end_ts
UNION ALL-- Aave 2 add collateral
SELECT 'Aave' AS project,
'2' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
"user" AS borrower, reserve AS asset_address,
amount AS asset_amount FROM aave_v2
."LendingPool_evt_Deposit" WHERE evt_block_time
>= start_ts AND evt_block_time < end_ts
UNION ALL-- Aave 2 remove collateral
SELECT 'Aave' AS project,
'2' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
"user" AS borrower, reserve AS asset_address,
-amount AS asset_amount FROM aave_v2
."LendingPool_evt_Withdraw" WHERE evt_block_time
>= start_ts AND evt_block_time < end_ts
UNION ALL-- Aave 2 liquidation calls
SELECT 'Aave' AS project,
'2' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
"user" AS borrower, "collateralAsset" AS asset_address,
-"liquidatedCollateralAmount" AS asset_amount FROM
aave_v2."LendingPool_evt_LiquidationCall" WHERE
evt_block_time
>= start_ts AND evt_block_time < end_ts AND
"receiveAToken"
= FALSE
UNION ALL-- Compound add collateral
SELECT 'Compound' AS project,
'2' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
minter AS borrower,
c."underlying_token_address" AS asset_address,
"mintAmount" AS asset_amount FROM (
SELECT *FROM
compound_v2."cErc20_evt_Mint" WHERE evt_block_time
>= start_ts AND evt_block_time
< end_ts UNION ALL SELECT
* FROM compound_v2
."cEther_evt_Mint" WHERE evt_block_time
>= start_ts AND evt_block_time
< end_ts UNION ALL SELECT
* FROM compound_v2
."CErc20Delegator_evt_Mint" WHERE
evt_block_time
>= start_ts AND evt_block_time < end_ts)
compound_add LEFT JOIN compound
.view_ctokens c ON compound_add.contract_address
= c.contract_address
UNION ALL-- Compound remove collateral
SELECT 'Compound' AS project,
'2' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
redeemer AS borrower,
c."underlying_token_address" AS asset_address,
-"redeemAmount" AS asset_amount FROM (
SELECT *FROM compound_v2
."cErc20_evt_Redeem" WHERE evt_block_time
>= start_ts AND evt_block_time
< end_ts UNION ALL SELECT
* FROM compound_v2
."cEther_evt_Redeem" WHERE evt_block_time
>= start_ts AND evt_block_time
< end_ts UNION ALL SELECT
* FROM compound_v2
."CErc20Delegator_evt_Redeem" WHERE
evt_block_time
>= start_ts AND evt_block_time
< end_ts) compound_redeem LEFT JOIN compound
.view_ctokens c ON compound_redeem.contract_address
= c.contract_address
UNION ALL
-- MakerDAO add collateral SELECT 'MakerDAO' AS project,
'2' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
"from" AS borrower, tr.contract_address AS asset_address,
value AS assset_amount FROM
erc20."ERC20_evt_Transfer" tr WHERE
"to" IN (SELECT address FROM
makermcd.collateral_addresses)
AND evt_block_time
>= start_ts AND evt_block_time < end_ts
UNION ALL
-- MakerDAO remove collateral
SELECT 'MakerDAO' AS project,
'2' AS version, evt_block_number AS block_number,
evt_block_time AS block_time, evt_tx_hash AS tx_hash,
evt_index, NULL::integer[] AS trace_address,
"to" AS borrower, tr.contract_address AS asset_address,
-value AS assset_amount FROM
erc20."ERC20_evt_Transfer" tr WHERE
"from" IN (SELECT address FROM makermcd
.collateral_addresses)
AND evt_block_time
>= start_ts AND evt_block_time < end_ts)
collateral INNER JOIN
ethereum.transactions tx ON collateral.tx_hash
= tx.hash AND tx.block_number >= start_block AND tx.block_number
< end_block AND tx.block_time >= start_ts AND tx.block_time
< end_ts LEFT JOIN erc20.tokens t ON t.contract_address
= collateral.asset_address LEFT JOIN prices.usd p ON p.minute
= date_trunc ('minute', collateral.block_time) AND p.contract_address
= collateral.asset_address AND p.minute >= start_ts AND p.minute < end_ts),
rows
AS (INSERT INTO lending.collateral_change (
project, version, block_time, block_number, tx_hash, evt_index,
trace_address, tx_from, borrower, asset_address, asset_symbol,
token_amount, usd_value) SELECT project,
version, block_time, block_number, tx_hash, evt_index, trace_address,
tx_from, borrower, asset_address, asset_symbol, token_amount,
usd_value FROM collateral_change ON CONFLICT DO NOTHING
RETURNING 1) SELECT count (*) INTO r from rows;
RETURN r;
END $function$;
CREATE UNIQUE INDEX IF NOT EXISTS lending_collateral_change_tr_addr_uniq_idx ON
lending.collateral_change (tx_hash, trace_address);
CREATE UNIQUE INDEX IF NOT EXISTS lending_collateral_change_evt_index_uniq_idx
ON lending.collateral_change (tx_hash, evt_index);
CREATE INDEX IF NOT EXISTS lending_collateral_change_block_time_idx ON
lending.collateral_change USING BRIN (block_time);
SELECT lending.insert_collateral_changes (
'2019-01-01', (SELECT now ()),
(SELECT max (number) FROM ethereum.blocks WHERE time < '2019-01-01'),
(SELECT MAX (number) FROM ethereum.blocks)) WHERE NOT
EXISTS (SELECT *FROM lending.collateral_change LIMIT 1);
INSERT INTO cron.job (schedule, command)
VALUES ('14 0 * * *',
$$SELECT lending.insert_collateral_changes (
(SELECT max (block_time)
- interval '2 days' FROM lending.collateral_change),
(SELECT now ()),
(SELECT max (number) FROM ethereum.blocks WHERE time
< (SELECT max (block_time)
- interval '2 days' FROM lending.collateral_change)),
(SELECT MAX (number) FROM ethereum.blocks));
$$) ON
CONFLICT (command) DO UPDATE SET schedule = EXCLUDED.schedule; | the_stack |
-- 2017-11-11T09:33:03.329
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Rolenauswahl überspringen',Updated=TO_TIMESTAMP('2017-11-11 09:33:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58863
;
-- 2017-11-11T09:33:48.428
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Nutzer Rabatt',Updated=TO_TIMESTAMP('2017-11-11 09:33:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=52018
;
-- 2017-11-11T09:34:08.736
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Sektion Login Pflicht',Updated=TO_TIMESTAMP('2017-11-11 09:34:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551446
;
-- 2017-11-11T09:34:26.689
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Menü anzeigen',Updated=TO_TIMESTAMP('2017-11-11 09:34:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=64774
;
-- 2017-11-11T09:34:47.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Login Datum änderbar',Updated=TO_TIMESTAMP('2017-11-11 09:34:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555206
;
-- 2017-11-11T09:34:56.424
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Alle Entity Typen anzeigen',Updated=TO_TIMESTAMP('2017-11-11 09:34:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556365
;
-- 2017-11-11T09:35:06.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Migrationsscripte erlauben',Updated=TO_TIMESTAMP('2017-11-11 09:35:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556218
;
-- 2017-11-11T09:35:19.953
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Abrechnung Prio erlaubt',Updated=TO_TIMESTAMP('2017-11-11 09:35:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556522
;
-- 2017-11-11T09:35:34.351
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Wurtelknoten Menü',Updated=TO_TIMESTAMP('2017-11-11 09:35:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558496
;
-- 2017-11-11T09:35:45.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Rabatt auf Summe erlaubt',Updated=TO_TIMESTAMP('2017-11-11 09:35:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=64772
;
-- 2017-11-11T09:36:00.051
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Rabatt bit Limit Preis erlaubt',Updated=TO_TIMESTAMP('2017-11-11 09:36:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=64773
;
-- 2017-11-11T09:36:31.787
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Login Sektion',Updated=TO_TIMESTAMP('2017-11-11 09:36:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551780
;
-- 2017-11-11T09:37:03.703
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Keine Rollenauswahl',Updated=TO_TIMESTAMP('2017-11-11 09:37:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58863
;
-- 2017-11-11T09:37:45.162
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Sektion Anmeldung Pflicht',Updated=TO_TIMESTAMP('2017-11-11 09:37:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=551446
;
-- 2017-11-11T09:38:18.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Sonder Fenster nach Anmeldung',Updated=TO_TIMESTAMP('2017-11-11 09:38:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=72252
;
-- 2017-11-11T09:38:33.509
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Anmeldung Datum änderbar',Updated=TO_TIMESTAMP('2017-11-11 09:38:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555206
;
-- 2017-11-11T09:42:29.144
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-11 09:42:29','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Use Beta Functionality override',Description='' WHERE AD_Field_ID=556233 AND AD_Language='en_US'
;
-- 2017-11-11T09:43:09.818
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-11 09:43:09','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='SeqNo.',Description='' WHERE AD_Field_ID=556432 AND AD_Language='en_US'
;
-- 2017-11-11T09:44:04.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,119,540529,TO_TIMESTAMP('2017-11-11 09:44:04','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-11-11 09:44:04','YYYY-MM-DD HH24:MI:SS'),100,'advanced edit')
;
-- 2017-11-11T09:44:04.831
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_UI_Section_ID=540529 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2017-11-11T09:44:06.949
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540704,540529,TO_TIMESTAMP('2017-11-11 09:44:06','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-11-11 09:44:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-11T09:44:21.439
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET AD_UI_Column_ID=540704, SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 09:44:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540229
;
-- 2017-11-11T09:45:41.715
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 09:45:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544367
;
-- 2017-11-11T09:45:44.653
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 09:45:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544467
;
-- 2017-11-11T09:45:47.294
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 09:45:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544367
;
-- 2017-11-11T09:45:50.202
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 09:45:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544467
;
-- 2017-11-11T09:54:11.179
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 09:54:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542734
;
-- 2017-11-11T09:55:43.821
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='WebUI Rolle',Updated=TO_TIMESTAMP('2017-11-11 09:55:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=546079
;
-- 2017-11-11T09:58:43.573
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=580,Updated=TO_TIMESTAMP('2017-11-11 09:58:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544365
;
-- 2017-11-11T09:58:47.262
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=590,Updated=TO_TIMESTAMP('2017-11-11 09:58:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544364
;
-- 2017-11-11T09:58:59.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=575,Updated=TO_TIMESTAMP('2017-11-11 09:58:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544363
;
-- 2017-11-11T09:59:10.132
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=600,Updated=TO_TIMESTAMP('2017-11-11 09:59:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542776
;
-- 2017-11-11T09:59:27.351
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=585,Updated=TO_TIMESTAMP('2017-11-11 09:59:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=544368
;
-- 2017-11-11T09:59:32.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=610,Updated=TO_TIMESTAMP('2017-11-11 09:59:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542762
;
-- 2017-11-11T09:59:57.703
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 09:59:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540229
;
-- 2017-11-11T10:05:28.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57374,0,53240,540230,549169,'F',TO_TIMESTAMP('2017-11-11 10:05:28','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-11-11 10:05:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-11T10:05:43.683
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,57372,0,53240,540230,549170,'F',TO_TIMESTAMP('2017-11-11 10:05:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-11-11 10:05:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-11T10:05:56.340
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mandant',Updated=TO_TIMESTAMP('2017-11-11 10:05:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=57372
;
-- 2017-11-11T10:06:26.626
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Sub Rolle',Updated=TO_TIMESTAMP('2017-11-11 10:06:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558499
;
-- 2017-11-11T10:07:12.597
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:07:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542781
;
-- 2017-11-11T10:07:12.600
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:07:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542782
;
-- 2017-11-11T10:07:12.603
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:07:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542780
;
-- 2017-11-11T10:07:12.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:07:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549169
;
-- 2017-11-11T10:07:24.028
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2017-11-11 10:07:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549169
;
-- 2017-11-11T10:07:29.353
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2017-11-11 10:07:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549170
;
-- 2017-11-11T10:07:31.694
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:07:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542779
;
-- 2017-11-11T10:07:33.072
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:07:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542780
;
-- 2017-11-11T10:07:34.518
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:07:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542781
;
-- 2017-11-11T10:07:39.115
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:07:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542782
;
-- 2017-11-11T10:07:44.750
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N', SeqNo=0,Updated=TO_TIMESTAMP('2017-11-11 10:07:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542781
;
-- 2017-11-11T10:07:46.800
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:07:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542782
;
-- 2017-11-11T10:07:49.474
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:07:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549169
;
-- 2017-11-11T10:07:53.321
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-11 10:07:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549170
;
-- 2017-11-11T10:08:45.946
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:08:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542780
;
-- 2017-11-11T10:08:50.329
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:08:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542782
;
-- 2017-11-11T10:10:23.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:10:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540230
;
-- 2017-11-11T10:11:46.256
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=19,Updated=TO_TIMESTAMP('2017-11-11 10:11:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=57940
;
-- 2017-11-11T10:12:11.863
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=19,Updated=TO_TIMESTAMP('2017-11-11 10:12:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=57941
;
-- 2017-11-11T10:14:38.993
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Organisation Zugriff',Updated=TO_TIMESTAMP('2017-11-11 10:14:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=351
;
-- 2017-11-11T10:15:08.005
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:15:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542785
;
-- 2017-11-11T10:15:08.008
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:15:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542784
;
-- 2017-11-11T10:15:08.010
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:15:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542786
;
-- 2017-11-11T10:15:08.012
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:15:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542787
;
-- 2017-11-11T10:15:27.072
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:15:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542784
;
-- 2017-11-11T10:15:29.395
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:15:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542786
;
-- 2017-11-11T10:15:34.048
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:15:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542787
;
-- 2017-11-11T10:15:41.623
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:15:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542783
;
-- 2017-11-11T10:16:00.235
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:16:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542783
;
-- 2017-11-11T10:16:00.238
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:16:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542786
;
-- 2017-11-11T10:16:00.239
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:16:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542787
;
-- 2017-11-11T10:16:11.687
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:16:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542783
;
-- 2017-11-11T10:16:13.660
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:16:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542786
;
-- 2017-11-11T10:16:35.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:16:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542787
;
-- 2017-11-11T10:16:44.989
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:16:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540231
;
-- 2017-11-11T10:18:05.694
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=19, IsUpdateable='N',Updated=TO_TIMESTAMP('2017-11-11 10:18:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5508
;
-- 2017-11-11T10:18:50.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:18:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542785
;
-- 2017-11-11T10:20:01.825
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:20:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542786
;
-- 2017-11-11T10:20:01.826
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:20:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542787
;
-- 2017-11-11T10:20:01.827
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:20:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542784
;
-- 2017-11-11T10:20:01.828
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:20:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542783
;
-- 2017-11-11T10:20:53.078
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:20:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542786
;
-- 2017-11-11T10:20:54.702
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542787
;
-- 2017-11-11T10:20:56.579
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:20:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542784
;
-- 2017-11-11T10:20:59.867
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:20:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542783
;
-- 2017-11-11T10:21:50.803
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:21:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542783
;
-- 2017-11-11T10:22:34.452
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:22:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542790
;
-- 2017-11-11T10:22:34.454
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:22:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542791
;
-- 2017-11-11T10:22:34.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:22:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542792
;
-- 2017-11-11T10:22:34.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:22:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542789
;
-- 2017-11-11T10:22:41.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:22:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540232
;
-- 2017-11-11T10:22:49.239
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542791
;
-- 2017-11-11T10:22:51.238
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:22:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542792
;
-- 2017-11-11T10:22:53.775
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:22:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542789
;
-- 2017-11-11T10:22:55.774
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:22:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542788
;
-- 2017-11-11T10:22:57.315
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:22:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542790
;
-- 2017-11-11T10:23:06.318
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Nutzer',Updated=TO_TIMESTAMP('2017-11-11 10:23:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542791
;
-- 2017-11-11T10:24:02.005
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='L',Updated=TO_TIMESTAMP('2017-11-11 10:24:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542791
;
-- 2017-11-11T10:27:10.280
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:27:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540233
;
-- 2017-11-11T10:27:22.528
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:27:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542795
;
-- 2017-11-11T10:27:22.530
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:27:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542796
;
-- 2017-11-11T10:27:22.531
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:27:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542797
;
-- 2017-11-11T10:27:22.532
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:27:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542798
;
-- 2017-11-11T10:27:22.533
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:27:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542794
;
-- 2017-11-11T10:27:32.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:27:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542796
;
-- 2017-11-11T10:27:34.307
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:27:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542797
;
-- 2017-11-11T10:27:35.868
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:27:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542798
;
-- 2017-11-11T10:27:39.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:27:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542794
;
-- 2017-11-11T10:27:44.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-11 10:27:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542793
;
-- 2017-11-11T10:27:45.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:27:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542795
;
-- 2017-11-11T10:30:02.648
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:30:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540234
;
-- 2017-11-11T10:30:12.708
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:30:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542801
;
-- 2017-11-11T10:30:12.714
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:30:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542802
;
-- 2017-11-11T10:30:12.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:30:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542803
;
-- 2017-11-11T10:30:12.722
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:30:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542804
;
-- 2017-11-11T10:30:12.725
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:30:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542800
;
-- 2017-11-11T10:30:20.636
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:30:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542802
;
-- 2017-11-11T10:30:22.911
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:30:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542803
;
-- 2017-11-11T10:30:24.686
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:30:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542804
;
-- 2017-11-11T10:30:27.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:30:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542800
;
-- 2017-11-11T10:30:29.200
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-11 10:30:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542799
;
-- 2017-11-11T10:30:30.796
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:30:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542801
;
-- 2017-11-11T10:30:48.865
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:30:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540235
;
-- 2017-11-11T10:30:55.406
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542807
;
-- 2017-11-11T10:30:55.407
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542808
;
-- 2017-11-11T10:30:55.409
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542809
;
-- 2017-11-11T10:30:55.411
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542810
;
-- 2017-11-11T10:30:55.412
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:30:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542806
;
-- 2017-11-11T10:31:00.264
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:31:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542808
;
-- 2017-11-11T10:31:01.855
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:31:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542809
;
-- 2017-11-11T10:31:03.698
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:31:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542810
;
-- 2017-11-11T10:31:05.741
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:31:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542806
;
-- 2017-11-11T10:31:07.642
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-11 10:31:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542805
;
-- 2017-11-11T10:31:09.334
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:31:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542807
;
-- 2017-11-11T10:31:28.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:31:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540236
;
-- 2017-11-11T10:31:36.042
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:31:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542813
;
-- 2017-11-11T10:31:36.043
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:31:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542814
;
-- 2017-11-11T10:31:36.043
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:31:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542815
;
-- 2017-11-11T10:31:36.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:31:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542816
;
-- 2017-11-11T10:31:36.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:31:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542812
;
-- 2017-11-11T10:31:41.152
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:31:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542814
;
-- 2017-11-11T10:31:42.639
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:31:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542815
;
-- 2017-11-11T10:31:44.758
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:31:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542816
;
-- 2017-11-11T10:31:46.412
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:31:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542812
;
-- 2017-11-11T10:31:52.110
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-11 10:31:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542811
;
-- 2017-11-11T10:31:53.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:31:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542813
;
-- 2017-11-11T10:32:14.964
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:32:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540237
;
-- 2017-11-11T10:32:42.504
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:32:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542819
;
-- 2017-11-11T10:32:42.505
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:32:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542820
;
-- 2017-11-11T10:32:42.506
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:32:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542821
;
-- 2017-11-11T10:32:42.508
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:32:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542822
;
-- 2017-11-11T10:32:42.509
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:32:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542818
;
-- 2017-11-11T10:33:03.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Aufgabe',Updated=TO_TIMESTAMP('2017-11-11 10:33:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3697
;
-- 2017-11-11T10:33:33.323
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Betriebssystem Task',Updated=TO_TIMESTAMP('2017-11-11 10:33:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3697
;
-- 2017-11-11T10:33:58.632
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Betriebssystem Task',Updated=TO_TIMESTAMP('2017-11-11 10:33:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542820
;
-- 2017-11-11T10:34:15.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:34:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540238
;
-- 2017-11-11T10:34:23.016
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:34:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542825
;
-- 2017-11-11T10:34:23.022
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:34:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542826
;
-- 2017-11-11T10:34:23.027
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:34:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542827
;
-- 2017-11-11T10:34:23.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:34:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542828
;
-- 2017-11-11T10:34:23.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:34:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542824
;
-- 2017-11-11T10:34:32.726
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:34:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542826
;
-- 2017-11-11T10:34:34.245
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:34:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542827
;
-- 2017-11-11T10:34:35.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:34:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542828
;
-- 2017-11-11T10:34:38.005
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:34:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542824
;
-- 2017-11-11T10:34:40.271
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-11 10:34:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542823
;
-- 2017-11-11T10:34:42.087
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:34:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542825
;
-- 2017-11-11T10:35:15.889
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:35:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540239
;
-- 2017-11-11T10:35:25.588
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542829
;
-- 2017-11-11T10:35:25.592
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542830
;
-- 2017-11-11T10:35:25.596
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542831
;
-- 2017-11-11T10:35:25.601
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542832
;
-- 2017-11-11T10:35:25.605
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542833
;
-- 2017-11-11T10:35:25.609
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542834
;
-- 2017-11-11T10:35:25.613
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542835
;
-- 2017-11-11T10:35:25.616
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542836
;
-- 2017-11-11T10:35:25.621
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542837
;
-- 2017-11-11T10:35:25.624
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542838
;
-- 2017-11-11T10:35:25.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542839
;
-- 2017-11-11T10:35:25.632
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542840
;
-- 2017-11-11T10:35:25.636
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-11-11 10:35:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542841
;
-- 2017-11-11T10:35:36.772
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,58888,0,53316,540239,549171,'F',TO_TIMESTAMP('2017-11-11 10:35:36','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-11-11 10:35:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-11T10:35:51.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,58884,0,53316,540239,549172,'F',TO_TIMESTAMP('2017-11-11 10:35:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-11-11 10:35:51','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-11T10:36:04.595
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mandant',Updated=TO_TIMESTAMP('2017-11-11 10:36:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58884
;
-- 2017-11-11T10:39:32.814
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:39:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542833
;
-- 2017-11-11T10:39:32.819
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-11-11 10:39:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542832
;
-- 2017-11-11T10:39:32.823
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-11-11 10:39:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542840
;
-- 2017-11-11T10:39:32.827
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-11-11 10:39:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542841
;
-- 2017-11-11T10:39:32.831
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-11-11 10:39:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542839
;
-- 2017-11-11T10:39:32.836
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-11-11 10:39:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549171
;
-- 2017-11-11T10:39:48.713
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2017-11-11 10:39:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549172
;
-- 2017-11-11T10:39:50.504
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:39:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542830
;
-- 2017-11-11T10:39:52.331
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:39:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542831
;
-- 2017-11-11T10:39:53.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:39:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542833
;
-- 2017-11-11T10:39:55.299
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:39:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542832
;
-- 2017-11-11T10:39:56.738
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-11 10:39:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542834
;
-- 2017-11-11T10:39:58.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2017-11-11 10:39:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542835
;
-- 2017-11-11T10:39:59.834
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2017-11-11 10:39:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542836
;
-- 2017-11-11T10:40:01.178
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2017-11-11 10:40:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542837
;
-- 2017-11-11T10:40:02.641
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2017-11-11 10:40:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542838
;
-- 2017-11-11T10:40:04.609
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2017-11-11 10:40:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542840
;
-- 2017-11-11T10:40:06.132
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=110,Updated=TO_TIMESTAMP('2017-11-11 10:40:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542841
;
-- 2017-11-11T10:40:07.819
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2017-11-11 10:40:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542839
;
-- 2017-11-11T10:40:11.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=130,Updated=TO_TIMESTAMP('2017-11-11 10:40:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549171
;
-- 2017-11-11T10:40:13.721
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=140,Updated=TO_TIMESTAMP('2017-11-11 10:40:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549172
;
-- 2017-11-11T10:40:16.724
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:40:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542829
;
-- 2017-11-11T10:40:27.665
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-11-11 10:40:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549172
;
-- 2017-11-11T10:40:32.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-11-11 10:40:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549171
;
-- 2017-11-11T10:41:02.130
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Fenster',Updated=TO_TIMESTAMP('2017-11-11 10:41:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58897
;
-- 2017-11-11T10:41:07.704
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Prozess',Updated=TO_TIMESTAMP('2017-11-11 10:41:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58891
;
-- 2017-11-11T10:41:22.905
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Form',Updated=TO_TIMESTAMP('2017-11-11 10:41:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58896
;
-- 2017-11-11T10:41:30.753
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Betriebssystem Task',Updated=TO_TIMESTAMP('2017-11-11 10:41:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58889
;
-- 2017-11-11T10:41:34.720
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Belegart',Updated=TO_TIMESTAMP('2017-11-11 10:41:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58886
;
-- 2017-11-11T10:41:40.971
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Belegaktion',Updated=TO_TIMESTAMP('2017-11-11 10:41:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58885
;
-- 2017-11-11T10:41:47.941
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Lesen-Schreiben',Updated=TO_TIMESTAMP('2017-11-11 10:41:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58892
;
-- 2017-11-11T10:42:01.901
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Berechtigung erteilt',Updated=TO_TIMESTAMP('2017-11-11 10:42:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58890
;
-- 2017-11-11T10:42:13.810
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Berechtigung erteilen',Updated=TO_TIMESTAMP('2017-11-11 10:42:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58887
;
-- 2017-11-11T10:42:21.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Berechtigung entziehen',Updated=TO_TIMESTAMP('2017-11-11 10:42:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58893
;
-- 2017-11-11T10:42:25.650
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Aktiv',Updated=TO_TIMESTAMP('2017-11-11 10:42:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58883
;
-- 2017-11-11T10:42:39.337
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Berechtigungsanfrage',Updated=TO_TIMESTAMP('2017-11-11 10:42:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58895
;
-- 2017-11-11T10:45:09.028
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Lesen-Schreiben',Updated=TO_TIMESTAMP('2017-11-11 10:45:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542837
;
-- 2017-11-11T10:45:15.811
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Berechtigung erteilt',Updated=TO_TIMESTAMP('2017-11-11 10:45:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542838
;
-- 2017-11-11T10:45:19.124
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Fenster',Updated=TO_TIMESTAMP('2017-11-11 10:45:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542830
;
-- 2017-11-11T10:45:25.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Prozess',Updated=TO_TIMESTAMP('2017-11-11 10:45:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542831
;
-- 2017-11-11T10:45:31.943
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Form',Updated=TO_TIMESTAMP('2017-11-11 10:45:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542833
;
-- 2017-11-11T10:45:38.285
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Betriebssystem Task',Updated=TO_TIMESTAMP('2017-11-11 10:45:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542834
;
-- 2017-11-11T10:45:42.056
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Belegart',Updated=TO_TIMESTAMP('2017-11-11 10:45:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542835
;
-- 2017-11-11T10:45:49.326
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Belegaktion',Updated=TO_TIMESTAMP('2017-11-11 10:45:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542836
;
-- 2017-11-11T10:45:59.686
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Berechtigung erteilen',Updated=TO_TIMESTAMP('2017-11-11 10:45:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542840
;
-- 2017-11-11T10:46:13.359
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Berechtigung entziehen',Updated=TO_TIMESTAMP('2017-11-11 10:46:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542841
;
-- 2017-11-11T10:48:57.303
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Fenster',Updated=TO_TIMESTAMP('2017-11-11 10:48:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58951
;
-- 2017-11-11T10:49:01.497
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Prozess',Updated=TO_TIMESTAMP('2017-11-11 10:49:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58952
;
-- 2017-11-11T10:49:08.392
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Form',Updated=TO_TIMESTAMP('2017-11-11 10:49:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58954
;
-- 2017-11-11T10:49:15.049
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Betriebssystem Task',Updated=TO_TIMESTAMP('2017-11-11 10:49:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58955
;
-- 2017-11-11T10:49:19.082
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Belegart',Updated=TO_TIMESTAMP('2017-11-11 10:49:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58956
;
-- 2017-11-11T10:49:23.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Belegaktion',Updated=TO_TIMESTAMP('2017-11-11 10:49:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58957
;
-- 2017-11-11T10:49:29.089
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Lesen-Schreiben',Updated=TO_TIMESTAMP('2017-11-11 10:49:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58958
;
-- 2017-11-11T10:49:36.459
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Berechtigung erteilt',Updated=TO_TIMESTAMP('2017-11-11 10:49:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58959
;
-- 2017-11-11T10:49:44.680
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Berechtigung erteilen',Updated=TO_TIMESTAMP('2017-11-11 10:49:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58960
;
-- 2017-11-11T10:49:51.042
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Berechtigung entziehen',Updated=TO_TIMESTAMP('2017-11-11 10:49:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58961
;
-- 2017-11-11T10:49:56.393
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Aktiv',Updated=TO_TIMESTAMP('2017-11-11 10:49:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58947
;
-- 2017-11-11T10:50:01.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Mandant',Updated=TO_TIMESTAMP('2017-11-11 10:50:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58949
;
-- 2017-11-11T10:50:17.616
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-11-11 10:50:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540240
;
-- 2017-11-11T10:50:24.833
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Form',Updated=TO_TIMESTAMP('2017-11-11 10:50:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542846
;
-- 2017-11-11T10:50:29.730
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Belegaktion',Updated=TO_TIMESTAMP('2017-11-11 10:50:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542849
;
-- 2017-11-11T10:50:35.305
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Lesen-Schreiben',Updated=TO_TIMESTAMP('2017-11-11 10:50:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542850
;
-- 2017-11-11T10:50:42.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Berechtigung erteilt',Updated=TO_TIMESTAMP('2017-11-11 10:50:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542851
;
-- 2017-11-11T10:50:48.875
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Berechtigung erteilen',Updated=TO_TIMESTAMP('2017-11-11 10:50:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542853
;
-- 2017-11-11T10:50:55.835
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Berechtigung entziehen',Updated=TO_TIMESTAMP('2017-11-11 10:50:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542854
;
-- 2017-11-11T10:50:59.699
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Fenster',Updated=TO_TIMESTAMP('2017-11-11 10:50:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542843
;
-- 2017-11-11T10:51:03.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Prozess',Updated=TO_TIMESTAMP('2017-11-11 10:51:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542844
;
-- 2017-11-11T10:51:13.440
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Betriebssystem Task',Updated=TO_TIMESTAMP('2017-11-11 10:51:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542847
;
-- 2017-11-11T10:51:18.302
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Belegart',Updated=TO_TIMESTAMP('2017-11-11 10:51:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542848
;
-- 2017-11-11T10:51:39.390
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542842
;
-- 2017-11-11T10:51:39.396
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542843
;
-- 2017-11-11T10:51:39.400
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542844
;
-- 2017-11-11T10:51:39.405
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542846
;
-- 2017-11-11T10:51:39.410
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542847
;
-- 2017-11-11T10:51:39.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542848
;
-- 2017-11-11T10:51:39.418
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542849
;
-- 2017-11-11T10:51:39.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542850
;
-- 2017-11-11T10:51:39.425
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542851
;
-- 2017-11-11T10:51:39.427
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542852
;
-- 2017-11-11T10:51:39.430
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542853
;
-- 2017-11-11T10:51:39.433
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-11-11 10:51:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542854
;
-- 2017-11-11T10:51:50.836
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,58948,0,53317,540240,549173,'F',TO_TIMESTAMP('2017-11-11 10:51:50','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-11-11 10:51:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-11T10:51:58.786
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,58949,0,53317,540240,549174,'F',TO_TIMESTAMP('2017-11-11 10:51:58','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-11-11 10:51:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-11-11T10:52:21.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-11-11 10:52:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542853
;
-- 2017-11-11T10:52:21.452
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-11-11 10:52:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542854
;
-- 2017-11-11T10:52:21.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-11-11 10:52:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542852
;
-- 2017-11-11T10:52:21.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-11-11 10:52:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549173
;
-- 2017-11-11T10:52:33.101
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2017-11-11 10:52:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549174
;
-- 2017-11-11T10:52:36.566
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-11-11 10:52:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542843
;
-- 2017-11-11T10:52:38.316
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-11-11 10:52:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542844
;
-- 2017-11-11T10:52:39.997
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-11-11 10:52:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542846
;
-- 2017-11-11T10:52:41.308
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-11-11 10:52:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542845
;
-- 2017-11-11T10:52:43.679
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-11-11 10:52:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542847
;
-- 2017-11-11T10:52:45.285
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2017-11-11 10:52:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542848
;
-- 2017-11-11T10:52:46.717
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2017-11-11 10:52:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542849
;
-- 2017-11-11T10:52:48.732
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2017-11-11 10:52:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542850
;
-- 2017-11-11T10:52:50.372
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2017-11-11 10:52:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542851
;
-- 2017-11-11T10:52:52.133
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2017-11-11 10:52:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542853
;
-- 2017-11-11T10:52:54.663
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=110,Updated=TO_TIMESTAMP('2017-11-11 10:52:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542854
;
-- 2017-11-11T10:52:56.397
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2017-11-11 10:52:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542852
;
-- 2017-11-11T10:53:01.885
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=130,Updated=TO_TIMESTAMP('2017-11-11 10:53:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549173
;
-- 2017-11-11T10:53:02.876
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2017-11-11 10:53:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=542842
;
-- 2017-11-11T10:53:09.024
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=140,Updated=TO_TIMESTAMP('2017-11-11 10:53:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549174
;
-- 2017-11-11T10:53:53.928
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-11-11 10:53:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549174
;
-- 2017-11-11T10:53:57.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-11-11 10:53:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=549173
;
-- 2017-11-11T10:55:59.976
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Berechtigung Anfrage',Updated=TO_TIMESTAMP('2017-11-11 10:55:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53316
;
-- 2017-11-11T10:56:17.646
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Berechtigung verweigert',Updated=TO_TIMESTAMP('2017-11-11 10:56:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=53317
;
-- 2017-11-11T10:58:21.888
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-11 10:58:21','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Description' WHERE AD_Field_ID=62853 AND AD_Language='en_US'
;
-- 2017-11-11T10:58:33.249
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-11-11 10:58:33','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Description' WHERE AD_Field_ID=62854 AND AD_Language='en_US'
; | the_stack |
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.11 (Debian 11.11-1.pgdg90+1)
-- Dumped by pg_dump version 11.14
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: intarray; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS intarray WITH SCHEMA public;
--
-- Name: EXTENSION intarray; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION intarray IS 'functions, operators, and index support for 1-D arrays of integers';
--
-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
--
-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed';
--
-- Name: pg_trgm; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pg_trgm WITH SCHEMA public;
--
-- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: access_control_lists; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.access_control_lists (
id integer NOT NULL,
user_group_id integer,
roles character varying[] DEFAULT '{}'::character varying[] NOT NULL,
resource_id integer,
resource_type character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: access_control_lists_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.access_control_lists_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: access_control_lists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.access_control_lists_id_seq OWNED BY public.access_control_lists.id;
--
-- Name: aggregations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.aggregations (
id integer NOT NULL,
workflow_id integer,
subject_id integer,
aggregation jsonb DEFAULT '{}'::jsonb NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: aggregations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.aggregations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: aggregations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.aggregations_id_seq OWNED BY public.aggregations.id;
--
-- Name: authorizations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.authorizations (
id integer NOT NULL,
user_id integer,
provider character varying,
uid character varying,
token character varying,
expires_at timestamp without time zone,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: authorizations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.authorizations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: authorizations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.authorizations_id_seq OWNED BY public.authorizations.id;
--
-- Name: classification_subjects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.classification_subjects (
classification_id integer NOT NULL,
subject_id integer NOT NULL
);
--
-- Name: classifications; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.classifications (
id integer NOT NULL,
project_id integer,
user_id integer,
workflow_id integer,
annotations jsonb DEFAULT '{}'::jsonb,
created_at timestamp without time zone,
updated_at timestamp without time zone,
user_group_id integer,
user_ip inet,
completed boolean DEFAULT true NOT NULL,
gold_standard boolean,
expert_classifier integer,
metadata jsonb DEFAULT '{}'::jsonb NOT NULL,
workflow_version text,
lifecycled_at timestamp without time zone
);
--
-- Name: classifications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.classifications_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: classifications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.classifications_id_seq OWNED BY public.classifications.id;
--
-- Name: code_experiment_configs; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.code_experiment_configs (
id integer NOT NULL,
name character varying NOT NULL,
enabled_rate double precision DEFAULT 0.0 NOT NULL,
always_enabled_for_admins boolean DEFAULT true NOT NULL
);
--
-- Name: code_experiment_configs_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.code_experiment_configs_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: code_experiment_configs_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.code_experiment_configs_id_seq OWNED BY public.code_experiment_configs.id;
--
-- Name: collections; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.collections (
id integer NOT NULL,
name character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
activated_state integer DEFAULT 0 NOT NULL,
display_name character varying,
private boolean DEFAULT true NOT NULL,
lock_version integer DEFAULT 0,
slug character varying DEFAULT ''::character varying,
favorite boolean DEFAULT false NOT NULL,
default_subject_id integer,
description text DEFAULT ''::text
);
--
-- Name: collections_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.collections_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: collections_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.collections_id_seq OWNED BY public.collections.id;
--
-- Name: collections_projects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.collections_projects (
collection_id integer NOT NULL,
project_id integer NOT NULL
);
--
-- Name: collections_subjects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.collections_subjects (
subject_id integer NOT NULL,
collection_id integer NOT NULL,
id integer NOT NULL
);
--
-- Name: collections_subjects_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.collections_subjects_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: collections_subjects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.collections_subjects_id_seq OWNED BY public.collections_subjects.id;
--
-- Name: field_guide_versions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.field_guide_versions (
id integer NOT NULL,
field_guide_id integer NOT NULL,
items json,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: field_guide_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.field_guide_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: field_guide_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.field_guide_versions_id_seq OWNED BY public.field_guide_versions.id;
--
-- Name: field_guides; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.field_guides (
id integer NOT NULL,
items json DEFAULT '[]'::json,
language text,
project_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: field_guides_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.field_guides_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: field_guides_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.field_guides_id_seq OWNED BY public.field_guides.id;
--
-- Name: flipper_features; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.flipper_features (
id integer NOT NULL,
key character varying NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: flipper_features_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.flipper_features_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: flipper_features_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.flipper_features_id_seq OWNED BY public.flipper_features.id;
--
-- Name: flipper_gates; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.flipper_gates (
id integer NOT NULL,
feature_key character varying NOT NULL,
key character varying NOT NULL,
value character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: flipper_gates_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.flipper_gates_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: flipper_gates_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.flipper_gates_id_seq OWNED BY public.flipper_gates.id;
--
-- Name: gold_standard_annotations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.gold_standard_annotations (
id integer NOT NULL,
project_id integer,
workflow_id integer,
subject_id integer,
user_id integer,
classification_id integer,
annotations json NOT NULL,
metadata json NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: gold_standard_annotations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.gold_standard_annotations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: gold_standard_annotations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.gold_standard_annotations_id_seq OWNED BY public.gold_standard_annotations.id;
--
-- Name: media; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.media (
id integer NOT NULL,
type character varying,
linked_id integer,
linked_type character varying,
content_type character varying,
src text,
path_opts text[] DEFAULT '{}'::text[],
private boolean DEFAULT false,
external_link boolean DEFAULT false,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
metadata jsonb,
put_expires integer,
get_expires integer,
content_disposition character varying
);
--
-- Name: media_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.media_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: media_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.media_id_seq OWNED BY public.media.id;
--
-- Name: memberships; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.memberships (
id integer NOT NULL,
state integer DEFAULT 2 NOT NULL,
user_group_id integer,
user_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone,
roles character varying[] DEFAULT '{group_member}'::character varying[] NOT NULL,
identity boolean DEFAULT false NOT NULL
);
--
-- Name: memberships_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.memberships_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: memberships_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.memberships_id_seq OWNED BY public.memberships.id;
--
-- Name: oauth_access_grants; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.oauth_access_grants (
id integer NOT NULL,
resource_owner_id integer NOT NULL,
application_id integer NOT NULL,
token character varying NOT NULL,
expires_in integer NOT NULL,
redirect_uri text NOT NULL,
created_at timestamp without time zone NOT NULL,
revoked_at timestamp without time zone,
scopes character varying
);
--
-- Name: oauth_access_grants_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.oauth_access_grants_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: oauth_access_grants_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.oauth_access_grants_id_seq OWNED BY public.oauth_access_grants.id;
--
-- Name: oauth_access_tokens; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.oauth_access_tokens (
id integer NOT NULL,
resource_owner_id integer,
application_id integer,
token text NOT NULL,
refresh_token character varying,
expires_in integer,
revoked_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
scopes character varying,
previous_refresh_token character varying
);
--
-- Name: oauth_access_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.oauth_access_tokens_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: oauth_access_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.oauth_access_tokens_id_seq OWNED BY public.oauth_access_tokens.id;
--
-- Name: oauth_applications; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.oauth_applications (
id integer NOT NULL,
name character varying NOT NULL,
uid character varying NOT NULL,
secret character varying NOT NULL,
redirect_uri text NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
owner_id integer,
owner_type character varying,
trust_level integer DEFAULT 1 NOT NULL,
default_scope character varying[] DEFAULT '{}'::character varying[],
scopes character varying DEFAULT ''::character varying NOT NULL,
confidential boolean DEFAULT true NOT NULL
);
--
-- Name: oauth_applications_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.oauth_applications_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: oauth_applications_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.oauth_applications_id_seq OWNED BY public.oauth_applications.id;
--
-- Name: organization_contents; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.organization_contents (
id integer NOT NULL,
title character varying NOT NULL,
description character varying NOT NULL,
introduction text DEFAULT ''::text,
language character varying NOT NULL,
organization_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
url_labels jsonb DEFAULT '{}'::jsonb,
announcement character varying DEFAULT ''::character varying
);
--
-- Name: organization_contents_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.organization_contents_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: organization_contents_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.organization_contents_id_seq OWNED BY public.organization_contents.id;
--
-- Name: organization_page_versions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.organization_page_versions (
id integer NOT NULL,
organization_page_id integer NOT NULL,
title text,
content text,
url_key character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: organization_page_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.organization_page_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: organization_page_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.organization_page_versions_id_seq OWNED BY public.organization_page_versions.id;
--
-- Name: organization_pages; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.organization_pages (
id integer NOT NULL,
url_key character varying,
title text,
language character varying,
content text,
organization_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: organization_pages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.organization_pages_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: organization_pages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.organization_pages_id_seq OWNED BY public.organization_pages.id;
--
-- Name: organization_versions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.organization_versions (
id integer NOT NULL,
organization_id integer NOT NULL,
display_name character varying,
description character varying,
introduction text,
urls jsonb,
url_labels jsonb,
announcement character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: organization_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.organization_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: organization_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.organization_versions_id_seq OWNED BY public.organization_versions.id;
--
-- Name: organizations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.organizations (
id integer NOT NULL,
display_name character varying,
slug character varying DEFAULT ''::character varying,
primary_language character varying NOT NULL,
listed_at timestamp without time zone,
activated_state integer DEFAULT 0 NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
urls jsonb DEFAULT '[]'::jsonb,
listed boolean DEFAULT false NOT NULL,
categories character varying[] DEFAULT '{}'::character varying[],
description character varying,
introduction text,
url_labels jsonb,
announcement character varying
);
--
-- Name: organizations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.organizations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: organizations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.organizations_id_seq OWNED BY public.organizations.id;
--
-- Name: project_contents; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.project_contents (
id integer NOT NULL,
project_id integer,
language character varying,
title character varying DEFAULT ''::character varying,
description text DEFAULT ''::text,
created_at timestamp without time zone,
updated_at timestamp without time zone,
introduction text DEFAULT ''::text,
url_labels jsonb DEFAULT '{}'::jsonb,
workflow_description text DEFAULT ''::text,
researcher_quote text DEFAULT ''::text
);
--
-- Name: project_contents_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.project_contents_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: project_contents_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.project_contents_id_seq OWNED BY public.project_contents.id;
--
-- Name: project_page_versions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.project_page_versions (
id integer NOT NULL,
project_page_id integer NOT NULL,
title text,
content text,
url_key character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: project_page_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.project_page_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: project_page_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.project_page_versions_id_seq OWNED BY public.project_page_versions.id;
--
-- Name: project_pages; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.project_pages (
id integer NOT NULL,
url_key character varying,
title text,
language character varying,
content text,
project_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: project_pages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.project_pages_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: project_pages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.project_pages_id_seq OWNED BY public.project_pages.id;
--
-- Name: project_versions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.project_versions (
id integer NOT NULL,
project_id integer,
private boolean,
live boolean NOT NULL,
beta_requested boolean,
beta_approved boolean,
launch_requested boolean,
launch_approved boolean,
display_name character varying,
description text,
introduction text,
url_labels jsonb,
workflow_description text,
researcher_quote text,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: project_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.project_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: project_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.project_versions_id_seq OWNED BY public.project_versions.id;
--
-- Name: projects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.projects (
id integer NOT NULL,
name character varying,
display_name character varying,
user_count integer,
created_at timestamp without time zone,
updated_at timestamp without time zone,
classifications_count integer DEFAULT 0 NOT NULL,
activated_state integer DEFAULT 0 NOT NULL,
primary_language character varying,
private boolean,
lock_version integer DEFAULT 0,
configuration jsonb DEFAULT '{}'::jsonb NOT NULL,
live boolean DEFAULT false NOT NULL,
urls jsonb DEFAULT '[]'::jsonb,
migrated boolean DEFAULT false,
classifiers_count integer DEFAULT 0,
slug character varying DEFAULT ''::character varying,
redirect text DEFAULT ''::text,
launch_requested boolean DEFAULT false,
launch_approved boolean DEFAULT false,
beta_requested boolean DEFAULT false,
beta_approved boolean DEFAULT false,
launched_row_order integer,
beta_row_order integer,
experimental_tools character varying[] DEFAULT '{}'::character varying[],
launch_date timestamp without time zone,
completeness double precision DEFAULT 0.0 NOT NULL,
activity integer DEFAULT 0 NOT NULL,
tsv tsvector,
state integer,
organization_id integer,
mobile_friendly boolean DEFAULT false NOT NULL,
featured boolean DEFAULT false NOT NULL,
description text,
introduction text,
url_labels jsonb,
workflow_description text,
researcher_quote text,
authentication_invitation text,
run_subject_set_completion_events boolean DEFAULT false
);
--
-- Name: projects_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.projects_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: projects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.projects_id_seq OWNED BY public.projects.id;
--
-- Name: recents; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.recents (
id integer NOT NULL,
classification_id integer,
subject_id integer,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
project_id integer,
workflow_id integer,
user_id integer,
user_group_id integer,
mark_remove boolean DEFAULT false
);
--
-- Name: recents_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.recents_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: recents_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.recents_id_seq OWNED BY public.recents.id;
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.schema_migrations (
version character varying NOT NULL
);
--
-- Name: set_member_subjects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.set_member_subjects (
id integer NOT NULL,
subject_set_id integer,
subject_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone,
priority numeric,
lock_version integer DEFAULT 0,
random numeric NOT NULL
);
--
-- Name: set_member_subjects_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.set_member_subjects_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: set_member_subjects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.set_member_subjects_id_seq OWNED BY public.set_member_subjects.id;
--
-- Name: subject_group_members; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subject_group_members (
id integer NOT NULL,
subject_group_id integer,
subject_id integer,
display_order integer NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: subject_group_members_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.subject_group_members_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: subject_group_members_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.subject_group_members_id_seq OWNED BY public.subject_group_members.id;
--
-- Name: subject_groups; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subject_groups (
id integer NOT NULL,
context jsonb DEFAULT '{}'::jsonb NOT NULL,
key character varying NOT NULL,
project_id integer NOT NULL,
group_subject_id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: subject_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.subject_groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: subject_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.subject_groups_id_seq OWNED BY public.subject_groups.id;
--
-- Name: subject_set_imports; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subject_set_imports (
id integer NOT NULL,
subject_set_id integer NOT NULL,
user_id integer NOT NULL,
source_url character varying,
imported_count integer DEFAULT 0 NOT NULL,
failed_count integer DEFAULT 0 NOT NULL,
failed_uuids character varying[] DEFAULT '{}'::character varying[] NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
manifest_count integer DEFAULT 0
);
--
-- Name: subject_set_imports_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.subject_set_imports_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: subject_set_imports_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.subject_set_imports_id_seq OWNED BY public.subject_set_imports.id;
--
-- Name: subject_sets; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subject_sets (
id integer NOT NULL,
display_name character varying,
project_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone,
set_member_subjects_count integer DEFAULT 0 NOT NULL,
metadata jsonb DEFAULT '{}'::jsonb,
lock_version integer DEFAULT 0,
expert_set boolean,
completeness jsonb DEFAULT '{}'::jsonb
);
--
-- Name: subject_sets_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.subject_sets_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: subject_sets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.subject_sets_id_seq OWNED BY public.subject_sets.id;
--
-- Name: subject_sets_workflows; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subject_sets_workflows (
id integer NOT NULL,
workflow_id integer,
subject_set_id integer,
completeness numeric DEFAULT 0.0
);
--
-- Name: subject_sets_workflows_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.subject_sets_workflows_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: subject_sets_workflows_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.subject_sets_workflows_id_seq OWNED BY public.subject_sets_workflows.id;
--
-- Name: subject_workflow_counts; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subject_workflow_counts (
id integer NOT NULL,
workflow_id integer,
classifications_count integer DEFAULT 0,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
retired_at timestamp without time zone,
subject_id integer NOT NULL,
retirement_reason integer
);
--
-- Name: subject_workflow_counts_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.subject_workflow_counts_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: subject_workflow_counts_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.subject_workflow_counts_id_seq OWNED BY public.subject_workflow_counts.id;
--
-- Name: subjects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.subjects (
id integer NOT NULL,
zooniverse_id character varying,
metadata jsonb DEFAULT '{}'::jsonb,
created_at timestamp without time zone,
updated_at timestamp without time zone,
project_id integer,
migrated boolean,
lock_version integer DEFAULT 0,
upload_user_id integer,
activated_state integer DEFAULT 0 NOT NULL,
external_id character varying
);
--
-- Name: subjects_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.subjects_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: subjects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.subjects_id_seq OWNED BY public.subjects.id;
--
-- Name: tagged_resources; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.tagged_resources (
id integer NOT NULL,
resource_id integer,
resource_type character varying,
tag_id integer
);
--
-- Name: tagged_resources_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.tagged_resources_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: tagged_resources_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.tagged_resources_id_seq OWNED BY public.tagged_resources.id;
--
-- Name: tags; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.tags (
id integer NOT NULL,
name text NOT NULL,
tagged_resources_count integer DEFAULT 0,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: tags_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.tags_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.tags_id_seq OWNED BY public.tags.id;
--
-- Name: translation_versions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.translation_versions (
id integer NOT NULL,
translation_id integer NOT NULL,
strings jsonb,
string_versions jsonb,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: translation_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.translation_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: translation_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.translation_versions_id_seq OWNED BY public.translation_versions.id;
--
-- Name: translations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.translations (
id integer NOT NULL,
translated_id integer,
translated_type character varying,
language character varying NOT NULL,
strings jsonb DEFAULT '{}'::jsonb NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
string_versions jsonb DEFAULT '{}'::jsonb NOT NULL,
published_version_id integer
);
--
-- Name: translations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.translations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: translations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.translations_id_seq OWNED BY public.translations.id;
--
-- Name: tutorial_versions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.tutorial_versions (
id integer NOT NULL,
tutorial_id integer NOT NULL,
steps json,
kind character varying,
display_name text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: tutorial_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.tutorial_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: tutorial_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.tutorial_versions_id_seq OWNED BY public.tutorial_versions.id;
--
-- Name: tutorials; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.tutorials (
id integer NOT NULL,
steps json DEFAULT '[]'::json,
language text,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
project_id integer NOT NULL,
kind character varying,
display_name text DEFAULT ''::text,
configuration jsonb DEFAULT '{}'::jsonb
);
--
-- Name: tutorials_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.tutorials_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: tutorials_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.tutorials_id_seq OWNED BY public.tutorials.id;
--
-- Name: user_collection_preferences; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.user_collection_preferences (
id integer NOT NULL,
preferences jsonb DEFAULT '{}'::jsonb,
user_id integer,
collection_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone
);
--
-- Name: user_collection_preferences_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.user_collection_preferences_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: user_collection_preferences_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.user_collection_preferences_id_seq OWNED BY public.user_collection_preferences.id;
--
-- Name: user_groups; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.user_groups (
id integer NOT NULL,
name character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
classifications_count integer DEFAULT 0 NOT NULL,
activated_state integer DEFAULT 0 NOT NULL,
display_name character varying,
private boolean DEFAULT true NOT NULL,
lock_version integer DEFAULT 0,
join_token character varying
);
--
-- Name: user_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.user_groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: user_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.user_groups_id_seq OWNED BY public.user_groups.id;
--
-- Name: user_project_preferences; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.user_project_preferences (
id integer NOT NULL,
user_id integer,
project_id integer,
email_communication boolean,
preferences jsonb DEFAULT '{}'::jsonb,
created_at timestamp without time zone,
updated_at timestamp without time zone,
activity_count integer,
legacy_count jsonb DEFAULT '{}'::jsonb,
settings jsonb DEFAULT '{}'::jsonb
);
--
-- Name: user_project_preferences_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.user_project_preferences_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: user_project_preferences_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.user_project_preferences_id_seq OWNED BY public.user_project_preferences.id;
--
-- Name: user_seen_subjects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.user_seen_subjects (
id integer NOT NULL,
user_id integer,
workflow_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone,
subject_ids integer[] DEFAULT '{}'::integer[] NOT NULL
);
--
-- Name: user_seen_subjects_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.user_seen_subjects_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: user_seen_subjects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.user_seen_subjects_id_seq OWNED BY public.user_seen_subjects.id;
--
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.users (
id integer NOT NULL,
email character varying DEFAULT ''::character varying,
encrypted_password character varying DEFAULT ''::character varying NOT NULL,
reset_password_token character varying,
reset_password_sent_at timestamp without time zone,
remember_created_at timestamp without time zone,
sign_in_count integer DEFAULT 0 NOT NULL,
current_sign_in_at timestamp without time zone,
last_sign_in_at timestamp without time zone,
current_sign_in_ip character varying,
last_sign_in_ip character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
hash_func character varying DEFAULT 'bcrypt'::character varying,
password_salt character varying,
display_name character varying,
zooniverse_id character varying,
credited_name character varying,
classifications_count integer DEFAULT 0 NOT NULL,
activated_state integer DEFAULT 0 NOT NULL,
languages character varying[] DEFAULT '{}'::character varying[] NOT NULL,
global_email_communication boolean,
project_email_communication boolean,
admin boolean DEFAULT false NOT NULL,
banned boolean DEFAULT false NOT NULL,
migrated boolean DEFAULT false,
valid_email boolean DEFAULT true NOT NULL,
project_id integer,
beta_email_communication boolean,
login character varying NOT NULL,
unsubscribe_token character varying,
api_key character varying,
ouroboros_created boolean DEFAULT false,
subject_limit integer,
private_profile boolean DEFAULT true,
tsv tsvector,
upload_whitelist boolean DEFAULT false NOT NULL,
ux_testing_email_communication boolean DEFAULT false,
intervention_notifications boolean DEFAULT true,
nasa_email_communication boolean DEFAULT false
);
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
-- Name: workflow_contents; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.workflow_contents (
id integer NOT NULL,
workflow_id integer,
language character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
strings json DEFAULT '{}'::json NOT NULL,
current_version_number character varying
);
--
-- Name: workflow_contents_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.workflow_contents_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: workflow_contents_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.workflow_contents_id_seq OWNED BY public.workflow_contents.id;
--
-- Name: workflow_tutorials; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.workflow_tutorials (
id integer NOT NULL,
workflow_id integer,
tutorial_id integer
);
--
-- Name: workflow_tutorials_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.workflow_tutorials_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: workflow_tutorials_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.workflow_tutorials_id_seq OWNED BY public.workflow_tutorials.id;
--
-- Name: workflow_versions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.workflow_versions (
id integer NOT NULL,
workflow_id integer NOT NULL,
major_number integer NOT NULL,
minor_number integer NOT NULL,
grouped boolean DEFAULT false NOT NULL,
pairwise boolean DEFAULT false NOT NULL,
prioritized boolean DEFAULT false NOT NULL,
tasks jsonb DEFAULT '{}'::jsonb NOT NULL,
first_task character varying NOT NULL,
strings jsonb DEFAULT '{}'::jsonb NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL
);
--
-- Name: workflow_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.workflow_versions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: workflow_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.workflow_versions_id_seq OWNED BY public.workflow_versions.id;
--
-- Name: workflows; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.workflows (
id integer NOT NULL,
display_name character varying,
tasks jsonb DEFAULT '{}'::jsonb,
project_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone,
classifications_count integer DEFAULT 0 NOT NULL,
pairwise boolean DEFAULT false NOT NULL,
grouped boolean DEFAULT false NOT NULL,
prioritized boolean DEFAULT false NOT NULL,
primary_language character varying,
first_task character varying,
tutorial_subject_id integer,
lock_version integer DEFAULT 0,
retired_set_member_subjects_count integer DEFAULT 0,
retirement jsonb DEFAULT '{}'::jsonb,
active boolean DEFAULT true,
aggregation jsonb DEFAULT '{}'::jsonb NOT NULL,
display_order integer,
configuration jsonb DEFAULT '{}'::jsonb NOT NULL,
public_gold_standard boolean DEFAULT false,
finished_at timestamp without time zone,
completeness double precision DEFAULT 0.0 NOT NULL,
activity integer DEFAULT 0 NOT NULL,
current_version_number character varying,
activated_state integer DEFAULT 0 NOT NULL,
subject_selection_strategy integer DEFAULT 0,
mobile_friendly boolean DEFAULT false NOT NULL,
strings jsonb DEFAULT '{}'::jsonb,
major_version integer DEFAULT 0 NOT NULL,
minor_version integer DEFAULT 0 NOT NULL,
published_version_id integer,
steps jsonb DEFAULT '[]'::jsonb NOT NULL,
serialize_with_project boolean DEFAULT true,
real_set_member_subjects_count integer DEFAULT 0 NOT NULL
);
--
-- Name: workflows_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public.workflows_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- Name: workflows_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public.workflows_id_seq OWNED BY public.workflows.id;
--
-- Name: access_control_lists id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.access_control_lists ALTER COLUMN id SET DEFAULT nextval('public.access_control_lists_id_seq'::regclass);
--
-- Name: aggregations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.aggregations ALTER COLUMN id SET DEFAULT nextval('public.aggregations_id_seq'::regclass);
--
-- Name: authorizations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.authorizations ALTER COLUMN id SET DEFAULT nextval('public.authorizations_id_seq'::regclass);
--
-- Name: classifications id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.classifications ALTER COLUMN id SET DEFAULT nextval('public.classifications_id_seq'::regclass);
--
-- Name: code_experiment_configs id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.code_experiment_configs ALTER COLUMN id SET DEFAULT nextval('public.code_experiment_configs_id_seq'::regclass);
--
-- Name: collections id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections ALTER COLUMN id SET DEFAULT nextval('public.collections_id_seq'::regclass);
--
-- Name: collections_subjects id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections_subjects ALTER COLUMN id SET DEFAULT nextval('public.collections_subjects_id_seq'::regclass);
--
-- Name: field_guide_versions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.field_guide_versions ALTER COLUMN id SET DEFAULT nextval('public.field_guide_versions_id_seq'::regclass);
--
-- Name: field_guides id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.field_guides ALTER COLUMN id SET DEFAULT nextval('public.field_guides_id_seq'::regclass);
--
-- Name: flipper_features id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flipper_features ALTER COLUMN id SET DEFAULT nextval('public.flipper_features_id_seq'::regclass);
--
-- Name: flipper_gates id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flipper_gates ALTER COLUMN id SET DEFAULT nextval('public.flipper_gates_id_seq'::regclass);
--
-- Name: gold_standard_annotations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.gold_standard_annotations ALTER COLUMN id SET DEFAULT nextval('public.gold_standard_annotations_id_seq'::regclass);
--
-- Name: media id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.media ALTER COLUMN id SET DEFAULT nextval('public.media_id_seq'::regclass);
--
-- Name: memberships id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.memberships ALTER COLUMN id SET DEFAULT nextval('public.memberships_id_seq'::regclass);
--
-- Name: oauth_access_grants id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_access_grants ALTER COLUMN id SET DEFAULT nextval('public.oauth_access_grants_id_seq'::regclass);
--
-- Name: oauth_access_tokens id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('public.oauth_access_tokens_id_seq'::regclass);
--
-- Name: oauth_applications id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_applications ALTER COLUMN id SET DEFAULT nextval('public.oauth_applications_id_seq'::regclass);
--
-- Name: organization_contents id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_contents ALTER COLUMN id SET DEFAULT nextval('public.organization_contents_id_seq'::regclass);
--
-- Name: organization_page_versions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_page_versions ALTER COLUMN id SET DEFAULT nextval('public.organization_page_versions_id_seq'::regclass);
--
-- Name: organization_pages id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_pages ALTER COLUMN id SET DEFAULT nextval('public.organization_pages_id_seq'::regclass);
--
-- Name: organization_versions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_versions ALTER COLUMN id SET DEFAULT nextval('public.organization_versions_id_seq'::regclass);
--
-- Name: organizations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organizations ALTER COLUMN id SET DEFAULT nextval('public.organizations_id_seq'::regclass);
--
-- Name: project_contents id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_contents ALTER COLUMN id SET DEFAULT nextval('public.project_contents_id_seq'::regclass);
--
-- Name: project_page_versions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_page_versions ALTER COLUMN id SET DEFAULT nextval('public.project_page_versions_id_seq'::regclass);
--
-- Name: project_pages id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_pages ALTER COLUMN id SET DEFAULT nextval('public.project_pages_id_seq'::regclass);
--
-- Name: project_versions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_versions ALTER COLUMN id SET DEFAULT nextval('public.project_versions_id_seq'::regclass);
--
-- Name: projects id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.projects ALTER COLUMN id SET DEFAULT nextval('public.projects_id_seq'::regclass);
--
-- Name: recents id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.recents ALTER COLUMN id SET DEFAULT nextval('public.recents_id_seq'::regclass);
--
-- Name: set_member_subjects id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.set_member_subjects ALTER COLUMN id SET DEFAULT nextval('public.set_member_subjects_id_seq'::regclass);
--
-- Name: subject_group_members id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_group_members ALTER COLUMN id SET DEFAULT nextval('public.subject_group_members_id_seq'::regclass);
--
-- Name: subject_groups id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_groups ALTER COLUMN id SET DEFAULT nextval('public.subject_groups_id_seq'::regclass);
--
-- Name: subject_set_imports id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_set_imports ALTER COLUMN id SET DEFAULT nextval('public.subject_set_imports_id_seq'::regclass);
--
-- Name: subject_sets id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_sets ALTER COLUMN id SET DEFAULT nextval('public.subject_sets_id_seq'::regclass);
--
-- Name: subject_sets_workflows id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_sets_workflows ALTER COLUMN id SET DEFAULT nextval('public.subject_sets_workflows_id_seq'::regclass);
--
-- Name: subject_workflow_counts id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_workflow_counts ALTER COLUMN id SET DEFAULT nextval('public.subject_workflow_counts_id_seq'::regclass);
--
-- Name: subjects id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subjects ALTER COLUMN id SET DEFAULT nextval('public.subjects_id_seq'::regclass);
--
-- Name: tagged_resources id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tagged_resources ALTER COLUMN id SET DEFAULT nextval('public.tagged_resources_id_seq'::regclass);
--
-- Name: tags id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tags ALTER COLUMN id SET DEFAULT nextval('public.tags_id_seq'::regclass);
--
-- Name: translation_versions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_versions ALTER COLUMN id SET DEFAULT nextval('public.translation_versions_id_seq'::regclass);
--
-- Name: translations id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translations ALTER COLUMN id SET DEFAULT nextval('public.translations_id_seq'::regclass);
--
-- Name: tutorial_versions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tutorial_versions ALTER COLUMN id SET DEFAULT nextval('public.tutorial_versions_id_seq'::regclass);
--
-- Name: tutorials id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tutorials ALTER COLUMN id SET DEFAULT nextval('public.tutorials_id_seq'::regclass);
--
-- Name: user_collection_preferences id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_collection_preferences ALTER COLUMN id SET DEFAULT nextval('public.user_collection_preferences_id_seq'::regclass);
--
-- Name: user_groups id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_groups ALTER COLUMN id SET DEFAULT nextval('public.user_groups_id_seq'::regclass);
--
-- Name: user_project_preferences id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_project_preferences ALTER COLUMN id SET DEFAULT nextval('public.user_project_preferences_id_seq'::regclass);
--
-- Name: user_seen_subjects id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_seen_subjects ALTER COLUMN id SET DEFAULT nextval('public.user_seen_subjects_id_seq'::regclass);
--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Name: workflow_contents id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_contents ALTER COLUMN id SET DEFAULT nextval('public.workflow_contents_id_seq'::regclass);
--
-- Name: workflow_tutorials id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_tutorials ALTER COLUMN id SET DEFAULT nextval('public.workflow_tutorials_id_seq'::regclass);
--
-- Name: workflow_versions id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_versions ALTER COLUMN id SET DEFAULT nextval('public.workflow_versions_id_seq'::regclass);
--
-- Name: workflows id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflows ALTER COLUMN id SET DEFAULT nextval('public.workflows_id_seq'::regclass);
--
-- Name: access_control_lists access_control_lists_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.access_control_lists
ADD CONSTRAINT access_control_lists_pkey PRIMARY KEY (id);
--
-- Name: aggregations aggregations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.aggregations
ADD CONSTRAINT aggregations_pkey PRIMARY KEY (id);
--
-- Name: authorizations authorizations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.authorizations
ADD CONSTRAINT authorizations_pkey PRIMARY KEY (id);
--
-- Name: classifications classifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.classifications
ADD CONSTRAINT classifications_pkey PRIMARY KEY (id);
--
-- Name: code_experiment_configs code_experiment_configs_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.code_experiment_configs
ADD CONSTRAINT code_experiment_configs_pkey PRIMARY KEY (id);
--
-- Name: collections collections_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections
ADD CONSTRAINT collections_pkey PRIMARY KEY (id);
--
-- Name: collections_subjects collections_subjects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections_subjects
ADD CONSTRAINT collections_subjects_pkey PRIMARY KEY (id);
--
-- Name: field_guide_versions field_guide_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.field_guide_versions
ADD CONSTRAINT field_guide_versions_pkey PRIMARY KEY (id);
--
-- Name: field_guides field_guides_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.field_guides
ADD CONSTRAINT field_guides_pkey PRIMARY KEY (id);
--
-- Name: flipper_features flipper_features_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flipper_features
ADD CONSTRAINT flipper_features_pkey PRIMARY KEY (id);
--
-- Name: flipper_gates flipper_gates_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.flipper_gates
ADD CONSTRAINT flipper_gates_pkey PRIMARY KEY (id);
--
-- Name: gold_standard_annotations gold_standard_annotations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.gold_standard_annotations
ADD CONSTRAINT gold_standard_annotations_pkey PRIMARY KEY (id);
--
-- Name: media media_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.media
ADD CONSTRAINT media_pkey PRIMARY KEY (id);
--
-- Name: memberships memberships_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.memberships
ADD CONSTRAINT memberships_pkey PRIMARY KEY (id);
--
-- Name: oauth_access_grants oauth_access_grants_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_access_grants
ADD CONSTRAINT oauth_access_grants_pkey PRIMARY KEY (id);
--
-- Name: oauth_access_tokens oauth_access_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_access_tokens
ADD CONSTRAINT oauth_access_tokens_pkey PRIMARY KEY (id);
--
-- Name: oauth_applications oauth_applications_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_applications
ADD CONSTRAINT oauth_applications_pkey PRIMARY KEY (id);
--
-- Name: organization_contents organization_contents_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_contents
ADD CONSTRAINT organization_contents_pkey PRIMARY KEY (id);
--
-- Name: organization_page_versions organization_page_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_page_versions
ADD CONSTRAINT organization_page_versions_pkey PRIMARY KEY (id);
--
-- Name: organization_pages organization_pages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_pages
ADD CONSTRAINT organization_pages_pkey PRIMARY KEY (id);
--
-- Name: organization_versions organization_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_versions
ADD CONSTRAINT organization_versions_pkey PRIMARY KEY (id);
--
-- Name: organizations organizations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organizations
ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);
--
-- Name: project_contents project_contents_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_contents
ADD CONSTRAINT project_contents_pkey PRIMARY KEY (id);
--
-- Name: project_page_versions project_page_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_page_versions
ADD CONSTRAINT project_page_versions_pkey PRIMARY KEY (id);
--
-- Name: project_pages project_pages_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_pages
ADD CONSTRAINT project_pages_pkey PRIMARY KEY (id);
--
-- Name: project_versions project_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_versions
ADD CONSTRAINT project_versions_pkey PRIMARY KEY (id);
--
-- Name: projects projects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.projects
ADD CONSTRAINT projects_pkey PRIMARY KEY (id);
--
-- Name: recents recents_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.recents
ADD CONSTRAINT recents_pkey PRIMARY KEY (id);
--
-- Name: set_member_subjects set_member_subjects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.set_member_subjects
ADD CONSTRAINT set_member_subjects_pkey PRIMARY KEY (id);
--
-- Name: subject_group_members subject_group_members_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_group_members
ADD CONSTRAINT subject_group_members_pkey PRIMARY KEY (id);
--
-- Name: subject_groups subject_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_groups
ADD CONSTRAINT subject_groups_pkey PRIMARY KEY (id);
--
-- Name: subject_set_imports subject_set_imports_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_set_imports
ADD CONSTRAINT subject_set_imports_pkey PRIMARY KEY (id);
--
-- Name: subject_sets subject_sets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_sets
ADD CONSTRAINT subject_sets_pkey PRIMARY KEY (id);
--
-- Name: subject_sets_workflows subject_sets_workflows_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_sets_workflows
ADD CONSTRAINT subject_sets_workflows_pkey PRIMARY KEY (id);
--
-- Name: subject_workflow_counts subject_workflow_counts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_workflow_counts
ADD CONSTRAINT subject_workflow_counts_pkey PRIMARY KEY (id);
--
-- Name: subjects subjects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subjects
ADD CONSTRAINT subjects_pkey PRIMARY KEY (id);
--
-- Name: tagged_resources tagged_resources_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tagged_resources
ADD CONSTRAINT tagged_resources_pkey PRIMARY KEY (id);
--
-- Name: tags tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tags
ADD CONSTRAINT tags_pkey PRIMARY KEY (id);
--
-- Name: translation_versions translation_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_versions
ADD CONSTRAINT translation_versions_pkey PRIMARY KEY (id);
--
-- Name: translations translations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translations
ADD CONSTRAINT translations_pkey PRIMARY KEY (id);
--
-- Name: tutorial_versions tutorial_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tutorial_versions
ADD CONSTRAINT tutorial_versions_pkey PRIMARY KEY (id);
--
-- Name: tutorials tutorials_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tutorials
ADD CONSTRAINT tutorials_pkey PRIMARY KEY (id);
--
-- Name: user_collection_preferences user_collection_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_collection_preferences
ADD CONSTRAINT user_collection_preferences_pkey PRIMARY KEY (id);
--
-- Name: user_groups user_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_groups
ADD CONSTRAINT user_groups_pkey PRIMARY KEY (id);
--
-- Name: user_project_preferences user_project_preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_project_preferences
ADD CONSTRAINT user_project_preferences_pkey PRIMARY KEY (id);
--
-- Name: user_seen_subjects user_seen_subjects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_seen_subjects
ADD CONSTRAINT user_seen_subjects_pkey PRIMARY KEY (id);
--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- Name: workflow_contents workflow_contents_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_contents
ADD CONSTRAINT workflow_contents_pkey PRIMARY KEY (id);
--
-- Name: workflow_tutorials workflow_tutorials_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_tutorials
ADD CONSTRAINT workflow_tutorials_pkey PRIMARY KEY (id);
--
-- Name: workflow_versions workflow_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_versions
ADD CONSTRAINT workflow_versions_pkey PRIMARY KEY (id);
--
-- Name: workflows workflows_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflows
ADD CONSTRAINT workflows_pkey PRIMARY KEY (id);
--
-- Name: classification_subjects_pk; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX classification_subjects_pk ON public.classification_subjects USING btree (classification_id, subject_id);
--
-- Name: idx_lower_email; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX idx_lower_email ON public.users USING btree (lower((email)::text));
--
-- Name: idx_translations_on_translated_type+id_and_language; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX "idx_translations_on_translated_type+id_and_language" ON public.translations USING btree (translated_type, translated_id, language);
--
-- Name: index_access_control_lists_on_resource_id_and_resource_type; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_access_control_lists_on_resource_id_and_resource_type ON public.access_control_lists USING btree (resource_id, resource_type);
--
-- Name: index_access_control_lists_on_user_group_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_access_control_lists_on_user_group_id ON public.access_control_lists USING btree (user_group_id);
--
-- Name: index_aggregations_on_subject_id_and_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_aggregations_on_subject_id_and_workflow_id ON public.aggregations USING btree (subject_id, workflow_id);
--
-- Name: index_aggregations_on_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_aggregations_on_workflow_id ON public.aggregations USING btree (workflow_id);
--
-- Name: index_authorizations_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_authorizations_on_user_id ON public.authorizations USING btree (user_id);
--
-- Name: index_classification_subjects_on_subject_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_classification_subjects_on_subject_id ON public.classification_subjects USING btree (subject_id);
--
-- Name: index_classifications_on_completed; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_classifications_on_completed ON public.classifications USING btree (completed) WHERE (completed IS FALSE);
--
-- Name: index_classifications_on_created_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_classifications_on_created_at ON public.classifications USING btree (created_at);
--
-- Name: index_classifications_on_gold_standard; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_classifications_on_gold_standard ON public.classifications USING btree (gold_standard) WHERE (gold_standard IS TRUE);
--
-- Name: index_classifications_on_lifecycled_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_classifications_on_lifecycled_at ON public.classifications USING btree (lifecycled_at) WHERE (lifecycled_at IS NULL);
--
-- Name: index_classifications_on_project_id_and_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_classifications_on_project_id_and_id ON public.classifications USING btree (project_id, id);
--
-- Name: index_classifications_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_classifications_on_user_id ON public.classifications USING btree (user_id);
--
-- Name: index_classifications_on_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_classifications_on_workflow_id ON public.classifications USING btree (workflow_id);
--
-- Name: index_code_experiment_configs_on_name; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_code_experiment_configs_on_name ON public.code_experiment_configs USING btree (name);
--
-- Name: index_collections_display_name_trgrm; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_collections_display_name_trgrm ON public.collections USING gin (COALESCE((display_name)::text, ''::text) public.gin_trgm_ops);
--
-- Name: index_collections_on_activated_state; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_collections_on_activated_state ON public.collections USING btree (activated_state);
--
-- Name: index_collections_on_display_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_collections_on_display_name ON public.collections USING btree (display_name);
--
-- Name: index_collections_on_favorite; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_collections_on_favorite ON public.collections USING btree (favorite);
--
-- Name: index_collections_on_private; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_collections_on_private ON public.collections USING btree (private);
--
-- Name: index_collections_on_slug; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_collections_on_slug ON public.collections USING btree (slug);
--
-- Name: index_collections_projects_on_collection_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_collections_projects_on_collection_id ON public.collections_projects USING btree (collection_id);
--
-- Name: index_collections_subjects_on_collection_id_and_subject_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_collections_subjects_on_collection_id_and_subject_id ON public.collections_subjects USING btree (collection_id, subject_id);
--
-- Name: index_collections_subjects_on_subject_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_collections_subjects_on_subject_id ON public.collections_subjects USING btree (subject_id);
--
-- Name: index_field_guide_versions_on_field_guide_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_field_guide_versions_on_field_guide_id ON public.field_guide_versions USING btree (field_guide_id);
--
-- Name: index_field_guides_on_language; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_field_guides_on_language ON public.field_guides USING btree (language);
--
-- Name: index_field_guides_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_field_guides_on_project_id ON public.field_guides USING btree (project_id);
--
-- Name: index_flipper_features_on_key; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_flipper_features_on_key ON public.flipper_features USING btree (key);
--
-- Name: index_flipper_gates_on_feature_key_and_key_and_value; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_flipper_gates_on_feature_key_and_key_and_value ON public.flipper_gates USING btree (feature_key, key, value);
--
-- Name: index_gold_standard_annotations_on_subject_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_gold_standard_annotations_on_subject_id ON public.gold_standard_annotations USING btree (subject_id);
--
-- Name: index_gold_standard_annotations_on_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_gold_standard_annotations_on_workflow_id ON public.gold_standard_annotations USING btree (workflow_id);
--
-- Name: index_media_on_linked_id_and_linked_type; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_media_on_linked_id_and_linked_type ON public.media USING btree (linked_id, linked_type);
--
-- Name: index_media_on_type; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_media_on_type ON public.media USING btree (type);
--
-- Name: index_memberships_on_user_group_id_and_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_memberships_on_user_group_id_and_user_id ON public.memberships USING btree (user_group_id, user_id);
--
-- Name: index_memberships_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_memberships_on_user_id ON public.memberships USING btree (user_id);
--
-- Name: index_oauth_access_grants_on_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_oauth_access_grants_on_token ON public.oauth_access_grants USING btree (token);
--
-- Name: index_oauth_access_tokens_on_app_id_and_owner_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_oauth_access_tokens_on_app_id_and_owner_id ON public.oauth_access_tokens USING btree (application_id, resource_owner_id);
--
-- Name: index_oauth_access_tokens_on_refresh_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_oauth_access_tokens_on_refresh_token ON public.oauth_access_tokens USING btree (refresh_token);
--
-- Name: index_oauth_access_tokens_on_resource_owner_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_oauth_access_tokens_on_resource_owner_id ON public.oauth_access_tokens USING btree (resource_owner_id);
--
-- Name: index_oauth_access_tokens_on_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_oauth_access_tokens_on_token ON public.oauth_access_tokens USING btree (token);
--
-- Name: index_oauth_applications_on_uid; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_oauth_applications_on_uid ON public.oauth_applications USING btree (uid);
--
-- Name: index_organization_page_versions_on_organization_page_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organization_page_versions_on_organization_page_id ON public.organization_page_versions USING btree (organization_page_id);
--
-- Name: index_organization_pages_on_language; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organization_pages_on_language ON public.organization_pages USING btree (language);
--
-- Name: index_organization_pages_on_organization_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organization_pages_on_organization_id ON public.organization_pages USING btree (organization_id);
--
-- Name: index_organization_versions_on_organization_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organization_versions_on_organization_id ON public.organization_versions USING btree (organization_id);
--
-- Name: index_organizations_on_activated_state; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organizations_on_activated_state ON public.organizations USING btree (activated_state);
--
-- Name: index_organizations_on_display_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organizations_on_display_name ON public.organizations USING btree (display_name);
--
-- Name: index_organizations_on_listed; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organizations_on_listed ON public.organizations USING btree (listed);
--
-- Name: index_organizations_on_listed_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organizations_on_listed_at ON public.organizations USING btree (listed_at);
--
-- Name: index_organizations_on_slug; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_organizations_on_slug ON public.organizations USING btree (slug);
--
-- Name: index_organizations_on_updated_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_organizations_on_updated_at ON public.organizations USING btree (updated_at);
--
-- Name: index_project_contents_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_project_contents_on_project_id ON public.project_contents USING btree (project_id);
--
-- Name: index_project_page_versions_on_project_page_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_project_page_versions_on_project_page_id ON public.project_page_versions USING btree (project_page_id);
--
-- Name: index_project_pages_on_language; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_project_pages_on_language ON public.project_pages USING btree (language);
--
-- Name: index_project_pages_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_project_pages_on_project_id ON public.project_pages USING btree (project_id);
--
-- Name: index_project_versions_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_project_versions_on_project_id ON public.project_versions USING btree (project_id);
--
-- Name: index_projects_display_name_trgrm; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_display_name_trgrm ON public.projects USING gin (COALESCE((display_name)::text, ''::text) public.gin_trgm_ops);
--
-- Name: index_projects_on_activated_state; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_activated_state ON public.projects USING btree (activated_state);
--
-- Name: index_projects_on_beta_approved; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_beta_approved ON public.projects USING btree (beta_approved);
--
-- Name: index_projects_on_beta_requested; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_beta_requested ON public.projects USING btree (beta_requested) WHERE (beta_requested = true);
--
-- Name: index_projects_on_beta_row_order; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_beta_row_order ON public.projects USING btree (beta_row_order);
--
-- Name: index_projects_on_featured; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_featured ON public.projects USING btree (featured);
--
-- Name: index_projects_on_launch_approved; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_launch_approved ON public.projects USING btree (launch_approved);
--
-- Name: index_projects_on_launch_requested; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_launch_requested ON public.projects USING btree (launch_requested) WHERE (launch_requested = true);
--
-- Name: index_projects_on_launched_row_order; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_launched_row_order ON public.projects USING btree (launched_row_order);
--
-- Name: index_projects_on_live; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_live ON public.projects USING btree (live);
--
-- Name: index_projects_on_migrated; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_migrated ON public.projects USING btree (migrated) WHERE (migrated = true);
--
-- Name: index_projects_on_mobile_friendly; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_mobile_friendly ON public.projects USING btree (mobile_friendly);
--
-- Name: index_projects_on_organization_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_organization_id ON public.projects USING btree (organization_id);
--
-- Name: index_projects_on_private; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_private ON public.projects USING btree (private);
--
-- Name: index_projects_on_slug; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_slug ON public.projects USING btree (slug);
--
-- Name: index_projects_on_state; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_state ON public.projects USING btree (state) WHERE (state IS NOT NULL);
--
-- Name: index_projects_on_tsv; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_projects_on_tsv ON public.projects USING gin (tsv);
--
-- Name: index_recents_on_created_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_recents_on_created_at ON public.recents USING btree (created_at);
--
-- Name: index_recents_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_recents_on_project_id ON public.recents USING btree (project_id);
--
-- Name: index_recents_on_subject_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_recents_on_subject_id ON public.recents USING btree (subject_id);
--
-- Name: index_recents_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_recents_on_user_id ON public.recents USING btree (user_id);
--
-- Name: index_recents_on_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_recents_on_workflow_id ON public.recents USING btree (workflow_id);
--
-- Name: index_set_member_subjects_on_random; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_set_member_subjects_on_random ON public.set_member_subjects USING btree (random);
--
-- Name: index_set_member_subjects_on_subject_id_and_subject_set_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_set_member_subjects_on_subject_id_and_subject_set_id ON public.set_member_subjects USING btree (subject_id, subject_set_id);
--
-- Name: index_set_member_subjects_on_subject_set_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_set_member_subjects_on_subject_set_id ON public.set_member_subjects USING btree (subject_set_id);
--
-- Name: index_subject_group_members_on_subject_group_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subject_group_members_on_subject_group_id ON public.subject_group_members USING btree (subject_group_id);
--
-- Name: index_subject_group_members_on_subject_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subject_group_members_on_subject_id ON public.subject_group_members USING btree (subject_id);
--
-- Name: index_subject_groups_on_key; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_subject_groups_on_key ON public.subject_groups USING btree (key);
--
-- Name: index_subject_set_imports_on_subject_set_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subject_set_imports_on_subject_set_id ON public.subject_set_imports USING btree (subject_set_id);
--
-- Name: index_subject_set_imports_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subject_set_imports_on_user_id ON public.subject_set_imports USING btree (user_id);
--
-- Name: index_subject_sets_on_metadata; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subject_sets_on_metadata ON public.subject_sets USING gin (metadata);
--
-- Name: index_subject_sets_on_project_id_and_display_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subject_sets_on_project_id_and_display_name ON public.subject_sets USING btree (project_id, display_name);
--
-- Name: index_subject_sets_workflows_on_subject_set_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subject_sets_workflows_on_subject_set_id ON public.subject_sets_workflows USING btree (subject_set_id);
--
-- Name: index_subject_sets_workflows_on_workflow_id_and_subject_set_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_subject_sets_workflows_on_workflow_id_and_subject_set_id ON public.subject_sets_workflows USING btree (workflow_id, subject_set_id);
--
-- Name: index_subject_workflow_counts_on_subject_id_and_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_subject_workflow_counts_on_subject_id_and_workflow_id ON public.subject_workflow_counts USING btree (subject_id, workflow_id);
--
-- Name: index_subject_workflow_counts_on_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subject_workflow_counts_on_workflow_id ON public.subject_workflow_counts USING btree (workflow_id);
--
-- Name: index_subjects_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subjects_on_project_id ON public.subjects USING btree (project_id);
--
-- Name: index_subjects_on_upload_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_subjects_on_upload_user_id ON public.subjects USING btree (upload_user_id);
--
-- Name: index_tagged_resources_on_resource_id_and_resource_type; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tagged_resources_on_resource_id_and_resource_type ON public.tagged_resources USING btree (resource_id, resource_type);
--
-- Name: index_tagged_resources_on_tag_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tagged_resources_on_tag_id ON public.tagged_resources USING btree (tag_id);
--
-- Name: index_tags_name_trgrm; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tags_name_trgrm ON public.tags USING gin (COALESCE(name, ''::text) public.gin_trgm_ops);
--
-- Name: index_tags_on_name; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_tags_on_name ON public.tags USING btree (name);
--
-- Name: index_translation_versions_on_translation_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_translation_versions_on_translation_id ON public.translation_versions USING btree (translation_id);
--
-- Name: index_tutorial_versions_on_tutorial_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tutorial_versions_on_tutorial_id ON public.tutorial_versions USING btree (tutorial_id);
--
-- Name: index_tutorials_on_kind; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tutorials_on_kind ON public.tutorials USING btree (kind);
--
-- Name: index_tutorials_on_language; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tutorials_on_language ON public.tutorials USING btree (language);
--
-- Name: index_tutorials_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_tutorials_on_project_id ON public.tutorials USING btree (project_id);
--
-- Name: index_user_collection_preferences_on_collection_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_user_collection_preferences_on_collection_id ON public.user_collection_preferences USING btree (collection_id);
--
-- Name: index_user_collection_preferences_on_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_user_collection_preferences_on_user_id ON public.user_collection_preferences USING btree (user_id);
--
-- Name: index_user_groups_display_name_trgrm; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_user_groups_display_name_trgrm ON public.user_groups USING gin (COALESCE((display_name)::text, ''::text) public.gin_trgm_ops);
--
-- Name: index_user_groups_on_activated_state; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_user_groups_on_activated_state ON public.user_groups USING btree (activated_state);
--
-- Name: index_user_groups_on_name; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_user_groups_on_name ON public.user_groups USING btree (lower((name)::text));
--
-- Name: index_user_groups_on_private; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_user_groups_on_private ON public.user_groups USING btree (private);
--
-- Name: index_user_project_preferences_on_project_id_and_user_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_user_project_preferences_on_project_id_and_user_id ON public.user_project_preferences USING btree (project_id, user_id);
--
-- Name: index_user_seen_subjects_on_user_id_and_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_user_seen_subjects_on_user_id_and_workflow_id ON public.user_seen_subjects USING btree (user_id, workflow_id);
--
-- Name: index_users_on_activated_state; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_activated_state ON public.users USING btree (activated_state);
--
-- Name: index_users_on_beta_email_communication; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_beta_email_communication ON public.users USING btree (beta_email_communication) WHERE (beta_email_communication = true);
--
-- Name: index_users_on_display_name; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_display_name ON public.users USING btree (lower((display_name)::text));
--
-- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_email ON public.users USING btree (email);
--
-- Name: index_users_on_global_email_communication; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_global_email_communication ON public.users USING btree (global_email_communication) WHERE (global_email_communication = true);
--
-- Name: index_users_on_login; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_login ON public.users USING btree (lower((login)::text));
--
-- Name: index_users_on_login_with_case; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_login_with_case ON public.users USING btree (login);
--
-- Name: index_users_on_lower_names; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_lower_names ON public.users USING btree (lower((login)::text) text_pattern_ops, lower((display_name)::text) text_pattern_ops);
--
-- Name: index_users_on_nasa_email_communication; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_nasa_email_communication ON public.users USING btree (nasa_email_communication) WHERE (nasa_email_communication = true);
--
-- Name: index_users_on_private_profile; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_private_profile ON public.users USING btree (private_profile) WHERE (private_profile = false);
--
-- Name: index_users_on_reset_password_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_reset_password_token ON public.users USING btree (reset_password_token);
--
-- Name: index_users_on_tsv; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_tsv ON public.users USING gin (tsv);
--
-- Name: index_users_on_unsubscribe_token; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_unsubscribe_token ON public.users USING btree (unsubscribe_token);
--
-- Name: index_users_on_ux_testing_email_communication; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_users_on_ux_testing_email_communication ON public.users USING btree (ux_testing_email_communication) WHERE (ux_testing_email_communication IS TRUE);
--
-- Name: index_users_on_zooniverse_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_users_on_zooniverse_id ON public.users USING btree (zooniverse_id);
--
-- Name: index_workflow_contents_on_workflow_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflow_contents_on_workflow_id ON public.workflow_contents USING btree (workflow_id);
--
-- Name: index_workflow_tutorials_on_tutorial_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflow_tutorials_on_tutorial_id ON public.workflow_tutorials USING btree (tutorial_id);
--
-- Name: index_workflow_tutorials_on_workflow_id_and_tutorial_id; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_workflow_tutorials_on_workflow_id_and_tutorial_id ON public.workflow_tutorials USING btree (workflow_id, tutorial_id);
--
-- Name: index_workflow_versions_on_workflow_and_major_and_minor; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX index_workflow_versions_on_workflow_and_major_and_minor ON public.workflow_versions USING btree (workflow_id, major_number, minor_number);
--
-- Name: index_workflows_on_activated_state; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflows_on_activated_state ON public.workflows USING btree (activated_state);
--
-- Name: index_workflows_on_aggregation; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflows_on_aggregation ON public.workflows USING btree (((aggregation ->> 'public'::text)));
--
-- Name: index_workflows_on_display_order; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflows_on_display_order ON public.workflows USING btree (display_order);
--
-- Name: index_workflows_on_mobile_friendly; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflows_on_mobile_friendly ON public.workflows USING btree (mobile_friendly);
--
-- Name: index_workflows_on_project_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflows_on_project_id ON public.workflows USING btree (project_id);
--
-- Name: index_workflows_on_public_gold_standard; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflows_on_public_gold_standard ON public.workflows USING btree (public_gold_standard) WHERE (public_gold_standard IS TRUE);
--
-- Name: index_workflows_on_tutorial_subject_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_workflows_on_tutorial_subject_id ON public.workflows USING btree (tutorial_subject_id);
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX unique_schema_migrations ON public.schema_migrations USING btree (version);
--
-- Name: users_idx_trgm_login; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX users_idx_trgm_login ON public.users USING gin (COALESCE((login)::text, ''::text) public.gin_trgm_ops);
--
-- Name: projects tsvectorupdate; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE ON public.projects FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('tsv', 'pg_catalog.english', 'display_name');
--
-- Name: users tsvectorupdate; Type: TRIGGER; Schema: public; Owner: -
--
CREATE TRIGGER tsvectorupdate BEFORE INSERT OR UPDATE ON public.users FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('tsv', 'pg_catalog.english', 'login');
--
-- Name: user_collection_preferences fk_rails_02f2e5d7ed; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_collection_preferences
ADD CONSTRAINT fk_rails_02f2e5d7ed FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: subject_sets_workflows fk_rails_038f6f9f13; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_sets_workflows
ADD CONSTRAINT fk_rails_038f6f9f13 FOREIGN KEY (workflow_id) REFERENCES public.workflows(id);
--
-- Name: gold_standard_annotations fk_rails_06fc22e4c3; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.gold_standard_annotations
ADD CONSTRAINT fk_rails_06fc22e4c3 FOREIGN KEY (classification_id) REFERENCES public.classifications(id);
--
-- Name: gold_standard_annotations fk_rails_082b4f1af7; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.gold_standard_annotations
ADD CONSTRAINT fk_rails_082b4f1af7 FOREIGN KEY (project_id) REFERENCES public.projects(id);
--
-- Name: field_guide_versions fk_rails_085970853c; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.field_guide_versions
ADD CONSTRAINT fk_rails_085970853c FOREIGN KEY (field_guide_id) REFERENCES public.field_guides(id);
--
-- Name: access_control_lists fk_rails_0be1922a0e; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.access_control_lists
ADD CONSTRAINT fk_rails_0be1922a0e FOREIGN KEY (user_group_id) REFERENCES public.user_groups(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: workflow_tutorials fk_rails_0ca158de43; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_tutorials
ADD CONSTRAINT fk_rails_0ca158de43 FOREIGN KEY (tutorial_id) REFERENCES public.tutorials(id) ON DELETE CASCADE;
--
-- Name: tutorial_versions fk_rails_0de211431f; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tutorial_versions
ADD CONSTRAINT fk_rails_0de211431f FOREIGN KEY (tutorial_id) REFERENCES public.tutorials(id);
--
-- Name: gold_standard_annotations fk_rails_0e782fcb3c; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.gold_standard_annotations
ADD CONSTRAINT fk_rails_0e782fcb3c FOREIGN KEY (subject_id) REFERENCES public.subjects(id);
--
-- Name: workflow_contents fk_rails_107209726e; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_contents
ADD CONSTRAINT fk_rails_107209726e FOREIGN KEY (workflow_id) REFERENCES public.workflows(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: collections_projects fk_rails_1be0872ee9; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections_projects
ADD CONSTRAINT fk_rails_1be0872ee9 FOREIGN KEY (collection_id) REFERENCES public.collections(id);
--
-- Name: gold_standard_annotations fk_rails_1d218ca624; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.gold_standard_annotations
ADD CONSTRAINT fk_rails_1d218ca624 FOREIGN KEY (workflow_id) REFERENCES public.workflows(id);
--
-- Name: recents fk_rails_1e54468460; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.recents
ADD CONSTRAINT fk_rails_1e54468460 FOREIGN KEY (classification_id) REFERENCES public.classifications(id);
--
-- Name: subject_workflow_counts fk_rails_2001a01c81; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_workflow_counts
ADD CONSTRAINT fk_rails_2001a01c81 FOREIGN KEY (subject_id) REFERENCES public.subjects(id) ON DELETE RESTRICT;
--
-- Name: aggregations fk_rails_27ae8e8a0d; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.aggregations
ADD CONSTRAINT fk_rails_27ae8e8a0d FOREIGN KEY (workflow_id) REFERENCES public.workflows(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: subject_groups fk_rails_283ede5252; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_groups
ADD CONSTRAINT fk_rails_283ede5252 FOREIGN KEY (project_id) REFERENCES public.projects(id);
--
-- Name: aggregations fk_rails_28a7ada458; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.aggregations
ADD CONSTRAINT fk_rails_28a7ada458 FOREIGN KEY (subject_id) REFERENCES public.subjects(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: project_contents fk_rails_305e6d8bf1; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_contents
ADD CONSTRAINT fk_rails_305e6d8bf1 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: oauth_access_grants fk_rails_330c32d8d9; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_access_grants
ADD CONSTRAINT fk_rails_330c32d8d9 FOREIGN KEY (resource_owner_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: workflows fk_rails_382d2c48c7; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflows
ADD CONSTRAINT fk_rails_382d2c48c7 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: project_pages fk_rails_489b3ea925; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_pages
ADD CONSTRAINT fk_rails_489b3ea925 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: subject_workflow_counts fk_rails_4a73c0f7f5; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_workflow_counts
ADD CONSTRAINT fk_rails_4a73c0f7f5 FOREIGN KEY (workflow_id) REFERENCES public.workflows(id);
--
-- Name: user_project_preferences fk_rails_4da2a0f9d6; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_project_preferences
ADD CONSTRAINT fk_rails_4da2a0f9d6 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: user_project_preferences fk_rails_4e8620169e; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_project_preferences
ADD CONSTRAINT fk_rails_4e8620169e FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: authorizations fk_rails_4ecef5b8c5; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.authorizations
ADD CONSTRAINT fk_rails_4ecef5b8c5 FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: recents fk_rails_5244e2cc55; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.recents
ADD CONSTRAINT fk_rails_5244e2cc55 FOREIGN KEY (subject_id) REFERENCES public.subjects(id);
--
-- Name: organization_page_versions fk_rails_53b1c6ff8a; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_page_versions
ADD CONSTRAINT fk_rails_53b1c6ff8a FOREIGN KEY (organization_page_id) REFERENCES public.organization_pages(id);
--
-- Name: subject_groups fk_rails_59adcbe133; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_groups
ADD CONSTRAINT fk_rails_59adcbe133 FOREIGN KEY (group_subject_id) REFERENCES public.subjects(id);
--
-- Name: user_collection_preferences fk_rails_670188dbc7; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_collection_preferences
ADD CONSTRAINT fk_rails_670188dbc7 FOREIGN KEY (collection_id) REFERENCES public.collections(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: workflows fk_rails_694e2977cf; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflows
ADD CONSTRAINT fk_rails_694e2977cf FOREIGN KEY (published_version_id) REFERENCES public.workflow_versions(id);
--
-- Name: workflow_versions fk_rails_6c88edf7d9; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_versions
ADD CONSTRAINT fk_rails_6c88edf7d9 FOREIGN KEY (workflow_id) REFERENCES public.workflows(id);
--
-- Name: oauth_access_tokens fk_rails_732cb83ab7; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_access_tokens
ADD CONSTRAINT fk_rails_732cb83ab7 FOREIGN KEY (application_id) REFERENCES public.oauth_applications(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: classification_subjects fk_rails_7c8fb1018a; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.classification_subjects
ADD CONSTRAINT fk_rails_7c8fb1018a FOREIGN KEY (classification_id) REFERENCES public.classifications(id);
--
-- Name: tutorials fk_rails_82e4d0479b; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tutorials
ADD CONSTRAINT fk_rails_82e4d0479b FOREIGN KEY (project_id) REFERENCES public.projects(id);
--
-- Name: subject_set_imports fk_rails_8661e689b0; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_set_imports
ADD CONSTRAINT fk_rails_8661e689b0 FOREIGN KEY (subject_set_id) REFERENCES public.subject_sets(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: collections_projects fk_rails_895b025564; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections_projects
ADD CONSTRAINT fk_rails_895b025564 FOREIGN KEY (project_id) REFERENCES public.projects(id);
--
-- Name: set_member_subjects fk_rails_93073bf3b1; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.set_member_subjects
ADD CONSTRAINT fk_rails_93073bf3b1 FOREIGN KEY (subject_id) REFERENCES public.subjects(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: gold_standard_annotations fk_rails_937b47dc37; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.gold_standard_annotations
ADD CONSTRAINT fk_rails_937b47dc37 FOREIGN KEY (user_id) REFERENCES public.users(id);
--
-- Name: subject_sets fk_rails_960d10a3c6; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_sets
ADD CONSTRAINT fk_rails_960d10a3c6 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: collections fk_rails_991d5ad7ab; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections
ADD CONSTRAINT fk_rails_991d5ad7ab FOREIGN KEY (default_subject_id) REFERENCES public.subjects(id);
--
-- Name: memberships fk_rails_99326fb65d; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.memberships
ADD CONSTRAINT fk_rails_99326fb65d FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: projects fk_rails_9aee26923d; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.projects
ADD CONSTRAINT fk_rails_9aee26923d FOREIGN KEY (organization_id) REFERENCES public.organizations(id);
--
-- Name: user_seen_subjects fk_rails_9c86377aa8; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_seen_subjects
ADD CONSTRAINT fk_rails_9c86377aa8 FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: memberships fk_rails_9dd81aaaa3; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.memberships
ADD CONSTRAINT fk_rails_9dd81aaaa3 FOREIGN KEY (user_group_id) REFERENCES public.user_groups(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: field_guides fk_rails_a1b35288b8; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.field_guides
ADD CONSTRAINT fk_rails_a1b35288b8 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: subject_group_members fk_rails_a5b8c1ffff; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_group_members
ADD CONSTRAINT fk_rails_a5b8c1ffff FOREIGN KEY (subject_id) REFERENCES public.subjects(id);
--
-- Name: translation_versions fk_rails_ad41ce8e02; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translation_versions
ADD CONSTRAINT fk_rails_ad41ce8e02 FOREIGN KEY (translation_id) REFERENCES public.translations(id);
--
-- Name: workflows fk_rails_b029d72783; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflows
ADD CONSTRAINT fk_rails_b029d72783 FOREIGN KEY (tutorial_subject_id) REFERENCES public.subjects(id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: subject_sets_workflows fk_rails_b08d342668; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_sets_workflows
ADD CONSTRAINT fk_rails_b08d342668 FOREIGN KEY (subject_set_id) REFERENCES public.subject_sets(id);
--
-- Name: oauth_access_grants fk_rails_b4b53e07b8; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_access_grants
ADD CONSTRAINT fk_rails_b4b53e07b8 FOREIGN KEY (application_id) REFERENCES public.oauth_applications(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: project_page_versions fk_rails_b7ce3e711e; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_page_versions
ADD CONSTRAINT fk_rails_b7ce3e711e FOREIGN KEY (project_page_id) REFERENCES public.project_pages(id);
--
-- Name: translations fk_rails_bae361a0ab; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.translations
ADD CONSTRAINT fk_rails_bae361a0ab FOREIGN KEY (published_version_id) REFERENCES public.translation_versions(id);
--
-- Name: set_member_subjects fk_rails_bbb4bf5489; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.set_member_subjects
ADD CONSTRAINT fk_rails_bbb4bf5489 FOREIGN KEY (subject_set_id) REFERENCES public.subject_sets(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: workflow_tutorials fk_rails_bcabfcd540; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.workflow_tutorials
ADD CONSTRAINT fk_rails_bcabfcd540 FOREIGN KEY (workflow_id) REFERENCES public.workflows(id) ON DELETE CASCADE;
--
-- Name: organization_versions fk_rails_be858ed31d; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_versions
ADD CONSTRAINT fk_rails_be858ed31d FOREIGN KEY (organization_id) REFERENCES public.organizations(id);
--
-- Name: subject_set_imports fk_rails_d596712569; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_set_imports
ADD CONSTRAINT fk_rails_d596712569 FOREIGN KEY (user_id) REFERENCES public.users(id);
--
-- Name: tagged_resources fk_rails_d6fe15ec78; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tagged_resources
ADD CONSTRAINT fk_rails_d6fe15ec78 FOREIGN KEY (tag_id) REFERENCES public.tags(id);
--
-- Name: organization_contents fk_rails_d80672ecd1; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.organization_contents
ADD CONSTRAINT fk_rails_d80672ecd1 FOREIGN KEY (organization_id) REFERENCES public.organizations(id) ON DELETE CASCADE;
--
-- Name: collections_subjects fk_rails_dff7cd1e07; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections_subjects
ADD CONSTRAINT fk_rails_dff7cd1e07 FOREIGN KEY (collection_id) REFERENCES public.collections(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: user_seen_subjects fk_rails_e881fca299; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_seen_subjects
ADD CONSTRAINT fk_rails_e881fca299 FOREIGN KEY (workflow_id) REFERENCES public.workflows(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: collections_subjects fk_rails_e9323f2e30; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.collections_subjects
ADD CONSTRAINT fk_rails_e9323f2e30 FOREIGN KEY (subject_id) REFERENCES public.subjects(id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: oauth_access_tokens fk_rails_ee63f25419; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.oauth_access_tokens
ADD CONSTRAINT fk_rails_ee63f25419 FOREIGN KEY (resource_owner_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE;
--
-- Name: project_versions fk_rails_eee5ff31fd; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.project_versions
ADD CONSTRAINT fk_rails_eee5ff31fd FOREIGN KEY (project_id) REFERENCES public.projects(id);
--
-- Name: subjects fk_rails_f1e22b77bf; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subjects
ADD CONSTRAINT fk_rails_f1e22b77bf FOREIGN KEY (upload_user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: subjects fk_rails_f26c409132; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subjects
ADD CONSTRAINT fk_rails_f26c409132 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- Name: subject_group_members fk_rails_f611f500c0; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.subject_group_members
ADD CONSTRAINT fk_rails_f611f500c0 FOREIGN KEY (subject_group_id) REFERENCES public.subject_groups(id);
--
-- Name: classification_subjects fk_rails_fc0cd14ebe; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.classification_subjects
ADD CONSTRAINT fk_rails_fc0cd14ebe FOREIGN KEY (subject_id) REFERENCES public.subjects(id);
--
-- Name: users fk_rails_fedc809cf8; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.users
ADD CONSTRAINT fk_rails_fedc809cf8 FOREIGN KEY (project_id) REFERENCES public.projects(id) ON UPDATE CASCADE ON DELETE RESTRICT;
--
-- PostgreSQL database dump complete
--
SET search_path TO "$user", public;
INSERT INTO schema_migrations (version) VALUES ('20150210025312');
INSERT INTO schema_migrations (version) VALUES ('20150216192914');
INSERT INTO schema_migrations (version) VALUES ('20150216192936');
INSERT INTO schema_migrations (version) VALUES ('20150220000430');
INSERT INTO schema_migrations (version) VALUES ('20150223194424');
INSERT INTO schema_migrations (version) VALUES ('20150223200017');
INSERT INTO schema_migrations (version) VALUES ('20150224161921');
INSERT INTO schema_migrations (version) VALUES ('20150224211450');
INSERT INTO schema_migrations (version) VALUES ('20150224223657');
INSERT INTO schema_migrations (version) VALUES ('20150225181828');
INSERT INTO schema_migrations (version) VALUES ('20150227223423');
INSERT INTO schema_migrations (version) VALUES ('20150309171224');
INSERT INTO schema_migrations (version) VALUES ('20150317180911');
INSERT INTO schema_migrations (version) VALUES ('20150318132024');
INSERT INTO schema_migrations (version) VALUES ('20150318174012');
INSERT INTO schema_migrations (version) VALUES ('20150318221605');
INSERT INTO schema_migrations (version) VALUES ('20150327184058');
INSERT INTO schema_migrations (version) VALUES ('20150406095027');
INSERT INTO schema_migrations (version) VALUES ('20150409130306');
INSERT INTO schema_migrations (version) VALUES ('20150421161901');
INSERT INTO schema_migrations (version) VALUES ('20150421191603');
INSERT INTO schema_migrations (version) VALUES ('20150427171257');
INSERT INTO schema_migrations (version) VALUES ('20150427181152');
INSERT INTO schema_migrations (version) VALUES ('20150427204917');
INSERT INTO schema_migrations (version) VALUES ('20150429163442');
INSERT INTO schema_migrations (version) VALUES ('20150430084746');
INSERT INTO schema_migrations (version) VALUES ('20150430132128');
INSERT INTO schema_migrations (version) VALUES ('20150501162020');
INSERT INTO schema_migrations (version) VALUES ('20150504171133');
INSERT INTO schema_migrations (version) VALUES ('20150504185433');
INSERT INTO schema_migrations (version) VALUES ('20150504193426');
INSERT INTO schema_migrations (version) VALUES ('20150505181642');
INSERT INTO schema_migrations (version) VALUES ('20150506195759');
INSERT INTO schema_migrations (version) VALUES ('20150506195817');
INSERT INTO schema_migrations (version) VALUES ('20150507120651');
INSERT INTO schema_migrations (version) VALUES ('20150507212315');
INSERT INTO schema_migrations (version) VALUES ('20150511151058');
INSERT INTO schema_migrations (version) VALUES ('20150512012101');
INSERT INTO schema_migrations (version) VALUES ('20150512123559');
INSERT INTO schema_migrations (version) VALUES ('20150512223346');
INSERT INTO schema_migrations (version) VALUES ('20150517015229');
INSERT INTO schema_migrations (version) VALUES ('20150521160726');
INSERT INTO schema_migrations (version) VALUES ('20150522155815');
INSERT INTO schema_migrations (version) VALUES ('20150523190207');
INSERT INTO schema_migrations (version) VALUES ('20150526180444');
INSERT INTO schema_migrations (version) VALUES ('20150527200052');
INSERT INTO schema_migrations (version) VALUES ('20150527223732');
INSERT INTO schema_migrations (version) VALUES ('20150602140836');
INSERT INTO schema_migrations (version) VALUES ('20150602160633');
INSERT INTO schema_migrations (version) VALUES ('20150604214129');
INSERT INTO schema_migrations (version) VALUES ('20150605103339');
INSERT INTO schema_migrations (version) VALUES ('20150610200133');
INSERT INTO schema_migrations (version) VALUES ('20150615153138');
INSERT INTO schema_migrations (version) VALUES ('20150616113453');
INSERT INTO schema_migrations (version) VALUES ('20150616113526');
INSERT INTO schema_migrations (version) VALUES ('20150616113559');
INSERT INTO schema_migrations (version) VALUES ('20150616155130');
INSERT INTO schema_migrations (version) VALUES ('20150622085848');
INSERT INTO schema_migrations (version) VALUES ('20150624131746');
INSERT INTO schema_migrations (version) VALUES ('20150624135643');
INSERT INTO schema_migrations (version) VALUES ('20150624155122');
INSERT INTO schema_migrations (version) VALUES ('20150625043821');
INSERT INTO schema_migrations (version) VALUES ('20150625045214');
INSERT INTO schema_migrations (version) VALUES ('20150625160224');
INSERT INTO schema_migrations (version) VALUES ('20150629192248');
INSERT INTO schema_migrations (version) VALUES ('20150630144332');
INSERT INTO schema_migrations (version) VALUES ('20150706100343');
INSERT INTO schema_migrations (version) VALUES ('20150706133624');
INSERT INTO schema_migrations (version) VALUES ('20150706185722');
INSERT INTO schema_migrations (version) VALUES ('20150709191011');
INSERT INTO schema_migrations (version) VALUES ('20150710184447');
INSERT INTO schema_migrations (version) VALUES ('20150715134211');
INSERT INTO schema_migrations (version) VALUES ('20150716161318');
INSERT INTO schema_migrations (version) VALUES ('20150717123631');
INSERT INTO schema_migrations (version) VALUES ('20150721221349');
INSERT INTO schema_migrations (version) VALUES ('20150722180408');
INSERT INTO schema_migrations (version) VALUES ('20150727212724');
INSERT INTO schema_migrations (version) VALUES ('20150729165415');
INSERT INTO schema_migrations (version) VALUES ('20150730160541');
INSERT INTO schema_migrations (version) VALUES ('20150811202500');
INSERT INTO schema_migrations (version) VALUES ('20150817145756');
INSERT INTO schema_migrations (version) VALUES ('20150827124834');
INSERT INTO schema_migrations (version) VALUES ('20150901222924');
INSERT INTO schema_migrations (version) VALUES ('20150902000226');
INSERT INTO schema_migrations (version) VALUES ('20150908162042');
INSERT INTO schema_migrations (version) VALUES ('20150908193654');
INSERT INTO schema_migrations (version) VALUES ('20150916161203');
INSERT INTO schema_migrations (version) VALUES ('20150916162320');
INSERT INTO schema_migrations (version) VALUES ('20150921130111');
INSERT INTO schema_migrations (version) VALUES ('20151005093746');
INSERT INTO schema_migrations (version) VALUES ('20151007161139');
INSERT INTO schema_migrations (version) VALUES ('20151007193849');
INSERT INTO schema_migrations (version) VALUES ('20151009145251');
INSERT INTO schema_migrations (version) VALUES ('20151012162248');
INSERT INTO schema_migrations (version) VALUES ('20151013181750');
INSERT INTO schema_migrations (version) VALUES ('20151023103228');
INSERT INTO schema_migrations (version) VALUES ('20151024080849');
INSERT INTO schema_migrations (version) VALUES ('20151026142554');
INSERT INTO schema_migrations (version) VALUES ('20151027134345');
INSERT INTO schema_migrations (version) VALUES ('20151106172531');
INSERT INTO schema_migrations (version) VALUES ('20151110101156');
INSERT INTO schema_migrations (version) VALUES ('20151110135415');
INSERT INTO schema_migrations (version) VALUES ('20151111154310');
INSERT INTO schema_migrations (version) VALUES ('20151116143407');
INSERT INTO schema_migrations (version) VALUES ('20151117154126');
INSERT INTO schema_migrations (version) VALUES ('20151120104454');
INSERT INTO schema_migrations (version) VALUES ('20151120161458');
INSERT INTO schema_migrations (version) VALUES ('20151125153712');
INSERT INTO schema_migrations (version) VALUES ('20151127150019');
INSERT INTO schema_migrations (version) VALUES ('20151201102135');
INSERT INTO schema_migrations (version) VALUES ('20151207111508');
INSERT INTO schema_migrations (version) VALUES ('20151207145728');
INSERT INTO schema_migrations (version) VALUES ('20151210134819');
INSERT INTO schema_migrations (version) VALUES ('20151231123306');
INSERT INTO schema_migrations (version) VALUES ('20160103142817');
INSERT INTO schema_migrations (version) VALUES ('20160104131622');
INSERT INTO schema_migrations (version) VALUES ('20160106120927');
INSERT INTO schema_migrations (version) VALUES ('20160107143209');
INSERT INTO schema_migrations (version) VALUES ('20160111112417');
INSERT INTO schema_migrations (version) VALUES ('20160113120732');
INSERT INTO schema_migrations (version) VALUES ('20160113132540');
INSERT INTO schema_migrations (version) VALUES ('20160113133848');
INSERT INTO schema_migrations (version) VALUES ('20160113143609');
INSERT INTO schema_migrations (version) VALUES ('20160114135531');
INSERT INTO schema_migrations (version) VALUES ('20160114141909');
INSERT INTO schema_migrations (version) VALUES ('20160202155708');
INSERT INTO schema_migrations (version) VALUES ('20160303163658');
INSERT INTO schema_migrations (version) VALUES ('20160323101942');
INSERT INTO schema_migrations (version) VALUES ('20160329144922');
INSERT INTO schema_migrations (version) VALUES ('20160330142609');
INSERT INTO schema_migrations (version) VALUES ('20160406151657');
INSERT INTO schema_migrations (version) VALUES ('20160408104326');
INSERT INTO schema_migrations (version) VALUES ('20160412125332');
INSERT INTO schema_migrations (version) VALUES ('20160414151041');
INSERT INTO schema_migrations (version) VALUES ('20160425190129');
INSERT INTO schema_migrations (version) VALUES ('20160427150421');
INSERT INTO schema_migrations (version) VALUES ('20160506182308');
INSERT INTO schema_migrations (version) VALUES ('20160512181921');
INSERT INTO schema_migrations (version) VALUES ('20160525103520');
INSERT INTO schema_migrations (version) VALUES ('20160527140046');
INSERT INTO schema_migrations (version) VALUES ('20160527162831');
INSERT INTO schema_migrations (version) VALUES ('20160601162035');
INSERT INTO schema_migrations (version) VALUES ('20160613074506');
INSERT INTO schema_migrations (version) VALUES ('20160613074514');
INSERT INTO schema_migrations (version) VALUES ('20160613074521');
INSERT INTO schema_migrations (version) VALUES ('20160613074534');
INSERT INTO schema_migrations (version) VALUES ('20160613074550');
INSERT INTO schema_migrations (version) VALUES ('20160613074559');
INSERT INTO schema_migrations (version) VALUES ('20160613074613');
INSERT INTO schema_migrations (version) VALUES ('20160613074625');
INSERT INTO schema_migrations (version) VALUES ('20160613074633');
INSERT INTO schema_migrations (version) VALUES ('20160613074640');
INSERT INTO schema_migrations (version) VALUES ('20160613074658');
INSERT INTO schema_migrations (version) VALUES ('20160613074711');
INSERT INTO schema_migrations (version) VALUES ('20160613074718');
INSERT INTO schema_migrations (version) VALUES ('20160613074730');
INSERT INTO schema_migrations (version) VALUES ('20160613074745');
INSERT INTO schema_migrations (version) VALUES ('20160613074746');
INSERT INTO schema_migrations (version) VALUES ('20160613074754');
INSERT INTO schema_migrations (version) VALUES ('20160613074924');
INSERT INTO schema_migrations (version) VALUES ('20160613074934');
INSERT INTO schema_migrations (version) VALUES ('20160613075003');
INSERT INTO schema_migrations (version) VALUES ('20160628165038');
INSERT INTO schema_migrations (version) VALUES ('20160630150419');
INSERT INTO schema_migrations (version) VALUES ('20160630170502');
INSERT INTO schema_migrations (version) VALUES ('20160810140805');
INSERT INTO schema_migrations (version) VALUES ('20160810195152');
INSERT INTO schema_migrations (version) VALUES ('20160819134413');
INSERT INTO schema_migrations (version) VALUES ('20160824101413');
INSERT INTO schema_migrations (version) VALUES ('20160901100944');
INSERT INTO schema_migrations (version) VALUES ('20160901141903');
INSERT INTO schema_migrations (version) VALUES ('20161017135917');
INSERT INTO schema_migrations (version) VALUES ('20161017141439');
INSERT INTO schema_migrations (version) VALUES ('20161125123824');
INSERT INTO schema_migrations (version) VALUES ('20161128193435');
INSERT INTO schema_migrations (version) VALUES ('20161205203956');
INSERT INTO schema_migrations (version) VALUES ('20161207111319');
INSERT INTO schema_migrations (version) VALUES ('20161212205412');
INSERT INTO schema_migrations (version) VALUES ('20161221203241');
INSERT INTO schema_migrations (version) VALUES ('20170112163747');
INSERT INTO schema_migrations (version) VALUES ('20170113113532');
INSERT INTO schema_migrations (version) VALUES ('20170116134142');
INSERT INTO schema_migrations (version) VALUES ('20170118141452');
INSERT INTO schema_migrations (version) VALUES ('20170202200131');
INSERT INTO schema_migrations (version) VALUES ('20170202202724');
INSERT INTO schema_migrations (version) VALUES ('20170206161946');
INSERT INTO schema_migrations (version) VALUES ('20170210163241');
INSERT INTO schema_migrations (version) VALUES ('20170215105309');
INSERT INTO schema_migrations (version) VALUES ('20170215151802');
INSERT INTO schema_migrations (version) VALUES ('20170310131642');
INSERT INTO schema_migrations (version) VALUES ('20170316170501');
INSERT INTO schema_migrations (version) VALUES ('20170320203350');
INSERT INTO schema_migrations (version) VALUES ('20170325135953');
INSERT INTO schema_migrations (version) VALUES ('20170403194826');
INSERT INTO schema_migrations (version) VALUES ('20170420095703');
INSERT INTO schema_migrations (version) VALUES ('20170425110939');
INSERT INTO schema_migrations (version) VALUES ('20170426162708');
INSERT INTO schema_migrations (version) VALUES ('20170519181110');
INSERT INTO schema_migrations (version) VALUES ('20170523135118');
INSERT INTO schema_migrations (version) VALUES ('20170524205300');
INSERT INTO schema_migrations (version) VALUES ('20170524210302');
INSERT INTO schema_migrations (version) VALUES ('20170525151142');
INSERT INTO schema_migrations (version) VALUES ('20170727142122');
INSERT INTO schema_migrations (version) VALUES ('20170808130619');
INSERT INTO schema_migrations (version) VALUES ('20170824165411');
INSERT INTO schema_migrations (version) VALUES ('20171019115705');
INSERT INTO schema_migrations (version) VALUES ('20171120222438');
INSERT INTO schema_migrations (version) VALUES ('20171121120455');
INSERT INTO schema_migrations (version) VALUES ('20171208141841');
INSERT INTO schema_migrations (version) VALUES ('20171208142645');
INSERT INTO schema_migrations (version) VALUES ('20171213144807');
INSERT INTO schema_migrations (version) VALUES ('20171214121332');
INSERT INTO schema_migrations (version) VALUES ('20180110133833');
INSERT INTO schema_migrations (version) VALUES ('20180115214144');
INSERT INTO schema_migrations (version) VALUES ('20180119110708');
INSERT INTO schema_migrations (version) VALUES ('20180122134607');
INSERT INTO schema_migrations (version) VALUES ('20180207120238');
INSERT INTO schema_migrations (version) VALUES ('20180403150901');
INSERT INTO schema_migrations (version) VALUES ('20180404144354');
INSERT INTO schema_migrations (version) VALUES ('20180404144531');
INSERT INTO schema_migrations (version) VALUES ('20180510100328');
INSERT INTO schema_migrations (version) VALUES ('20180510121206');
INSERT INTO schema_migrations (version) VALUES ('20180614131933');
INSERT INTO schema_migrations (version) VALUES ('20180710151618');
INSERT INTO schema_migrations (version) VALUES ('20180724112620');
INSERT INTO schema_migrations (version) VALUES ('20180726133210');
INSERT INTO schema_migrations (version) VALUES ('20180730133806');
INSERT INTO schema_migrations (version) VALUES ('20180730150333');
INSERT INTO schema_migrations (version) VALUES ('20180808140938');
INSERT INTO schema_migrations (version) VALUES ('20180821125430');
INSERT INTO schema_migrations (version) VALUES ('20180821151555');
INSERT INTO schema_migrations (version) VALUES ('20181001154345');
INSERT INTO schema_migrations (version) VALUES ('20181002145749');
INSERT INTO schema_migrations (version) VALUES ('20181015112421');
INSERT INTO schema_migrations (version) VALUES ('20181022172507');
INSERT INTO schema_migrations (version) VALUES ('20181023130028');
INSERT INTO schema_migrations (version) VALUES ('20181203164038');
INSERT INTO schema_migrations (version) VALUES ('20190220114950');
INSERT INTO schema_migrations (version) VALUES ('20190220155414');
INSERT INTO schema_migrations (version) VALUES ('20190220161628');
INSERT INTO schema_migrations (version) VALUES ('20190222121420');
INSERT INTO schema_migrations (version) VALUES ('20190307114830');
INSERT INTO schema_migrations (version) VALUES ('20190307121801');
INSERT INTO schema_migrations (version) VALUES ('20190307141138');
INSERT INTO schema_migrations (version) VALUES ('20190411125709');
INSERT INTO schema_migrations (version) VALUES ('20190507103007');
INSERT INTO schema_migrations (version) VALUES ('20190524111214');
INSERT INTO schema_migrations (version) VALUES ('20190624094308');
INSERT INTO schema_migrations (version) VALUES ('20200513124310');
INSERT INTO schema_migrations (version) VALUES ('20200714191914');
INSERT INTO schema_migrations (version) VALUES ('20200716170833');
INSERT INTO schema_migrations (version) VALUES ('20200717155424');
INSERT INTO schema_migrations (version) VALUES ('20200720125246');
INSERT INTO schema_migrations (version) VALUES ('20201113151433');
INSERT INTO schema_migrations (version) VALUES ('20210226173243');
INSERT INTO schema_migrations (version) VALUES ('20210602210437');
INSERT INTO schema_migrations (version) VALUES ('20210729152047');
INSERT INTO schema_migrations (version) VALUES ('20211007125705');
INSERT INTO schema_migrations (version) VALUES ('20211124175756');
INSERT INTO schema_migrations (version) VALUES ('20211201164326'); | the_stack |
-- 2021-09-23T16:43:29.839Z
-- URL zum Konzept
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsFormatExcelFile,IsNotifyUserAfterExecution,IsOneInstanceOnly,IsReport,IsTranslateExcelHeaders,IsUseBPartnerLanguage,LockWaitTimeout,Name,PostgrestResponseFormat,RefreshAllAfterExecution,ShowHelp,SpreadsheetFormat,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,584911,'Y','de.metas.contracts.flatrate.process.C_Flatrate_Term_Change_For_FlatrateData','N',TO_TIMESTAMP('2021-09-23 19:43:28','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','Y','N','N','N','Y','Y',0,'Vertrag Kündigen','json','N','N','xls','Java',TO_TIMESTAMP('2021-09-23 19:43:28','YYYY-MM-DD HH24:MI:SS'),100,'C_Flatrate_Term_Change_For_FlatrateData')
;
-- 2021-09-23T16:43:29.930Z
-- URL zum Konzept
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,IsActive) SELECT l.AD_Language, t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,'Y' FROM AD_Language l, AD_Process t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_ID=584911 AND NOT EXISTS (SELECT 1 FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 2021-09-23T16:44:37.382Z
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,540081,0,584911,542101,15,'EventDate',TO_TIMESTAMP('2021-09-23 19:44:36','YYYY-MM-DD HH24:MI:SS'),100,'@EndDate@','D',0,'Y','N','Y','N','Y','N','Wechsel-Datum',5,TO_TIMESTAMP('2021-09-23 19:44:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-23T16:44:37.458Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,IsActive) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,'Y' FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_Para_ID=542101 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2021-09-23T16:44:37.616Z
-- URL zum Konzept
DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 542101
;
-- 2021-09-23T16:44:37.689Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Process_Para_ID, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated) SELECT 542101, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 540002
;
-- 2021-09-23T16:44:38.323Z
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Reference_Value_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,152,0,584911,542102,17,540361,'Action',TO_TIMESTAMP('2021-09-23 19:44:37','YYYY-MM-DD HH24:MI:SS'),100,'CA','','D',2,'','Y','N','Y','N','Y','N','Aktion',7,TO_TIMESTAMP('2021-09-23 19:44:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-23T16:44:38.401Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,IsActive) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,'Y' FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_Para_ID=542102 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2021-09-23T16:44:38.555Z
-- URL zum Konzept
DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 542102
;
-- 2021-09-23T16:44:38.632Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Process_Para_ID, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated) SELECT 542102, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 540008
;
-- 2021-09-23T16:44:39.255Z
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,543838,0,584911,542103,20,'IsCreditOpenInvoices',TO_TIMESTAMP('2021-09-23 19:44:38','YYYY-MM-DD HH24:MI:SS'),100,'N','D',0,'Y','N','Y','N','N','N','Offene rechnungen gutschreiben',8,TO_TIMESTAMP('2021-09-23 19:44:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-23T16:44:39.301Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,IsActive) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,'Y' FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_Para_ID=542103 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2021-09-23T16:44:39.457Z
-- URL zum Konzept
DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 542103
;
-- 2021-09-23T16:44:39.535Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Process_Para_ID, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated) SELECT 542103, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 541262
;
-- 2021-09-23T16:44:40.188Z
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Reference_Value_ID,ColumnName,Created,CreatedBy,DefaultValue,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,543465,0,584911,542104,17,540761,'TerminationReason',TO_TIMESTAMP('2021-09-23 19:44:39','YYYY-MM-DD HH24:MI:SS'),100,'','D',2000,'Y','N','Y','N','N','N','Termination Reason',9,TO_TIMESTAMP('2021-09-23 19:44:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-23T16:44:40.265Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,IsActive) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,'Y' FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_Para_ID=542104 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2021-09-23T16:44:40.422Z
-- URL zum Konzept
DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 542104
;
-- 2021-09-23T16:44:40.500Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Process_Para_ID, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated) SELECT 542104, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 541232
;
-- 2021-09-23T16:44:41.133Z
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,543466,0,584911,542105,14,'TerminationMemo',TO_TIMESTAMP('2021-09-23 19:44:40','YYYY-MM-DD HH24:MI:SS'),100,'D',2000,'Y','N','Y','N','N','N','Termination Memo',10,TO_TIMESTAMP('2021-09-23 19:44:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-09-23T16:44:41.194Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,IsActive) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,'Y' FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_Para_ID=542105 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2021-09-23T16:44:41.362Z
-- URL zum Konzept
DELETE FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 542105
;
-- 2021-09-23T16:44:41.441Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Process_Para_ID, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated) SELECT 542105, AD_Language, AD_Client_ID, AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy, Name, Description, Help, IsTranslated FROM AD_Process_Para_Trl WHERE AD_Process_Para_ID = 541229
;
-- 2021-09-23T16:46:08.931Z
-- URL zum Konzept
INSERT INTO AD_Table_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Table_ID,AD_Table_Process_ID,Created,CreatedBy,EntityType,IsActive,Updated,UpdatedBy,WEBUI_DocumentAction,WEBUI_IncludedTabTopAction,WEBUI_ViewAction,WEBUI_ViewQuickAction,WEBUI_ViewQuickAction_Default) VALUES (0,0,584911,540310,541001,TO_TIMESTAMP('2021-09-23 19:46:08','YYYY-MM-DD HH24:MI:SS'),100,'D','Y',TO_TIMESTAMP('2021-09-23 19:46:08','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','N','N')
;
-- 2021-09-29T15:18:33.496Z
-- URL zum Konzept
UPDATE AD_Process_Para SET DefaultValue='',Updated=TO_TIMESTAMP('2021-09-29 18:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=542101
; | the_stack |
------------------
-- FIXEDDECIMAL --
------------------
CREATE TYPE FIXEDDECIMAL;
CREATE FUNCTION fixeddecimalin(cstring, oid, int4)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalin'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalout(fixeddecimal)
RETURNS cstring
AS 'babelfishpg_money', 'fixeddecimalout'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalrecv(internal)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalrecv'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalsend(FIXEDDECIMAL)
RETURNS bytea
AS 'babelfishpg_money', 'fixeddecimalsend'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimaltypmodin(_cstring)
RETURNS INT4
AS 'babelfishpg_money', 'fixeddecimaltypmodin'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimaltypmodout(INT4)
RETURNS cstring
AS 'babelfishpg_money', 'fixeddecimaltypmodout'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE TYPE FIXEDDECIMAL (
INPUT = fixeddecimalin,
OUTPUT = fixeddecimalout,
RECEIVE = fixeddecimalrecv,
SEND = fixeddecimalsend,
TYPMOD_IN = fixeddecimaltypmodin,
TYPMOD_OUT = fixeddecimaltypmodout,
INTERNALLENGTH = 8,
ALIGNMENT = 'double',
STORAGE = plain,
CATEGORY = 'N',
PREFERRED = true,
COLLATABLE = false,
PASSEDBYVALUE -- But not always.. XXX fix that.
);
-- FIXEDDECIMAL, NUMERIC
CREATE FUNCTION fixeddecimaleq(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimaleq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalne(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimalne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimallt(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimallt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalle(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimalle'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalgt(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimalgt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalge(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimalge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalum(FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalum'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalpl(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalpl'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalmi(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalmi'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalmul(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalmul'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimaldiv(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimaldiv'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION abs(FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalabs'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimallarger(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimallarger'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalsmaller(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalsmaller'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_cmp(FIXEDDECIMAL, FIXEDDECIMAL)
RETURNS INT4
AS 'babelfishpg_money', 'fixeddecimal_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_hash(FIXEDDECIMAL)
RETURNS INT4
AS 'babelfishpg_money', 'fixeddecimal_hash'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
--
-- Operators.
--
-- FIXEDDECIMAL op FIXEDDECIMAL
CREATE OPERATOR = (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = fixeddecimaleq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = fixeddecimalne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = fixeddecimallt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = fixeddecimalle,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = fixeddecimalge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = fixeddecimalgt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR + (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = +,
PROCEDURE = fixeddecimalpl
);
CREATE OPERATOR - (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
PROCEDURE = fixeddecimalmi
);
CREATE OPERATOR - (
RIGHTARG = FIXEDDECIMAL,
PROCEDURE = fixeddecimalum
);
CREATE OPERATOR * (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = *,
PROCEDURE = fixeddecimalmul
);
CREATE OPERATOR / (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = FIXEDDECIMAL,
PROCEDURE = fixeddecimaldiv
);
CREATE OPERATOR CLASS fixeddecimal_ops
DEFAULT FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (FIXEDDECIMAL, FIXEDDECIMAL),
OPERATOR 2 <= (FIXEDDECIMAL, FIXEDDECIMAL),
OPERATOR 3 = (FIXEDDECIMAL, FIXEDDECIMAL),
OPERATOR 4 >= (FIXEDDECIMAL, FIXEDDECIMAL),
OPERATOR 5 > (FIXEDDECIMAL, FIXEDDECIMAL),
FUNCTION 1 fixeddecimal_cmp(FIXEDDECIMAL, FIXEDDECIMAL);
CREATE OPERATOR CLASS fixeddecimal_ops
DEFAULT FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (FIXEDDECIMAL, FIXEDDECIMAL),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
-- FIXEDDECIMAL, NUMERIC
CREATE FUNCTION fixeddecimal_numeric_cmp(FIXEDDECIMAL, NUMERIC)
RETURNS INT4
AS 'babelfishpg_money', 'fixeddecimal_numeric_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION numeric_fixeddecimal_cmp(NUMERIC, FIXEDDECIMAL)
RETURNS INT4
AS 'babelfishpg_money', 'numeric_fixeddecimal_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_numeric_eq(FIXEDDECIMAL, NUMERIC)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_numeric_eq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_numeric_ne(FIXEDDECIMAL, NUMERIC)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_numeric_ne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_numeric_lt(FIXEDDECIMAL, NUMERIC)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_numeric_lt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_numeric_le(FIXEDDECIMAL, NUMERIC)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_numeric_le'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_numeric_gt(FIXEDDECIMAL, NUMERIC)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_numeric_gt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_numeric_ge(FIXEDDECIMAL, NUMERIC)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_numeric_ge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE OPERATOR = (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = NUMERIC,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = fixeddecimal_numeric_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = NUMERIC,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = fixeddecimal_numeric_ne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = NUMERIC,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = fixeddecimal_numeric_lt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = NUMERIC,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = fixeddecimal_numeric_le,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = NUMERIC,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = fixeddecimal_numeric_ge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = NUMERIC,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = fixeddecimal_numeric_gt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR CLASS fixeddecimal_numeric_ops
FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (FIXEDDECIMAL, NUMERIC),
OPERATOR 2 <= (FIXEDDECIMAL, NUMERIC),
OPERATOR 3 = (FIXEDDECIMAL, NUMERIC),
OPERATOR 4 >= (FIXEDDECIMAL, NUMERIC),
OPERATOR 5 > (FIXEDDECIMAL, NUMERIC),
FUNCTION 1 fixeddecimal_numeric_cmp(FIXEDDECIMAL, NUMERIC);
CREATE OPERATOR CLASS fixeddecimal_numeric_ops
FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (FIXEDDECIMAL, NUMERIC),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
-- NUMERIC, FIXEDDECIMAL
CREATE FUNCTION numeric_fixeddecimal_eq(NUMERIC, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'numeric_fixeddecimal_eq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION numeric_fixeddecimal_ne(NUMERIC, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'numeric_fixeddecimal_ne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION numeric_fixeddecimal_lt(NUMERIC, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'numeric_fixeddecimal_lt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION numeric_fixeddecimal_le(NUMERIC, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'numeric_fixeddecimal_le'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION numeric_fixeddecimal_gt(NUMERIC, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'numeric_fixeddecimal_gt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION numeric_fixeddecimal_ge(NUMERIC, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'numeric_fixeddecimal_ge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE OPERATOR = (
LEFTARG = NUMERIC,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = numeric_fixeddecimal_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = NUMERIC,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = numeric_fixeddecimal_ne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = NUMERIC,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = numeric_fixeddecimal_lt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = NUMERIC,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = numeric_fixeddecimal_le,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = NUMERIC,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = numeric_fixeddecimal_ge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = NUMERIC,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = numeric_fixeddecimal_gt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR CLASS numeric_fixeddecimal_ops
FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (NUMERIC, FIXEDDECIMAL) FOR SEARCH,
OPERATOR 2 <= (NUMERIC, FIXEDDECIMAL) FOR SEARCH,
OPERATOR 3 = (NUMERIC, FIXEDDECIMAL) FOR SEARCH,
OPERATOR 4 >= (NUMERIC, FIXEDDECIMAL) FOR SEARCH,
OPERATOR 5 > (NUMERIC, FIXEDDECIMAL) FOR SEARCH,
FUNCTION 1 numeric_fixeddecimal_cmp(NUMERIC, FIXEDDECIMAL);
CREATE OPERATOR CLASS numeric_fixeddecimal_ops
FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (NUMERIC, FIXEDDECIMAL),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
--
-- Cross type operators with int8
--
-- FIXEDDECIMAL, INT8
CREATE FUNCTION fixeddecimal_int8_cmp(FIXEDDECIMAL, INT8)
RETURNS INT4
AS 'babelfishpg_money', 'fixeddecimal_int8_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int8_eq(FIXEDDECIMAL, INT8)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int8_eq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int8_ne(FIXEDDECIMAL, INT8)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int8_ne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int8_lt(FIXEDDECIMAL, INT8)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int8_lt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int8_le(FIXEDDECIMAL, INT8)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int8_le'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int8_gt(FIXEDDECIMAL, INT8)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int8_gt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int8_ge(FIXEDDECIMAL, INT8)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int8_ge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE OPERATOR = (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT8,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = fixeddecimal_int8_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT8,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = fixeddecimal_int8_ne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT8,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = fixeddecimal_int8_lt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT8,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = fixeddecimal_int8_le,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT8,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = fixeddecimal_int8_ge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT8,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = fixeddecimal_int8_gt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR CLASS fixeddecimal_int8_ops
FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (FIXEDDECIMAL, INT8),
OPERATOR 2 <= (FIXEDDECIMAL, INT8),
OPERATOR 3 = (FIXEDDECIMAL, INT8),
OPERATOR 4 >= (FIXEDDECIMAL, INT8),
OPERATOR 5 > (FIXEDDECIMAL, INT8),
FUNCTION 1 fixeddecimal_int8_cmp(FIXEDDECIMAL, INT8);
CREATE OPERATOR CLASS fixeddecimal_int8_ops
FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (FIXEDDECIMAL, INT8),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
-- INT8, FIXEDDECIMAL
CREATE FUNCTION int8_fixeddecimal_cmp(INT8, FIXEDDECIMAL)
RETURNS INT4
AS 'babelfishpg_money', 'int8_fixeddecimal_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int8_fixeddecimal_eq(INT8, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int8_fixeddecimal_eq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int8_fixeddecimal_ne(INT8, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int8_fixeddecimal_ne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int8_fixeddecimal_lt(INT8, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int8_fixeddecimal_lt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int8_fixeddecimal_le(INT8, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int8_fixeddecimal_le'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int8_fixeddecimal_gt(INT8, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int8_fixeddecimal_gt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int8_fixeddecimal_ge(INT8, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int8_fixeddecimal_ge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE OPERATOR = (
LEFTARG = INT8,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = int8_fixeddecimal_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = INT8,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = int8_fixeddecimal_ne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = INT8,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = int8_fixeddecimal_lt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = INT8,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = int8_fixeddecimal_le,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = INT8,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = int8_fixeddecimal_ge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = INT8,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = int8_fixeddecimal_gt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR CLASS int8_fixeddecimal_ops
FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (INT8, FIXEDDECIMAL),
OPERATOR 2 <= (INT8, FIXEDDECIMAL),
OPERATOR 3 = (INT8, FIXEDDECIMAL),
OPERATOR 4 >= (INT8, FIXEDDECIMAL),
OPERATOR 5 > (INT8, FIXEDDECIMAL),
FUNCTION 1 int8_fixeddecimal_cmp(INT8, FIXEDDECIMAL);
CREATE OPERATOR CLASS int8_fixeddecimal_ops
FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (INT8, FIXEDDECIMAL),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
--
-- Cross type operators with int4
--
-- FIXEDDECIMAL, INT4
CREATE FUNCTION fixeddecimal_int4_cmp(FIXEDDECIMAL, INT4)
RETURNS INT4
AS 'babelfishpg_money', 'fixeddecimal_int4_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int4_eq(FIXEDDECIMAL, INT4)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int4_eq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int4_ne(FIXEDDECIMAL, INT4)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int4_ne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int4_lt(FIXEDDECIMAL, INT4)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int4_lt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int4_le(FIXEDDECIMAL, INT4)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int4_le'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int4_gt(FIXEDDECIMAL, INT4)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int4_gt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int4_ge(FIXEDDECIMAL, INT4)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int4_ge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint4pl(FIXEDDECIMAL, INT4)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalint4pl'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint4mi(FIXEDDECIMAL, INT4)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalint4mi'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint4mul(FIXEDDECIMAL, INT4)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalint4mul'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint4div(FIXEDDECIMAL, INT4)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalint4div'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE OPERATOR = (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = fixeddecimal_int4_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = fixeddecimal_int4_ne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = fixeddecimal_int4_lt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = fixeddecimal_int4_le,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = fixeddecimal_int4_ge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = fixeddecimal_int4_gt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR + (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
COMMUTATOR = +,
PROCEDURE = fixeddecimalint4pl
);
CREATE OPERATOR - (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
PROCEDURE = fixeddecimalint4mi
);
CREATE OPERATOR * (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
COMMUTATOR = *,
PROCEDURE = fixeddecimalint4mul
);
CREATE OPERATOR / (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT4,
PROCEDURE = fixeddecimalint4div
);
CREATE OPERATOR CLASS fixeddecimal_int4_ops
FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (FIXEDDECIMAL, INT4),
OPERATOR 2 <= (FIXEDDECIMAL, INT4),
OPERATOR 3 = (FIXEDDECIMAL, INT4),
OPERATOR 4 >= (FIXEDDECIMAL, INT4),
OPERATOR 5 > (FIXEDDECIMAL, INT4),
FUNCTION 1 fixeddecimal_int4_cmp(FIXEDDECIMAL, INT4);
CREATE OPERATOR CLASS fixeddecimal_int4_ops
FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (FIXEDDECIMAL, INT4),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
-- INT4, FIXEDDECIMAL
CREATE FUNCTION int4_fixeddecimal_cmp(INT4, FIXEDDECIMAL)
RETURNS INT4
AS 'babelfishpg_money', 'int4_fixeddecimal_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4_fixeddecimal_eq(INT4, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int4_fixeddecimal_eq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4_fixeddecimal_ne(INT4, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int4_fixeddecimal_ne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4_fixeddecimal_lt(INT4, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int4_fixeddecimal_lt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4_fixeddecimal_le(INT4, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int4_fixeddecimal_le'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4_fixeddecimal_gt(INT4, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int4_fixeddecimal_gt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4_fixeddecimal_ge(INT4, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int4_fixeddecimal_ge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4fixeddecimalpl(INT4, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'int4fixeddecimalpl'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4fixeddecimalmi(INT4, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'int4fixeddecimalmi'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4fixeddecimalmul(INT4, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'int4fixeddecimalmul'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4fixeddecimaldiv(INT4, FIXEDDECIMAL)
RETURNS DOUBLE PRECISION
AS 'babelfishpg_money', 'int4fixeddecimaldiv'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE OPERATOR = (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = int4_fixeddecimal_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = int4_fixeddecimal_ne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = int4_fixeddecimal_lt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = int4_fixeddecimal_le,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = int4_fixeddecimal_ge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = int4_fixeddecimal_gt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR + (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = +,
PROCEDURE = int4fixeddecimalpl
);
CREATE OPERATOR - (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
PROCEDURE = int4fixeddecimalmi
);
CREATE OPERATOR * (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = *,
PROCEDURE = int4fixeddecimalmul
);
CREATE OPERATOR / (
LEFTARG = INT4,
RIGHTARG = FIXEDDECIMAL,
PROCEDURE = int4fixeddecimaldiv
);
CREATE OPERATOR CLASS int4_fixeddecimal_ops
FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (INT4, FIXEDDECIMAL),
OPERATOR 2 <= (INT4, FIXEDDECIMAL),
OPERATOR 3 = (INT4, FIXEDDECIMAL),
OPERATOR 4 >= (INT4, FIXEDDECIMAL),
OPERATOR 5 > (INT4, FIXEDDECIMAL),
FUNCTION 1 int4_fixeddecimal_cmp(INT4, FIXEDDECIMAL);
CREATE OPERATOR CLASS int4_fixeddecimal_ops
FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (INT4, FIXEDDECIMAL),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
--
-- Cross type operators with int2
--
-- FIXEDDECIMAL, INT2
CREATE FUNCTION fixeddecimal_int2_cmp(FIXEDDECIMAL, INT2)
RETURNS INT4
AS 'babelfishpg_money', 'fixeddecimal_int2_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int2_eq(FIXEDDECIMAL, INT2)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int2_eq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int2_ne(FIXEDDECIMAL, INT2)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int2_ne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int2_lt(FIXEDDECIMAL, INT2)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int2_lt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int2_le(FIXEDDECIMAL, INT2)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int2_le'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int2_gt(FIXEDDECIMAL, INT2)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int2_gt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_int2_ge(FIXEDDECIMAL, INT2)
RETURNS bool
AS 'babelfishpg_money', 'fixeddecimal_int2_ge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint2pl(FIXEDDECIMAL, INT2)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalint2pl'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint2mi(FIXEDDECIMAL, INT2)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalint2mi'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint2mul(FIXEDDECIMAL, INT2)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalint2mul'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint2div(FIXEDDECIMAL, INT2)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimalint2div'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE OPERATOR = (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = fixeddecimal_int2_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = fixeddecimal_int2_ne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = fixeddecimal_int2_lt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = fixeddecimal_int2_le,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = fixeddecimal_int2_ge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = fixeddecimal_int2_gt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR + (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
COMMUTATOR = +,
PROCEDURE = fixeddecimalint2pl
);
CREATE OPERATOR - (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
PROCEDURE = fixeddecimalint2mi
);
CREATE OPERATOR * (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
COMMUTATOR = *,
PROCEDURE = fixeddecimalint2mul
);
CREATE OPERATOR / (
LEFTARG = FIXEDDECIMAL,
RIGHTARG = INT2,
PROCEDURE = fixeddecimalint2div
);
CREATE OPERATOR CLASS fixeddecimal_int2_ops
FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (FIXEDDECIMAL, INT2),
OPERATOR 2 <= (FIXEDDECIMAL, INT2),
OPERATOR 3 = (FIXEDDECIMAL, INT2),
OPERATOR 4 >= (FIXEDDECIMAL, INT2),
OPERATOR 5 > (FIXEDDECIMAL, INT2),
FUNCTION 1 fixeddecimal_int2_cmp(FIXEDDECIMAL, INT2);
CREATE OPERATOR CLASS fixeddecimal_int2_ops
FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (FIXEDDECIMAL, INT2),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
-- INT2, FIXEDDECIMAL
CREATE FUNCTION int2_fixeddecimal_cmp(INT2, FIXEDDECIMAL)
RETURNS INT4
AS 'babelfishpg_money', 'int2_fixeddecimal_cmp'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2_fixeddecimal_eq(INT2, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int2_fixeddecimal_eq'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2_fixeddecimal_ne(INT2, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int2_fixeddecimal_ne'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2_fixeddecimal_lt(INT2, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int2_fixeddecimal_lt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2_fixeddecimal_le(INT2, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int2_fixeddecimal_le'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2_fixeddecimal_gt(INT2, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int2_fixeddecimal_gt'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2_fixeddecimal_ge(INT2, FIXEDDECIMAL)
RETURNS bool
AS 'babelfishpg_money', 'int2_fixeddecimal_ge'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2fixeddecimalpl(INT2, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'int2fixeddecimalpl'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2fixeddecimalmi(INT2, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'int2fixeddecimalmi'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2fixeddecimalmul(INT2, FIXEDDECIMAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'int2fixeddecimalmul'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2fixeddecimaldiv(INT2, FIXEDDECIMAL)
RETURNS DOUBLE PRECISION
AS 'babelfishpg_money', 'int2fixeddecimaldiv'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE OPERATOR = (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = int2_fixeddecimal_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
MERGES
);
CREATE OPERATOR <> (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = =,
COMMUTATOR = <>,
PROCEDURE = int2_fixeddecimal_ne,
RESTRICT = neqsel,
JOIN = neqjoinsel
);
CREATE OPERATOR < (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >=,
COMMUTATOR = >,
PROCEDURE = int2_fixeddecimal_lt,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR <= (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = >,
COMMUTATOR = >=,
PROCEDURE = int2_fixeddecimal_le,
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel
);
CREATE OPERATOR >= (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <,
COMMUTATOR = <=,
PROCEDURE = int2_fixeddecimal_ge,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR > (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
NEGATOR = <=,
COMMUTATOR = <,
PROCEDURE = int2_fixeddecimal_gt,
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel
);
CREATE OPERATOR + (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = +,
PROCEDURE = int2fixeddecimalpl
);
CREATE OPERATOR - (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
PROCEDURE = int2fixeddecimalmi
);
CREATE OPERATOR * (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
COMMUTATOR = *,
PROCEDURE = int2fixeddecimalmul
);
CREATE OPERATOR / (
LEFTARG = INT2,
RIGHTARG = FIXEDDECIMAL,
PROCEDURE = int2fixeddecimaldiv
);
CREATE OPERATOR CLASS int2_fixeddecimal_ops
FOR TYPE FIXEDDECIMAL USING btree AS
OPERATOR 1 < (INT2, FIXEDDECIMAL),
OPERATOR 2 <= (INT2, FIXEDDECIMAL),
OPERATOR 3 = (INT2, FIXEDDECIMAL),
OPERATOR 4 >= (INT2, FIXEDDECIMAL),
OPERATOR 5 > (INT2, FIXEDDECIMAL),
FUNCTION 1 int2_fixeddecimal_cmp(INT2, FIXEDDECIMAL);
CREATE OPERATOR CLASS int2_fixeddecimal_ops
FOR TYPE FIXEDDECIMAL USING hash AS
OPERATOR 1 = (INT2, FIXEDDECIMAL),
FUNCTION 1 fixeddecimal_hash(FIXEDDECIMAL);
--
-- Casts
--
CREATE FUNCTION fixeddecimal(FIXEDDECIMAL, INT4)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'fixeddecimal'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int4fixeddecimal(INT4)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'int4fixeddecimal'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint4(FIXEDDECIMAL)
RETURNS INT4
AS 'babelfishpg_money', 'fixeddecimalint4'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION int2fixeddecimal(INT2)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'int2fixeddecimal'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimalint2(FIXEDDECIMAL)
RETURNS INT2
AS 'babelfishpg_money', 'fixeddecimalint2'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimaltod(FIXEDDECIMAL)
RETURNS DOUBLE PRECISION
AS 'babelfishpg_money', 'fixeddecimaltod'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION dtofixeddecimal(DOUBLE PRECISION)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'dtofixeddecimal'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimaltof(FIXEDDECIMAL)
RETURNS REAL
AS 'babelfishpg_money', 'fixeddecimaltof'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION ftofixeddecimal(REAL)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'ftofixeddecimal'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION fixeddecimal_numeric(FIXEDDECIMAL)
RETURNS NUMERIC
AS 'babelfishpg_money', 'fixeddecimal_numeric'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE FUNCTION numeric_fixeddecimal(NUMERIC)
RETURNS FIXEDDECIMAL
AS 'babelfishpg_money', 'numeric_fixeddecimal'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;
CREATE CAST (FIXEDDECIMAL AS FIXEDDECIMAL)
WITH FUNCTION fixeddecimal (FIXEDDECIMAL, INT4) AS ASSIGNMENT;
CREATE CAST (INT4 AS FIXEDDECIMAL)
WITH FUNCTION int4fixeddecimal (INT4) AS IMPLICIT;
CREATE CAST (FIXEDDECIMAL AS INT4)
WITH FUNCTION fixeddecimalint4 (FIXEDDECIMAL) AS ASSIGNMENT;
CREATE CAST (INT2 AS FIXEDDECIMAL)
WITH FUNCTION int2fixeddecimal (INT2) AS IMPLICIT;
CREATE CAST (FIXEDDECIMAL AS INT2)
WITH FUNCTION fixeddecimalint2 (FIXEDDECIMAL) AS ASSIGNMENT;
CREATE CAST (FIXEDDECIMAL AS DOUBLE PRECISION)
WITH FUNCTION fixeddecimaltod (FIXEDDECIMAL) AS IMPLICIT;
CREATE CAST (DOUBLE PRECISION AS FIXEDDECIMAL)
WITH FUNCTION dtofixeddecimal (DOUBLE PRECISION) AS ASSIGNMENT; -- XXX? or Implicit?
CREATE CAST (FIXEDDECIMAL AS REAL)
WITH FUNCTION fixeddecimaltof (FIXEDDECIMAL) AS IMPLICIT;
CREATE CAST (REAL AS FIXEDDECIMAL)
WITH FUNCTION ftofixeddecimal (REAL) AS ASSIGNMENT; -- XXX or Implicit?
CREATE CAST (FIXEDDECIMAL AS NUMERIC)
WITH FUNCTION fixeddecimal_numeric (FIXEDDECIMAL) AS IMPLICIT;
CREATE CAST (NUMERIC AS FIXEDDECIMAL)
WITH FUNCTION numeric_fixeddecimal (NUMERIC) AS ASSIGNMENT; | the_stack |
-- Your SQL goes here
CREATE OR REPLACE FUNCTION payment_service.chargedback_transition_at(payment payment_service.catalog_payments)
RETURNS timestamp without time zone
LANGUAGE sql
STABLE
AS $function$
select created_at from payment_service.payment_status_transitions
where catalog_payment_id = $1.id
and to_status = 'chargedback'::payment_service.payment_status
order by created_at desc limit 1;
$function$
;
CREATE OR REPLACE FUNCTION payment_service.refunded_transition_at(payment payment_service.catalog_payments)
RETURNS timestamp without time zone
LANGUAGE sql
STABLE
AS $function$
select created_at from payment_service.payment_status_transitions
where catalog_payment_id = $1.id
and to_status = 'refunded'::payment_service.payment_status
order by created_at desc limit 1;
$function$
;
CREATE OR REPLACE FUNCTION payment_service.refused_transition_at(payment payment_service.catalog_payments)
RETURNS timestamp without time zone
LANGUAGE sql
STABLE
AS $function$
select created_at from payment_service.payment_status_transitions
where catalog_payment_id = $1.id
and to_status = 'refused'::payment_service.payment_status
order by created_at desc limit 1;
$function$
;
create or replace function notification_service._generate_template_vars_from_relations(json)
returns json
language plpgsql
stable
as $$
declare
_user community_service.users;
_payment payment_service.catalog_payments;
_subscription payment_service.subscriptions;
_last_subscription_payment payment_service.catalog_payments;
_first_subscription_paid_payment payment_service.catalog_payments;
_project project_service.projects;
_reward project_service.rewards;
_platform platform_service.platforms;
_project_owner community_service.users;
_result jsonb;
begin
-- get user
select * from community_service.users where id = ($1->>'user_id')::uuid into _user;
if _user is null then
raise 'missing user_id';
end if;
_result := jsonb_build_object('user', jsonb_build_object(
'id', _user.id,
'name', _user.data ->> 'name',
'email', _user.email,
'document_type', _user.data ->> 'document_type',
'document_number', _user.data ->> 'document_number',
'created_at', _user.created_at
));
-- get payment
select * from payment_service.catalog_payments where id = ($1->>'catalog_payment_id')::uuid into _payment;
if _payment.id is not null then
_result := jsonb_set(_result, '{payment}'::text[], jsonb_build_object(
'id', _payment.id,
'amount', ((_payment.data ->> 'amount')::decimal / 100),
'boleto_url', (_payment.gateway_general_data ->> 'boleto_url')::text,
'boleto_barcode', (_payment.gateway_general_data ->> 'boleto_barcode')::text,
'boleto_expiration_date', (_payment.gateway_general_data ->> 'boleto_expiration_date'),
'boleto_expiration_day_month', to_char((_payment.gateway_general_data->>'boleto_expiration_date'::text)::timestamp, 'DD/MM'),
'payment_method', (_payment.data->>'payment_method')::text,
'confirmed_at', (payment_service.paid_transition_at(_payment)),
'refused_at', (payment_service.refused_transition_at(_payment)),
'chargedback_at', (payment_service.chargedback_transition_at(_payment)),
'refunded_at', (payment_service.refunded_transition_at(_payment)),
'next_charge_at', (case when _payment.subscription_id is not null then
(payment_service.paid_transition_at(_payment) + '1 month'::interval)
else null end),
'subscription_period_month_year', (case when _payment.subscription_id is not null then
to_char(_payment.created_at, 'MM/YYYY')
else null end),
'card_last_digits', (_payment.gateway_general_data ->> 'card_last_digits')::text,
'card_brand', (_payment.gateway_general_data ->> 'card_brand')::text
));
end if;
-- get subscription
select * from payment_service.subscriptions where id = ($1->>'subscription_id')::uuid into _subscription;
select * from payment_service.catalog_payments where subscription_id = _subscription.id
order by created_at desc limit 1
into _last_subscription_payment;
select * from payment_service.catalog_payments where subscription_id = _subscription.id and status = 'paid'
order by created_at asc limit 1
into _first_subscription_paid_payment;
if _subscription.id is not null then
_result := jsonb_set(_result, '{subscription}'::text[], jsonb_build_object(
'id', _subscription.id,
'reward_id', _subscription.reward_id,
'period_month_year', to_char(_last_subscription_payment.created_at, 'MM/YYYY'),
'payment_method', (_last_subscription_payment.data ->> 'payment_method')::text,
'amount', (_last_subscription_payment.data ->> 'amount')::decimal / 100,
'paid_count', (select count(1) from payment_service.catalog_payments
where subscription_id = _subscription.id and status = 'paid'),
'paid_sum', (select sum((data ->> 'amount')::decimal / 100) from payment_service.catalog_payments
where subscription_id = _subscription.id and status = 'paid'),
'first_payment_at', payment_service.paid_transition_at(_first_subscription_paid_payment)
));
end if;
-- get project
select * from project_service.projects where id = ($1->>'project_id')::uuid into _project;
if _project.id is not null then
_result := jsonb_set(_result, '{project}'::text[], jsonb_build_object(
'id', _project.id,
'name', _project.name,
'mode', _project.mode,
'permalink', _project.permalink,
'expires_at', (_project.data ->> 'expires_at'::text)::timestamp,
'video_info', (_project.data ->> 'video_info')::json,
'online_days', (_project.data ->> 'online_days'),
'card_info', (_project.data ->> 'card_info')::json,
'total_paid_in_contributions', (select sum((data ->> 'amount')::decimal / 100) from payment_service.catalog_payments
where project_id = _project.id and status in('paid') and subscription_id is null),
'total_paid_in_active_subscriptions', (select sum((checkout_data ->> 'amount')::decimal / 100) from payment_service.subscriptions
where project_id = _project.id and status in('active')),
'total_contributors', (select count(distinct user_id) from payment_service.catalog_payments
where project_id = _project.id and status in('paid', 'refunded')),
'total_contributions', (select count(1) from payment_service.catalog_payments
where project_id = _project.id and status in('paid', 'refunded') and subscription_id is null),
'total_subscriptions', (select count(distinct subscription_id) from payment_service.catalog_payments
where project_id = _project.id and status in('paid', 'refunded') and subscription_id is not null)
));
end if;
-- get reward
select * from project_service.rewards where id = ($1->>'reward_id')::uuid into _reward;
if _reward.id is not null then
_result := jsonb_set(_result, '{reward}'::text[], jsonb_build_object(
'id', _reward.id,
'title', _reward.data ->> 'title',
'minimum_value', (_reward.data ->> 'minimum_value')::decimal / 100,
'deliver_at', (_reward.data ->> 'deliver_at')::timestamp,
'deliver_at_period', to_char((_reward.data ->> 'deliver_at')::timestamp, 'MM/YYYY')
));
end if;
-- get platform
select * from platform_service.platforms where id = _user.platform_id into _platform;
if _platform.id is not null then
_result := jsonb_set(_result, '{platform}'::text[], jsonb_build_object(
'id', _platform.id,
'name', _platform.name
));
end if;
-- get project_owner
select * from community_service.users where id = _project.user_id into _project_owner;
if _project_owner.id is not null then
_result := jsonb_set(_result, '{project_owner}'::text[], jsonb_build_object(
'id', _project_owner.id,
'name', _project_owner.data ->> 'name',
'email', _project_owner.email,
'document_type', _project_owner.data ->> 'document_type',
'document_number', _project_owner.data ->> 'document_number',
'created_at', _project_owner.created_at
));
end if;
return _result::json;
end;
$$;
CREATE OR REPLACE FUNCTION payment_service.transition_to(payment payment_service.catalog_payments, status payment_service.payment_status, reason json)
RETURNS boolean
LANGUAGE plpgsql
AS $function$
declare
_project project_service.projects;
_contributors_count integer;
_contributor community_service.users;
_project_owner community_service.users;
begin
-- check if to state is same from state
if $1.status = $2 then
return false;
end if;
-- generate a new payment status transition
insert into payment_service.payment_status_transitions (catalog_payment_id, from_status, to_status, data)
values ($1.id, $1.status, $2, ($3)::jsonb);
-- update the payment status
update payment_service.catalog_payments
set status = $2,
updated_at = now()
where id = $1.id;
-- deliver notifications after status changes to paid
if not exists (
select true from notification_service.user_catalog_notifications n
where n.user_id = $1.user_id
and (n.data -> 'relations' ->> 'catalog_payment_id')::uuid = $1.id
and n.label = 'paid_subscription_payment'
) and $2 = 'paid' and $1.subscription_id is not null then
perform notification_service.notify('paid_subscription_payment', json_build_object(
'relations', json_build_object(
'catalog_payment_id', $1.id,
'subscription_id', $1.subscription_id,
'project_id', $1.project_id,
'reward_id', $1.reward_id,
'user_id', $1.user_id
)
));
end if;
return true;
end;
$function$
;
CREATE OR REPLACE FUNCTION notification_service.notify(label text, data json)
RETURNS notification_service.notifications
LANGUAGE plpgsql
AS $function$
declare
_user community_service.users;
_notification_template notification_service.notification_templates;
_notification_global_template notification_service.notification_global_templates;
_notification notification_service.notifications;
_mail_config jsonb;
_data jsonb;
begin
select * from community_service.users
where id = ($2 -> 'relations' ->>'user_id')::uuid
into _user;
if _user.id is null then
raise 'user_id not found';
end if;
select nt.* from notification_service.notification_templates nt
where nt.platform_id = _user.platform_id
and nt.label = $1
into _notification_template;
if _notification_template is null then
select ngt.* from notification_service.notification_global_templates ngt
where ngt.label = $1
into _notification_global_template;
if _notification_global_template is null then
return null;
end if;
end if;
_mail_config := json_build_object(
'to', _user.email,
'from', coalesce((($2)->'mail_config'->>'from')::text, core.get_setting('system_email')),
'from_name', coalesce((($2)->'mail_config'->>'from')::text, core.get_setting('system_email')),
'reply_to', coalesce((($2)->'mail_config'->>'reply_to')::text, core.get_setting('system_email'))
)::jsonb;
_data := jsonb_set(($2)::jsonb, '{mail_config}'::text[], _mail_config);
_data := jsonb_set(_data, '{template_vars}'::text[], notification_service._generate_template_vars_from_relations((_data ->> 'relations')::json)::jsonb);
insert into notification_service.notifications
(platform_id, user_id, notification_template_id, notification_global_template_id, deliver_at, data)
values (_user.platform_id, _user.id, _notification_template.id, _notification_global_template.id, coalesce(($2->>'deliver_at')::timestamp, now()), _data)
returning * into _notification;
if _notification.deliver_at <= now() and ($2->>'supress_notify') is null then
perform pg_notify('dispatch_notifications_channel',
json_build_object(
'id', _notification.id,
'subject_template', coalesce(_notification_template.subject, _notification_global_template.subject),
'mail_config', json_build_object(
'to', _user.email,
'from', coalesce((($2)->'mail_config'->>'from')::text, core.get_setting('system_email')),
'from_name', coalesce((($2)->'mail_config'->>'from')::text, core.get_setting('system_email')),
'reply_to', coalesce((($2)->'mail_config'->>'reply_to')::text, core.get_setting('system_email'))
),
'content_template', coalesce(_notification_template.template, _notification_global_template.template),
'template_vars', (_data->>'template_vars')::json
)::text);
end if;
return _notification;
end;
$function$;
insert into notification_service.notification_global_templates
(label, subject, template) values
('slip_subscription_payment', 'Estamos contando com o seu apoio mensal! {{payment.boleto_expiration_day_month}} vence o boleto gerado para {{project.name}}', '<p>Olá, {{user.name}}!</p>
<p>
{{payment.boleto_expiration_day_month}} é o dia do vencimento do boleto gerado para o apoio de {{payment.subscription_period_month_year}} ao projeto {{project.name}}.<br/>
{{project_owner.name}} está contando com o seu apoio mensal para o projeto.
</p>
<p>
Se você não imprimiu seu boleto ainda, você pode clicar no link abaixo e fazer isso agora mesmo:
</p>
<p>
<a href="{{payment.boleto_url}}">{{payment.boleto_url}}</a>
</p>
<p>
PS: Caso já tenha pago o boleto bancário, desconsidere esse email por favor.
</p>
<p>
Um abraço
</p>'),
('paid_subscription_payment', 'Recibo: apoio mensal confirmado para {{project.name}}', '<p>Olá, {{user.name}}!</p>
<p>
Seu apoio mensal de {{payment.subscription_period_month_year}} para o projeto {{project.name}} foi confirmado com sucesso!
</p>
<p>
A próxima cobrança acontecerá em: {{payment.next_charge_at}}
</p>
<p>
Esse e-mail serve como um recibo definitivo do seu apoio este mês.
</p>
<p>Seguem todos os dados do pagamento:</p>
<p>Nome do apoiador: {{user.name}}
<br/>CPF/CNPJ do apoiador: {{user.document_number}}
<br/>Data da confirmação do apoio: {{payment.confirmed_at}}
<br/>Valor da contribuição: R$ {{payment.amount}}
<br/>ID do apoio: {{payment.id}}
<br/>Nome/Razão Social do realizador: {{project_owner.name}}
<br/>CPF/CNPJ do realizador: {{project_owner.document_number}}</p>
<p>
Um abraço
</p>'),
('inactive_subscription', 'Assinatura Inativa: seu apoio de {{subscription.period_month_year}} para o projeto {{project.name}} não foi confirmado.', '<p>Olá, {{user.name}}!</p>
<p>
Seu apoio mensal de {{subscription.period_month_year}} para o projeto {{project.name}} não foi confirmado :(
</p>
<p>
De acordo com nossos registros,
{% if payment.payment_method == "boleto" %}
o boleto bancário no valor de R${{payment.amount}} e vencimento em {{payment.boleto_expiration_day_month}} não foi pago.
{% else %}
a cobrança no cartão {{payment.card_brand}} final {{payment.card_last_digits}} no valor de R${{payment.amount}} foi recusada em {{payment.refused_at}}.
{% endif %}
</p>
<p>
<b>Sua assinatura agora está inativa.</b> Isso quer dizer que <b>você não terá acesso às novidades exclusivas</b> para assinantes do projeto e <b>perderá o direito ao recebimento de recompensas futuras.</b>
</p>
<p>
Um abraço
</p>'),
('pending_subscription', 'O projeto {{project.name}} precisa do seu apoio!', '<p>Olá, {{user.name}}!</p>
<p>
Verificamos que você iniciou sua assinatura para o projeto {{project.name}}, porém não chegou a concluí-la.
</p>
<p>
O seu apoio mensal é essencial e você pode juntar-se a outras {{project.total_contributors}} pessoas para tornar esse projeto uma realidade. Faça agora sua assinatura de onde parou:
</p>
<p>
<a href="">assinar o projeto</a>
</p>
<p>
Um abraço
</p>'); | the_stack |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for shop_coupon
-- ----------------------------
DROP TABLE IF EXISTS `shop_coupon`;
CREATE TABLE `shop_coupon` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '优惠券名称',
`coupon_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '优惠券类型 新人券 现金券 满减券 折扣券',
`denomination` decimal(10, 2) NULL DEFAULT NULL COMMENT '面额 优惠多少钱和打多少折',
`fixed_denomination` decimal(10, 0) NULL DEFAULT NULL COMMENT '固定面额 即 大于多少开始优惠',
`start_time` datetime NULL DEFAULT NULL COMMENT '开始时间 ',
`end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
`is_limited` tinyint(1) NULL DEFAULT 0 COMMENT '是否限量',
`total` int(10) NULL DEFAULT NULL COMMENT '发放总数',
`last_total` int(10) NULL DEFAULT 0 COMMENT '剩余总数',
`status` tinyint(1) NOT NULL COMMENT '状态 0 未开始 1进行中 2已结束',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_coupon
-- ----------------------------
INSERT INTO `shop_coupon` VALUES (1, '新人优惠券', 'new', 30.00, 1, '2021-01-03 16:00:00', '2021-12-31 16:00:00', 0, 1, 0, 1, '2021-01-04 17:54:54', 'admin', '2021-01-25 22:05:07', 'admin', NULL, 0);
INSERT INTO `shop_coupon` VALUES (2, '9折优惠券,限量领取', 'discount', 9.00, NULL, '2021-01-11 16:00:00', '2021-06-29 16:00:00', 1, 100, 99, 1, '2021-01-12 16:28:08', 'admin', '2021-02-04 10:17:16', 'admin', NULL, 0);
INSERT INTO `shop_coupon` VALUES (3, '大促销满减券', 'fullRed', 20.00, 60, '2021-02-03 16:00:00', '2021-04-29 16:00:00', 1, 90, 90, 1, '2021-02-04 10:19:23', 'admin', '2021-02-04 10:19:23', 'admin', NULL, 0);
-- ----------------------------
-- Table structure for shop_coupon_user
-- ----------------------------
DROP TABLE IF EXISTS `shop_coupon_user`;
CREATE TABLE `shop_coupon_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(11) NULL DEFAULT NULL COMMENT '用户ID',
`coupon_id` int(11) NULL DEFAULT NULL COMMENT '优惠券ID',
`end_time` datetime NULL DEFAULT NULL COMMENT '过期时间',
`use_time` datetime NULL DEFAULT NULL COMMENT '使用时间',
`status` tinyint(1) NULL DEFAULT NULL COMMENT '状态 0 未使用 1 已使用 2 已过期',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modify_date` datetime NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '优惠券发放记录' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_coupon_user
-- ----------------------------
INSERT INTO `shop_coupon_user` VALUES (4, 2, 1, '2021-12-31 16:00:00', NULL, 0, '2021-01-26 17:02:46', '2021-01-26 17:02:46');
INSERT INTO `shop_coupon_user` VALUES (5, 2, 2, '2021-06-29 16:00:00', NULL, 0, '2021-02-04 11:14:22', '2021-02-04 11:14:22');
-- ----------------------------
-- Table structure for shop_goods
-- ----------------------------
DROP TABLE IF EXISTS `shop_goods`;
CREATE TABLE `shop_goods` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`goods_sn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品编号',
`title` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品标题',
`category_ids` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品分类',
`category_names` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品分类name',
`keywords` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品关键词',
`brief` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品简介',
`home_pic` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '首页图片',
`unit` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位',
`is_new` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否新品',
`is_hot` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否人气推荐',
`retail_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '零售价格',
`wholesale_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '批发价格',
`min_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '最小单价',
`max_price` decimal(10, 2) NULL DEFAULT NULL COMMENT '最大价格',
`specs` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格',
`detail` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '描述',
`sort_order` smallint(4) NULL DEFAULT 100 COMMENT '排序',
`status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态 0 待上架 1 上架 2 下架',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
`stock` int(7) NULL DEFAULT 0 COMMENT '库存',
`publish_time` datetime NULL DEFAULT NULL COMMENT '上架时间',
`publisher` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '上架人',
`sale_num` int(10) NULL DEFAULT 0 COMMENT '销售件数',
`activity` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '活动状态 0 正常 1秒杀 2 团购',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 29 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_goods
-- ----------------------------
INSERT INTO `shop_goods` VALUES (5, '10001', '赣南脐橙单果', '4,9,8,18', '生鲜,时令水果,柑桔橙柚,橙子', '精选', '汁水充盈,个头硕大', 'http://qliiucyce.hb-bkt.clouddn.com/5bbb875feb394cfbb52ceee48a5bac11.jpg', 'piece/pieces', '1', '1', 4.90, 4.00, 10.00, 20.00, '3', '<p><img src=\"http://qliiucyce.hb-bkt.clouddn.com/5615d313c4984ba3aa49de2b738595ca.jpeg\" alt=\"\" /><img src=\"http://qliiucyce.hb-bkt.clouddn.com/deebd562bb2945b7a6d6e959054335ea.jpeg\" alt=\"\" /></p>', 100, '1', '2021-01-10 19:03:09', 'admin', '2021-01-10 19:04:51', 'admin', NULL, 1, 186, '2021-01-10 19:04:51', 'admin', 100, '0');
INSERT INTO `shop_goods` VALUES (6, '001', '奶油草莓', '1,11', '甄选水果,葡提莓果', '精选', '奶油草莓', 'https://oss.xiapeiyi.com/shop/goods/b36a28567663433da35cb728170d9135.jpg', '1', '1', '1', 60.00, 60.00, 60.00, 0.00, '3', '<p>奶油草莓</p>', 100, '1', '2021-01-12 16:17:18', 'admin', '2021-01-23 09:29:25', 'admin', NULL, 0, 9999, '2021-01-23 09:29:25', 'admin', 100, '1');
INSERT INTO `shop_goods` VALUES (7, '002', '椰子', '1,16', '甄选水果,热带水果', '年货', '椰子', 'https://oss.xiapeiyi.com/shop/goods/7047c9be614a49949938e9c293065e0b.png', '1', '0', '0', 1.00, 1.00, 1.00, 0.00, '3', '<p>1</p>', 100, '1', '2021-01-12 16:19:26', 'admin', '2021-01-20 22:31:58', 'admin', NULL, 0, 1, '2021-01-20 14:00:34', 'admin', 100, '0');
INSERT INTO `shop_goods` VALUES (9, '003', '苹果', '1,12', '甄选水果,苹果梨焦', '年货', '苹果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', '1', '1', '1', 1.00, 1.00, 1.00, 0.00, '3', '<p>1</p>', 100, '1', '2021-01-12 16:22:10', 'admin', '2021-01-20 13:55:46', 'admin', NULL, 0, 1, '2021-01-20 13:55:46', 'admin', 100, '0');
INSERT INTO `shop_goods` VALUES (11, '004', '葡萄', '1,11', '甄选水果,葡提莓果', '年货', '葡萄', 'https://oss.xiapeiyi.com/shop/goods/a10e70b86fa04703b76663ef167050b7.png', '1', '1', '1', 10.00, 5.00, 1.00, 0.00, '3', '<p>1</p>', 100, '1', '2021-01-12 16:23:03', 'admin', '2021-01-28 22:30:01', 'admin', NULL, 0, 6, '2021-01-20 14:00:31', 'admin', 100, '2');
INSERT INTO `shop_goods` VALUES (12, '005', '111', '1,14', '甄选水果,桃李杏枣', '年货', '11', 'https://oss.xiapeiyi.com/shop/goods/6a47a2678e3149e5a05f1a6ed151b84e.png', '1', '1', '1', 1.00, 1.00, 1.00, 0.00, '3', '<p>1</p>', 100, '1', '2021-01-12 16:24:51', 'admin', '2021-01-22 20:58:03', 'admin', NULL, 0, 1, '2021-01-22 20:58:03', 'admin', 100, '0');
INSERT INTO `shop_goods` VALUES (13, NULL, '测试商品', '1,10', '甄选水果,柑桔橙柚', '精选', '这是一个测试标题这是一个测试标题这是一个测试标题这是一个测试标题', 'http://qliiucyce.hb-bkt.clouddn.com/86c9d2fff511415ea09f1a4e26085cb0.jpg', 'kg', '1', '1', 1.00, 1.00, 1.00, 0.00, '3', '<p>1111</p>', 100, '0', '2021-01-12 16:35:34', 'admin', '2021-01-12 16:37:19', 'admin', NULL, 1, 1, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (14, NULL, '进口香蕉', '1,12', '甄选水果,苹果梨焦', '精选', '香甜软糯', 'https://oss.xiapeiyi.com/shop/goods/f6c6f58b7aff47afa0225658a15e91de.jpeg', '1', '1', '1', 10.00, 9.00, 8.00, 16.00, '2', '<p><img src=\"https://oss.xiapeiyi.com/shop/goods/fe1d5cce84d04b9593635793b11c2b1b.jpg\" alt=\"图片\" width=\"1176\" height=\"935\" /></p>', 100, '1', '2021-01-21 23:15:41', 'admin', '2021-01-21 23:17:22', 'admin', NULL, 0, 200, '2021-01-21 23:17:22', 'admin', 100, '0');
INSERT INTO `shop_goods` VALUES (15, NULL, '红颜草莓', '1,11', '甄选水果,葡提莓果', '精选', '好吃不贵的红颜草莓', 'https://oss.xiapeiyi.com/shop/goods/53a94bfc73af4b4d951df1c120071d44.jpg', '1', '1', '1', 68.00, 60.00, 17.80, 30.00, '2', '<p>红颜草莓</p>', 100, '1', '2021-01-22 23:17:54', 'admin', '2021-01-22 23:30:57', 'admin', NULL, 0, 200, '2021-01-22 23:25:15', 'admin', 100, '1');
INSERT INTO `shop_goods` VALUES (16, NULL, '菲律宾凤梨', '1,16', '甄选水果,热带水果', '精选', '菲律宾凤梨', 'https://oss.xiapeiyi.com/shop/goods/b7ed8a9c75fa4e79b3e4946060175095.jpg', '1', '1', '1', 13.20, 13.00, 8.00, 16.00, '2', '<p>菲律宾凤梨</p>', 100, '1', '2021-01-22 23:22:10', 'admin', '2021-01-22 23:31:34', 'admin', NULL, 0, 200, '2021-01-22 23:25:10', 'admin', 100, '1');
INSERT INTO `shop_goods` VALUES (17, NULL, '泰国桂圆', '1,16', '甄选水果,热带水果', '精选', '泰国桂圆', 'https://oss.xiapeiyi.com/shop/goods/2bbfa72e3147474cad58c29e96a64751.jpg', '1', '0', '0', 9.90, 9.00, 10.00, 40.00, '3,1,2', '<p>泰国桂圆</p>', 100, '1', '2021-01-22 23:23:33', 'admin', '2021-01-23 19:27:52', 'admin', NULL, 0, 630, '2021-01-22 23:25:08', 'admin', 100, '0');
INSERT INTO `shop_goods` VALUES (18, NULL, '橘子春见(中)', '1,10', '甄选水果,柑桔橙柚', '精选', '橘子春见(中)', 'https://oss.xiapeiyi.com/shop/goods/e8e65446e3ff4ab78e7b85f7a456c12d.jpg', '1', '0', '0', 12.80, 12.00, 5.90, 0.00, '3', '<p>橘子春见(中)</p>', 100, '1', '2021-01-22 23:24:54', 'admin', '2021-01-22 23:26:59', 'admin', NULL, 0, 1000, '2021-01-22 23:25:02', 'admin', 100, '1');
INSERT INTO `shop_goods` VALUES (19, NULL, '石榴', '1,10', '甄选水果,柑桔橙柚', '石榴', '石榴', 'https://oss.xiapeiyi.com/shop/goods/c2750e72fbdd49b29f5571fec2cae608.jpeg', '1', '0', '0', 10.00, 10.00, 10.00, 0.00, '2', '<p>石榴</p>', 100, '1', '2021-01-26 13:23:55', 'admin', '2021-01-26 13:24:02', 'admin', NULL, 0, 10, '2021-01-26 13:24:02', 'admin', 100, '0');
INSERT INTO `shop_goods` VALUES (20, NULL, '牛油果', '1,16', '甄选水果,热带水果', '牛油果', '牛油果', 'https://oss.xiapeiyi.com/shop/goods/c354827057ea43dfadfcc45470592b58.jpeg', '1', '1', '1', 10.00, 10.00, 10.00, 0.00, '2', '<p>牛油果</p>', 100, '1', '2021-01-26 13:25:26', 'admin', '2021-01-26 13:25:26', 'admin', NULL, 0, 297, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (21, NULL, '荔枝', '1,16', '甄选水果,热带水果', '荔枝,团长推荐', '荔枝', 'https://oss.xiapeiyi.com/shop/goods/abafbd5bc7ab46a7b3c2c14e648e0700.jpg', '1', '1', '1', 10.00, 10.00, 10.00, 0.00, '2', '<p>荔枝</p>', 100, '1', '2021-01-26 13:26:21', 'admin', '2021-01-26 13:26:21', 'admin', NULL, 0, 198, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (22, NULL, '西柚', '1,10', '甄选水果,柑桔橙柚', '西柚', '西柚', 'https://oss.xiapeiyi.com/shop/goods/6b2d5ea301954df1b85b01aea793da1f.jpeg', '1', '1', '1', 10.00, 10.00, 10.00, 0.00, '2', '<p>西柚</p>', 100, '1', '2021-01-26 13:27:21', 'admin', '2021-01-26 13:27:21', 'admin', NULL, 0, 10, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (23, NULL, '杨桃', '1,14', '甄选水果,桃李杏枣', '杨桃', '杨桃', 'https://oss.xiapeiyi.com/shop/goods/53fdbec9ab9f45a4ac73ffbd0feb0488.jpg', '1', '1', '1', 10.00, 10.00, 10.00, 0.00, '2', '<p>杨桃</p>', 100, '1', '2021-01-26 13:28:38', 'admin', '2021-01-26 13:28:38', 'admin', NULL, 0, 10, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (24, NULL, '红毛丹', '1,16', '甄选水果,热带水果', '红毛丹', '红毛丹', 'https://oss.xiapeiyi.com/shop/goods/6950a33dcd324895b6fce5a13fabfa73.jpg', '1', '1', '1', 10.00, 10.00, 10.00, 0.00, '2', '<p>红毛丹</p>', 100, '1', '2021-01-26 13:29:35', 'admin', '2021-01-26 13:29:35', 'admin', NULL, 0, 10, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (25, NULL, '油桃', '1,14', '甄选水果,桃李杏枣', '油桃', '油桃', 'https://oss.xiapeiyi.com/shop/goods/d72db68393154b38b92bd03430fd5f42.jpeg', '1', '1', '1', 10.00, 10.00, 10.00, 0.00, '3', '<p>油桃</p>', 100, '1', '2021-01-26 13:30:21', 'admin', '2021-01-26 13:30:21', 'admin', NULL, 0, 10, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (26, NULL, '苹果', '1,12', '甄选水果,苹果梨焦', '苹果,精选,当季畅销,年货精选', '苹果', 'https://oss.xiapeiyi.com/shop/goods/fc68f2a0e9cb439dab7714e992a3e0d2.jpeg', '1', '1', '1', 10.00, 10.00, 10.00, 0.00, '3', '<p>苹果</p>', 100, '1', '2021-01-26 13:31:12', 'admin', '2021-01-26 13:31:12', 'admin', NULL, 0, 10, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (27, NULL, '百香果', '1,16', '甄选水果,热带水果', '百香果,团长推荐', '百香果', 'https://oss.xiapeiyi.com/shop/goods/d57444e852524af895bfeed4c2812969.jpeg', '1', '1', '1', 10.00, 11.00, 10.00, 0.00, '3', '<p>百香果</p>', 100, '1', '2021-01-26 13:32:43', 'admin', '2021-01-26 13:32:43', 'admin', NULL, 0, 20, NULL, NULL, 100, '0');
INSERT INTO `shop_goods` VALUES (28, NULL, '杏子', '1,14', '甄选水果,桃李杏枣', '杏子,团长推荐', '杏子', 'https://oss.xiapeiyi.com/shop/goods/fe9a0a8bc8a24039a1095a1af0968b6f.jpeg', '1', '1', '1', 1.00, 1.00, 1.00, 0.00, '3', '<p>杏子</p>', 100, '1', '2021-01-26 13:33:28', 'admin', '2021-01-26 13:33:28', 'admin', NULL, 0, 1, NULL, NULL, 100, '0');
-- ----------------------------
-- Table structure for shop_goods_attr
-- ----------------------------
DROP TABLE IF EXISTS `shop_goods_attr`;
CREATE TABLE `shop_goods_attr` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`attr_id` int(11) NOT NULL COMMENT '属性ID',
`goods_id` int(11) NOT NULL COMMENT '商品主键',
`attr_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性名称',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 131 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_goods_attr
-- ----------------------------
INSERT INTO `shop_goods_attr` VALUES (1, 1, 1, '颜色');
INSERT INTO `shop_goods_attr` VALUES (47, 3, 3, '重量');
INSERT INTO `shop_goods_attr` VALUES (60, 1, 2, '颜色');
INSERT INTO `shop_goods_attr` VALUES (61, 2, 2, '尺码');
INSERT INTO `shop_goods_attr` VALUES (62, 1, 4, '颜色');
INSERT INTO `shop_goods_attr` VALUES (63, 2, 4, '尺码');
INSERT INTO `shop_goods_attr` VALUES (65, 3, 5, '重量');
INSERT INTO `shop_goods_attr` VALUES (69, 3, 8, '重量');
INSERT INTO `shop_goods_attr` VALUES (74, 3, 10, '重量');
INSERT INTO `shop_goods_attr` VALUES (81, 3, 13, '重量');
INSERT INTO `shop_goods_attr` VALUES (89, 3, 12, '重量');
INSERT INTO `shop_goods_attr` VALUES (94, 3, 9, '重量');
INSERT INTO `shop_goods_attr` VALUES (101, 3, 7, '重量');
INSERT INTO `shop_goods_attr` VALUES (105, 3, 11, '重量');
INSERT INTO `shop_goods_attr` VALUES (107, 2, 14, '件数');
INSERT INTO `shop_goods_attr` VALUES (108, 2, 15, '件数');
INSERT INTO `shop_goods_attr` VALUES (109, 2, 16, '件数');
INSERT INTO `shop_goods_attr` VALUES (111, 3, 18, '重量');
INSERT INTO `shop_goods_attr` VALUES (112, 3, 6, '重量');
INSERT INTO `shop_goods_attr` VALUES (117, 3, 17, '重量');
INSERT INTO `shop_goods_attr` VALUES (118, 1, 17, '颜色');
INSERT INTO `shop_goods_attr` VALUES (119, 2, 17, '件数');
INSERT INTO `shop_goods_attr` VALUES (120, 2, 19, '件数');
INSERT INTO `shop_goods_attr` VALUES (121, 2, 20, '件数');
INSERT INTO `shop_goods_attr` VALUES (122, 2, 21, '件数');
INSERT INTO `shop_goods_attr` VALUES (123, 2, 22, '件数');
INSERT INTO `shop_goods_attr` VALUES (124, 2, 23, '件数');
INSERT INTO `shop_goods_attr` VALUES (125, 2, 24, '件数');
INSERT INTO `shop_goods_attr` VALUES (126, 3, 25, '重量');
INSERT INTO `shop_goods_attr` VALUES (127, 3, 26, '重量');
INSERT INTO `shop_goods_attr` VALUES (128, 2, 27, '件数');
INSERT INTO `shop_goods_attr` VALUES (129, 3, 27, '重量');
INSERT INTO `shop_goods_attr` VALUES (130, 3, 28, '重量');
-- ----------------------------
-- Table structure for shop_goods_attr_val
-- ----------------------------
DROP TABLE IF EXISTS `shop_goods_attr_val`;
CREATE TABLE `shop_goods_attr_val` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`attr_id` int(11) NOT NULL COMMENT '属性ID',
`attr_val_id` int(11) NOT NULL COMMENT '主键',
`attr_val` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性值',
`goods_id` int(11) NULL DEFAULT NULL COMMENT '商品ID',
`pic` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 237 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性值' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_goods_attr_val
-- ----------------------------
INSERT INTO `shop_goods_attr_val` VALUES (1, 1, 1, '蓝色', 1, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (93, 3, 10, '1KG', 3, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (94, 3, 11, '2KG', 3, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (95, 3, 12, '4KG', 3, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (121, 1, 1, '蓝色', 2, 'http://qliiucyce.hb-bkt.clouddn.com/020e38b6c8324d1e84189031cfee9474.jpg');
INSERT INTO `shop_goods_attr_val` VALUES (122, 1, 2, '红色', 2, 'http://qliiucyce.hb-bkt.clouddn.com/f4945f46b70f416caa5191fba7db9208.jpg');
INSERT INTO `shop_goods_attr_val` VALUES (123, 2, 4, 'XS', 2, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (124, 2, 5, 'S', 2, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (125, 2, 7, 'L', 2, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (126, 1, 2, '红色', 4, 'http://qliiucyce.hb-bkt.clouddn.com/8987121841a84531b170c22a16d68e1b.jpg');
INSERT INTO `shop_goods_attr_val` VALUES (127, 2, 4, 'XS', 4, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (128, 2, 5, 'S', 4, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (129, 2, 6, 'M', 4, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (132, 3, 10, '1KG', 5, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (133, 3, 11, '2KG', 5, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (137, 3, 10, '1KG', 8, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (142, 3, 10, '1KG', 10, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (143, 3, 11, '2KG', 10, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (144, 3, 12, '4KG', 10, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (153, 3, 11, '2KG', 13, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (161, 3, 10, '1KG', 12, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (168, 3, 10, '1KG', 9, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (177, 3, 10, '1KG', 7, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (187, 3, 10, '1KG', 11, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (188, 3, 11, '2KG', 11, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (189, 3, 12, '4KG', 11, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (192, 2, 4, '1', 14, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (193, 2, 5, '2', 14, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (194, 2, 4, '1', 15, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (195, 2, 5, '2', 15, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (196, 2, 4, '1', 16, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (197, 2, 5, '2', 16, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (199, 3, 10, '1KG', 18, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (200, 3, 10, '1KG', 6, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (213, 3, 10, '1KG', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (214, 3, 11, '2KG', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (215, 3, 12, '4KG', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (216, 1, 1, '蓝色', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (217, 1, 2, '红色', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (218, 1, 3, '灰色', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (219, 2, 4, '1', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (220, 2, 5, '2', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (221, 2, 6, '3', 17, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (222, 2, 4, '1', 19, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (223, 2, 4, '1', 20, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (224, 2, 5, '2', 20, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (225, 2, 6, '3', 20, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (226, 2, 4, '1', 21, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (227, 2, 5, '2', 21, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (228, 2, 4, '1', 22, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (229, 2, 4, '1', 23, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (230, 2, 4, '1', 24, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (231, 3, 10, '1KG', 25, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (232, 3, 10, '1KG', 26, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (233, 2, 5, '2', 27, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (234, 3, 10, '1KG', 27, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (235, 3, 11, '2KG', 27, NULL);
INSERT INTO `shop_goods_attr_val` VALUES (236, 3, 10, '1KG', 28, NULL);
-- ----------------------------
-- Table structure for shop_goods_category
-- ----------------------------
DROP TABLE IF EXISTS `shop_goods_category`;
CREATE TABLE `shop_goods_category` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`pid` int(11) NULL DEFAULT NULL COMMENT '父id',
`pids` varchar(122) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父ids',
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类名称',
`pic` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分类图',
`sort` int(5) NULL DEFAULT NULL COMMENT '排序',
`is_leaf` tinyint(1) NULL DEFAULT 1 COMMENT '是否最末级',
`level` smallint(2) NULL DEFAULT 1 COMMENT '层次级别',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品分类' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_goods_category
-- ----------------------------
INSERT INTO `shop_goods_category` VALUES (1, 0, '0', '甄选水果', 'https://oss.xiapeiyi.com/shop/category/80e9730caac648fdb81b1b13fecf441b.png', 1, 0, 1, '2021-01-12 15:56:31', 'admin', '2021-01-26 13:41:52', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (2, 0, '0', '新鲜蔬菜', 'http://49.232.72.173:9000/shop/category/aaac48ba6f19482aa802899cf5b1352b.png', 1, 1, 1, '2021-01-12 15:57:00', 'admin', '2021-01-20 18:00:31', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (3, 0, '0', '海鲜水产', 'http://49.232.72.173:9000/shop/category/1186d6b481b648a88082f641ff3c6a4c.png', 1, 1, 1, '2021-01-12 15:57:12', 'admin', '2021-01-20 18:00:46', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (4, 0, '0', '冷冻副食', 'http://49.232.72.173:9000/shop/category/0dd9beba0397459e97a04b90ae7907db.png', 1, 1, 1, '2021-01-12 15:57:30', 'admin', '2021-01-20 18:02:20', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (5, 0, '0', '肉蛋禽类', 'https://oss.xiapeiyi.com/shop/category/f1f1b7d6c07d4c7c858f18122ac94fe9.png', 1, 1, 1, '2021-01-12 15:57:53', 'admin', '2021-01-26 13:41:31', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (6, 0, '0', '粮油调味', 'http://49.232.72.173:9000/shop/category/37e82af7884d4a6eaa50dc769cb8a9b0.png', 1, 1, 1, '2021-01-12 15:58:10', 'admin', '2021-01-20 18:01:41', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (7, 0, '0', '休闲零食', 'https://oss.xiapeiyi.com/shop/category/fe08f82735bd415aaa57d2c5a24ef78d.png', 1, 1, 1, '2021-01-12 15:58:20', 'admin', '2021-01-26 13:41:16', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (8, 0, '0', '乳品烘焙', 'https://oss.xiapeiyi.com/shop/category/78abd4ab4abb457284070673305a0042.png', 1, 1, 1, '2021-01-12 15:58:43', 'admin', '2021-01-26 13:41:04', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (9, 0, '0', '方便速食', 'http://49.232.72.173:9000/shop/category/d4baa502c973426092f44ef9224ec9a7.png', 1, 1, 1, '2021-01-12 15:59:14', 'admin', '2021-01-20 18:02:08', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (10, 1, '0,1', '柑桔橙柚', 'http://49.232.72.173:9000/shop/category/f3a373c7579a4ee6afbc79874527d4db.png', 1, 1, 2, '2021-01-12 15:59:49', 'admin', '2021-01-20 17:59:21', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (11, 1, '0,1', '葡提莓果', 'http://49.232.72.173:9000/shop/category/a6092b59ad7e4b7daca4e2f6d1614c9e.png', 1, 1, 2, '2021-01-12 16:00:20', 'admin', '2021-01-20 17:59:30', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (12, 1, '0,1', '苹果梨焦', 'http://49.232.72.173:9000/shop/category/8698f9c2da724d3ba45df01c5dbe4b22.png', 1, 1, 2, '2021-01-12 16:00:41', 'admin', '2021-01-20 17:59:39', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (13, 1, '0,1', '猕猴桃', 'http://49.232.72.173:9000/shop/category/52fdf8fd660f4057a64d1ac72e2f7a9e.png', 1, 1, 2, '2021-01-12 16:00:59', 'admin', '2021-01-20 17:59:48', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (14, 1, '0,1', '桃李杏枣', 'http://49.232.72.173:9000/shop/category/e50ada86bfd64eefa68a86fb27d0bee1.png', 1, 1, 2, '2021-01-12 16:01:14', 'admin', '2021-01-20 17:59:56', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (15, 1, '0,1', '西瓜/蜜瓜', 'http://49.232.72.173:9000/shop/category/81ec0dfc94c14772b19e3e08919d1d4b.png', 1, 1, 2, '2021-01-12 16:01:30', 'admin', '2021-01-20 18:00:03', 'admin', NULL, 0);
INSERT INTO `shop_goods_category` VALUES (16, 1, '0,1', '热带水果', 'https://oss.xiapeiyi.com/shop/category/3a8b3ce3959b4e67bfe9ff54d50b2498.png', 1, 1, 2, '2021-01-12 16:01:42', 'admin', '2021-01-26 13:40:45', 'admin', NULL, 0);
-- ----------------------------
-- Table structure for shop_goods_comment
-- ----------------------------
DROP TABLE IF EXISTS `shop_goods_comment`;
CREATE TABLE `shop_goods_comment` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`goods_id` int(11) NULL DEFAULT NULL COMMENT '商品ID',
`user_id` int(11) NULL DEFAULT NULL COMMENT '用户ID',
`order_id` int(11) NULL DEFAULT NULL COMMENT '订单ID',
`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '内容',
`star` smallint(1) NULL DEFAULT NULL COMMENT '描述相符',
`pic` varchar(512) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片',
`create_date` datetime NOT NULL COMMENT '创建时间',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品评价' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_goods_comment
-- ----------------------------
INSERT INTO `shop_goods_comment` VALUES (1, 2, 1, NULL, '商品非常满意', 5, NULL, '2020-12-18 22:51:31', 0);
-- ----------------------------
-- Table structure for shop_goods_gallery
-- ----------------------------
DROP TABLE IF EXISTS `shop_goods_gallery`;
CREATE TABLE `shop_goods_gallery` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`goods_id` int(11) NULL DEFAULT NULL COMMENT '商品主键',
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片路径',
`sort` int(1) NULL DEFAULT NULL COMMENT '排序',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` int(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 54 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品主图' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_goods_gallery
-- ----------------------------
INSERT INTO `shop_goods_gallery` VALUES (1, 2, 'http://127.0.0.1:9090/file/biz\\2020-12-19\\ee0d8636736e4a82858aa733c0099abc.jpg', NULL, '2020-12-19 11:44:58', 'admin', '2020-12-21 15:16:10', 'admin', NULL, 1);
INSERT INTO `shop_goods_gallery` VALUES (2, 2, 'http://127.0.0.1:9090/file/biz\\2020-12-19\\3ab4e7f36aee4e7d8f397eeaaf3eaa69.jpg', NULL, '2020-12-19 11:44:58', 'admin', '2020-12-21 15:16:10', 'admin', NULL, 1);
INSERT INTO `shop_goods_gallery` VALUES (3, 2, 'http://127.0.0.1:9090/file/biz\\2020-12-19\\9a8790ea921e4f0c9467c6692ad20983.jpg', NULL, '2020-12-19 11:44:58', 'admin', '2020-12-21 15:16:11', 'admin', NULL, 1);
INSERT INTO `shop_goods_gallery` VALUES (4, 2, 'http://127.0.0.1:9090/file/biz\\2020-12-19\\105d715c480c4b6fadf435de0d074928.jpg', NULL, '2020-12-19 11:44:58', 'admin', '2020-12-21 15:16:11', 'admin', NULL, 1);
INSERT INTO `shop_goods_gallery` VALUES (5, 2, 'http://127.0.0.1:9090/file/biz\\2020-12-19\\ddfeac2c1dd74e6c97ecac965bdd12b0.jpg', NULL, '2020-12-19 11:44:58', 'admin', '2020-12-21 15:16:11', 'admin', NULL, 1);
INSERT INTO `shop_goods_gallery` VALUES (6, 2, 'http://127.0.0.1:9090/file/biz\\2020-12-19\\216eb3e00c184a5e87e669ab51d1b855.jpg', NULL, '2020-12-19 11:44:58', 'admin', '2020-12-21 15:16:11', 'admin', NULL, 1);
INSERT INTO `shop_goods_gallery` VALUES (7, 3, 'http://127.0.0.1:9090/file/biz\\2020-12-19\\046ed4fa4f3541dda25b7a4c3531079a.jpg', NULL, '2020-12-19 14:59:58', 'admin', '2020-12-19 17:01:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (8, 3, 'http://127.0.0.1:9090/file/biz\\2020-12-19\\59e3644268f54a77985802a6e191dd5c.jpg', NULL, '2020-12-19 15:01:25', 'admin', '2020-12-19 17:01:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (9, 4, 'http://qliiucyce.hb-bkt.clouddn.com/4d18338896ad44d2af8a0687b871818d.jpg', NULL, '2020-12-19 16:02:18', 'admin', '2021-01-06 17:21:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (10, 4, 'http://qliiucyce.hb-bkt.clouddn.com/61afd39d0bf745af9b8e9e0a7c3ee5be.jpg', NULL, '2020-12-19 16:02:18', 'admin', '2021-01-06 17:21:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (11, 4, 'http://qliiucyce.hb-bkt.clouddn.com/1d6209c57faf4bfb9e1b2266123885dc.jpg', NULL, '2020-12-19 16:02:18', 'admin', '2021-01-06 17:21:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (12, 4, 'http://qliiucyce.hb-bkt.clouddn.com/feb06b9316734b92b45096576031f0b8.jpg', NULL, '2020-12-19 16:02:18', 'admin', '2021-01-06 17:21:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (13, 4, 'http://qliiucyce.hb-bkt.clouddn.com/5dcf7cef256747098235f0e6c5d97177.jpg', NULL, '2020-12-19 16:02:18', 'admin', '2021-01-06 17:21:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (14, 4, 'http://qliiucyce.hb-bkt.clouddn.com/886b234ec1d44c31a1b7378740e4492d.jpg', NULL, '2020-12-19 16:02:18', 'admin', '2021-01-06 17:21:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (15, 3, 'http://qliiucyce.hb-bkt.clouddn.com/5f22a4db2e0e406295fd70b48400f9d2.jpg', NULL, '2020-12-19 16:38:33', 'admin', '2020-12-19 17:01:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (16, 3, 'http://qliiucyce.hb-bkt.clouddn.com/27db7b3a8d214313b9ef7ec6dc1894d0.jpg', NULL, '2020-12-19 16:38:33', 'admin', '2020-12-19 17:01:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (17, 2, 'http://qliiucyce.hb-bkt.clouddn.com/052d625a53a54378820b420783cdd2b7.jpeg', NULL, '2020-12-19 21:30:48', 'admin', '2021-01-06 17:20:07', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (18, 2, 'http://qliiucyce.hb-bkt.clouddn.com/012b4661a15e419f8b6fc955f95e38d1.jpeg', NULL, '2020-12-19 21:30:48', 'admin', '2021-01-06 17:20:07', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (19, 2, 'http://qliiucyce.hb-bkt.clouddn.com/2be347368c3d485ab08de411404b4d26.jpg', NULL, '2020-12-19 21:30:48', 'admin', '2021-01-06 17:20:07', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (20, 2, 'http://qliiucyce.hb-bkt.clouddn.com/7d7210ebbca14b1587d14ec6eca7c2dd.JPG', NULL, '2020-12-19 21:30:48', 'admin', '2021-01-06 17:20:07', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (21, 2, 'http://qliiucyce.hb-bkt.clouddn.com/695981413449411d934d2ccf358d3bc2.jpg', NULL, '2020-12-19 21:30:48', 'admin', '2021-01-06 17:20:07', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (22, 2, 'http://qliiucyce.hb-bkt.clouddn.com/b63c1607d3da40aaba6746a978d3aa98.jpg', NULL, '2020-12-19 21:30:48', 'admin', '2021-01-06 17:20:07', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (23, 5, 'http://qliiucyce.hb-bkt.clouddn.com/5615d313c4984ba3aa49de2b738595ca.jpeg', NULL, '2021-01-10 19:03:10', 'admin', '2021-01-10 19:04:23', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (24, 5, 'http://qliiucyce.hb-bkt.clouddn.com/deebd562bb2945b7a6d6e959054335ea.jpeg', NULL, '2021-01-10 19:03:10', 'admin', '2021-01-10 19:04:24', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (25, 6, 'http://qliiucyce.hb-bkt.clouddn.com/d30a17ffe9124680be8c1ad9a3114854.jpg', NULL, '2021-01-12 16:17:18', 'admin', '2021-01-20 13:51:16', 'admin', NULL, 1);
INSERT INTO `shop_goods_gallery` VALUES (26, 7, 'http://qliiucyce.hb-bkt.clouddn.com/ceb2e79a749c4db9ac80ae8bacc4bef5.png', NULL, '2021-01-12 16:19:26', 'admin', '2021-01-20 13:50:49', 'admin', NULL, 1);
INSERT INTO `shop_goods_gallery` VALUES (27, 8, 'http://qliiucyce.hb-bkt.clouddn.com/ceb2e79a749c4db9ac80ae8bacc4bef5.png', NULL, '2021-01-12 16:19:27', 'admin', '2021-01-12 16:19:27', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (28, 13, 'http://qliiucyce.hb-bkt.clouddn.com/d516fee63b3b436da2e146a7d02682fe.jpg', NULL, '2021-01-12 16:35:34', 'admin', '2021-01-12 16:37:19', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (29, 13, 'http://qliiucyce.hb-bkt.clouddn.com/63d0d47481c04f188f682273d7c320eb.jpg', NULL, '2021-01-12 16:35:34', 'admin', '2021-01-12 16:37:19', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (30, 9, 'https://oss.xiapeiyi.com/shop/goods/65e1eee6e69a4aaf95b9cad873d151e8.png', NULL, '2021-01-20 13:55:39', 'admin', '2021-01-20 13:55:39', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (31, 9, 'https://oss.xiapeiyi.com/shop/goods/119728f04d8e4c1daafa1f08a1cad79b.png', NULL, '2021-01-20 13:55:39', 'admin', '2021-01-20 13:55:39', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (32, 6, 'https://oss.xiapeiyi.com/shop/goods/d8a3743f0d264c269b238b0e72812556.png', NULL, '2021-01-20 13:57:38', 'admin', '2021-01-23 09:27:56', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (33, 6, 'https://oss.xiapeiyi.com/shop/goods/ecd2b34578c84ea78be7db21eed5092b.png', NULL, '2021-01-20 13:57:38', 'admin', '2021-01-23 09:27:56', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (34, 7, 'https://oss.xiapeiyi.com/shop/goods/a0e473b87aa44eb2b5198c45be41eedb.png', NULL, '2021-01-20 13:59:13', 'admin', '2021-01-20 22:31:58', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (35, 7, 'https://oss.xiapeiyi.com/shop/goods/2881dcc8ade147bc8eac9ea37ae8c398.png', NULL, '2021-01-20 13:59:13', 'admin', '2021-01-20 22:31:58', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (36, 11, 'https://oss.xiapeiyi.com/shop/goods/d22df87b1bb2461b89249934e9c3f04c.png', NULL, '2021-01-20 14:00:23', 'admin', '2021-01-20 22:47:26', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (37, 11, 'https://oss.xiapeiyi.com/shop/goods/955a1b8eaa8845639a2e2d21d3633484.png', NULL, '2021-01-20 14:00:23', 'admin', '2021-01-20 22:47:26', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (38, 14, 'https://oss.xiapeiyi.com/shop/goods/0bf8966f14bc460aa01f5e1f16ad8310.jpeg', NULL, '2021-01-21 23:15:41', 'admin', '2021-01-21 23:17:16', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (39, 14, 'https://oss.xiapeiyi.com/shop/goods/fe1d5cce84d04b9593635793b11c2b1b.jpg', NULL, '2021-01-21 23:15:41', 'admin', '2021-01-21 23:17:16', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (40, 15, 'https://oss.xiapeiyi.com/shop/goods/9d793fa460f94b298da0186942e14a5c.jpg', NULL, '2021-01-22 23:17:54', 'admin', '2021-01-22 23:17:54', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (41, 16, 'https://oss.xiapeiyi.com/shop/goods/86cedf1ced42476cb964a01e55d578c4.jpg', NULL, '2021-01-22 23:22:10', 'admin', '2021-01-22 23:22:10', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (42, 17, 'https://oss.xiapeiyi.com/shop/goods/5f0574ddfa5c499db7170f13645deb17.jpg', NULL, '2021-01-22 23:23:33', 'admin', '2021-01-23 19:27:52', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (43, 18, 'https://oss.xiapeiyi.com/shop/goods/ffb9de4d8a65470a8e16cbadc779eb46.jpg', NULL, '2021-01-22 23:24:54', 'admin', '2021-01-22 23:24:54', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (44, 19, 'https://oss.xiapeiyi.com/shop/goods/7b910d6c870445bebc3cf7b6ba5dcf0e.jpeg', NULL, '2021-01-26 13:23:55', 'admin', '2021-01-26 13:23:55', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (45, 20, 'https://oss.xiapeiyi.com/shop/goods/5ac9652253b7437fb377b208266df577.jpeg', NULL, '2021-01-26 13:25:26', 'admin', '2021-01-26 13:25:26', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (46, 21, 'https://oss.xiapeiyi.com/shop/goods/063157e95d564270bdfa79d84db91a92.jpg', NULL, '2021-01-26 13:26:21', 'admin', '2021-01-26 13:26:21', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (47, 22, 'https://oss.xiapeiyi.com/shop/goods/40f715265abe4b94a3abd163a956b744.jpeg', NULL, '2021-01-26 13:27:21', 'admin', '2021-01-26 13:27:21', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (48, 23, 'https://oss.xiapeiyi.com/shop/goods/062006dc25dc47e489ca602177b999a0.jpg', NULL, '2021-01-26 13:28:38', 'admin', '2021-01-26 13:28:38', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (49, 24, 'https://oss.xiapeiyi.com/shop/goods/8763fde7a15c46428535b8db97ee8021.jpg', NULL, '2021-01-26 13:29:35', 'admin', '2021-01-26 13:29:35', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (50, 25, 'https://oss.xiapeiyi.com/shop/goods/3aeedb0b2c50445588640a25c6dcab9f.jpeg', NULL, '2021-01-26 13:30:21', 'admin', '2021-01-26 13:30:21', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (51, 26, 'https://oss.xiapeiyi.com/shop/goods/4a544d33c6364e33b5d1c6126501115b.jpeg', NULL, '2021-01-26 13:31:12', 'admin', '2021-01-26 13:31:12', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (52, 27, 'https://oss.xiapeiyi.com/shop/goods/fe989374dee34c35b36b364c2bb57de5.jpeg', NULL, '2021-01-26 13:32:43', 'admin', '2021-01-26 13:32:43', 'admin', NULL, 0);
INSERT INTO `shop_goods_gallery` VALUES (53, 28, 'https://oss.xiapeiyi.com/shop/goods/6c0ea6c83cc44e1c9c6da015fcdd025f.jpeg', NULL, '2021-01-26 13:33:28', 'admin', '2021-01-26 13:33:28', 'admin', NULL, 0);
-- ----------------------------
-- Table structure for shop_goods_param
-- ----------------------------
DROP TABLE IF EXISTS `shop_goods_param`;
CREATE TABLE `shop_goods_param` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`goods_id` int(11) NULL DEFAULT NULL COMMENT '商品ID',
`param_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数名',
`param_value` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '参数值',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` int(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品产品参数' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_goods_param
-- ----------------------------
INSERT INTO `shop_goods_param` VALUES (1, 2, '品牌', 'spark', '2020-12-18 22:03:21', 'admin', '2020-12-18 22:03:21', 'admin', NULL, 1);
INSERT INTO `shop_goods_param` VALUES (2, 2, '质地', '柔软', '2020-12-18 22:03:21', 'admin', '2021-01-06 17:20:07', 'admin', NULL, 0);
INSERT INTO `shop_goods_param` VALUES (3, 4, '1', '1', '2020-12-19 16:02:19', 'admin', '2021-01-06 17:21:11', 'admin', NULL, 0);
INSERT INTO `shop_goods_param` VALUES (4, 5, '品牌', '每日优鲜', '2021-01-10 19:03:10', 'admin', '2021-01-10 19:04:24', 'admin', NULL, 0);
INSERT INTO `shop_goods_param` VALUES (5, 9, '1斤', '10', '2021-01-12 16:22:11', 'admin', '2021-01-20 13:55:39', 'admin', NULL, 0);
INSERT INTO `shop_goods_param` VALUES (6, 9, '2斤', '20', '2021-01-12 16:22:11', 'admin', '2021-01-20 13:55:39', 'admin', NULL, 0);
INSERT INTO `shop_goods_param` VALUES (7, 7, '成分', '椰子', '2021-01-20 22:30:59', 'admin', '2021-01-20 22:31:59', 'admin', NULL, 0);
INSERT INTO `shop_goods_param` VALUES (8, 11, '成分', '葡萄', '2021-01-20 22:33:30', 'admin', '2021-01-20 22:47:26', 'admin', NULL, 0);
INSERT INTO `shop_goods_param` VALUES (9, 14, '品牌', '自己运营', '2021-01-21 23:15:42', 'admin', '2021-01-21 23:17:16', 'admin', NULL, 0);
-- ----------------------------
-- Table structure for shop_goods_sku
-- ----------------------------
DROP TABLE IF EXISTS `shop_goods_sku`;
CREATE TABLE `shop_goods_sku` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`attr_val_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性值搭配,逗号',
`attr_vals` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性值name搭配,逗号',
`price` decimal(10, 2) NULL DEFAULT NULL COMMENT '价格',
`stock` int(10) NULL DEFAULT NULL COMMENT '库存',
`sku_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品编码',
`goods_id` int(11) NOT NULL COMMENT '商品主键',
`activity_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '活动价格',
PRIMARY KEY (`id`) USING BTREE,
INDEX `goods_id`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 236 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品属性搭配' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_goods_sku
-- ----------------------------
INSERT INTO `shop_goods_sku` VALUES (1, '1', NULL, 1.00, 1, '1', 1, 0.00);
INSERT INTO `shop_goods_sku` VALUES (81, '10', '1KG', 1.00, 4444, NULL, 3, 0.00);
INSERT INTO `shop_goods_sku` VALUES (82, '11', '2KG', 2.00, 4444, NULL, 3, 0.00);
INSERT INTO `shop_goods_sku` VALUES (83, '12', '4KG', 4.00, 444, NULL, 3, 0.00);
INSERT INTO `shop_goods_sku` VALUES (109, '1:1,2:4', '蓝色,XS', 1.00, 1, '2', 2, 0.00);
INSERT INTO `shop_goods_sku` VALUES (110, '1:1,2:5', '蓝色,S', 1.00, 1, '2', 2, 0.00);
INSERT INTO `shop_goods_sku` VALUES (111, '1:1,2:7', '蓝色,L', 1.00, 1, '2', 2, 0.00);
INSERT INTO `shop_goods_sku` VALUES (112, '1:2,2:4', '红色,XS', 1.00, 1, '2', 2, 0.00);
INSERT INTO `shop_goods_sku` VALUES (113, '1:2,2:5', '红色,S', 1.00, 1, '2', 2, 0.00);
INSERT INTO `shop_goods_sku` VALUES (114, '1:2,2:7', '红色,L', 1.00, 1, '2', 2, 0.00);
INSERT INTO `shop_goods_sku` VALUES (115, '1:2,2:4', '红色,XS', 2.00, 2, NULL, 4, 1.00);
INSERT INTO `shop_goods_sku` VALUES (116, '1:2,2:5', '红色,S', 2.00, 2, NULL, 4, 1.00);
INSERT INTO `shop_goods_sku` VALUES (117, '1:2,2:6', '红色,M', 2.00, 2, NULL, 4, 1.00);
INSERT INTO `shop_goods_sku` VALUES (120, '3:10', '1KG', 10.00, 91, '', 5, 0.00);
INSERT INTO `shop_goods_sku` VALUES (121, '3:11', '2KG', 20.00, 98, NULL, 5, 0.00);
INSERT INTO `shop_goods_sku` VALUES (125, '3:10', '1KG', 1.00, 1, '1', 8, 0.00);
INSERT INTO `shop_goods_sku` VALUES (130, '3:10', '1KG', 1.00, 2, '2', 10, 0.00);
INSERT INTO `shop_goods_sku` VALUES (131, '3:11', '2KG', 1.00, 2, '2', 10, 0.00);
INSERT INTO `shop_goods_sku` VALUES (132, '3:12', '4KG', 1.00, 2, '2', 10, 0.00);
INSERT INTO `shop_goods_sku` VALUES (141, '3:11', '2KG', 1.00, 1, NULL, 13, 0.00);
INSERT INTO `shop_goods_sku` VALUES (149, '3:10', '1KG', 1.00, 1, '1', 12, 0.00);
INSERT INTO `shop_goods_sku` VALUES (156, '3:10', '1KG', 1.00, 1, '1', 9, 0.00);
INSERT INTO `shop_goods_sku` VALUES (165, '3:10', '1KG', 1.00, 1, '1', 7, 0.00);
INSERT INTO `shop_goods_sku` VALUES (175, '3:10', '1KG', 1.00, 2, '2', 11, 0.80);
INSERT INTO `shop_goods_sku` VALUES (176, '3:11', '2KG', 1.00, 2, '2', 11, 0.80);
INSERT INTO `shop_goods_sku` VALUES (177, '3:12', '4KG', 1.00, 2, '2', 11, 0.80);
INSERT INTO `shop_goods_sku` VALUES (180, '2:4', '1', 8.00, 100, NULL, 14, 0.00);
INSERT INTO `shop_goods_sku` VALUES (181, '2:5', '2', 16.00, 100, NULL, 14, 0.00);
INSERT INTO `shop_goods_sku` VALUES (182, '2:4', '1', 17.80, 100, NULL, 15, 15.80);
INSERT INTO `shop_goods_sku` VALUES (183, '2:5', '2', 30.00, 100, NULL, 15, 28.80);
INSERT INTO `shop_goods_sku` VALUES (184, '2:4', '1', 8.00, 100, NULL, 16, 7.00);
INSERT INTO `shop_goods_sku` VALUES (185, '2:5', '2', 16.00, 100, NULL, 16, 14.00);
INSERT INTO `shop_goods_sku` VALUES (187, '3:10', '1KG', 5.90, 1000, NULL, 18, 4.50);
INSERT INTO `shop_goods_sku` VALUES (188, '3:10', '1KG', 60.00, 9999, '001', 6, 55.00);
INSERT INTO `shop_goods_sku` VALUES (195, '3:10,1:1,2:4', '1KG,蓝色,1', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (196, '3:10,1:1,2:5', '1KG,蓝色,2', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (197, '3:10,1:1,2:6', '1KG,蓝色,3', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (198, '3:10,1:2,2:4', '1KG,红色,1', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (199, '3:10,1:2,2:5', '1KG,红色,2', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (200, '3:10,1:2,2:6', '1KG,红色,3', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (201, '3:10,1:3,2:4', '1KG,灰色,1', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (202, '3:10,1:3,2:5', '1KG,灰色,2', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (203, '3:10,1:3,2:6', '1KG,灰色,3', 10.00, 10, '10', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (204, '3:11,1:1,2:4', '2KG,蓝色,1', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (205, '3:11,1:1,2:5', '2KG,蓝色,2', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (206, '3:11,1:1,2:6', '2KG,蓝色,3', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (207, '3:11,1:2,2:4', '2KG,红色,1', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (208, '3:11,1:2,2:5', '2KG,红色,2', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (209, '3:11,1:2,2:6', '2KG,红色,3', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (210, '3:11,1:3,2:4', '2KG,灰色,1', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (211, '3:11,1:3,2:5', '2KG,灰色,2', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (212, '3:11,1:3,2:6', '2KG,灰色,3', 20.00, 20, '20', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (213, '3:12,1:1,2:4', '4KG,蓝色,1', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (214, '3:12,1:1,2:5', '4KG,蓝色,2', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (215, '3:12,1:1,2:6', '4KG,蓝色,3', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (216, '3:12,1:2,2:4', '4KG,红色,1', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (217, '3:12,1:2,2:5', '4KG,红色,2', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (218, '3:12,1:2,2:6', '4KG,红色,3', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (219, '3:12,1:3,2:4', '4KG,灰色,1', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (220, '3:12,1:3,2:5', '4KG,灰色,2', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (221, '3:12,1:3,2:6', '4KG,灰色,3', 40.00, 40, '40', 17, 0.00);
INSERT INTO `shop_goods_sku` VALUES (222, '2:4', '1', 10.00, 10, '', 19, 0.00);
INSERT INTO `shop_goods_sku` VALUES (223, '2:4', '1', 10.00, 99, NULL, 20, 0.00);
INSERT INTO `shop_goods_sku` VALUES (224, '2:5', '2', 10.00, 99, NULL, 20, 0.00);
INSERT INTO `shop_goods_sku` VALUES (225, '2:6', '3', 10.00, 99, NULL, 20, 0.00);
INSERT INTO `shop_goods_sku` VALUES (226, '2:4', '1', 10.00, 99, NULL, 21, 0.00);
INSERT INTO `shop_goods_sku` VALUES (227, '2:5', '2', 10.00, 99, NULL, 21, 0.00);
INSERT INTO `shop_goods_sku` VALUES (228, '2:4', '1', 10.00, 10, NULL, 22, 0.00);
INSERT INTO `shop_goods_sku` VALUES (229, '2:4', '1', 10.00, 10, NULL, 23, 0.00);
INSERT INTO `shop_goods_sku` VALUES (230, '2:4', '1', 10.00, 10, NULL, 24, 0.00);
INSERT INTO `shop_goods_sku` VALUES (231, '3:10', '1KG', 10.00, 10, NULL, 25, 0.00);
INSERT INTO `shop_goods_sku` VALUES (232, '3:10', '1KG', 10.00, 10, NULL, 26, 0.00);
INSERT INTO `shop_goods_sku` VALUES (233, '2:5,3:10', '2,1KG', 10.00, 10, NULL, 27, 0.00);
INSERT INTO `shop_goods_sku` VALUES (234, '2:5,3:11', '2,2KG', 10.00, 10, NULL, 27, 0.00);
INSERT INTO `shop_goods_sku` VALUES (235, '3:10', '1KG', 1.00, 1, NULL, 28, 0.00);
-- ----------------------------
-- Table structure for shop_order
-- ----------------------------
DROP TABLE IF EXISTS `shop_order`;
CREATE TABLE `shop_order` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`order_sn` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '订单编号',
`user_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '会员ID',
`order_type` tinyint(1) NULL DEFAULT NULL COMMENT '订单类型 0 普通订单 1 团购订单 2 秒杀订单',
`order_status` smallint(1) NOT NULL DEFAULT 0 COMMENT '订单状态 0 待付款 1 已取消 2 已付款 3 已发货 4 用户确认收货 5 退款 6 完成',
`shipping_status` smallint(1) NULL DEFAULT 0 COMMENT '发货状态 0 待发货 1 已发货 2 已收货 2 退货',
`refund_status` smallint(1) NULL DEFAULT NULL COMMENT '退款状态 0 申请中 1 退款完成 2 拒绝退款',
`biz_id` bigint(20) NULL DEFAULT NULL COMMENT '业务id 对应的是 团购列表ID 秒杀商品的ID',
`consignee` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '收件人名称',
`province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '省',
`city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '市',
`district` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '0' COMMENT '区',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '详细地址',
`mobile` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '电话',
`shipping_fee` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '运费',
`pay_name` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '支付Name',
`pay_id` tinyint(3) NOT NULL DEFAULT 0 COMMENT '支付ID',
`actual_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '实际需要支付的金额',
`order_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '订单总价',
`goods_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品总价',
`pay_time` datetime NULL DEFAULT NULL COMMENT '支付时间',
`confirm_time` datetime NULL DEFAULT NULL COMMENT '用户确认收货时间',
`send_time` datetime NULL DEFAULT NULL COMMENT '发货时间',
`complete_time` datetime NULL DEFAULT NULL COMMENT '完成时间',
`freight_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '配送费用',
`coupon_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '使用的优惠券id',
`coupon_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '优惠券价格',
`remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '系统订单备注',
`user_remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '用户备注',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modify_date` datetime NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `order_sn`(`order_sn`) USING BTREE,
INDEX `user_id`(`user_id`) USING BTREE,
INDEX `order_status`(`order_status`) USING BTREE,
INDEX `shipping_status`(`shipping_status`) USING BTREE,
INDEX `pay_id`(`pay_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 17 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '订单管理' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_order
-- ----------------------------
INSERT INTO `shop_order` VALUES (2, '1348562110866657280', 2, 0, 3, 1, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:27:17', '2021-01-12 09:56:16');
INSERT INTO `shop_order` VALUES (3, '1348564262020321280', 2, 0, 4, 0, 2, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:35:50', '2021-01-12 17:46:44');
INSERT INTO `shop_order` VALUES (4, '1348564630129217536', 2, 0, 3, 1, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, '2021-01-14 15:28:36', NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:18', '2021-01-14 15:28:44');
INSERT INTO `shop_order` VALUES (5, '1348564632234758144', 2, 0, 1, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:18', '2021-02-18 13:07:21');
INSERT INTO `shop_order` VALUES (6, '1348564633006510080', 2, 0, 5, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:18', '2021-01-11 17:37:18');
INSERT INTO `shop_order` VALUES (7, '1348564633795039232', 2, 0, 1, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:18', '2021-02-18 13:07:12');
INSERT INTO `shop_order` VALUES (8, '1348564634554208256', 2, 0, 0, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:19', '2021-01-11 17:37:19');
INSERT INTO `shop_order` VALUES (9, '1348564635325960192', 2, 0, 0, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:19', '2021-01-11 17:37:19');
INSERT INTO `shop_order` VALUES (10, '1348564636068352000', 2, 0, 0, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:19', '2021-01-11 17:37:19');
INSERT INTO `shop_order` VALUES (11, '1348564636806549504', 2, 0, 0, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:19', '2021-01-11 17:37:19');
INSERT INTO `shop_order` VALUES (12, '1348564637645410304', 2, 0, 0, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:19', '2021-01-11 17:37:19');
INSERT INTO `shop_order` VALUES (13, '1348564638471688192', 2, 0, 0, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 10.00, 10.00, 10.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:37:20', '2021-01-11 17:37:20');
INSERT INTO `shop_order` VALUES (14, '1348565153897123840', 2, 0, 0, 0, NULL, NULL, '王小峰', '浙江省', '杭州市', '江干区', '浙江省杭州市江干区彭埠街道', '18513262490', 0.00, '', 0, 20.00, 20.00, 20.00, NULL, NULL, NULL, NULL, 0.00, 0, 0.00, NULL, '测试', '2021-01-11 17:39:22', '2021-01-11 17:39:22');
-- ----------------------------
-- Table structure for shop_order_express
-- ----------------------------
DROP TABLE IF EXISTS `shop_order_express`;
CREATE TABLE `shop_order_express` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`order_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单ID',
`shipper_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '运费ID',
`shipper_name` varchar(120) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '物流公司名称',
`shipper_code` varchar(60) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '物流公司代码',
`logistic_code` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '快递单号',
`traces` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '物流跟踪信息',
`is_finish` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否完成',
`request_count` int(11) NULL DEFAULT 0 COMMENT '总查询次数',
`request_time` datetime NULL DEFAULT NULL COMMENT '最近一次向第三方查询物流信息时间',
`create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
`modify_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `order_id`(`order_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '订单物流信息表,发货时生成' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_order_express
-- ----------------------------
INSERT INTO `shop_order_express` VALUES (1, 1, 1, '顺丰快递', 'SF', '2021011001000', '开始发货', 0, 0, NULL, '2021-01-07 23:01:34', '2021-01-07 23:01:37');
INSERT INTO `shop_order_express` VALUES (2, 1, 0, '中通快递', 'ZTO', '1111', '', 0, 0, NULL, '2021-01-12 09:52:48', '2021-01-12 09:52:48');
INSERT INTO `shop_order_express` VALUES (4, 2, 0, '中通快递', 'ZTO', '202101120111', '', 0, 0, NULL, '2021-01-12 09:56:16', '2021-01-12 09:56:16');
INSERT INTO `shop_order_express` VALUES (5, 4, 0, '圆通速递', 'YTO', 'YT5144498012364', '签收成功', 0, 0, NULL, '2021-01-14 15:28:44', '2021-01-14 15:28:44');
-- ----------------------------
-- Table structure for shop_order_goods
-- ----------------------------
DROP TABLE IF EXISTS `shop_order_goods`;
CREATE TABLE `shop_order_goods` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`order_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '订单ID',
`goods_id` int(8) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商品ID',
`goods_sn` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '商品编号',
`goods_title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '商品title',
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '商品图片',
`number` smallint(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT '下单数',
`price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '下单单价',
`total_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '商品总额',
`goods_attr_val_ids` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '规格',
`goods_attr_vals` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '规格名称',
PRIMARY KEY (`id`) USING BTREE,
INDEX `order_id`(`order_id`) USING BTREE,
INDEX `goods_id`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 15 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '下单商品详情' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_order_goods
-- ----------------------------
INSERT INTO `shop_order_goods` VALUES (1, 1, 2, '2222', '好吃不贵的栗子', 'http://qliiucyce.hb-bkt.clouddn.com/3eede97ee19a40a0901d103eb4ac7e95.jpg', 1, 0.00, NULL, '1:1:,2:2', '红色,L');
INSERT INTO `shop_order_goods` VALUES (2, 2, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (3, 3, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (4, 4, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (5, 5, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (6, 6, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (7, 7, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (8, 8, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (9, 9, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (10, 10, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (11, 11, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (12, 12, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (13, 13, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 1, 10.00, 10.00, '3:10', '1KG');
INSERT INTO `shop_order_goods` VALUES (14, 14, 5, '10001', '赣南脐橙单果', 'https://oss.xiapeiyi.com/shop/goods/9f53f249ecfa4710830b2383973bd9c7.png', 2, 10.00, 20.00, '3:11', '2KG');
-- ----------------------------
-- Table structure for shop_order_refund
-- ----------------------------
DROP TABLE IF EXISTS `shop_order_refund`;
CREATE TABLE `shop_order_refund` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`refund_sn` bigint(20) NULL DEFAULT NULL COMMENT '退款单号',
`order_id` int(11) NULL DEFAULT NULL COMMENT '订单ID',
`order_sn` bigint(22) NULL DEFAULT NULL COMMENT '订单编号',
`user_id` int(11) NULL DEFAULT NULL COMMENT '退款用户',
`order_goods_id` int(11) NULL DEFAULT NULL COMMENT '退款商品ID',
`num` int(4) NULL DEFAULT NULL COMMENT '退款数量',
`refund_status` tinyint(1) NULL DEFAULT NULL COMMENT '退款状态 0 申请中 1 退款完成 2 拒绝退款',
`order_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '订单金额',
`refund_amount` decimal(10, 2) NULL DEFAULT NULL COMMENT '退款金额',
`refund_time` datetime NULL DEFAULT NULL COMMENT '退款时间',
`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '退款图片',
`reason` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '退款原因',
`refused_reason` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '拒绝退款原因',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modify_date` datetime NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `order_id`(`order_id`) USING BTREE COMMENT 'order_id'
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '退款管理' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_order_refund
-- ----------------------------
INSERT INTO `shop_order_refund` VALUES (1, 1348893439302963200, 3, 1348564262020321280, 1, 6, 1, 2, 10.00, 10.00, NULL, 'http://qliiucyce.hb-bkt.clouddn.com/5bbb875feb394cfbb52ceee48a5bac11.jpg', '我不喜欢', '拒绝', '2021-01-12 15:23:52', '2021-01-12 17:46:44');
-- ----------------------------
-- Table structure for shop_pink_goods
-- ----------------------------
DROP TABLE IF EXISTS `shop_pink_goods`;
CREATE TABLE `shop_pink_goods` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`goods_id` int(11) NOT NULL COMMENT '商品ID',
`start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
`end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
`effective_time` int(10) NULL DEFAULT NULL COMMENT '拼团有效时间 小时',
`price` decimal(10, 2) NULL DEFAULT NULL COMMENT '拼团价格',
`people` int(2) NULL DEFAULT NULL COMMENT '参团人数',
`quota` int(255) NULL DEFAULT NULL COMMENT '限购',
`status` tinyint(1) NULL DEFAULT NULL COMMENT '状态 0 关闭 1开始',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE,
INDEX `goods_id`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '拼团产品' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_pink_goods
-- ----------------------------
INSERT INTO `shop_pink_goods` VALUES (2, 11, '2021-01-28 11:00:00', '2021-01-28 15:00:00', 1, 0.80, 2, 1, 1, 'admin', '2021-01-28 22:30:00', 'admin', '2021-01-28 22:30:04', NULL, 0);
-- ----------------------------
-- Table structure for shop_pink_user
-- ----------------------------
DROP TABLE IF EXISTS `shop_pink_user`;
CREATE TABLE `shop_pink_user` (
`id` int(20) NOT NULL COMMENT '团购单ID',
`user_id` int(11) NULL DEFAULT NULL COMMENT '用户主键',
`goods_id` int(11) NULL DEFAULT NULL COMMENT '商品主键',
`goods_title` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品名称',
`order_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '下单IDs',
`people` int(2) NULL DEFAULT NULL COMMENT '几人团',
`count_people` int(2) NULL DEFAULT NULL COMMENT '几人参加',
`start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
`end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '状态 1 进行中 2 已完成 3 未完成',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '拼团用户列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_pink_user
-- ----------------------------
INSERT INTO `shop_pink_user` VALUES (1, 1, 2, '【值享焕新版】Apple iPhone 12 Pro Max (A2412) 128GB 金色 支持移动联通电信5G 双卡双待手机', '1000000002,1000003', 2, 1, '2021-01-07 11:41:19', '2021-01-08 11:41:21', 1);
-- ----------------------------
-- Table structure for shop_seckill
-- ----------------------------
DROP TABLE IF EXISTS `shop_seckill`;
CREATE TABLE `shop_seckill` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '秒杀名称',
`start_time` time NULL DEFAULT NULL COMMENT '开始时间',
`end_time` time NULL DEFAULT NULL COMMENT '结束时间',
`image` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片',
`sort` int(2) NULL DEFAULT NULL COMMENT '排序',
`status` tinyint(1) NULL DEFAULT NULL COMMENT '状态 0 关闭 1开始',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`create_date` datetime NOT NULL COMMENT '创建时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '秒杀配置' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_seckill
-- ----------------------------
INSERT INTO `shop_seckill` VALUES (1, '8点秒杀', '08:00:00', '10:00:00', 'https://oss.xiapeiyi.com/shop/seckill/9647b2b8376f48edbfa708b211e5181d.png', 1, 1, 'admin', '2021-01-06 10:16:29', 'admin', '2021-02-04 13:49:54', NULL, 0);
-- ----------------------------
-- Table structure for shop_seckill_goods
-- ----------------------------
DROP TABLE IF EXISTS `shop_seckill_goods`;
CREATE TABLE `shop_seckill_goods` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`goods_id` int(11) NULL DEFAULT NULL COMMENT '商品主键',
`start_time` datetime NULL DEFAULT NULL COMMENT '开始时间',
`end_time` datetime NULL DEFAULT NULL COMMENT '结束时间',
`kill_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '秒杀价格',
`sales` int(10) NULL DEFAULT 0 COMMENT '秒杀销量',
`create_time` datetime NULL DEFAULT NULL COMMENT '添加时间',
`is_quota` tinyint(1) NULL DEFAULT NULL COMMENT '是否限购',
`quota` int(10) NULL DEFAULT 0 COMMENT '限购总数',
`del_flag` tinyint(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE,
INDEX `goods_id`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品秒杀配置列表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_seckill_goods
-- ----------------------------
INSERT INTO `shop_seckill_goods` VALUES (1, 2, '2021-01-25 08:00:00', '2021-01-25 10:00:00', 0.90, 100, NULL, 1, 2, 1);
INSERT INTO `shop_seckill_goods` VALUES (2, 6, '2021-02-10 08:00:00', '2021-02-10 10:00:00', 55.00, 1000, NULL, 0, 0, 0);
INSERT INTO `shop_seckill_goods` VALUES (3, 15, '2021-02-10 08:00:00', '2021-02-10 10:00:00', 15.80, 888, NULL, 0, 0, 0);
INSERT INTO `shop_seckill_goods` VALUES (4, 16, '2021-02-10 08:00:00', '2021-02-10 10:00:00', 7.00, 332, NULL, NULL, 0, 0);
INSERT INTO `shop_seckill_goods` VALUES (5, 18, '2021-02-10 08:00:00', '2021-02-10 10:00:00', 4.50, 456, NULL, NULL, 0, 0);
-- ----------------------------
-- Table structure for shop_setting_swiper
-- ----------------------------
DROP TABLE IF EXISTS `shop_setting_swiper`;
CREATE TABLE `shop_setting_swiper` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`img_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '图片地址',
`sort` tinyint(2) NULL DEFAULT NULL COMMENT '排序',
`type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '类型 none 无类型 goods 商品',
`goods_id` int(11) NULL DEFAULT NULL COMMENT '商品ID',
`status` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '状态 0 正常 1 停用 ',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` tinyint(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '首页轮播图' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_setting_swiper
-- ----------------------------
INSERT INTO `shop_setting_swiper` VALUES (1, 'https://oss.xiapeiyi.com/shop/swiper/f6492f255d394b60a0baccddd3ff088a.jpg', 2, 'goods', 11, '0', '2021-01-03 16:30:33', 'admin', '2021-01-23 14:04:11', 'admin', NULL, 0);
INSERT INTO `shop_setting_swiper` VALUES (2, 'https://oss.xiapeiyi.com/shop/swiper/9245c2be59984b54b93cf214a07b25b6.jpg', 1, 'none', NULL, '0', '2021-01-21 20:17:30', 'admin', '2021-01-23 14:04:21', 'admin', NULL, 0);
INSERT INTO `shop_setting_swiper` VALUES (3, 'https://oss.xiapeiyi.com/shop/swiper/20dbd132471c448e824e7a2911bffa74.jpg', 1, 'none', NULL, '0', '2021-01-21 20:17:40', 'admin', '2021-01-21 20:17:40', 'admin', NULL, 0);
-- ----------------------------
-- Table structure for shop_specs_attr
-- ----------------------------
DROP TABLE IF EXISTS `shop_specs_attr`;
CREATE TABLE `shop_specs_attr` (
`attr_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`attr_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性名称',
`attr_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '组件类型',
`is_pic` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '是否上传图片',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` int(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`attr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品规格属性' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_specs_attr
-- ----------------------------
INSERT INTO `shop_specs_attr` VALUES (1, '颜色', 'list_box', '1', '2020-12-16 16:05:15', 'admin', '2020-12-16 16:14:20', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr` VALUES (2, '件数', 'check_box', '0', '2020-12-16 16:26:33', 'admin', '2021-01-12 16:25:50', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr` VALUES (3, '重量', 'check_box', '0', '2020-12-19 13:59:36', 'admin', '2020-12-19 13:59:36', 'admin', NULL, 0);
-- ----------------------------
-- Table structure for shop_specs_attr_val
-- ----------------------------
DROP TABLE IF EXISTS `shop_specs_attr_val`;
CREATE TABLE `shop_specs_attr_val` (
`attr_val_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`attr_id` int(11) NULL DEFAULT NULL COMMENT '属性ID',
`attr_val` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '属性值',
`sort` int(1) NULL DEFAULT NULL COMMENT '排序',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`del_flag` int(1) NOT NULL COMMENT '是否删除 (0 是 1否)',
PRIMARY KEY (`attr_val_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 13 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商品规格属性值' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_specs_attr_val
-- ----------------------------
INSERT INTO `shop_specs_attr_val` VALUES (1, 1, '蓝色', 1, '2020-12-16 16:05:15', 'admin', '2020-12-16 16:14:20', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (2, 1, '红色', 2, '2020-12-16 16:05:15', 'admin', '2020-12-16 16:14:20', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (3, 1, '灰色', 3, '2020-12-16 16:14:20', 'admin', '2020-12-16 16:14:20', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (4, 2, '1', 1, '2020-12-16 16:26:33', 'admin', '2021-01-12 16:25:50', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (5, 2, '2', 2, '2020-12-16 16:26:33', 'admin', '2021-01-12 16:25:50', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (6, 2, '3', 3, '2020-12-16 16:26:33', 'admin', '2021-01-12 16:25:50', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (7, 2, '4', 4, '2020-12-16 16:26:33', 'admin', '2021-01-12 16:25:50', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (8, 2, '5', 5, '2020-12-16 16:26:33', 'admin', '2021-01-12 16:25:50', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (9, 2, '6', 6, '2020-12-16 16:26:33', 'admin', '2021-01-12 16:25:50', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (10, 3, '1KG', 1, '2020-12-19 13:59:36', 'admin', '2020-12-19 13:59:36', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (11, 3, '2KG', 2, '2020-12-19 13:59:36', 'admin', '2020-12-19 13:59:36', 'admin', NULL, 0);
INSERT INTO `shop_specs_attr_val` VALUES (12, 3, '4KG', 3, '2020-12-19 13:59:36', 'admin', '2020-12-19 13:59:36', 'admin', NULL, 0);
-- ----------------------------
-- Table structure for shop_user
-- ----------------------------
DROP TABLE IF EXISTS `shop_user`;
CREATE TABLE `shop_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名称',
`password` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户密码',
`gender` tinyint(1) NOT NULL DEFAULT 1 COMMENT '性别:0 未知, 1男, 1 女',
`birthday` date NULL DEFAULT NULL COMMENT '生日',
`last_login_time` datetime NULL DEFAULT NULL COMMENT '最近一次登录时间',
`last_login_ip` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '最近一次登录IP地址',
`user_type` tinyint(3) NULL DEFAULT 0 COMMENT '用户类型 0 普通用户',
`nickname` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称或网络名称',
`mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户手机号码',
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户头像图片',
`wx_openid` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '微信登录openid',
`status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '0 可用, 1 禁用, 2 注销',
`create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_date` datetime NULL DEFAULT NULL COMMENT '更新时间',
`del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '逻辑删除',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `user_name`(`username`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'shop会员管理' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_user
-- ----------------------------
INSERT INTO `shop_user` VALUES (1, '微信用户xxx', '123456', 1, '2020-12-13', '2020-12-13 16:47:33', '122.122.122.122', 0, 'Mr_王小峰', '18513262490', 'https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJDZJCdn1xIDrMVpfntF0ZDKjeHENEZLQ8nqSPuMQ92ibnrUOPpibpRoj4MJW9SmfDFPDGnscZeR4dw/132', '011GAkFa1dh69A0c5MHa1us5eE1GAkFQ', 0, '2020-12-13 16:48:03', '2020-12-13 16:48:08', 0);
INSERT INTO `shop_user` VALUES (2, '微信用户oaDJg5', '', 1, NULL, '2021-02-19 11:57:02', '124.160.214.140', 0, 'Mr_王小峰', '123888888', 'https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTJDZJCdn1xIDrMVpfntF0ZDKjeHENEZLQ8nqSPuMQ92ibnrUOPpibpRojShZuAxVbmPyfIjOcnwvJgQ/132', 'oaDJg5SAy2AIlqKJ30Wp2uffOZPk', 0, '2021-01-16 17:18:40', NULL, 0);
INSERT INTO `shop_user` VALUES (3, '微信用户oaQMI5', '', 1, NULL, '2021-01-29 21:31:50', '183.158.249.102', 0, '', '', '', 'oaQMI5kqJUOOuvmVAPVsV3s7rwG0', 0, '2021-01-18 18:49:03', NULL, 0);
-- ----------------------------
-- Table structure for shop_user_address
-- ----------------------------
DROP TABLE IF EXISTS `shop_user_address`;
CREATE TABLE `shop_user_address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '收货人名称',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户表的用户ID',
`province_id` int(11) NOT NULL DEFAULT 0 COMMENT '行政区域表的省ID',
`province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '省',
`city_id` int(11) NOT NULL DEFAULT 0 COMMENT '行政区域表的市ID',
`city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '城市',
`area_id` int(11) NOT NULL DEFAULT 0 COMMENT '行政区域表的区县ID',
`area` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '区县',
`address` varchar(127) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '具体收货地址',
`mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号码',
`is_default` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否默认地址',
`create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
`modify_date` datetime NULL DEFAULT NULL COMMENT '更新时间',
`del_flag` tinyint(1) NULL DEFAULT 0 COMMENT '逻辑删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `user_id`(`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '收货地址表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_user_address
-- ----------------------------
INSERT INTO `shop_user_address` VALUES (1, '王小峰', 2, 330000, '浙江省', 330100, '杭州市', 330104, '江干区', '彭埠街道', '18513262490', 1, '2020-12-13 17:14:33', '2021-02-10 14:44:48', 0);
INSERT INTO `shop_user_address` VALUES (7, '王小峰', 2, 110000, '北京市', 110100, '北京市', 110105, '朝阳区', '大望路22号', '15538107993', 0, '2021-01-29 17:29:30', '2021-02-10 14:45:06', 0);
INSERT INTO `shop_user_address` VALUES (8, '', 2, 0, NULL, 0, NULL, 0, NULL, '', '', 0, '2021-01-29 17:44:34', '2021-01-29 17:44:34', 1);
-- ----------------------------
-- Table structure for shop_user_cart
-- ----------------------------
DROP TABLE IF EXISTS `shop_user_cart`;
CREATE TABLE `shop_user_cart` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(11) NULL DEFAULT NULL COMMENT '会员ID',
`goods_id` int(11) NULL DEFAULT NULL COMMENT '商品ID',
`attr_val_ids` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格搭配',
`attr_vals` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格搭配翻译',
`num` int(5) NULL DEFAULT NULL COMMENT '数量',
`create_date` datetime NOT NULL COMMENT '创建时间',
`del_flag` tinyint(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `attr_val_ids`(`attr_val_ids`) USING BTREE COMMENT 'attr_val_ids',
INDEX `user_id`(`user_id`) USING BTREE COMMENT 'user_id',
INDEX `goods_id`(`goods_id`) USING BTREE COMMENT 'goods_id'
) ENGINE = InnoDB AUTO_INCREMENT = 14 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '会员购物车' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_user_cart
-- ----------------------------
INSERT INTO `shop_user_cart` VALUES (1, 1, 9, '3:10', '1KG', 2, '2021-01-20 17:07:38', 0);
INSERT INTO `shop_user_cart` VALUES (2, 3, 17, '3:10,1:1,2:4', '1KG,蓝色,1', 4, '2021-01-25 23:04:43', 0);
INSERT INTO `shop_user_cart` VALUES (3, 2, 14, '2:4', '1', 1, '2021-01-26 22:40:54', 1);
INSERT INTO `shop_user_cart` VALUES (4, 2, 16, '2:4', '1', 3, '2021-01-26 22:55:51', 1);
INSERT INTO `shop_user_cart` VALUES (5, 2, 18, '3:10', '1KG', 2, '2021-01-26 22:57:00', 1);
INSERT INTO `shop_user_cart` VALUES (6, 2, 25, '3:10', '1KG', 1, '2021-01-26 23:04:27', 0);
INSERT INTO `shop_user_cart` VALUES (7, 2, 14, '2:5', '2', 1, '2021-01-26 23:05:51', 0);
INSERT INTO `shop_user_cart` VALUES (8, 2, 27, '2:5,3:10', '2,1KG', 1, '2021-01-26 23:07:10', 1);
INSERT INTO `shop_user_cart` VALUES (9, 2, 26, '3:10', '1KG', 1, '2021-02-01 14:47:56', 0);
INSERT INTO `shop_user_cart` VALUES (10, 2, 28, '3:10', '1KG', 2, '2021-02-02 16:53:45', 1);
INSERT INTO `shop_user_cart` VALUES (11, 2, 18, '3:10', '1KG', 1, '2021-02-04 14:50:07', 0);
INSERT INTO `shop_user_cart` VALUES (12, 2, 21, '2:4', '1', 1, '2021-02-10 14:19:43', 1);
INSERT INTO `shop_user_cart` VALUES (13, 2, 27, '2:5,3:10', '2,1KG', 1, '2021-02-10 14:19:57', 0);
-- ----------------------------
-- Table structure for shop_user_collect
-- ----------------------------
DROP TABLE IF EXISTS `shop_user_collect`;
CREATE TABLE `shop_user_collect` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(10) NOT NULL COMMENT '用户Id',
`goods_id` int(10) NULL DEFAULT NULL COMMENT '商品Id',
`create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
`del_flag` tinyint(1) NULL DEFAULT NULL COMMENT '逻辑删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `user_id`(`user_id`) USING BTREE,
INDEX `goods_id`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户收藏' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_user_collect
-- ----------------------------
INSERT INTO `shop_user_collect` VALUES (1, 1, 2, '2020-12-13 17:27:24', 1);
INSERT INTO `shop_user_collect` VALUES (2, 1, 9, '2021-01-20 16:18:02', 0);
INSERT INTO `shop_user_collect` VALUES (3, 2, 6, '2021-02-03 10:06:49', 0);
INSERT INTO `shop_user_collect` VALUES (4, 2, 14, '2021-02-03 10:29:02', 1);
INSERT INTO `shop_user_collect` VALUES (5, 2, 16, '2021-02-03 11:18:27', 1);
INSERT INTO `shop_user_collect` VALUES (6, 2, 16, '2021-02-03 11:18:41', 0);
INSERT INTO `shop_user_collect` VALUES (7, 2, 26, '2021-02-03 11:54:01', 1);
INSERT INTO `shop_user_collect` VALUES (8, 2, 15, '2021-02-10 14:42:49', 1);
INSERT INTO `shop_user_collect` VALUES (9, 2, 15, '2021-02-10 14:42:51', 0);
-- ----------------------------
-- Table structure for shop_user_footprint
-- ----------------------------
DROP TABLE IF EXISTS `shop_user_footprint`;
CREATE TABLE `shop_user_footprint` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(10) NOT NULL COMMENT '用户ID',
`goods_id` int(10) NOT NULL COMMENT '产品id',
`create_date` datetime NULL DEFAULT NULL COMMENT '创建时间',
`del_flag` tinyint(1) NULL DEFAULT NULL COMMENT '逻辑删除',
PRIMARY KEY (`id`) USING BTREE,
INDEX `user_id`(`user_id`) USING BTREE,
INDEX `goods_id`(`goods_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 45 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '用户浏览足迹' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_user_footprint
-- ----------------------------
INSERT INTO `shop_user_footprint` VALUES (4, 1, 9, '2021-01-20 15:40:25', 0);
INSERT INTO `shop_user_footprint` VALUES (5, 1, 12, '2021-01-20 15:43:36', 0);
INSERT INTO `shop_user_footprint` VALUES (6, 2, 16, '2021-01-27 15:35:19', 0);
INSERT INTO `shop_user_footprint` VALUES (7, 2, 15, '2021-01-27 15:36:10', 0);
INSERT INTO `shop_user_footprint` VALUES (8, 2, 6, '2021-01-27 16:45:25', 0);
INSERT INTO `shop_user_footprint` VALUES (9, 2, 14, '2021-01-27 18:05:40', 0);
INSERT INTO `shop_user_footprint` VALUES (10, 2, 17, '2021-01-27 18:06:52', 0);
INSERT INTO `shop_user_footprint` VALUES (11, 2, 6, '2021-01-28 16:35:44', 0);
INSERT INTO `shop_user_footprint` VALUES (12, 2, 6, '2021-01-30 11:27:32', 0);
INSERT INTO `shop_user_footprint` VALUES (13, 2, 14, '2021-01-30 15:17:09', 0);
INSERT INTO `shop_user_footprint` VALUES (14, 2, 15, '2021-01-30 16:40:38', 0);
INSERT INTO `shop_user_footprint` VALUES (15, 2, 16, '2021-01-30 19:40:23', 0);
INSERT INTO `shop_user_footprint` VALUES (16, 2, 6, '2021-02-01 14:43:21', 0);
INSERT INTO `shop_user_footprint` VALUES (17, 2, 18, '2021-02-01 14:47:40', 0);
INSERT INTO `shop_user_footprint` VALUES (18, 2, 26, '2021-02-01 14:47:51', 0);
INSERT INTO `shop_user_footprint` VALUES (19, 2, 15, '2021-02-01 14:48:13', 0);
INSERT INTO `shop_user_footprint` VALUES (20, 2, 6, '2021-02-02 16:51:24', 0);
INSERT INTO `shop_user_footprint` VALUES (21, 2, 18, '2021-02-02 16:53:30', 0);
INSERT INTO `shop_user_footprint` VALUES (22, 2, 28, '2021-02-02 16:53:42', 0);
INSERT INTO `shop_user_footprint` VALUES (23, 2, 14, '2021-02-02 17:34:53', 0);
INSERT INTO `shop_user_footprint` VALUES (24, 2, 6, '2021-02-03 09:36:10', 0);
INSERT INTO `shop_user_footprint` VALUES (25, 2, 18, '2021-02-03 09:55:26', 0);
INSERT INTO `shop_user_footprint` VALUES (26, 2, 14, '2021-02-03 09:56:09', 0);
INSERT INTO `shop_user_footprint` VALUES (27, 2, 16, '2021-02-03 11:18:12', 0);
INSERT INTO `shop_user_footprint` VALUES (28, 2, 26, '2021-02-03 11:53:59', 0);
INSERT INTO `shop_user_footprint` VALUES (29, 2, 26, '2021-02-04 10:31:55', 0);
INSERT INTO `shop_user_footprint` VALUES (30, 2, 6, '2021-02-04 11:14:52', 0);
INSERT INTO `shop_user_footprint` VALUES (31, 2, 18, '2021-02-04 11:21:06', 0);
INSERT INTO `shop_user_footprint` VALUES (32, 2, 14, '2021-02-04 11:23:11', 0);
INSERT INTO `shop_user_footprint` VALUES (33, 2, 15, '2021-02-04 11:32:22', 0);
INSERT INTO `shop_user_footprint` VALUES (34, 2, 16, '2021-02-04 11:39:11', 0);
INSERT INTO `shop_user_footprint` VALUES (35, 2, 17, '2021-02-04 11:39:19', 0);
INSERT INTO `shop_user_footprint` VALUES (36, 2, 6, '2021-02-10 13:47:00', 0);
INSERT INTO `shop_user_footprint` VALUES (37, 2, 18, '2021-02-10 14:19:15', 0);
INSERT INTO `shop_user_footprint` VALUES (38, 2, 26, '2021-02-10 14:19:31', 0);
INSERT INTO `shop_user_footprint` VALUES (39, 2, 21, '2021-02-10 14:19:40', 0);
INSERT INTO `shop_user_footprint` VALUES (40, 2, 27, '2021-02-10 14:19:53', 0);
INSERT INTO `shop_user_footprint` VALUES (41, 2, 15, '2021-02-10 14:42:44', 0);
INSERT INTO `shop_user_footprint` VALUES (42, 2, 9, '2021-02-10 14:46:16', 0);
INSERT INTO `shop_user_footprint` VALUES (43, 2, 6, '2021-02-19 11:57:07', 0);
INSERT INTO `shop_user_footprint` VALUES (44, 2, 15, '2021-02-19 11:57:14', 0);
-- ----------------------------
-- Table structure for shop_wx_auth
-- ----------------------------
DROP TABLE IF EXISTS `shop_wx_auth`;
CREATE TABLE `shop_wx_auth` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
`app_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'appID',
`secret` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'secret',
`client_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'oauth2 clientId',
`mchid` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '直连商户号',
`create_date` datetime NOT NULL COMMENT '创建时间',
`creator` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '创建人',
`modify_date` datetime NOT NULL COMMENT '修改时间',
`modifier` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '修改人',
`remarks` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注',
`del_flag` bit(1) NOT NULL COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '微信小程序授权信息' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of shop_wx_auth
-- ----------------------------
INSERT INTO `shop_wx_auth` VALUES (1, 'wx28480e43e3e8636f', 'fdd8df9f3ddad22a9216e6fe72f62f5d', 'spark-app', NULL, '2020-12-14 13:24:01', 'admin', '2020-12-15 14:25:35', 'admin', '微信小程序', b'0');
INSERT INTO `shop_wx_auth` VALUES (2, 'wxd9544ddf5fa3c9b8', 'a6ef177adeb1b519fb37ddc3134d4df0', 'spark-app', NULL, '2021-01-16 17:41:53', 'admin', '2021-01-16 17:41:53', 'admin', '回家小程序', b'0');
SET FOREIGN_KEY_CHECKS = 1; | the_stack |
-- migrate:up
create type sg_public.post_kind as enum(
'post',
'proposal',
'vote'
);
comment on type sg_public.post_kind
is 'The three kinds of posts.';
create table sg_public.topic (
id uuid primary key default uuid_generate_v4(),
created timestamp not null default current_timestamp,
modified timestamp not null default current_timestamp,
user_id uuid null references sg_public.user (id),
session_id uuid null,
name text not null,
entity_id uuid not null,
entity_kind sg_public.entity_kind not null,
foreign key (entity_id, entity_kind)
references sg_public.entity (entity_id, entity_kind),
constraint user_or_session check (((user_id is not null) or (session_id is not null)))
);
comment on table sg_public.topic
is 'The topics on an entity''s talk page.';
comment on column sg_public.topic.id
is 'The public ID of the topic.';
comment on column sg_public.topic.created
is 'When the user created the topic.';
comment on column sg_public.topic.modified
is 'When the user last modified the topic.';
comment on column sg_public.topic.user_id
is 'The user who created the topic.';
comment on column sg_public.topic.session_id
is 'The logged out person who created the topic.';
comment on column sg_public.topic.name
is 'The name of the topic.';
comment on column sg_public.topic.entity_id
is 'The entity the topic belongs to.';
comment on column sg_public.topic.entity_kind
is 'The kind of entity the topic belongs to.';
create index on "sg_public"."topic"("created");
create index on "sg_public"."topic"("entity_id");
create table sg_public.post (
id uuid primary key default uuid_generate_v4(),
created timestamp not null default current_timestamp,
modified timestamp not null default current_timestamp,
user_id uuid null references sg_public.user (id)
check (kind <> 'vote' or user_id is not null),
session_id uuid null,
topic_id uuid not null references sg_public.topic (id),
kind sg_public.post_kind not null default 'post',
body text null
check (kind = 'vote' or body is not null),
parent_id uuid null references sg_public.post (id)
check (kind <> 'vote' or parent_id is not null),
response boolean null
check (kind <> 'vote' or response is not null),
constraint user_or_session check (((user_id is not null) or (session_id is not null)))
-- also see join table: sg_public.post_entity_version
-- specific to kind = 'proposal'
);
comment on table sg_public.post
is 'The posts on an entity''s talk page. Belongs to a topic.';
comment on column sg_public.post.id
is 'The ID of the post.';
comment on column sg_public.post.created
is 'When the user created the post.';
comment on column sg_public.post.modified
is 'When the post last changed.';
comment on column sg_public.post.user_id
is 'The user who created the post.';
comment on column sg_public.post.session_id
is 'The logged out user who created the post.';
comment on column sg_public.post.topic_id
is 'The topic the post belongs to.';
comment on column sg_public.post.kind
is 'The kind of post (post, proposal, vote).';
comment on column sg_public.post.body
is 'The body or main content of the post.';
comment on column sg_public.post.parent_id
is 'If the post is a reply, which post it replies to.';
comment on column sg_public.post.response
is 'If the post is a vote, yes/no on approving.';
create table sg_public.post_entity_version (
id uuid primary key default uuid_generate_v4(),
created timestamp not null default current_timestamp,
modified timestamp not null default current_timestamp,
post_id uuid not null references sg_public.post (id),
version_id uuid not null,
entity_kind sg_public.entity_kind not null,
foreign key (version_id, entity_kind)
references sg_public.entity_version (version_id, entity_kind),
unique (post_id, version_id)
);
comment on table sg_public.post_entity_version
is 'A join table between a proposal (post) and its entity versions.';
comment on column sg_public.post_entity_version.id
is 'The relationship ID.';
comment on column sg_public.post_entity_version.created
is 'When a user created this post.';
comment on column sg_public.post_entity_version.modified
is 'When a user last modified this post.';
comment on column sg_public.post_entity_version.post_id
is 'The post ID.';
comment on column sg_public.post_entity_version.version_id
is 'The entity ID of the entity version.';
create unique index post_vote_unique_idx
on sg_public.post (user_id, parent_id)
where kind = 'vote';
-- comment on index post_vote_unique_idx
-- is 'A user may only vote once on a proposal.';
create or replace function sg_private.verify_post()
returns trigger as $$
declare
parent sg_public.post;
begin
if (new.parent_id) then
select * into parent
from sg_public.post
where id = new.parent_id;
if (parent.topic_id <> new.topic_id) then
raise exception 'A reply must belong to the same topic.'
using errcode = '76177573';
end if;
if (new.kind = 'vote' and parent.kind <> 'proposal') then
raise exception 'A vote may only reply to a proposal.'
using errcode = '8DF72C56';
end if;
if (new.kind = 'vote' and parent.user_id = new.user_id) then
raise exception 'A user cannot vote on their own proposal.'
using errcode = 'E47E0411';
end if;
end if;
return new;
end;
$$ language 'plpgsql';
comment on function sg_private.verify_post()
is 'Verify valid data when creating or updating a post.';
create trigger insert_topic_user_id
before insert on sg_public.topic
for each row execute procedure sg_private.insert_user_or_session();
comment on trigger insert_topic_user_id on sg_public.topic
is 'Whenever I make a new topic, auto fill the `user_id` column';
create trigger insert_post_user_id
before insert on sg_public.post
for each row execute procedure sg_private.insert_user_or_session();
comment on trigger insert_post_user_id on sg_public.post
is 'Whenever I make a new post, auto fill the `user_id` column';
create trigger insert_post_verify
before insert on sg_public.post
for each row execute procedure sg_private.verify_post();
comment on trigger insert_post_verify on sg_public.post
is 'Whenever I make a new post, check that the post is valid.';
create trigger update_topic_modified
before update on sg_public.topic
for each row execute procedure sg_private.update_modified_column();
comment on trigger update_topic_modified on sg_public.topic
is 'Whenever a topic changes, update the `modified` column.';
create trigger update_post_modified
before update on sg_public.post
for each row execute procedure sg_private.update_modified_column();
comment on trigger update_post_modified on sg_public.post
is 'Whenever a post changes, update the `modified` column.';
create trigger update_post_verify
before update on sg_public.post
for each row execute procedure sg_private.verify_post();
comment on trigger update_post_verify on sg_public.post
is 'Whenever I make a new post, check that the post is valid.';
create trigger update_post_entity_version_modified
before update on sg_public.post_entity_version
for each row execute procedure sg_private.update_modified_column();
comment on trigger update_post_entity_version_modified
on sg_public.post_entity_version
is 'Whenever a post entity version changes, update the `modified` column.';
alter table sg_public.topic enable row level security;
alter table sg_public.post enable row level security;
-- Select topic: any.
grant select on table sg_public.topic to sg_anonymous, sg_user, sg_admin;
create policy select_topic on sg_public.topic
for select -- any user
using (true);
comment on policy select_topic on sg_public.topic
is 'Anyone can select topics.';
-- Insert topic: any.
grant insert (name, entity_id, entity_kind) on table sg_public.topic
to sg_anonymous, sg_user, sg_admin;
create policy insert_topic on sg_public.topic
for insert -- any user
with check (true);
-- Update topic: user self (name), or admin.
grant update (name) on table sg_public.topic to sg_user;
create policy update_topic on sg_public.topic
for update to sg_user
using (user_id = nullif(current_setting('jwt.claims.user_id', true), '')::uuid);
comment on policy update_topic on sg_public.topic
is 'A user can update the name of their own topic.';
grant update on table sg_public.topic to sg_admin;
create policy update_topic_admin on sg_public.topic
for update to sg_admin
using (true);
comment on policy update_topic on sg_public.topic
is 'An admin can update the name of any topic.';
-- Delete topic: admin.
grant delete on table sg_public.topic to sg_admin;
create policy delete_topic_admin on sg_public.topic
for delete to sg_admin
using (true);
comment on policy delete_topic_admin on sg_public.topic
is 'An admin can delete any topic.';
-- Select post: any.
grant select on table sg_public.post to sg_anonymous, sg_user, sg_admin;
create policy select_post on sg_public.post
for select -- any user
using (true);
comment on policy select_post on sg_public.post
is 'Anyone can select posts.';
-- Insert post: any.
grant insert (topic_id, kind, body, parent_id, response) on table sg_public.post
to sg_anonymous, sg_user, sg_admin;
create policy insert_post on sg_public.post
for insert -- any user
with check (true);
-- Update post: user self (body, response), or admin.
grant update (body, response) on table sg_public.post to sg_user;
create policy update_post on sg_public.post
for update to sg_user
using (user_id = nullif(current_setting('jwt.claims.user_id', true), '')::uuid);
comment on policy update_post on sg_public.post
is 'A user can update the body or response of their own post.';
grant update on table sg_public.post to sg_admin;
create policy update_post_admin on sg_public.post
for update to sg_admin
using (true);
comment on policy update_post_admin on sg_public.post
is 'An admin can update any post.';
-- Delete post: admin.
grant delete on table sg_public.post to sg_admin;
create policy delete_post_admin on sg_public.post
for delete to sg_admin
using (true);
comment on policy delete_post_admin on sg_public.post
is 'An admin can delete any post.';
-- Select post_entity_version: any.
grant select on table sg_public.post_entity_version
to sg_anonymous, sg_user, sg_admin;
-- Update or delete post_entity_version: admin.
grant update, delete on table sg_public.post_entity_version
to sg_admin;
create or replace function sg_public.topic_posts(sg_public.topic)
returns setof sg_public.post as $$
select p.*
from sg_public.post p
where p.topic_id = $1.id
order by p.created desc;
$$ language sql stable;
comment on function sg_public.topic_posts(sg_public.topic)
is 'Returns the posts of the topic.';
grant execute on function sg_public.topic_posts(sg_public.topic)
to sg_anonymous, sg_user, sg_admin;
create index on "sg_public"."post"("created");
create index on "sg_public"."post"("user_id");
CREATE INDEX ON "sg_public"."topic"("user_id");
CREATE INDEX ON "sg_public"."post"("topic_id");
CREATE INDEX ON "sg_public"."post"("parent_id");
CREATE INDEX ON "sg_public"."post_entity_version"("version_id", "entity_kind");
CREATE INDEX ON "sg_public"."topic"("entity_id", "entity_kind");
-- migrate:down | the_stack |
;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`blackshop_config` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `blackshop_config`;
/*Table structure for table `config_info` */
DROP TABLE IF EXISTS `config_info`;
CREATE TABLE `config_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
`md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
`src_user` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'source user',
`src_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
`app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
`c_desc` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`c_use` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`effect` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`c_schema` text CHARACTER SET utf8 COLLATE utf8_bin,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfo_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info';
/*Data for the table `config_info` */
insert into `config_info`(`id`,`data_id`,`group_id`,`content`,`md5`,`gmt_create`,`gmt_modified`,`src_user`,`src_ip`,`app_name`,`tenant_id`,`c_desc`,`c_use`,`effect`,`type`,`c_schema`) values
(1,'application-dev.yml','DEFAULT_GROUP','jasypt:\n encryptor:\n password: blackshop\n \nspring:\n redis:\n host: ${REDIS-HOST:blackshop-redis}\n password: ${REDIS-PASSWORD:123456}\n cloud:\n sentinel:\n transport:\n dashboard: blackshop-sentinel:5020 \nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n response:\n enabled: true\n\nribbon:\n ReadTimeout: 10000\n ConnectTimeout: 10000\n\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'','fd38be50c444514059e8f4d308b5694c','2019-04-18 02:10:20','2020-04-13 22:39:27',NULL,'0:0:0:0:0:0:0:1','','','通用配置文件','null','null','yaml','null'),
(3,'black-shop-user-service-dev.yml','DEFAULT_GROUP','spring:\r\n datasource:\r\n type: com.alibaba.druid.pool.DruidDataSource\r\n druid:\r\n driver-class-name: com.mysql.cj.jdbc.Driver\r\n username: ${MYSQL-USER:black_user}\r\n password: ${MYSQL-PWD:123456}\r\n url: jdbc:mysql://${MYSQL-HOST:blackshop-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:blackshop_user}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true','533dadd8eee7323ab6b6cb194f66060e','2020-03-17 23:04:13','2020-03-17 23:43:24',NULL,'0:0:0:0:0:0:0:1','','','321321','null','null','yaml','null'),
(5,'black-shop-auth-dev.yml','DEFAULT_GROUP','spring:\r\n datasource:\r\n type: com.alibaba.druid.pool.DruidDataSource\r\n druid:\r\n driver-class-name: com.mysql.cj.jdbc.Driver\r\n username: ${MYSQL-USER:black_user}\r\n password: ${MYSQL-PWD:123456}\r\n url: jdbc:mysql://${MYSQL-HOST:blackshop-mysql}:${MYSQL-PORT:3306}/${MYSQL-DB:blackshop_user}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&allowMultiQueries=true&allowPublicKeyRetrieval=true','533dadd8eee7323ab6b6cb194f66060e','2020-03-17 23:06:12','2020-03-17 23:41:19',NULL,'0:0:0:0:0:0:0:1','','','认证服务配置项','null','null','yaml','null'),
(17,'black-shop-gateway-dev.yml','DEFAULT_GROUP','spring:\r\n cloud:\r\n gateway:\r\n routes:\r\n - id: auth-service\r\n uri: lb://black-shop-auth\r\n predicates:\r\n - Path=/auth2/**\r\n filters:\r\n - StripPrefix=1\r\n - id: user-service\r\n uri: lb://black-shop-user-service\r\n predicates:\r\n - Path=/user/**\r\n filters:\r\n - StripPrefix=1\r\n - id: goods-service\r\n uri: lb://black-shop-goods-service\r\n predicates:\r\n - Path=/goods/**','bd55f47b497b4edb2a5df2c9619c5716','2020-03-26 22:04:36','2020-04-13 23:49:04',NULL,'0:0:0:0:0:0:0:1','','','网关配置','null','null','yaml','null');
/*Table structure for table `config_info_aggr` */
DROP TABLE IF EXISTS `config_info_aggr`;
CREATE TABLE `config_info_aggr` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
`datum_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'datum_id',
`content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '内容',
`gmt_modified` datetime NOT NULL COMMENT '修改时间',
`app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfoaggr_datagrouptenantdatum` (`data_id`,`group_id`,`tenant_id`,`datum_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='增加租户字段';
/*Data for the table `config_info_aggr` */
/*Table structure for table `config_info_beta` */
DROP TABLE IF EXISTS `config_info_beta`;
CREATE TABLE `config_info_beta` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
`app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'app_name',
`content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
`beta_ips` varchar(1024) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'betaIps',
`md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
`src_user` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'source user',
`src_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
`tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfobeta_datagrouptenant` (`data_id`,`group_id`,`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_beta';
/*Data for the table `config_info_beta` */
/*Table structure for table `config_info_tag` */
DROP TABLE IF EXISTS `config_info_tag`;
CREATE TABLE `config_info_tag` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
`tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT 'tenant_id',
`tag_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'tag_id',
`app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'app_name',
`content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'content',
`md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'md5',
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
`src_user` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'source user',
`src_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'source ip',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_configinfotag_datagrouptenanttag` (`data_id`,`group_id`,`tenant_id`,`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_info_tag';
/*Data for the table `config_info_tag` */
/*Table structure for table `config_tags_relation` */
DROP TABLE IF EXISTS `config_tags_relation`;
CREATE TABLE `config_tags_relation` (
`id` bigint(20) NOT NULL COMMENT 'id',
`tag_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'tag_name',
`tag_type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'tag_type',
`data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'data_id',
`group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'group_id',
`tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT 'tenant_id',
`nid` bigint(20) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`nid`),
UNIQUE KEY `uk_configtagrelation_configidtag` (`id`,`tag_name`,`tag_type`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='config_tag_relation';
/*Data for the table `config_tags_relation` */
/*Table structure for table `group_capacity` */
DROP TABLE IF EXISTS `group_capacity`;
CREATE TABLE `group_capacity` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Group ID,空字符表示整个集群',
`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数,,0表示使用默认值',
`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='集群、各Group容量信息表';
/*Data for the table `group_capacity` */
/*Table structure for table `his_config_info` */
DROP TABLE IF EXISTS `his_config_info`;
CREATE TABLE `his_config_info` (
`id` bigint(64) unsigned NOT NULL,
`nid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`data_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`group_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`app_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'app_name',
`content` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`md5` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00',
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00',
`src_user` text CHARACTER SET utf8 COLLATE utf8_bin,
`src_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`op_type` char(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '租户字段',
PRIMARY KEY (`nid`),
KEY `idx_gmt_create` (`gmt_create`),
KEY `idx_gmt_modified` (`gmt_modified`),
KEY `idx_did` (`data_id`)
) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='多租户改造';
/*Data for the table `his_config_info` */
insert into `his_config_info`(`id`,`nid`,`data_id`,`group_id`,`app_name`,`content`,`md5`,`gmt_create`,`gmt_modified`,`src_user`,`src_ip`,`op_type`,`tenant_id`) values
(1,25,'application-dev.yml','DEFAULT_GROUP','','jasypt:\n encryptor:\n password: blackshop\n \nspring:\n redis:\n host: 47.106.190.221\n password: 123456\n cloud:\n sentinel:\n transport:\n dashboard: blackshop-sentinel:5020 \nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n response:\n enabled: true\n\nribbon:\n ReadTimeout: 10000\n ConnectTimeout: 10000\n\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'','29c2eca9827c02673efb5a36ade59e79','2010-05-05 00:00:00','2020-04-13 22:30:56',NULL,'0:0:0:0:0:0:0:1','U',''),
(1,26,'application-dev.yml','DEFAULT_GROUP','','jasypt:\n encryptor:\n password: blackshop\n \nspring:\n redis:\n host: ${REDIS-HOST:blackshop-redis}\n password: ${REDIS-PASSWORD:123456}\n cloud:\n sentinel:\n transport:\n dashboard: blackshop-sentinel:5020 \nfeign:\n sentinel:\n enabled: true\n okhttp:\n enabled: true\n httpclient:\n enabled: false\n client:\n config:\n default:\n connectTimeout: 10000\n readTimeout: 10000\n compression:\n request:\n enabled: true\n response:\n enabled: true\n\nribbon:\n ReadTimeout: 10000\n ConnectTimeout: 10000\n\nmanagement:\n endpoints:\n web:\n exposure:\n include: \'*\'','fd38be50c444514059e8f4d308b5694c','2010-05-05 00:00:00','2020-04-13 22:39:27',NULL,'0:0:0:0:0:0:0:1','U',''),
(17,27,'black-shop-gateway-dev.yml','DEFAULT_GROUP','','spring:\r\n cloud:\r\n gateway:\r\n routes:\r\n - id: auth-service\r\n uri: lb://black-shop-auth\r\n predicates:\r\n - Path=/auth2/**\r\n filters:\r\n - StripPrefix=1\r\n - id: user-service\r\n uri: lb://black-shop-user-service\r\n predicates:\r\n - Path=/test/**\r\n filters:\r\n - StripPrefix=1','5c4616181083e724284b7ef96c31579a','2010-05-05 00:00:00','2020-04-13 22:57:15',NULL,'0:0:0:0:0:0:0:1','U',''),
(17,28,'black-shop-gateway-dev.yml','DEFAULT_GROUP','','spring:\r\n cloud:\r\n gateway:\r\n routes:\r\n - id: auth-service\r\n uri: lb://black-shop-auth\r\n predicates:\r\n - Path=/auth2/**\r\n filters:\r\n - StripPrefix=1\r\n - id: user-service\r\n uri: lb://black-shop-user-service\r\n predicates:\r\n - Path=/user/**\r\n filters:\r\n - StripPrefix=1\r\n - id: goods-service\r\n uri: lb://black-shop-goods-service\r\n predicates:\r\n - Path=/goods/**\r\n filters:\r\n - StripPrefix=1','d548c4f755cf67844e5d3993b9948e75','2010-05-05 00:00:00','2020-04-13 23:00:29',NULL,'0:0:0:0:0:0:0:1','U',''),
(17,29,'black-shop-gateway-dev.yml','DEFAULT_GROUP','','spring:\r\n cloud:\r\n gateway:\r\n routes:\r\n - id: auth-service\r\n uri: lb://black-shop-auth\r\n predicates:\r\n - Path=/auth2/**\r\n filters:\r\n - StripPrefix=1\r\n - id: user-service\r\n uri: lb://black-shop-user-service\r\n predicates:\r\n - Path=/user/**\r\n - id: goods-service\r\n uri: lb://black-shop-goods-service\r\n predicates:\r\n - Path=/goods/**\r\n filters:\r\n - StripPrefix=1','2c7051d023d455aff2eb367af95e9274','2010-05-05 00:00:00','2020-04-13 23:01:17',NULL,'0:0:0:0:0:0:0:1','U',''),
(17,30,'black-shop-gateway-dev.yml','DEFAULT_GROUP','','spring:\r\n cloud:\r\n gateway:\r\n routes:\r\n - id: auth-service\r\n uri: lb://black-shop-auth\r\n predicates:\r\n - Path=/auth2/**\r\n filters:\r\n - StripPrefix=1\r\n - id: user-service\r\n uri: lb://black-shop-user-service\r\n predicates:\r\n - Path=/user/**\r\n - id: goods-service\r\n uri: lb://black-shop-goods-service\r\n predicates:\r\n - Path=/goods/**','8af6d10442376785649418ebe18a0ec5','2010-05-05 00:00:00','2020-04-13 23:49:04',NULL,'0:0:0:0:0:0:0:1','U','');
/*Table structure for table `roles` */
DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles` (
`username` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`role` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*Data for the table `roles` */
insert into `roles`(`username`,`role`) values
('nacos','ROLE_ADMIN');
/*Table structure for table `tenant_capacity` */
DROP TABLE IF EXISTS `tenant_capacity`;
CREATE TABLE `tenant_capacity` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'Tenant ID',
`quota` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '配额,0表示使用默认值',
`usage` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用量',
`max_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个配置大小上限,单位为字节,0表示使用默认值',
`max_aggr_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '聚合子配置最大个数',
`max_aggr_size` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '单个聚合数据的子配置大小上限,单位为字节,0表示使用默认值',
`max_history_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最大变更历史数量',
`gmt_create` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '创建时间',
`gmt_modified` datetime NOT NULL DEFAULT '2010-05-05 00:00:00' COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_tenant_id` (`tenant_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='租户容量信息表';
/*Data for the table `tenant_capacity` */
/*Table structure for table `tenant_info` */
DROP TABLE IF EXISTS `tenant_info`;
CREATE TABLE `tenant_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`kp` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'kp',
`tenant_id` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT 'tenant_id',
`tenant_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT 'tenant_name',
`tenant_desc` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'tenant_desc',
`create_source` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'create_source',
`gmt_create` bigint(20) NOT NULL COMMENT '创建时间',
`gmt_modified` bigint(20) NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_tenant_info_kptenantid` (`kp`,`tenant_id`),
KEY `idx_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';
/*Data for the table `tenant_info` */
insert into `tenant_info`(`id`,`kp`,`tenant_id`,`tenant_name`,`tenant_desc`,`create_source`,`gmt_create`,`gmt_modified`) values
(1,'1','bd19918b-7773-48eb-9cee-106f7bf94789','initalizr','start-initalizr','nacos',1584978156849,1584978156849);
/*Table structure for table `users` */
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`username` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`enabled` tinyint(1) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*Data for the table `users` */
insert into `users`(`username`,`password`,`enabled`) values
('nacos','$2a$10$7BBgCU858kduirKEEITNkOP4HiSGsUsV0xX89lU49uMY9BZWUkqw6',1);
/*!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 */; | the_stack |
create table perct as select a, a / 10 as b from generate_series(1, 100)a;
create table perct2 as select a, a / 10 as b from generate_series(1, 100)a, generate_series(1, 2);
create table perct3 as select a, b from perct, generate_series(1, 10)i where a % 7 < i;
create table perct4 as select case when a % 10 = 5 then null else a end as a,
b, null::float as c from perct;
create table percts as select '2012-01-01 00:00:00'::timestamp + interval '1day' * i as a,
i / 10 as b, i as c from generate_series(1, 100)i;
create table perctsz as select '2012-01-01 00:00:00 UTC'::timestamptz + interval '1day' * i as a,
i / 10 as b, i as c from generate_series(1, 100)i;
create view percv as select percentile_cont(0.4) within group (order by a / 10),
median(a), percentile_disc(0.51) within group (order by a desc) from perct group by b order by b;
create view percv2 as select median(a) as m1, median(a::float) as m2 from perct;
create table mpp_22219(col_a character(2) NOT NULL, dkey_a character varying(8) NOT NULL, value double precision)
WITH (APPENDONLY=true, COMPRESSLEVEL=5, ORIENTATION=column, COMPRESSTYPE=zlib, OIDS=FALSE)
DISTRIBUTED BY (dkey_a);
insert into mpp_22219 select i, i, i from (select * from generate_series(1, 20) i ) a ;
create table mpp_21026 ( t1 varchar(10), t2 int);
insert into mpp_21026 select i, i from (select * from generate_series(1, 20) i ) a ;
create table mpp_20076 (col1 timestamp, col2 int);
insert into mpp_20076 select to_timestamp(i),i from generate_series(1,20) i;
CREATE TABLE mpp_22413
(
col_a character(2) NOT NULL,
d1 character varying(8) NOT NULL,
d2 character varying(8) NOT NULL,
d3 character varying(8) NOT NULL,
value1 double precision,
value2 double precision
)
WITH (OIDS=FALSE)
DISTRIBUTED BY (d1,d2,d3);
insert into mpp_22413
select i, i, i, i, i,i
from (select * from generate_series(1, 99) i ) a ;
-- We test the same queries with gp_idf_deduplicate none/force. Make sure
-- both tests have the same when adding.
set gp_idf_deduplicate to none;
select percentile_cont(0.5) within group (order by a),
median(a), percentile_disc(0.5) within group(order by a) from perct;
select b, percentile_cont(0.5) within group (order by a),
median(a), percentile_disc(0.5) within group(order by a) from perct group by b order by b;
select percentile_cont(0.2) within group (order by a) from generate_series(1, 100)a;
select a / 10, percentile_cont(0.2) within group (order by a) from generate_series(1, 100)a
group by a / 10 order by a / 10;
select percentile_cont(0.2) within group (order by a),
percentile_cont(0.8) within group (order by a desc) from perct group by b order by b;
select percentile_cont(0.1) within group (order by a), count(*), sum(a) from perct
group by b order by b;
select percentile_cont(0.6) within group (order by a), count(*), sum(a) from perct;
select percentile_cont(0.3) within group (order by a) + count(*) from perct group by b order by b;
select median(a) from perct group by b having median(a) = 5;
select median(a), percentile_cont(0.6) within group (order by a desc) from perct group by b having count(*) > 1 order by 1;
select median(10);
select count(*), median(b+1) from perct group by b+2
having median(b+1) in (select avg(b+1) from perct group by b+2);
select median(a) from perct2;
select median(a) from perct2 group by b order by b;
select b, count(*), count(distinct a), median(a) from perct3 group by b order by b;
select b+1, count(*), count(distinct a),
median(a), percentile_cont(0.3) within group (order by a desc)
from perct group by b+1 order by b+1;
select median(a), median(c) from perct4;
select median(a), median(c) from perct4 group by b;
select count(*) over (partition by b), median(a) from perct group by b order by b;
select sum(median(a)) over (partition by b) from perct group by b order by b;
select percentile_disc(0) within group (order by a) from perct;
prepare p (float) as select percentile_cont($1) within group (order by a)
from perct group by b order by b;
execute p(0.1);
execute p(0.8);
deallocate p;
select sum((select median(a) from perct)) from perct;
select percentile_cont(null) within group (order by a) from perct;
select percentile_cont(null) within group (order by a),
percentile_disc(null) within group (order by a desc) from perct group by b;
select median(a), percentile_cont(0.5) within group (order by a),
percentile_disc(0.5) within group(order by a),
(select min(a) from percts) - interval '1day' + interval '1day' * median(c),
(select min(a) from percts) - interval '1day' + interval '1day' *
percentile_disc(0.5) within group (order by c)
from percts group by b order by b;
select percentile_cont(1.0/86400) within group (order by a) from percts
where c between 1 and 2;
select percentile_cont(0.1) within group (order by a),
percentile_cont(0.9) within group (order by a desc) from percts;
select percentile_cont(0.1) within group (order by a),
percentile_cont(0.2) within group (order by a) from perctsz;
select median(a - (select min(a) from percts)) from percts;
select median(a), b from perct group by b order by b desc;
select count(*) from(select median(a) from perct group by ())s;
select median(a) from perct group by grouping sets((b)) order by b;
select distinct median(a), count(*) from perct;
select perct.a, 0.2*avg(perct2.a) as avga,
percentile_cont(0.34)within group(order by perct2.b)
from
(select a, a / 10 b from generate_series(1, 100)a)perct,
(select a, a / 10 b from generate_series(1, 100)a)perct2
where perct.a=perct2.a group by perct.a having median(perct.b) > 10;
select median(a - '2011-12-31 00:00:00 UTC'::timestamptz) from perctsz group by b order by median;
-- view
select * from percv;
set gp_idf_deduplicate to force;
select percentile_cont(0.5) within group (order by a),
median(a), percentile_disc(0.5) within group(order by a) from perct;
select b, percentile_cont(0.5) within group (order by a),
median(a), percentile_disc(0.5) within group(order by a) from perct group by b order by b;
select percentile_cont(0.2) within group (order by a) from generate_series(1, 100)a;
select a / 10, percentile_cont(0.2) within group (order by a) from generate_series(1, 100)a
group by a / 10 order by a / 10;
select percentile_cont(0.2) within group (order by a),
percentile_cont(0.8) within group (order by a desc) from perct group by b order by b;
select percentile_cont(0.1) within group (order by a), count(*), sum(a) from perct
group by b order by b;
select percentile_cont(0.6) within group (order by a), count(*), sum(a) from perct;
select percentile_cont(0.3) within group (order by a) + count(*) from perct group by b order by b;
select median(a) from perct group by b having median(a) = 5;
select median(a), percentile_cont(0.6) within group (order by a desc) from perct group by b having count(*) > 1 order by 1;
select median(10);
select count(*), median(b+1) from perct group by b+2
having median(b+1) in (select avg(b+1) from perct group by b+2);
select median(a) from perct2;
select median(a) from perct2 group by b order by b;
select b, count(*), count(distinct a), median(a) from perct3 group by b order by b;
select b+1, count(*), count(distinct a),
median(a), percentile_cont(0.3) within group (order by a desc)
from perct group by b+1 order by b+1;
select median(a), median(c) from perct4;
select median(a), median(c) from perct4 group by b;
select count(*) over (partition by b), median(a) from perct group by b order by b;
select sum(median(a)) over (partition by b) from perct group by b order by b;
select percentile_disc(0) within group (order by a) from perct;
prepare p (float) as select percentile_cont($1) within group (order by a)
from perct group by b order by b;
execute p(0.1);
execute p(0.8);
deallocate p;
select sum((select median(a) from perct)) from perct;
select percentile_cont(null) within group (order by a) from perct;
select percentile_cont(null) within group (order by a),
percentile_disc(null) within group (order by a desc) from perct group by b;
select median(a), percentile_cont(0.5) within group (order by a),
percentile_disc(0.5) within group(order by a),
(select min(a) from percts) - interval '1day' + interval '1day' * median(c),
(select min(a) from percts) - interval '1day' + interval '1day' *
percentile_disc(0.5) within group (order by c)
from percts group by b order by b;
select percentile_cont(1.0/86400) within group (order by a) from percts
where c between 1 and 2;
select percentile_cont(0.1) within group (order by a),
percentile_cont(0.9) within group (order by a desc) from percts;
select percentile_cont(0.1) within group (order by a),
percentile_cont(0.2) within group (order by a) from perctsz;
select median(a - (select min(a) from percts)) from percts;
select median(a), b from perct group by b order by b desc;
select count(*) from(select median(a) from perct group by ())s;
select median(a) from perct group by grouping sets((b)) order by b;
select distinct median(a), count(*) from perct;
select perct.a, 0.2*avg(perct2.a) as avga,
percentile_cont(0.34)within group(order by perct2.b)
from
(select a, a / 10 b from generate_series(1, 100)a)perct,
(select a, a / 10 b from generate_series(1, 100)a)perct2
where perct.a=perct2.a group by perct.a having median(perct.b) > 10;
select median(a - '2011-12-31 00:00:00 UTC'::timestamptz) from perctsz group by b order by median;
-- view
select * from percv;
reset gp_idf_deduplicate;
select pg_get_viewdef('percv');
select pg_get_viewdef('percv2');
-- errors
-- no WITHIN GROUP clause
select percentile_cont(a) from perct;
-- the argument must not contain variable
select percentile_cont(a) within group (order by a) from perct;
-- ungrouped column
select b, percentile_disc(0.1) within group (order by a) from perct;
-- nested aggregate
select percentile_cont(count(*)) within group (order by a) from perct;
select sum(percentile_cont(0.22) within group (order by a)) from perct;
-- OVER clause
select percentile_cont(0.3333) within group (order by a) over (partition by a%2) from perct;
select median(a) over (partition by b) from perct group by b;
-- function scan
select * from median(10);
-- wrong type argument
select percentile_disc('a') within group (order by a) from perct;
-- nested case
select count(median(a)) from perct;
select median(count(*)) from perct;
select percentile_cont(0.2) within group (order by count(*) over()) from perct;
select percentile_disc(0.1) within group (order by group_id()) from perct;
-- subquery is not allowed to the argument
select percentile_cont((select 0.1 from gp_version_at_initdb)) within group (order by a) from perct;
-- the argument must not be volatile expression
select percentile_cont(random()) within group (order by a) from perct;
-- out of range
select percentile_cont(-0.1) within group (order by a) from perct;
select percentile_cont(1.00000001) within group (order by a) from perct;
-- CSQ is not supported currently. Shame.
select sum((select median(a) from perct where b = t.b)) from perct t;
-- used in LIMIT
select * from perct limit median(a);
-- multiple sort key
select percentile_cont(0.8) within group (order by a, a + 1, a + 2) from perct;
-- set-returning
select generate_series(1, 2), median(a) from perct;
-- GROUPING SETS
select median(a) from perct group by grouping sets((), (b));
-- wrong type in ORDER BY
select median('text') from perct;
select percentile_cont(now()) within group (order by a) from percts;
select percentile_cont(0.5) within group (order by point(0,0)) from perct;
-- outer reference is not allowed for now
select (select a from perct where median(t.a) = 5) from perct t;
-- MPP-22219
select count(*) from
(SELECT b.dkey_a, MEDIAN(B.VALUE)
FROM mpp_22219 B
GROUP BY b.dkey_a) s;
select count(*) from
(SELECT b.dkey_a, percentile_cont(0.5) within group (order by b.VALUE)
FROM mpp_22219 B
GROUP BY b.dkey_a) s;
-- MPP-21026
select median(t2) from mpp_21026 group by t1;
-- MPP-20076
select 1, to_char(col1, 'YYYY'), median(col2) from mpp_20076 group by 1, 2;
select 1, col1, median(col2) from mpp_20076 group by 1, 2;
select to_char(col1, 'YYYY') AS tstmp_column, median(col2) from mpp_20076 group by 1;
select 1, median(col2) from mpp_20076 group by 1;
-- MPP-22413
select median(value1), count(*)
from mpp_22413
where d2 ='55'
group by d1, d2, d3, value2;
select median(value1), count(*)
from mpp_22413
where d2 ='55'
group by d1, d2, d3, value2::int;
select median(value1), count(*)
from mpp_22413
where d2 ='55'
group by d1, d2, d3, value2::varchar;
select median(value1), count(*)
from mpp_22413
where d2 ='55'
group by d1, d2, value2;
select median(value1), count(*)
from mpp_22413
where d2 ='55'
group by d1, d2, value2, d3;
select median(value1), count(*)
from mpp_22413
where d2 ='55'
group by d1, d2;
drop view percv2;
drop view percv;
drop table perct;
drop table perct2;
drop table perct3;
drop table perct4;
drop table percts;
drop table perctsz;
drop table mpp_22219;
drop table mpp_21026;
drop table mpp_20076;
drop table mpp_22413; | the_stack |
--PRIMARY KEY
SELECT * FROM pglogical_regress_variables()
\gset
\c :provider_dsn
-- testing update of primary key
-- create table with primary key and 3 other tables referencing it
SELECT pglogical.replicate_ddl_command($$
CREATE TABLE public.pk_users (
id integer PRIMARY KEY,
another_id integer unique not null,
a_id integer,
name text,
address text
);
--pass
$$);
SELECT * FROM pglogical.replication_set_add_table('default', 'pk_users');
INSERT INTO pk_users VALUES(1,11,1,'User1', 'Address1');
INSERT INTO pk_users VALUES(2,12,1,'User2', 'Address2');
INSERT INTO pk_users VALUES(3,13,2,'User3', 'Address3');
INSERT INTO pk_users VALUES(4,14,2,'User4', 'Address4');
SELECT * FROM pk_users ORDER BY id;
SELECT attname, attnotnull, attisdropped from pg_attribute where attrelid = 'pk_users'::regclass and attnum > 0 order by attnum;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT * FROM pk_users ORDER BY id;
\c :provider_dsn
UPDATE pk_users SET address='UpdatedAddress1' WHERE id=1;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT * FROM pk_users ORDER BY id;
-- Set up for secondary unique index and two-index
-- conflict handling cases.
INSERT INTO pk_users VALUES (5000,5000,0,'sub1',NULL);
INSERT INTO pk_users VALUES (6000,6000,0,'sub2',NULL);
\c :provider_dsn
-- Resolve a conflict on the secondary unique constraint
INSERT INTO pk_users VALUES (5001,5000,1,'pub1',NULL);
-- And a conflict that violates two constraints
INSERT INTO pk_users VALUES (6000,6000,1,'pub2',NULL);
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT * FROM pk_users WHERE id IN (5000,5001,6000) ORDER BY id;
\c :provider_dsn
DELETE FROM pk_users WHERE id IN (5000,5001,6000);
\set VERBOSITY terse
SELECT pglogical.replicate_ddl_command($$
CREATE UNIQUE INDEX another_id_temp_idx ON public.pk_users (another_id);
ALTER TABLE public.pk_users DROP CONSTRAINT pk_users_pkey,
ADD CONSTRAINT pk_users_pkey PRIMARY KEY USING INDEX another_id_temp_idx;
ALTER TABLE public.pk_users DROP CONSTRAINT pk_users_another_id_key;
$$);
SELECT attname, attnotnull, attisdropped from pg_attribute where attrelid = 'pk_users'::regclass and attnum > 0 order by attnum;
UPDATE pk_users SET address='UpdatedAddress2' WHERE id=2;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT attname, attnotnull, attisdropped from pg_attribute where attrelid = 'pk_users'::regclass and attnum > 0 order by attnum;
SELECT * FROM pk_users ORDER BY id;
\c :provider_dsn
UPDATE pk_users SET address='UpdatedAddress3' WHERE another_id=12;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT * FROM pk_users ORDER BY id;
\c :provider_dsn
UPDATE pk_users SET address='UpdatedAddress4' WHERE a_id=2;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
INSERT INTO pk_users VALUES(4,15,2,'User5', 'Address5');
-- subscriber now has duplicated value in id field while provider does not
SELECT * FROM pk_users ORDER BY id;
\c :provider_dsn
\set VERBOSITY terse
SELECT quote_literal(pg_current_xlog_location()) as curr_lsn
\gset
SELECT pglogical.replicate_ddl_command($$
CREATE UNIQUE INDEX id_temp_idx ON public.pk_users (id);
ALTER TABLE public.pk_users DROP CONSTRAINT pk_users_pkey,
ADD CONSTRAINT pk_users_pkey PRIMARY KEY USING INDEX id_temp_idx;
$$);
SELECT attname, attnotnull, attisdropped from pg_attribute where attrelid = 'pk_users'::regclass and attnum > 0 order by attnum;
SELECT pglogical.wait_slot_confirm_lsn(NULL, :curr_lsn);
\c :subscriber_dsn
SELECT attname, attnotnull, attisdropped from pg_attribute where attrelid = 'pk_users'::regclass and attnum > 0 order by attnum;
SELECT pglogical.alter_subscription_disable('test_subscription', true);
\c :provider_dsn
-- Wait for subscription to disconnect. It will have been bouncing already
-- due to apply worker restarts, but if it was retrying it'll stay down
-- this time.
DO $$
BEGIN
FOR i IN 1..100 LOOP
IF (SELECT count(1) FROM pg_replication_slots WHERE active = false) THEN
RETURN;
END IF;
PERFORM pg_sleep(0.1);
END LOOP;
END;
$$;
SELECT data::json->'action' as action, CASE WHEN data::json->>'action' IN ('I', 'D', 'U') THEN json_extract_path(data::json, 'relation') END as data FROM pg_logical_slot_get_changes((SELECT slot_name FROM pg_replication_slots), NULL, 1, 'min_proto_version', '1', 'max_proto_version', '1', 'startup_params_format', '1', 'proto_format', 'json', 'pglogical.replication_set_names', 'default,ddl_sql');
SELECT data::json->'action' as action, CASE WHEN data::json->>'action' IN ('I', 'D', 'U') THEN data END as data FROM pg_logical_slot_get_changes((SELECT slot_name FROM pg_replication_slots), NULL, 1, 'min_proto_version', '1', 'max_proto_version', '1', 'startup_params_format', '1', 'proto_format', 'json', 'pglogical.replication_set_names', 'default,ddl_sql');
\c :subscriber_dsn
SELECT pglogical.alter_subscription_enable('test_subscription', true);
DELETE FROM pk_users WHERE id = 4;-- remove the offending entries.
\c :provider_dsn
DO $$
BEGIN
FOR i IN 1..100 LOOP
IF (SELECT count(1) FROM pg_replication_slots WHERE active = true) THEN
RETURN;
END IF;
PERFORM pg_sleep(0.1);
END LOOP;
END;
$$;
UPDATE pk_users SET address='UpdatedAddress2' WHERE id=2;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT * FROM pk_users ORDER BY id;
\c :provider_dsn
--
-- Test to show that we don't defend against alterations to tables
-- that will break replication once added to a repset, or prevent
-- dml that would break on apply.
--
-- See 2ndQuadrant/pglogical_internal#146
--
-- Show that the current PK is not marked 'indisreplident' because we use
-- REPLICA IDENTITY DEFAULT
SELECT indisreplident FROM pg_index WHERE indexrelid = 'pk_users_pkey'::regclass;
SELECT relreplident FROM pg_class WHERE oid = 'pk_users'::regclass;
SELECT pglogical.replicate_ddl_command($$
ALTER TABLE public.pk_users DROP CONSTRAINT pk_users_pkey;
$$);
INSERT INTO pk_users VALUES(90,0,0,'User90', 'Address90');
-- pglogical will stop us adding the table to a repset if we try to,
-- but didn't stop us altering it, and won't stop us updating it...
BEGIN;
SELECT * FROM pglogical.replication_set_remove_table('default', 'pk_users');
SELECT * FROM pglogical.replication_set_add_table('default', 'pk_users');
ROLLBACK;
-- Per 2ndQuadrant/pglogical_internal#146 this shouldn't be allowed, but
-- currently is. Logical decoding will fail to capture this change and we
-- won't progress with decoding.
--
-- This will get recorded by logical decoding with no 'oldkey' values,
-- causing pglogical to fail to apply it with an error like
--
-- CONFLICT: remote UPDATE on relation public.pk_users (tuple not found). Resolution: skip.
--
UPDATE pk_users SET id = 91 WHERE id = 90;
-- Catchup will replay the insert and succeed, but the update
-- will be lost.
BEGIN;
SET LOCAL statement_timeout = '2s';
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
ROLLBACK;
-- To carry on we'll need to make the index on the downstream
-- (which is odd, because logical decoding didn't capture the
-- oldkey of the tuple, so how can we apply it?)
\c :subscriber_dsn
ALTER TABLE public.pk_users
ADD CONSTRAINT pk_users_pkey PRIMARY KEY (id) NOT DEFERRABLE;
\c :provider_dsn
ALTER TABLE public.pk_users
ADD CONSTRAINT pk_users_pkey PRIMARY KEY (id) NOT DEFERRABLE;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
-- Demonstrate that deferrable indexes aren't yet supported for updates on downstream
-- and will fail with an informative error.
SELECT pglogical.replicate_ddl_command($$
ALTER TABLE public.pk_users
DROP CONSTRAINT pk_users_pkey,
ADD CONSTRAINT pk_users_pkey PRIMARY KEY (id) DEFERRABLE INITIALLY DEFERRED;
$$);
-- Not allowed, deferrable
ALTER TABLE public.pk_users REPLICA IDENTITY USING INDEX pk_users_pkey;
-- New index isn't REPLICA IDENTITY either
SELECT indisreplident FROM pg_index WHERE indexrelid = 'pk_users_pkey'::regclass;
-- pglogical won't let us add the table to a repset, though
-- it doesn't stop us altering it; see 2ndQuadrant/pglogical_internal#146
BEGIN;
SELECT * FROM pglogical.replication_set_remove_table('default', 'pk_users');
SELECT * FROM pglogical.replication_set_add_table('default', 'pk_users');
ROLLBACK;
-- We can still INSERT (which is fine)
INSERT INTO pk_users VALUES(100,0,0,'User100', 'Address100');
-- FIXME pglogical shouldn't allow this, no valid replica identity exists
-- see 2ndQuadrant/pglogical_internal#146
UPDATE pk_users SET id = 101 WHERE id = 100;
-- Must time out, apply will fail on downstream due to no replident index
BEGIN;
SET LOCAL statement_timeout = '2s';
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
ROLLBACK;
\c :subscriber_dsn
-- entry 100 must be absent since we can't apply it without
-- a suitable pk
SELECT id FROM pk_users WHERE id IN (90, 91, 100, 101) ORDER BY id;
-- we can recover by re-creating the pk as non-deferrable
ALTER TABLE public.pk_users DROP CONSTRAINT pk_users_pkey,
ADD CONSTRAINT pk_users_pkey PRIMARY KEY (id) NOT DEFERRABLE;
-- then replay. Toggle the subscription's enabled state
-- to make it recover faster for a quicker test run.
SELECT pglogical.alter_subscription_disable('test_subscription', true);
SELECT pglogical.alter_subscription_enable('test_subscription', true);
\c :provider_dsn
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT id FROM pk_users WHERE id IN (90, 91, 100, 101) ORDER BY id;
\c :provider_dsn
-- Subscriber and provider have diverged due to inability to replicate
-- the UPDATEs
SELECT id FROM pk_users WHERE id IN (90, 91, 100, 101) ORDER BY id;
-- Demonstrate that we properly handle wide conflict rows
\c :subscriber_dsn
INSERT INTO pk_users (id, another_id, address)
VALUES (200,2000,repeat('waah daah sooo mooo', 1000));
\c :provider_dsn
INSERT INTO pk_users (id, another_id, address)
VALUES (200,2000,repeat('boop boop doop boop', 1000));
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT id, another_id, left(address,30) AS address_abbrev
FROM pk_users WHERE another_id = 2000;
-- DELETE conflicts; the DELETE is discarded
\c :subscriber_dsn
DELETE FROM pk_users WHERE id = 1;
\c :provider_dsn
DELETE FROM pk_users WHERE id = 1;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
-- UPDATE conflicts violating multiple constraints.
-- For this one we need to put the secondary unique
-- constraint back.
TRUNCATE TABLE pk_users;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
SELECT pglogical.replicate_ddl_command($$
CREATE UNIQUE INDEX pk_users_another_id_idx ON public.pk_users(another_id);
$$);
\c :subscriber_dsn
INSERT INTO pk_users VALUES
(1,10,0,'sub',NULL),
(2,20,0,'sub',NULL);
\c :provider_dsn
INSERT INTO pk_users VALUES
(3,11,1,'pub',NULL),
(4,22,1,'pub',NULL);
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT * FROM pk_users ORDER BY id;
\c :provider_dsn
-- UPDATE one of our upstream tuples to violate both constraints on the
-- downstream. The constraints are independent but there's only one existing
-- downstream tuple that violates both constraints. We'll match it by replica
-- identity, replace it, and satisfy the other constraint in the process.
UPDATE pk_users SET id=1, another_id = 10, name='should_error' WHERE id = 3 AND another_id = 11;
SELECT * FROM pk_users ORDER BY id;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
-- UPDATEs to missing rows could either resurrect the row or conclude it
-- shouldn't exist and discard it. Currently pgl unconditionally discards, so
-- this row's name is a misnomer.
\c :subscriber_dsn
DELETE FROM pk_users WHERE id = 4 AND another_id = 22;
\c :provider_dsn
UPDATE pk_users SET name = 'jesus' WHERE id = 4;
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
-- No resurrection here
SELECT * FROM pk_users ORDER BY id;
-- But if the UPDATE would create a row that violates
-- a secondary unique index (but doesn't match the replident)
-- we'll ERROR on the secondary index.
INSERT INTO pk_users VALUES (5,55,0,'sub',NULL);
\c :provider_dsn
INSERT INTO pk_users VALUES (6,66,0,'sub',NULL);
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
-- The new row (6,55) will conflict with (5,55)
UPDATE pk_users SET another_id = 55, name = 'pub_should_error' WHERE id = 6;
SELECT * FROM pk_users ORDER BY id;
-- We'll time out due to apply errors
BEGIN;
SET LOCAL statement_timeout = '2s';
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
ROLLBACK;
-- This time we'll fix it by deleting the conflicting row
\c :subscriber_dsn
SELECT * FROM pk_users ORDER BY id;
DELETE FROM pk_users WHERE id = 5;
\c :provider_dsn
SELECT pglogical.wait_slot_confirm_lsn(NULL, NULL);
\c :subscriber_dsn
SELECT * FROM pk_users ORDER BY id;
\c :provider_dsn
\set VERBOSITY terse
SELECT pglogical.replicate_ddl_command($$
DROP TABLE public.pk_users CASCADE;
$$); | the_stack |
#define YYLAST 2061
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 91
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 65
/* YYNRULES -- Number of rules. */
#define YYNRULES 211
/* YYNRULES -- Number of states. */
#define YYNSTATES 422
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 326
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 78, 2, 2, 9, 11, 13, 2,
89, 88, 12, 8, 67, 7, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 70, 14,
2, 2, 2, 69, 10, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 5, 2, 6, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 3, 2, 4, 79, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
68, 71, 72, 73, 74, 75, 76, 77, 80, 81,
82, 83, 84, 85, 86, 87, 90
};
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
static const yytype_uint16 yyprhs[] =
{
0, 0, 3, 6, 11, 12, 13, 14, 19, 20,
21, 24, 27, 30, 32, 34, 37, 40, 44, 46,
48, 52, 56, 60, 64, 68, 72, 73, 76, 83,
91, 99, 106, 109, 110, 113, 123, 133, 144, 154,
163, 176, 180, 189, 190, 191, 193, 194, 196, 198,
200, 202, 204, 205, 207, 209, 211, 213, 215, 217,
219, 221, 226, 228, 229, 236, 243, 244, 245, 246,
248, 249, 251, 252, 255, 257, 260, 262, 264, 266,
270, 271, 279, 283, 287, 291, 293, 296, 300, 302,
306, 312, 319, 323, 327, 333, 336, 341, 342, 348,
350, 352, 358, 363, 369, 374, 380, 387, 393, 398,
404, 409, 413, 420, 426, 430, 434, 438, 442, 446,
450, 454, 458, 462, 466, 470, 474, 478, 482, 485,
488, 491, 494, 497, 500, 503, 506, 510, 513, 518,
522, 528, 531, 534, 539, 545, 550, 556, 558, 560,
562, 564, 570, 573, 575, 578, 582, 585, 587, 589,
591, 593, 595, 597, 602, 608, 610, 612, 616, 621,
625, 627, 630, 633, 635, 638, 641, 643, 646, 648,
651, 653, 657, 659, 663, 668, 673, 675, 677, 679,
683, 686, 690, 693, 695, 697, 699, 700, 702, 703,
705, 708, 710, 713, 716, 719, 722, 725, 728, 730,
732, 734
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int16 yyrhs[] =
{
92, 0, -1, 96, 99, -1, 3, 94, 99, 4,
-1, -1, -1, -1, 3, 98, 99, 4, -1, -1,
-1, 99, 116, -1, 99, 100, -1, 115, 103, -1,
106, -1, 107, -1, 115, 104, -1, 115, 14, -1,
115, 101, 14, -1, 1, -1, 133, -1, 133, 32,
133, -1, 133, 33, 133, -1, 133, 30, 133, -1,
133, 31, 111, -1, 133, 37, 133, -1, 133, 39,
133, -1, -1, 34, 97, -1, 35, 89, 112, 88,
97, 102, -1, 32, 89, 94, 112, 88, 97, 102,
-1, 33, 89, 94, 114, 88, 97, 102, -1, 39,
89, 94, 112, 88, 97, -1, 40, 93, -1, -1,
36, 93, -1, 115, 30, 89, 94, 110, 88, 108,
97, 105, -1, 115, 31, 89, 94, 111, 88, 108,
97, 105, -1, 115, 37, 58, 94, 148, 89, 112,
88, 97, 105, -1, 115, 37, 150, 89, 94, 112,
88, 97, 105, -1, 115, 37, 89, 94, 112, 88,
97, 105, -1, 115, 37, 89, 94, 113, 14, 110,
14, 108, 113, 88, 97, -1, 115, 93, 105, -1,
115, 38, 89, 94, 95, 112, 88, 97, -1, -1,
-1, 101, -1, -1, 133, -1, 133, -1, 133, -1,
109, -1, 111, -1, -1, 24, -1, 118, -1, 121,
-1, 120, -1, 130, -1, 131, -1, 117, -1, 90,
-1, 25, 124, 119, 93, -1, 15, -1, -1, 59,
122, 125, 126, 127, 129, -1, 26, 122, 125, 126,
127, 129, -1, -1, -1, -1, 15, -1, -1, 18,
-1, -1, 61, 18, -1, 61, -1, 61, 18, -1,
61, -1, 93, -1, 14, -1, 28, 15, 14, -1,
-1, 29, 122, 132, 15, 15, 146, 14, -1, 133,
65, 133, -1, 133, 64, 133, -1, 133, 63, 133,
-1, 134, -1, 134, 67, -1, 134, 67, 143, -1,
143, -1, 48, 155, 134, -1, 46, 89, 155, 133,
88, -1, 143, 87, 137, 89, 147, 88, -1, 143,
87, 137, -1, 16, 155, 146, -1, 17, 155, 89,
147, 88, -1, 48, 146, -1, 46, 89, 147, 88,
-1, -1, 23, 123, 93, 136, 146, -1, 16, -1,
150, -1, 154, 3, 133, 14, 4, -1, 150, 5,
133, 6, -1, 143, 87, 5, 133, 6, -1, 138,
5, 133, 6, -1, 150, 3, 133, 14, 4, -1,
143, 87, 3, 133, 14, 4, -1, 138, 3, 133,
14, 4, -1, 143, 87, 89, 88, -1, 143, 87,
89, 133, 88, -1, 138, 89, 133, 88, -1, 138,
89, 88, -1, 89, 133, 88, 5, 133, 6, -1,
89, 88, 5, 133, 6, -1, 143, 68, 143, -1,
143, 82, 143, -1, 143, 51, 143, -1, 143, 52,
143, -1, 143, 76, 143, -1, 143, 49, 143, -1,
143, 50, 143, -1, 143, 75, 143, -1, 143, 74,
143, -1, 143, 42, 143, -1, 143, 73, 143, -1,
143, 72, 143, -1, 143, 71, 143, -1, 143, 77,
143, -1, 7, 143, -1, 8, 143, -1, 78, 143,
-1, 79, 143, -1, 143, 84, -1, 143, 83, -1,
86, 143, -1, 85, 143, -1, 5, 133, 6, -1,
5, 6, -1, 55, 133, 14, 4, -1, 55, 14,
4, -1, 27, 123, 126, 127, 93, -1, 54, 143,
-1, 54, 93, -1, 54, 15, 89, 88, -1, 54,
15, 89, 133, 88, -1, 54, 150, 89, 88, -1,
54, 150, 89, 133, 88, -1, 139, -1, 140, -1,
141, -1, 142, -1, 143, 69, 143, 70, 143, -1,
80, 143, -1, 144, -1, 57, 143, -1, 89, 133,
88, -1, 89, 88, -1, 150, -1, 154, -1, 152,
-1, 151, -1, 153, -1, 138, -1, 151, 5, 133,
6, -1, 151, 3, 133, 14, 4, -1, 18, -1,
149, -1, 149, 89, 88, -1, 149, 89, 133, 88,
-1, 56, 15, 146, -1, 41, -1, 41, 143, -1,
66, 134, -1, 47, -1, 47, 93, -1, 47, 143,
-1, 60, -1, 60, 143, -1, 22, -1, 22, 143,
-1, 44, -1, 44, 89, 88, -1, 21, -1, 45,
89, 88, -1, 45, 89, 133, 88, -1, 19, 89,
134, 88, -1, 15, -1, 135, -1, 43, -1, 58,
145, 128, -1, 58, 145, -1, 89, 133, 88, -1,
89, 88, -1, 150, -1, 152, -1, 151, -1, -1,
134, -1, -1, 133, -1, 133, 67, -1, 150, -1,
13, 155, -1, 9, 155, -1, 10, 155, -1, 11,
155, -1, 53, 155, -1, 12, 155, -1, 15, -1,
150, -1, 93, -1, 20, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
0, 140, 140, 146, 156, 160, 164, 170, 180, 185,
186, 193, 203, 206, 207, 209, 211, 228, 247, 249,
251, 255, 259, 263, 267, 272, 278, 279, 283, 294,
302, 313, 316, 322, 323, 330, 343, 355, 366, 376,
386, 418, 426, 436, 442, 443, 448, 451, 455, 460,
464, 468, 474, 483, 487, 489, 491, 493, 495, 500,
504, 510, 524, 525, 529, 542, 565, 571, 576, 581,
591, 592, 597, 598, 602, 612, 616, 626, 627, 636,
650, 649, 668, 672, 676, 680, 684, 694, 703, 707,
712, 719, 728, 734, 740, 748, 752, 759, 758, 769,
770, 774, 783, 788, 796, 803, 810, 820, 829, 836,
845, 852, 858, 865, 875, 879, 883, 889, 893, 897,
901, 905, 909, 913, 925, 929, 933, 937, 947, 951,
958, 962, 966, 971, 976, 981, 990, 995, 1000, 1006,
1012, 1023, 1027, 1031, 1043, 1056, 1064, 1076, 1077, 1078,
1079, 1080, 1085, 1089, 1091, 1095, 1100, 1105, 1107, 1109,
1111, 1113, 1115, 1117, 1126, 1137, 1139, 1141, 1146, 1159,
1164, 1169, 1173, 1177, 1181, 1185, 1189, 1193, 1197, 1199,
1202, 1206, 1212, 1215, 1224, 1230, 1235, 1236, 1237, 1245,
1253, 1260, 1265, 1270, 1272, 1274, 1279, 1281, 1286, 1287,
1289, 1304, 1308, 1314, 1320, 1326, 1332, 1338, 1345, 1347,
1349, 1352
};
#endif
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "'{'", "'}'", "'['", "']'", "'-'", "'+'",
"'$'", "'@'", "'%'", "'*'", "'&'", "';'", "WORD", "METHOD", "FUNCMETH",
"THING", "PMFUNC", "PRIVATEREF", "FUNC0SUB", "UNIOPSUB", "LSTOPSUB",
"LABEL", "FORMAT", "SUB", "ANONSUB", "PACKAGE", "USE", "WHILE", "UNTIL",
"IF", "UNLESS", "ELSE", "ELSIF", "CONTINUE", "FOR", "GIVEN", "WHEN",
"DEFAULT", "LOOPEX", "DOTDOT", "YADAYADA", "FUNC0", "FUNC1", "FUNC",
"UNIOP", "LSTOP", "RELOP", "EQOP", "MULOP", "ADDOP", "DOLSHARP", "DO",
"HASHBRACK", "NOAMP", "LOCAL", "MY", "MYSUB", "REQUIRE", "COLONATTR",
"PREC_LOW", "DOROP", "OROP", "ANDOP", "NOTOP", "','", "ASSIGNOP", "'?'",
"':'", "DORDOR", "OROR", "ANDAND", "BITOROP", "BITANDOP", "SHIFTOP",
"MATCHOP", "'!'", "'~'", "REFGEN", "UMINUS", "POWOP", "POSTDEC",
"POSTINC", "PREDEC", "PREINC", "ARROW", "')'", "'('", "PEG", "$accept",
"prog", "block", "remember", "mydefsv", "progstart", "mblock",
"mremember", "lineseq", "line", "sideff", "else", "cond", "case", "cont",
"loop", "switch", "mintro", "nexpr", "texpr", "iexpr", "mexpr", "mnexpr",
"miexpr", "label", "decl", "peg", "format", "formname", "mysubrout",
"subrout", "startsub", "startanonsub", "startformsub", "subname",
"proto", "subattrlist", "myattrlist", "subbody", "package", "use", "$@1",
"expr", "argexpr", "listop", "@2", "method", "subscripted", "termbinop",
"termunop", "anonymous", "termdo", "term", "myattrterm", "myterm",
"listexpr", "listexprcom", "my_scalar", "amper", "scalar", "ary", "hsh",
"arylen", "star", "indirob", 0
};
#endif
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 123, 125, 91, 93, 45, 43, 36,
64, 37, 42, 38, 59, 258, 259, 260, 261, 262,
263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
273, 274, 275, 276, 277, 278, 279, 280, 281, 282,
283, 284, 285, 286, 287, 288, 289, 290, 291, 292,
293, 294, 295, 296, 297, 298, 299, 300, 301, 302,
303, 304, 305, 306, 307, 308, 309, 44, 310, 63,
58, 311, 312, 313, 314, 315, 316, 317, 33, 126,
318, 319, 320, 321, 322, 323, 324, 325, 41, 40,
326
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
0, 91, 92, 93, 94, 95, 96, 97, 98, 99,
99, 99, 100, 100, 100, 100, 100, 100, 101, 101,
101, 101, 101, 101, 101, 101, 102, 102, 102, 103,
103, 104, 104, 105, 105, 106, 106, 106, 106, 106,
106, 106, 107, 108, 109, 109, 110, 110, 111, 112,
113, 114, 115, 115, 116, 116, 116, 116, 116, 116,
117, 118, 119, 119, 120, 121, 122, 123, 124, 125,
126, 126, 127, 127, 127, 128, 128, 129, 129, 130,
132, 131, 133, 133, 133, 133, 134, 134, 134, 135,
135, 135, 135, 135, 135, 135, 135, 136, 135, 137,
137, 138, 138, 138, 138, 138, 138, 138, 138, 138,
138, 138, 138, 138, 139, 139, 139, 139, 139, 139,
139, 139, 139, 139, 139, 139, 139, 139, 140, 140,
140, 140, 140, 140, 140, 140, 141, 141, 141, 141,
141, 142, 142, 142, 142, 142, 142, 143, 143, 143,
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
143, 143, 143, 143, 143, 143, 143, 143, 143, 144,
144, 145, 145, 145, 145, 145, 146, 146, 147, 147,
147, 148, 149, 150, 151, 152, 153, 154, 155, 155,
155, 155
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 2, 4, 0, 0, 0, 4, 0, 0,
2, 2, 2, 1, 1, 2, 2, 3, 1, 1,
3, 3, 3, 3, 3, 3, 0, 2, 6, 7,
7, 6, 2, 0, 2, 9, 9, 10, 9, 8,
12, 3, 8, 0, 0, 1, 0, 1, 1, 1,
1, 1, 0, 1, 1, 1, 1, 1, 1, 1,
1, 4, 1, 0, 6, 6, 0, 0, 0, 1,
0, 1, 0, 2, 1, 2, 1, 1, 1, 3,
0, 7, 3, 3, 3, 1, 2, 3, 1, 3,
5, 6, 3, 3, 5, 2, 4, 0, 5, 1,
1, 5, 4, 5, 4, 5, 6, 5, 4, 5,
4, 3, 6, 5, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 2, 2,
2, 2, 2, 2, 2, 2, 3, 2, 4, 3,
5, 2, 2, 4, 5, 4, 5, 1, 1, 1,
1, 5, 2, 1, 2, 3, 2, 1, 1, 1,
1, 1, 1, 4, 5, 1, 1, 3, 4, 3,
1, 2, 2, 1, 2, 2, 1, 2, 1, 2,
1, 3, 1, 3, 4, 4, 1, 1, 1, 3,
2, 3, 2, 1, 1, 1, 0, 1, 0, 1,
2, 1, 2, 2, 2, 2, 2, 2, 1, 1,
1, 1
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
static const yytype_uint8 yydefact[] =
{
6, 0, 9, 1, 52, 53, 68, 66, 0, 66,
66, 60, 11, 13, 14, 0, 10, 59, 54, 56,
55, 57, 58, 63, 0, 0, 80, 0, 18, 4,
0, 0, 0, 0, 0, 0, 0, 0, 16, 186,
0, 0, 165, 0, 182, 178, 67, 67, 0, 0,
0, 0, 0, 0, 0, 0, 170, 188, 180, 0,
0, 173, 196, 0, 0, 0, 0, 0, 0, 176,
0, 0, 0, 0, 0, 0, 0, 33, 0, 12,
15, 19, 85, 187, 162, 147, 148, 149, 150, 88,
153, 166, 157, 160, 159, 161, 158, 62, 0, 69,
70, 79, 0, 70, 9, 137, 0, 128, 129, 208,
211, 210, 209, 203, 204, 205, 207, 202, 196, 0,
0, 179, 0, 70, 4, 4, 4, 4, 4, 4,
0, 4, 4, 32, 171, 0, 0, 198, 174, 175,
208, 197, 95, 209, 0, 206, 186, 142, 141, 157,
0, 0, 196, 154, 0, 190, 193, 195, 194, 177,
172, 130, 131, 152, 135, 134, 156, 0, 0, 41,
17, 0, 0, 0, 0, 0, 0, 0, 0, 0,
86, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 133,
132, 0, 0, 0, 0, 0, 0, 0, 61, 71,
72, 0, 72, 52, 136, 93, 198, 0, 97, 72,
46, 0, 0, 0, 0, 0, 4, 5, 0, 181,
183, 0, 199, 0, 0, 89, 0, 0, 139, 0,
169, 192, 0, 76, 189, 0, 155, 34, 22, 23,
48, 20, 21, 24, 25, 84, 83, 82, 87, 0,
0, 111, 0, 123, 119, 120, 116, 117, 114, 0,
126, 125, 124, 122, 121, 118, 127, 115, 0, 0,
99, 0, 92, 100, 167, 0, 0, 0, 0, 0,
0, 74, 0, 196, 0, 3, 0, 185, 196, 0,
0, 47, 0, 0, 49, 51, 0, 0, 201, 45,
50, 0, 0, 19, 0, 0, 0, 184, 200, 96,
0, 143, 0, 145, 0, 138, 191, 75, 0, 0,
0, 104, 110, 0, 0, 0, 108, 0, 198, 168,
0, 102, 0, 163, 0, 73, 78, 77, 65, 0,
64, 94, 98, 140, 43, 43, 0, 0, 0, 0,
46, 0, 0, 0, 90, 144, 146, 113, 0, 107,
151, 0, 103, 109, 0, 105, 164, 101, 81, 0,
0, 8, 26, 26, 0, 33, 0, 0, 0, 31,
112, 106, 91, 33, 33, 9, 0, 0, 29, 30,
0, 39, 43, 33, 42, 35, 36, 52, 27, 0,
33, 0, 38, 7, 0, 37, 0, 0, 0, 26,
40, 28
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
-1, 1, 111, 104, 315, 2, 382, 395, 4, 12,
309, 398, 79, 80, 169, 13, 14, 379, 310, 300,
249, 303, 312, 306, 15, 16, 17, 18, 98, 19,
20, 24, 122, 23, 100, 210, 292, 244, 348, 21,
22, 102, 304, 82, 83, 298, 282, 84, 85, 86,
87, 88, 89, 90, 155, 142, 233, 307, 91, 92,
93, 94, 95, 96, 113
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -354
static const yytype_int16 yypact[] =
{
-354, 26, -354, -354, 145, -354, -354, -354, 25, -354,
-354, -354, -354, -354, -354, 294, -354, -354, -354, -354,
-354, -354, -354, 64, 71, 96, -354, 71, -354, -354,
876, 1722, 1722, 373, 373, 373, 373, 373, -354, -354,
373, 373, -354, 24, -354, 1722, -354, -354, 55, 63,
90, 104, 0, 107, 108, 116, 1722, -354, 113, 118,
120, 645, 560, 373, 730, 959, 138, 1722, 35, 1722,
1722, 1722, 1722, 1722, 1722, 1722, 1042, 177, 204, -354,
-354, 1003, 162, -354, 14, -354, -354, -354, -354, 1896,
-354, 167, 38, 73, -354, -354, 231, -354, 116, -354,
239, -354, 244, 239, -354, -354, 30, 133, 133, -354,
-354, -354, -354, -354, -354, -354, -354, -354, 1722, 172,
1722, 421, 116, 239, -354, -354, -354, -354, -354, -354,
173, -354, -354, -354, 1896, 179, 1127, 560, -354, 421,
1783, 162, -354, 792, 1722, -354, 176, -354, 421, 22,
270, 7, 1722, 421, 1212, 219, -354, -354, -354, 421,
162, 133, 133, 133, -10, -10, 277, 255, 116, -354,
-354, 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722,
1722, 1722, 1722, 1297, 1722, 1722, 1722, 1722, 1722, 1722,
1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722, 1722, -354,
-354, 13, 1382, 1722, 1722, 1722, 1722, 1722, -354, -354,
226, 275, 226, 122, -354, -354, 1722, -39, -354, 226,
1722, 1722, 1722, 1722, 282, 390, -354, -354, 1722, -354,
-354, 306, 360, 206, 1722, 162, 1467, 1552, -354, 289,
-354, -354, 322, 278, -354, 1722, 293, -354, 377, -354,
377, 377, 377, 377, 377, 235, 235, -354, 1896, 33,
69, -354, 351, 1974, 908, 717, 201, 279, 1896, 1857,
461, 461, 547, 631, 861, 378, 133, 133, 1722, 1722,
-354, 1637, 233, -354, -354, 459, 121, 77, 135, 112,
168, 310, 78, 1722, 78, -354, 241, -354, 1722, 116,
248, 377, 256, 258, 377, -354, 265, 266, -354, -354,
-354, 269, 344, 389, 1722, 1722, 276, -354, -354, -354,
521, -354, 606, -354, 632, -354, -354, -354, 174, 1722,
361, -354, -354, 1722, 212, 205, -354, 691, 1722, -354,
371, -354, 374, -354, 386, -354, -354, -354, -354, 367,
-354, -354, -354, -354, -354, -354, 415, 415, 1722, 415,
1722, 304, 363, 415, -354, -354, -354, -354, 208, -354,
1935, 428, -354, -354, 369, -354, -354, -354, -354, 415,
415, -354, 81, 81, 370, 177, 435, 415, 415, -354,
-354, -354, -354, 177, 177, -354, 415, 375, -354, -354,
415, -354, -354, 177, -354, -354, -354, 199, -354, 1722,
177, 473, -354, -354, 379, -354, 383, 415, 415, 81,
-354, -354
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
-354, -354, -13, -72, -354, -354, 1505, -354, -103, -354,
444, -353, -354, -354, -26, -354, -354, -335, -354, 103,
-116, -215, 76, -354, -354, -354, -354, -354, -354, -354,
-354, 128, 419, -354, 466, -19, -181, -354, 207, -354,
-354, -354, -15, -38, -354, -354, -354, -354, -354, -354,
-354, -354, 56, -354, -354, -115, -202, -354, -354, -29,
431, 434, -354, -354, 28
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
positive, shift that token. If negative, reduce the rule which
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -187
static const yytype_int16 yytable[] =
{
81, 213, 77, 215, 112, 112, 112, 112, 112, 33,
311, 112, 112, 316, 296, 106, 278, 181, 279, 182,
380, 239, 33, 130, 141, 203, 3, 204, 180, 280,
399, 294, 160, 143, 112, 149, 214, 240, 299, 156,
25, 203, 133, 204, 33, 34, 35, 330, 138, 297,
151, 147, 220, 221, 222, 223, 224, 225, 128, 227,
228, 167, 114, 115, 116, 117, 421, 411, 118, 119,
177, 178, 179, -187, -187, 331, 205, 201, 206, 97,
141, 29, 217, 341, 212, 208, 99, 107, 108, 129,
144, 145, 346, 177, 178, 179, 177, 178, 179, 361,
362, 121, 281, 183, 219, 302, 235, 305, 143, 218,
101, 237, 134, 120, 141, 396, 397, 139, 343, 29,
148, 231, 232, 153, 154, 159, 295, 161, 162, 163,
164, 165, 177, 178, 179, 340, 374, 26, 27, 242,
177, 178, 179, 384, 124, -2, 5, 6, 7, 342,
8, 9, 125, 152, 314, 247, 248, 250, 251, 252,
253, 254, 255, 256, 257, 234, 259, 260, 262, 5,
6, 7, 283, 8, 9, 177, 178, 179, 349, 126,
367, 10, 344, 352, 177, 178, 179, 285, 286, 287,
288, 289, 290, 127, 414, 308, 131, 132, 177, 178,
179, 232, 135, 413, 10, 301, 250, 136, 250, 137,
313, 372, 11, 168, 390, 198, 199, 200, 170, 320,
201, 322, 324, 5, 6, 7, 371, 8, 9, 180,
328, 177, 178, 179, 207, 11, 258, 177, 178, 179,
263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
273, 274, 275, 276, 277, 141, 202, 209, 10, 211,
141, 216, 226, 334, 335, 236, 337, 229, 177, 178,
179, 177, 178, 179, 238, 177, 178, 179, 197, 347,
243, 347, 245, 198, 199, 200, 353, 291, 201, 11,
293, 33, 407, 325, 319, 28, 327, 29, 329, 30,
179, 31, 32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 368, 44, 45, 46, 177, 178,
179, 47, 338, 232, 48, 49, 50, 51, 345, 351,
187, 52, 53, 54, 55, 56, 354, 57, 58, 59,
60, 61, 62, 246, 355, 301, 356, 63, 64, 65,
66, 67, 68, 357, 69, 358, 197, 359, 360, 401,
70, 198, 199, 200, 363, 369, 201, 405, 406, 177,
178, 179, 71, 72, 73, 375, 29, 412, 376, 74,
75, 378, 33, 76, 415, 177, 178, 179, 109, 370,
377, 28, 387, 110, 317, 30, 81, 31, 32, 33,
34, 35, 36, 37, -44, 39, 40, 41, 42, 43,
326, 44, 45, 46, 177, 178, 179, 47, 381, 171,
172, 173, 174, 177, 178, 179, 175, 318, 176, 187,
188, 56, 391, 57, 58, 59, 60, 61, 62, 332,
177, 178, 179, 63, 64, 65, 66, 67, 68, 402,
69, 388, 177, 178, 179, 197, 70, 392, 400, 78,
198, 199, 200, 386, 409, 201, 123, 417, 71, 72,
73, 418, 187, 188, 28, 74, 75, -49, 30, 76,
31, 32, 33, 34, 35, 36, 37, 416, 39, 40,
41, 42, 43, 103, 44, 45, 46, 196, 197, 157,
47, 350, 158, 198, 199, 200, 0, 0, 201, 0,
185, 186, 187, 188, 56, 0, 57, 58, 59, 60,
61, 62, 177, 178, 179, 0, 63, 64, 65, 66,
67, 68, 0, 69, 193, 194, 195, 196, 197, 70,
0, 0, 0, 198, 199, 200, 0, 339, 201, 0,
0, 71, 72, 73, 0, 0, 0, 0, 74, 75,
0, -44, 76, 29, 0, 30, 0, 31, 32, 33,
34, 35, 36, 37, 0, 140, 40, 41, 42, 43,
110, 44, 45, 46, 177, 178, 179, 47, 0, 0,
0, 0, 0, 0, 0, 0, 185, 186, 187, 188,
0, 56, 0, 57, 58, 59, 60, 61, 62, 364,
0, 0, 0, 63, 64, 65, 66, 67, 68, 0,
69, 194, 195, 196, 197, 0, 70, 0, 0, 198,
199, 200, 0, 0, 201, 0, 0, 0, 71, 72,
73, 0, 0, 0, 0, 74, 75, 0, 29, 76,
30, 0, 31, 32, 33, 34, 35, 36, 37, 0,
39, 40, 41, 42, 43, 0, 44, 45, 46, 177,
178, 179, 47, 0, 0, 0, 0, 0, 0, 0,
185, 186, 187, 188, 0, 0, 56, 0, 57, 58,
59, 60, 61, 62, 365, 177, 178, 179, 63, 64,
65, 66, 67, 68, 0, 69, 195, 196, 197, 0,
0, 70, 0, 198, 199, 200, 0, 0, 201, 0,
366, 0, 0, 71, 72, 73, 0, 0, 0, 0,
74, 75, 0, 29, 76, 30, 0, 31, 32, 33,
34, 35, 36, 37, 0, 146, 40, 41, 42, 43,
0, 44, 45, 46, 177, 178, 179, 47, 0, 0,
0, 0, 0, 0, 0, 0, 185, -187, 187, 188,
0, 56, 0, 57, 58, 59, 60, 61, 62, 373,
0, 0, 0, 63, 64, 65, 66, 67, 68, 0,
69, 0, 0, 196, 197, 203, 70, 204, -157, 198,
199, 200, 0, 0, 201, 0, -157, 0, 71, 72,
73, 0, 0, 0, 0, 74, 75, 0, 0, 76,
0, 0, -157, -157, -157, -157, 0, 0, 0, -157,
0, -157, 0, 0, -157, 0, 0, 0, 0, 0,
0, -157, -157, -157, -157, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, -157, -157, -157, 0, -157,
-157, -157, -157, -157, -157, -157, -157, -157, -157, -157,
0, 0, 0, 0, -157, -157, -157, 0, 0, -157,
-157, 30, 105, 31, 32, 33, 34, 35, 36, 37,
0, 39, 40, 41, 42, 43, 0, 44, 45, 46,
0, 0, 0, 47, 0, 0, 0, 0, 0, 0,
185, 186, 187, 188, 0, 0, 0, 56, 0, 57,
58, 59, 60, 61, 62, 0, 0, 0, 0, 63,
64, 65, 66, 67, 68, 0, 69, 196, 197, 0,
0, 0, 70, 198, 199, 200, 0, 0, 201, 0,
0, 0, 0, 0, 71, 72, 73, -187, 0, 187,
188, 74, 75, 0, 30, 76, 31, 32, 33, 34,
35, 36, 37, 150, 39, 40, 41, 42, 43, 0,
44, 45, 46, 0, 196, 197, 47, 0, 0, 0,
198, 199, 200, 0, 0, 201, 0, 0, 0, 0,
56, 0, 57, 58, 59, 60, 61, 62, 0, 0,
0, 0, 63, 64, 65, 66, 67, 68, 0, 69,
0, 0, 0, 0, 0, 70, 0, 0, 0, 0,
0, 0, 0, 171, 172, 173, 174, 71, 72, 73,
175, 0, 176, 0, 74, 75, 0, 30, 76, 31,
32, 33, 34, 35, 36, 37, 0, 39, 40, 41,
42, 43, 0, 44, 45, 46, 177, 178, 179, 47,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 56, 0, 57, 58, 59, 60, 61,
62, 0, 0, 0, 0, 63, 64, 65, 66, 67,
68, 0, 69, 0, 0, 0, 0, 0, 70, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
71, 72, 73, 0, 0, 0, 0, 74, 75, 0,
166, 76, 30, 0, 31, 32, 33, 34, 35, 36,
37, 0, 39, 40, 41, 42, 43, 0, 44, 45,
46, 0, 0, 0, 47, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 56, 0,
57, 58, 59, 60, 61, 62, 0, 0, 0, 0,
63, 64, 65, 66, 67, 68, 0, 69, 0, 0,
0, 0, 0, 70, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 71, 72, 73, 0, 0,
0, 0, 74, 75, 0, 230, 76, 30, 0, 31,
32, 33, 34, 35, 36, 37, 0, 39, 40, 41,
42, 43, 0, 44, 45, 46, 0, 0, 0, 47,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 56, 0, 57, 58, 59, 60, 61,
62, 0, 0, 0, 0, 63, 64, 65, 66, 67,
68, 0, 69, 0, 0, 0, 0, 0, 70, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
71, 72, 73, 0, 0, 0, 0, 74, 75, 0,
241, 76, 30, 0, 31, 32, 33, 34, 35, 36,
37, 0, 39, 40, 41, 42, 43, 0, 44, 45,
46, 0, 0, 0, 47, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 56, 0,
57, 58, 59, 60, 61, 62, 0, 0, 0, 0,
63, 64, 65, 66, 67, 68, 0, 69, 0, 0,
0, 0, 0, 70, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 71, 72, 73, 0, 0,
0, 0, 74, 75, 0, 261, 76, 30, 0, 31,
32, 33, 34, 35, 36, 37, 0, 39, 40, 41,
42, 43, 0, 44, 45, 46, 0, 0, 0, 47,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 56, 0, 57, 58, 59, 60, 61,
62, 0, 0, 0, 0, 63, 64, 65, 66, 67,
68, 0, 69, 0, 0, 0, 0, 0, 70, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
71, 72, 73, 0, 0, 0, 0, 74, 75, 0,
284, 76, 30, 0, 31, 32, 33, 34, 35, 36,
37, 0, 39, 40, 41, 42, 43, 0, 44, 45,
46, 0, 0, 0, 47, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 56, 0,
57, 58, 59, 60, 61, 62, 0, 0, 0, 0,
63, 64, 65, 66, 67, 68, 0, 69, 0, 0,
0, 0, 0, 70, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 71, 72, 73, 0, 0,
0, 0, 74, 75, 0, 321, 76, 30, 0, 31,
32, 33, 34, 35, 36, 37, 0, 39, 40, 41,
42, 43, 0, 44, 45, 46, 0, 0, 0, 47,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 56, 0, 57, 58, 59, 60, 61,
62, 0, 0, 0, 0, 63, 64, 65, 66, 67,
68, 0, 69, 0, 0, 0, 0, 0, 70, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
71, 72, 73, 0, 0, 0, 0, 74, 75, 0,
323, 76, 30, 0, 31, 32, 33, 34, 35, 36,
37, 0, 39, 40, 41, 42, 43, 0, 44, 45,
46, 0, 0, 0, 47, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 56, 0,
57, 58, 59, 60, 61, 62, 0, 0, 0, 0,
63, 64, 65, 66, 67, 68, 0, 69, 0, 0,
0, 0, 0, 70, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 71, 72, 73, 0, 0,
0, 0, 74, 75, 0, 336, 76, 30, 0, 31,
32, 33, 34, 35, 36, 37, 0, 39, 40, 41,
42, 43, 0, 44, 45, 46, 0, 0, 0, 47,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 56, 0, 57, 58, 59, 60, 61,
62, 0, 0, 0, 0, 63, 64, 65, 66, 67,
68, 0, 69, 0, 0, 0, 0, 0, 70, -186,
0, 0, 0, 0, 0, 0, 0, -186, 0, 0,
71, 72, 73, 0, 0, 0, 0, 74, 75, 0,
0, 76, 0, -186, -186, -186, -186, 0, 0, 0,
-186, 0, -186, 0, 0, -186, 0, 0, 0, 0,
0, 0, -186, -186, -186, -186, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, -186, -186, -186, 0,
-186, -186, -186, -186, -186, -186, -186, -186, -186, -186,
-186, 0, 383, 0, 385, -186, -186, -186, 389, 0,
-186, -186, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 393, 394, 0, 0, 0, 0,
0, 0, 403, 404, 0, 0, 0, 0, 0, 184,
0, 408, 0, 0, 0, 410, 185, 186, 187, 188,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 419, 420, 0, 189, 190, 333, 191, 192,
193, 194, 195, 196, 197, 0, 0, 0, 184, 198,
199, 200, 0, 0, 201, 185, 186, 187, 188, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 189, 190, 0, 191, 192, 193,
194, 195, 196, 197, 0, 0, 0, 184, 198, 199,
200, 0, 0, 201, 185, 186, 187, 188, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 190, 0, 191, 192, 193, 194,
195, 196, 197, 0, 0, 0, -187, 198, 199, 200,
0, 0, 201, 185, 186, 187, 188, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 191, 192, 193, 194, 195,
196, 197, 0, 0, 0, 0, 198, 199, 200, 0,
0, 201
};
static const yytype_int16 yycheck[] =
{
15, 104, 15, 118, 33, 34, 35, 36, 37, 9,
225, 40, 41, 228, 216, 30, 3, 3, 5, 5,
355, 14, 9, 52, 62, 3, 0, 5, 67, 16,
383, 212, 70, 62, 63, 64, 6, 152, 219, 68,
15, 3, 55, 5, 9, 10, 11, 14, 61, 88,
65, 64, 124, 125, 126, 127, 128, 129, 58, 131,
132, 76, 34, 35, 36, 37, 419, 402, 40, 41,
63, 64, 65, 83, 84, 6, 3, 87, 5, 15,
118, 3, 120, 6, 103, 98, 15, 31, 32, 89,
62, 63, 14, 63, 64, 65, 63, 64, 65, 314,
315, 45, 89, 89, 123, 221, 144, 223, 137, 122,
14, 89, 56, 89, 152, 34, 35, 61, 6, 3,
64, 136, 137, 67, 89, 69, 4, 71, 72, 73,
74, 75, 63, 64, 65, 14, 338, 9, 10, 154,
63, 64, 65, 358, 89, 0, 24, 25, 26, 14,
28, 29, 89, 15, 226, 168, 171, 172, 173, 174,
175, 176, 177, 178, 179, 137, 181, 182, 183, 24,
25, 26, 201, 28, 29, 63, 64, 65, 293, 89,
6, 59, 14, 298, 63, 64, 65, 202, 203, 204,
205, 206, 207, 89, 409, 224, 89, 89, 63, 64,
65, 216, 89, 4, 59, 220, 221, 89, 223, 89,
225, 6, 90, 36, 6, 82, 83, 84, 14, 234,
87, 236, 237, 24, 25, 26, 14, 28, 29, 67,
245, 63, 64, 65, 3, 90, 180, 63, 64, 65,
184, 185, 186, 187, 188, 189, 190, 191, 192, 193,
194, 195, 196, 197, 198, 293, 89, 18, 59, 15,
298, 89, 89, 278, 279, 89, 281, 88, 63, 64,
65, 63, 64, 65, 4, 63, 64, 65, 77, 292,
61, 294, 5, 82, 83, 84, 299, 61, 87, 90,
15, 9, 395, 4, 88, 1, 18, 3, 5, 5,
65, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 329, 21, 22, 23, 63, 64,
65, 27, 89, 338, 30, 31, 32, 33, 18, 88,
51, 37, 38, 39, 40, 41, 88, 43, 44, 45,
46, 47, 48, 88, 88, 360, 88, 53, 54, 55,
56, 57, 58, 88, 60, 89, 77, 88, 14, 385,
66, 82, 83, 84, 88, 4, 87, 393, 394, 63,
64, 65, 78, 79, 80, 4, 3, 403, 4, 85,
86, 14, 9, 89, 410, 63, 64, 65, 15, 333,
4, 1, 88, 20, 88, 5, 411, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
88, 21, 22, 23, 63, 64, 65, 27, 3, 30,
31, 32, 33, 63, 64, 65, 37, 67, 39, 51,
52, 41, 4, 43, 44, 45, 46, 47, 48, 88,
63, 64, 65, 53, 54, 55, 56, 57, 58, 14,
60, 88, 63, 64, 65, 77, 66, 88, 88, 15,
82, 83, 84, 360, 89, 87, 47, 88, 78, 79,
80, 88, 51, 52, 1, 85, 86, 88, 5, 89,
7, 8, 9, 10, 11, 12, 13, 411, 15, 16,
17, 18, 19, 27, 21, 22, 23, 76, 77, 68,
27, 294, 68, 82, 83, 84, -1, -1, 87, -1,
49, 50, 51, 52, 41, -1, 43, 44, 45, 46,
47, 48, 63, 64, 65, -1, 53, 54, 55, 56,
57, 58, -1, 60, 73, 74, 75, 76, 77, 66,
-1, -1, -1, 82, 83, 84, -1, 88, 87, -1,
-1, 78, 79, 80, -1, -1, -1, -1, 85, 86,
-1, 88, 89, 3, -1, 5, -1, 7, 8, 9,
10, 11, 12, 13, -1, 15, 16, 17, 18, 19,
20, 21, 22, 23, 63, 64, 65, 27, -1, -1,
-1, -1, -1, -1, -1, -1, 49, 50, 51, 52,
-1, 41, -1, 43, 44, 45, 46, 47, 48, 88,
-1, -1, -1, 53, 54, 55, 56, 57, 58, -1,
60, 74, 75, 76, 77, -1, 66, -1, -1, 82,
83, 84, -1, -1, 87, -1, -1, -1, 78, 79,
80, -1, -1, -1, -1, 85, 86, -1, 3, 89,
5, -1, 7, 8, 9, 10, 11, 12, 13, -1,
15, 16, 17, 18, 19, -1, 21, 22, 23, 63,
64, 65, 27, -1, -1, -1, -1, -1, -1, -1,
49, 50, 51, 52, -1, -1, 41, -1, 43, 44,
45, 46, 47, 48, 88, 63, 64, 65, 53, 54,
55, 56, 57, 58, -1, 60, 75, 76, 77, -1,
-1, 66, -1, 82, 83, 84, -1, -1, 87, -1,
88, -1, -1, 78, 79, 80, -1, -1, -1, -1,
85, 86, -1, 3, 89, 5, -1, 7, 8, 9,
10, 11, 12, 13, -1, 15, 16, 17, 18, 19,
-1, 21, 22, 23, 63, 64, 65, 27, -1, -1,
-1, -1, -1, -1, -1, -1, 49, 50, 51, 52,
-1, 41, -1, 43, 44, 45, 46, 47, 48, 88,
-1, -1, -1, 53, 54, 55, 56, 57, 58, -1,
60, -1, -1, 76, 77, 3, 66, 5, 6, 82,
83, 84, -1, -1, 87, -1, 14, -1, 78, 79,
80, -1, -1, -1, -1, 85, 86, -1, -1, 89,
-1, -1, 30, 31, 32, 33, -1, -1, -1, 37,
-1, 39, -1, -1, 42, -1, -1, -1, -1, -1,
-1, 49, 50, 51, 52, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 63, 64, 65, -1, 67,
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
-1, -1, -1, -1, 82, 83, 84, -1, -1, 87,
88, 5, 6, 7, 8, 9, 10, 11, 12, 13,
-1, 15, 16, 17, 18, 19, -1, 21, 22, 23,
-1, -1, -1, 27, -1, -1, -1, -1, -1, -1,
49, 50, 51, 52, -1, -1, -1, 41, -1, 43,
44, 45, 46, 47, 48, -1, -1, -1, -1, 53,
54, 55, 56, 57, 58, -1, 60, 76, 77, -1,
-1, -1, 66, 82, 83, 84, -1, -1, 87, -1,
-1, -1, -1, -1, 78, 79, 80, 49, -1, 51,
52, 85, 86, -1, 5, 89, 7, 8, 9, 10,
11, 12, 13, 14, 15, 16, 17, 18, 19, -1,
21, 22, 23, -1, 76, 77, 27, -1, -1, -1,
82, 83, 84, -1, -1, 87, -1, -1, -1, -1,
41, -1, 43, 44, 45, 46, 47, 48, -1, -1,
-1, -1, 53, 54, 55, 56, 57, 58, -1, 60,
-1, -1, -1, -1, -1, 66, -1, -1, -1, -1,
-1, -1, -1, 30, 31, 32, 33, 78, 79, 80,
37, -1, 39, -1, 85, 86, -1, 5, 89, 7,
8, 9, 10, 11, 12, 13, -1, 15, 16, 17,
18, 19, -1, 21, 22, 23, 63, 64, 65, 27,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 41, -1, 43, 44, 45, 46, 47,
48, -1, -1, -1, -1, 53, 54, 55, 56, 57,
58, -1, 60, -1, -1, -1, -1, -1, 66, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
78, 79, 80, -1, -1, -1, -1, 85, 86, -1,
88, 89, 5, -1, 7, 8, 9, 10, 11, 12,
13, -1, 15, 16, 17, 18, 19, -1, 21, 22,
23, -1, -1, -1, 27, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 41, -1,
43, 44, 45, 46, 47, 48, -1, -1, -1, -1,
53, 54, 55, 56, 57, 58, -1, 60, -1, -1,
-1, -1, -1, 66, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 78, 79, 80, -1, -1,
-1, -1, 85, 86, -1, 88, 89, 5, -1, 7,
8, 9, 10, 11, 12, 13, -1, 15, 16, 17,
18, 19, -1, 21, 22, 23, -1, -1, -1, 27,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 41, -1, 43, 44, 45, 46, 47,
48, -1, -1, -1, -1, 53, 54, 55, 56, 57,
58, -1, 60, -1, -1, -1, -1, -1, 66, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
78, 79, 80, -1, -1, -1, -1, 85, 86, -1,
88, 89, 5, -1, 7, 8, 9, 10, 11, 12,
13, -1, 15, 16, 17, 18, 19, -1, 21, 22,
23, -1, -1, -1, 27, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 41, -1,
43, 44, 45, 46, 47, 48, -1, -1, -1, -1,
53, 54, 55, 56, 57, 58, -1, 60, -1, -1,
-1, -1, -1, 66, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 78, 79, 80, -1, -1,
-1, -1, 85, 86, -1, 88, 89, 5, -1, 7,
8, 9, 10, 11, 12, 13, -1, 15, 16, 17,
18, 19, -1, 21, 22, 23, -1, -1, -1, 27,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 41, -1, 43, 44, 45, 46, 47,
48, -1, -1, -1, -1, 53, 54, 55, 56, 57,
58, -1, 60, -1, -1, -1, -1, -1, 66, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
78, 79, 80, -1, -1, -1, -1, 85, 86, -1,
88, 89, 5, -1, 7, 8, 9, 10, 11, 12,
13, -1, 15, 16, 17, 18, 19, -1, 21, 22,
23, -1, -1, -1, 27, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 41, -1,
43, 44, 45, 46, 47, 48, -1, -1, -1, -1,
53, 54, 55, 56, 57, 58, -1, 60, -1, -1,
-1, -1, -1, 66, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 78, 79, 80, -1, -1,
-1, -1, 85, 86, -1, 88, 89, 5, -1, 7,
8, 9, 10, 11, 12, 13, -1, 15, 16, 17,
18, 19, -1, 21, 22, 23, -1, -1, -1, 27,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 41, -1, 43, 44, 45, 46, 47,
48, -1, -1, -1, -1, 53, 54, 55, 56, 57,
58, -1, 60, -1, -1, -1, -1, -1, 66, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
78, 79, 80, -1, -1, -1, -1, 85, 86, -1,
88, 89, 5, -1, 7, 8, 9, 10, 11, 12,
13, -1, 15, 16, 17, 18, 19, -1, 21, 22,
23, -1, -1, -1, 27, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 41, -1,
43, 44, 45, 46, 47, 48, -1, -1, -1, -1,
53, 54, 55, 56, 57, 58, -1, 60, -1, -1,
-1, -1, -1, 66, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 78, 79, 80, -1, -1,
-1, -1, 85, 86, -1, 88, 89, 5, -1, 7,
8, 9, 10, 11, 12, 13, -1, 15, 16, 17,
18, 19, -1, 21, 22, 23, -1, -1, -1, 27,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 41, -1, 43, 44, 45, 46, 47,
48, -1, -1, -1, -1, 53, 54, 55, 56, 57,
58, -1, 60, -1, -1, -1, -1, -1, 66, 6,
-1, -1, -1, -1, -1, -1, -1, 14, -1, -1,
78, 79, 80, -1, -1, -1, -1, 85, 86, -1,
-1, 89, -1, 30, 31, 32, 33, -1, -1, -1,
37, -1, 39, -1, -1, 42, -1, -1, -1, -1,
-1, -1, 49, 50, 51, 52, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 63, 64, 65, -1,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, -1, 357, -1, 359, 82, 83, 84, 363, -1,
87, 88, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 379, 380, -1, -1, -1, -1,
-1, -1, 387, 388, -1, -1, -1, -1, -1, 42,
-1, 396, -1, -1, -1, 400, 49, 50, 51, 52,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 417, 418, -1, 68, 69, 70, 71, 72,
73, 74, 75, 76, 77, -1, -1, -1, 42, 82,
83, 84, -1, -1, 87, 49, 50, 51, 52, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 68, 69, -1, 71, 72, 73,
74, 75, 76, 77, -1, -1, -1, 42, 82, 83,
84, -1, -1, 87, 49, 50, 51, 52, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 69, -1, 71, 72, 73, 74,
75, 76, 77, -1, -1, -1, 42, 82, 83, 84,
-1, -1, 87, 49, 50, 51, 52, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 71, 72, 73, 74, 75,
76, 77, -1, -1, -1, -1, 82, 83, 84, -1,
-1, 87
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
0, 92, 96, 0, 99, 24, 25, 26, 28, 29,
59, 90, 100, 106, 107, 115, 116, 117, 118, 120,
121, 130, 131, 124, 122, 15, 122, 122, 1, 3,
5, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 21, 22, 23, 27, 30, 31,
32, 33, 37, 38, 39, 40, 41, 43, 44, 45,
46, 47, 48, 53, 54, 55, 56, 57, 58, 60,
66, 78, 79, 80, 85, 86, 89, 93, 101, 103,
104, 133, 134, 135, 138, 139, 140, 141, 142, 143,
144, 149, 150, 151, 152, 153, 154, 15, 119, 15,
125, 14, 132, 125, 94, 6, 133, 143, 143, 15,
20, 93, 150, 155, 155, 155, 155, 155, 155, 155,
89, 143, 123, 123, 89, 89, 89, 89, 58, 89,
150, 89, 89, 93, 143, 89, 89, 89, 93, 143,
15, 134, 146, 150, 155, 155, 15, 93, 143, 150,
14, 133, 15, 143, 89, 145, 150, 151, 152, 143,
134, 143, 143, 143, 143, 143, 88, 133, 36, 105,
14, 30, 31, 32, 33, 37, 39, 63, 64, 65,
67, 3, 5, 89, 42, 49, 50, 51, 52, 68,
69, 71, 72, 73, 74, 75, 76, 77, 82, 83,
84, 87, 89, 3, 5, 3, 5, 3, 93, 18,
126, 15, 126, 99, 6, 146, 89, 134, 93, 126,
94, 94, 94, 94, 94, 94, 89, 94, 94, 88,
88, 133, 133, 147, 155, 134, 89, 89, 4, 14,
146, 88, 133, 61, 128, 5, 88, 93, 133, 111,
133, 133, 133, 133, 133, 133, 133, 133, 143, 133,
133, 88, 133, 143, 143, 143, 143, 143, 143, 143,
143, 143, 143, 143, 143, 143, 143, 143, 3, 5,
16, 89, 137, 150, 88, 133, 133, 133, 133, 133,
133, 61, 127, 15, 127, 4, 147, 88, 136, 127,
110, 133, 111, 112, 133, 111, 114, 148, 150, 101,
109, 112, 113, 133, 94, 95, 112, 88, 67, 88,
133, 88, 133, 88, 133, 4, 88, 18, 133, 5,
14, 6, 88, 70, 133, 133, 88, 133, 89, 88,
14, 6, 14, 6, 14, 18, 14, 93, 129, 146,
129, 88, 146, 93, 88, 88, 88, 88, 89, 88,
14, 112, 112, 88, 88, 88, 88, 6, 133, 4,
143, 14, 6, 88, 147, 4, 4, 4, 14, 108,
108, 3, 97, 97, 112, 97, 110, 88, 88, 97,
6, 4, 88, 97, 97, 98, 34, 35, 102, 102,
88, 105, 14, 97, 97, 105, 105, 99, 97, 89,
97, 108, 105, 4, 112, 105, 113, 88, 88, 97,
97, 102
};
typedef enum {
toketype_i_tkval, toketype_ival, toketype_opval, toketype_p_tkval
} toketypes;
/* type of each token/terminal */
static const toketypes yy_type_tab[] =
{
toketype_ival, toketype_ival, toketype_ival, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval,
toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
toketype_p_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval,
toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval,
toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval,
toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval,
toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval, toketype_i_tkval,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival,
toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_ival, toketype_i_tkval, toketype_ival,
toketype_ival, toketype_opval, toketype_ival, toketype_ival, toketype_ival, toketype_opval,
toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_p_tkval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_ival, toketype_ival, toketype_ival, toketype_opval,
toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_ival,
toketype_opval, toketype_opval, toketype_opval, toketype_ival, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval, toketype_opval,
toketype_opval, toketype_opval, toketype_opval
}; | the_stack |
-- 用户表
create table iam_user
(
id bigint auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
org_id bigint default 0 not null comment '组织ID',
user_num varchar(20) not null comment '用户编号',
realname varchar(50) not null comment '真实姓名',
gender varchar(10) not null comment '性别',
birthdate date null comment '出生日期',
mobile_phone varchar(20) null comment '手机号',
email varchar(50) null comment 'Email',
avatar_url varchar(200) null comment '头像地址',
status varchar(10) default 'A' not null comment '状态',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
)AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '系统用户';
-- 索引
create index idx_iam_user_1 on iam_user (org_id);
create index idx_iam_user_2 on iam_user (mobile_phone);
create index idx_iam_user_num on iam_user (user_num);
create index idx_iam_user_tenant on iam_user (tenant_id);
-- 账号表
create table iam_account
(
id bigint auto_increment COMMENT 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
user_type varchar(100) default 'IamUser' not null comment '用户类型',
user_id bigint not null comment '用户ID',
auth_type varchar(20) default 'PWD' not null comment '认证方式',
auth_account varchar(100) not null comment '用户名',
auth_secret varchar(32) null comment '密码',
secret_salt varchar(32) null comment '加密盐',
status varchar(10) default 'A' not null comment '用户状态',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
) AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '登录账号';
-- 创建索引
create index idx_iam_account on iam_account(auth_account, auth_type, user_type);
create index idx_iam_account_tenant on iam_account (tenant_id);
-- 角色表
create table iam_role
(
id bigint auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
name varchar(50) not null comment '名称',
code varchar(50) not null comment '编码',
description varchar(100) null comment '备注',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间'
)AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '角色';
-- 创建索引
create index idx_iam_role_tenant on iam_role (tenant_id);
-- 用户角色表
create table iam_user_role
(
id bigint auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
user_type varchar(100) default 'IamUser' not null comment '用户类型',
user_id bigint not null comment '用户ID',
role_id bigint not null comment '角色ID',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
)AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '用户角色关联';
-- 索引
create index idx_iam_user_role on iam_user_role (user_type, user_id);
create index idx_iam_user_role_tenant on iam_user_role (tenant_id);
-- 前端资源权限表
create table iam_resource_permission
(
id bigint auto_increment comment 'ID' primary key,
parent_id bigint default 0 not null comment '父级资源',
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
app_module varchar(50) null comment '应用模块',
display_type varchar(20) not null comment '展现类型',
display_name varchar(100) not null comment '显示名称',
resource_code varchar(100) not null comment '前端编码',
api_set varchar(3000) null comment '接口列表',
sort_id bigint null comment '排序号',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
update_time timestamp null on update CURRENT_TIMESTAMP comment '更新时间'
)AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '资源权限';
-- 索引
create index idx_iam_resource_permission on iam_resource_permission (parent_id);
create index idx_iam_resource_permission_tenant on iam_resource_permission (tenant_id);
-- 角色-权限
create table iam_role_resource
(
id bigint auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
role_id bigint not null comment '角色ID',
resource_id bigint not null comment '资源ID',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
)AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '角色资源';
-- 索引
create index idx_iam_role_resource on iam_role_resource (role_id, resource_id);
create index idx_iam_role_resource_tenant on iam_role_resource (tenant_id);
-- 登录日志表
create table iam_login_trace
(
id bigint auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
user_type varchar(100) default 'IamUser' not null comment '用户类型',
user_id bigint not null comment '用户ID',
auth_type varchar(20) default 'PWD' not null comment '认证方式',
auth_account varchar(100) not null comment '用户名',
ip_address varchar(50) null comment 'IP',
user_agent varchar(200) null comment '客户端信息',
is_success tinyint(1) default 0 not null comment '是否成功',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
) AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '登录日志';
-- 创建索引
create index idx_iam_login_trace on iam_login_trace (user_type, user_id);
create index idx_iam_login_trace_2 on iam_login_trace (auth_account);
create index idx_iam_login_trace_tenant on iam_login_trace (tenant_id);
-- 操作日志表
create table iam_operation_log
(
id bigint auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
app_module varchar(50) null comment '应用模块',
business_obj varchar(100) not null comment '业务对象',
operation varchar(100) not null comment '操作描述',
user_type varchar(100) default 'IamUser' null comment '用户类型',
user_id bigint null comment '用户ID',
user_realname varchar(100) null comment '用户姓名',
request_uri varchar(500) not null comment '请求URI',
request_method varchar(20) not null comment '请求方式',
request_params varchar(1000) null comment '请求参数',
request_ip varchar(50) null comment 'IP',
status_code smallint default 0 not null comment '状态码',
error_msg varchar(1000) null comment '异常信息',
is_deleted tinyint(1) null comment '删除标记',
create_time timestamp default CURRENT_TIMESTAMP null comment '创建时间'
)
AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COMMENT '操作日志';
-- 创建索引
create index idx_iam_operation_log on iam_operation_log (user_type, user_id);
create index idx_iam_operation_log_tenant on iam_operation_log (tenant_id);
-- 组织表
create table iam_org
(
id bigint auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
parent_id bigint default 0 not null comment '上级ID',
top_org_id bigint default 0 not null comment '企业ID',
name varchar(100) not null comment '名称',
short_name varchar(50) not null comment '短名称',
type varchar(100) default 'DEPT' not null comment '组织类别',
code varchar(50) not null comment '编码',
manager_id bigint default 0 not null comment '负责人ID',
depth smallint(6) default 1 not null comment '层级',
sort_id bigint null comment '排序号',
status varchar(10) default 'A' not null comment '状态',
org_comment varchar(200) COMMENT '备注',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
)
comment '组织';
create index idx_iam_org on iam_org (parent_id);
create index idx_iam_org_tenant on iam_org (tenant_id);
-- 岗位
create table iam_position
(
id bigint auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
name varchar(100) not null comment '名称',
code varchar(50) not null comment '编码',
is_virtual tinyint(1) default 0 not null comment '是否虚拟岗',
grade_name varchar(50) null comment '职级头衔',
grade_value varchar(30) default '0' null comment '职级',
data_permission_type varchar(20) default 'SELF' null comment '数据权限类型',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
)
comment '岗位';
create index idx_iam_position on iam_position (code);
create index idx_iam_position_tenant on iam_position (tenant_id);
-- 用户岗位
create table iam_user_position
(
id int auto_increment comment 'ID' primary key,
tenant_id bigint NOT NULL DEFAULT 0 COMMENT '租户ID',
user_type varchar(100) default 'IamUser' not null comment '用户类型',
user_id bigint not null comment '用户ID',
org_id bigint default 0 not null comment '组织ID',
position_id bigint not null comment '岗位ID',
is_primary_position tinyint(1) default 1 not null comment '是否主岗',
is_deleted tinyint(1) default 0 not null comment '是否删除',
create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
update_time timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间'
)
comment '用户岗位关联';
create index idx_iam_user_position on iam_user_position (user_type, user_id);
create index idx_iam_user_position_2 on iam_user_position (org_id, position_id); | the_stack |
set echo on
spool XFILES_DBA_TASKS.log
--
def XFILES_SCHEMA = &1
--
--
begin
XDB_OUTPUT.createLogFile('/public/xFilesInstallation.log',TRUE);
XDB_OUTPUT.writeLogFileEntry('Start: XFILES_DBA_TASKS.sql');
XDB_OUTPUT.writeLogFileEntry('XFILES_SCHEMA = &XFILES_SCHEMA');
XDB_OUTPUT.flushLogFile();
end;
/
--
-- Enable Anonymous access to XML DB Repository
--
ALTER SESSION SET XML_DB_EVENTS = DISABLE
/
alter user anonymous account unlock
/
call xdb_configuration.setAnonymousAccess('true')
/
--
-- Enable use of Unified Java API for all users on NT...
--
call dbms_java.grant_permission('PUBLIC','SYS:oracle.aurora.rdbms.security.PolicyTablePermission','0:java.lang.RuntimePermission#loadLibrary.oraxml11',null)
/
call dbms_java.grant_permission('PUBLIC','SYS:java.lang.RuntimePermission','loadLibrary.oraxml11',null)
/
--
-- Delete and Install the Servlets
--
call dbms_xdb.deleteServletMapping('SelectionProcessor')
/
call dbms_xdb.deleteServletMapping('VersionResources')
/
call dbms_xdb.deleteServletMapping('VersionHistory')
/
call dbms_xdb.deleteServletMapping('UploadFiles')
/
call dbms_xdb.deleteServletMapping('FolderProcessor')
/
call dbms_xdb.deleteServletMapping('NewFolder')
/
call dbms_xdb.deleteServletMapping('XDBReposSearch')
/
call dbms_xdb.deleteServletMapping('XMLRefProcessor')
/
call dbms_xdb.deleteServlet('SelectionProcessor')
/
call dbms_xdb.deleteServlet('VersionResources')
/
call dbms_xdb.deleteServlet('VersionHistory')
/
call dbms_xdb.deleteServlet('UploadFiles')
/
call dbms_xdb.deleteServlet('FolderProcessor')
/
call dbms_xdb.deleteServlet('NewFolder')
/
call dbms_xdb.deleteServlet('XDBReposSearch')
/
call dbms_xdb.deleteServlet('XMLRefProcessor')
/
call dbms_xdb.deleteServlet('XFilesServlet')
/
--
declare
non_existant_dad exception;
PRAGMA EXCEPTION_INIT( non_existant_dad , -24231 );
begin
--
dbms_epg.drop_dad('XFILESUPLOAD');
exception
when non_existant_dad then
null;
end;
/
begin
dbms_epg.create_dad('XFILESUPLOAD','/sys/servlets/&XFILES_SCHEMA/FileUpload/*');
dbms_epg.set_dad_attribute('XFILESUPLOAD','document-table-name','&XFILES_SCHEMA..DOCUMENT_UPLOAD_TABLE');
dbms_epg.set_dad_attribute('XFILESUPLOAD','nls-language','american_america.al32utf8');
end;
/
begin
dbms_epg.create_dad('XFILESREST','/sys/servlets/&XFILES_SCHEMA/RestService/*');
dbms_epg.set_dad_attribute('XFILESREST','database-username','ANONYMOUS');
end;
/
begin
dbms_epg.create_dad('XFILESAUTH','/sys/servlets/&XFILES_SCHEMA/Protected/*');
end;
/
call DBMS_XDB.DELETESERVLET(NAME => 'orawsv')
/
call DBMS_XDB.DELETESERVLETMAPPING(NAME => 'orawsv')
/
call DBMS_XDB.DELETESERVLETSECROLE(SERVNAME => 'orawsv', ROLENAME => 'XDB_WEBSERVICES' )
/
call DBMS_XDB.ADDSERVLETMAPPING(PATTERN => '/orawsv/*', NAME => 'orawsv')
/
call DBMS_XDB.ADDSERVLET(
NAME => 'orawsv',
LANGUAGE => 'C',
DISPNAME => 'Oracle Database Native Web Services',
DESCRIPT => 'Servlet for issuing queries as a Web Service'
)
/
call DBMS_XDB.ADDSERVLETSECROLE(
SERVNAME => 'orawsv',
ROLENAME => 'XDB_WEBSERVICES',
ROLELINK => 'XDB_WEBSERVICES'
)
/
call DBMS_XDB.addMimeMapping('sql','text/plain')
/
call DBMS_XDB.addMimeMapping('log','text/plain')
/
call DBMS_XDB.addMimeMapping('ctl','text/plain')
/
call DBMS_XDB.addMimeMapping('exif','text/xml')
/
call DBMS_XDB.addMimeMapping('doc', 'application/msword')
/
call DBMS_XDB.addMimeMapping('dot', 'application/msword')
/
call DBMS_XDB.addMimeMapping('docx','application/vnd.openxmlformats-officedocument.wordprocessingml.document')
/
call DBMS_XDB.addMimeMapping('dotx','application/vnd.openxmlformats-officedocument.wordprocessingml.template')
/
call DBMS_XDB.addMimeMapping('docm','application/vnd.ms-word.document.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('dotm','application/vnd.ms-word.template.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('xls', 'application/vnd.ms-excel')
/
call DBMS_XDB.addMimeMapping('xlt', 'application/vnd.ms-excel')
/
call DBMS_XDB.addMimeMapping('xla', 'application/vnd.ms-excel')
/
call DBMS_XDB.addMimeMapping('xlsx','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
/
call DBMS_XDB.addMimeMapping('xltx','application/vnd.openxmlformats-officedocument.spreadsheetml.template')
/
call DBMS_XDB.addMimeMapping('xlsm','application/vnd.ms-excel.sheet.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('xltm','application/vnd.ms-excel.template.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('xlam','application/vnd.ms-excel.addin.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('xlsb','application/vnd.ms-excel.sheet.binary.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('ppt', 'application/vnd.ms-powerpoint')
/
call DBMS_XDB.addMimeMapping('pot', 'application/vnd.ms-powerpoint')
/
call DBMS_XDB.addMimeMapping('pps', 'application/vnd.ms-powerpoint')
/
call DBMS_XDB.addMimeMapping('ppa', 'application/vnd.ms-powerpoint')
/
call DBMS_XDB.addMimeMapping('pptx','application/vnd.openxmlformats-officedocument.presentationml.presentation')
/
call DBMS_XDB.addMimeMapping('potx','application/vnd.openxmlformats-officedocument.presentationml.template')
/
call DBMS_XDB.addMimeMapping('ppsx','application/vnd.openxmlformats-officedocument.presentationml.slideshow')
/
call DBMS_XDB.addMimeMapping('ppam','application/vnd.ms-powerpoint.addin.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('pptm','application/vnd.ms-powerpoint.presentation.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('potm','application/vnd.ms-powerpoint.template.macroEnabled.12')
/
call DBMS_XDB.addMimeMapping('ppsm','application/vnd.ms-powerpoint.slideshow.macroEnabled.12')
/
commit
/
@@XFILES_DROP_OLD_OBJECTS
--
declare
XFILES_ROOT VARCHAR2(700) := '/XFILES';
XFILES_HOME VARCHAR2(700) := '/home/&XFILES_SCHEMA';
WHOAMI_DOCUMENT VARCHAR2(700) := XFILES_ROOT || '/whoami.xml';
AUTH_STATUS_DOCUMENT VARCHAR2(700) := XFILES_ROOT || '/authenticationStatus.xml';
UNAUTHENTICATED_DOCUMENT VARCHAR2(700) := XFILES_ROOT || '/unauthenticated.xml';
FOLDER_RESCONFIG_ARCHIVE VARCHAR2(700) := '/sys/resConfig/XFILES/xfilesRedirect';
ACL_ALLOW_XFILES_USERS VARCHAR2(700) := XFILES_HOME || '/src/acls/xfilesUserAcl.xml';
ACL_DENY_XFILES_USERS VARCHAR2(700) := XFILES_HOME || '/src/acls/denyXFilesUserAcl.xml';
XMLINDEX_LIST VARCHAR2(700) := XFILES_HOME || '/configuration/xmlIndex/xmlIndexList.xml';
XMLSCHEMA_LIST VARCHAR2(700) := XFILES_HOME || '/configuration/xmlSchema/xmlSchemaList.xml';
XMLSCHEMA_OBJ_LIST VARCHAR2(700) := XFILES_HOME || '/configuration/xmlSchema/xmlSchemaObjectList.xml';
V_RESULT BOOLEAN;
V_COUNTER NUMBER;
V_TARGET_NAME VARCHAR2(4000);
cursor getAclUsage(C_ACL_PATH VARCHAR2)
is
select r.ANY_PATH RESOURCE_PATH
from XDB.RESOURCE_VIEW r, RESOURCE_VIEW ar
where equals_path(ar.res,C_ACL_PATH) = 1
and XMLCast(
XMLQuery(
'declare default element namespace "http://xmlns.oracle.com/xdb/XDBResource.xsd"; (: :)
$RES/Resource/ACLOID'
passing r.RES as "RES"
returning content
) as RAW(16)
) = SYS_OP_R2O(
XMLCast(
XMLQuery(
'declare default element namespace "http://xmlns.oracle.com/xdb/XDBResource.xsd"; (: :)
fn:data($RES/Resource/XMLRef)'
passing ar.RES as "RES"
returning content
) as REF XMLType
)
);
cursor getResConfigUsage(C_FOLDER_PATH VARCHAR2)
is
select RV.ANY_PATH RESOURCE_PATH, RCRV.ANY_PATH RESCONFIG_PATH
from RESOURCE_VIEW RV, RESOURCE_VIEW rcrv,
XMLTable(
'declare default element namespace "http://xmlns.oracle.com/xdb/XDBResource.xsd"; (: :)
$R/Resource/RCList/OID'
passing rv.RES as "R"
columns
OBJECT_ID RAW(16) path '.'
) rce
where XMLEXists(
'declare default element namespace "http://xmlns.oracle.com/xdb/XDBResource.xsd"; (: :)
$R/Resource/RCList'
passing rv.RES as "R"
)
and under_path(rcrv.RES,C_FOLDER_PATH) = 1
and under_path(rv.RES,C_FOLDER_PATH) = 1
and SYS_OP_R2O(
XMLCast(
XMLQuery(
'declare default element namespace "http://xmlns.oracle.com/xdb/XDBResource.xsd"; (: :)
fn:data($RES/Resource/XMLRef)'
passing rcrv.RES as "RES"
returning content
) as REF XMLType
)
) = rce.OBJECT_ID;
cursor getResConfigsInUse(C_FOLDER_PATH VARCHAR2)
is
select distinct(RCRV.ANY_PATH) RESCONFIG_PATH
from RESOURCE_VIEW RV, XDB.XDB$RESCONFIG rc, RESOURCE_VIEW rcrv,
XMLTable(
'declare default element namespace "http://xmlns.oracle.com/xdb/XDBResource.xsd"; (: :)
$R/Resource/RCList/OID'
passing rv.RES as "R"
columns
OBJECT_ID RAW(16) path '.'
) rce
where XMLEXists(
'declare default element namespace "http://xmlns.oracle.com/xdb/XDBResource.xsd"; (: :)
$R/Resource/RCList'
passing rv.RES as "R"
)
and under_path(rcrv.RES,C_FOLDER_PATH) = 1
and rc.OBJECT_ID = rce.OBJECT_ID
and SYS_OP_R2O(
XMLCast(
XMLQuery(
'declare default element namespace "http://xmlns.oracle.com/xdb/XDBResource.xsd"; (: :)
fn:data($RES/Resource/XMLRef)'
passing rcrv.RES as "RES"
returning content
) as REF XMLType
)
) = rc.OBJECT_ID;
cursor getRepositoryResConfigs(C_FOLDER_PATH VARCHAR2)
is
select POSITION, RESCONFIG_PATH
from (
select (ROWNUM-1) POSITION, COLUMN_VALUE RESCONFIG_PATH
from TABLE(
DBMS_RESCONFIG.getRepositoryResConfigPaths()
)
)
where RESCONFIG_PATH like C_FOLDER_PATH || '%';
begin
if DBMS_XDB.existsResource(XMLINDEX_LIST) then
XDB_OUTPUT.writeLogFileEntry('Delete: ' || XMLINDEX_LIST);
XDB_OUTPUT.flushLogFile();
dbms_xdb.deleteResource(XMLINDEX_LIST,DBMS_XDB.DELETE_FORCE);
end if;
commit;
if DBMS_XDB.existsResource(XMLSCHEMA_LIST) then
XDB_OUTPUT.writeLogFileEntry('Delete: ' || XMLSCHEMA_LIST);
XDB_OUTPUT.flushLogFile();
dbms_xdb.deleteResource(XMLSCHEMA_LIST,DBMS_XDB.DELETE_FORCE);
end if ;
commit;
if DBMS_XDB.existsResource(XMLSCHEMA_OBJ_LIST) then
XDB_OUTPUT.writeLogFileEntry('Delete: ' || XMLSCHEMA_OBJ_LIST);
XDB_OUTPUT.flushLogFile();
dbms_xdb.deleteResource(XMLSCHEMA_OBJ_LIST,DBMS_XDB.DELETE_FORCE);
end if ;
commit;
if (DBMS_XDB.existsResource(UNAUTHENTICATED_DOCUMENT)) then
XDB_OUTPUT.writeLogFileEntry('Delete: ' || UNAUTHENTICATED_DOCUMENT);
XDB_OUTPUT.flushLogFile();
DBMS_XDB.deleteResource(UNAUTHENTICATED_DOCUMENT);
end if;
commit;
if (DBMS_XDB.existsResource(WHOAMI_DOCUMENT)) then
XDB_OUTPUT.writeLogFileEntry('Delete: ' || WHOAMI_DOCUMENT);
XDB_OUTPUT.flushLogFile();
DBMS_XDB.deleteResource(WHOAMI_DOCUMENT);
end if;
commit;
if (DBMS_XDB.existsResource(AUTH_STATUS_DOCUMENT)) then
XDB_OUTPUT.writeLogFileEntry('Delete: ' || AUTH_STATUS_DOCUMENT);
XDB_OUTPUT.flushLogFile();
DBMS_XDB.deleteResource(AUTH_STATUS_DOCUMENT);
end if;
commit;
-- Remove Repository Resource configurations under /XFILES
XDB_OUTPUT.writeLogFileEntry('Delete Repository Resconfig under ' || XFILES_ROOT);
XDB_OUTPUT.flushLogFile();
for r in getRepositoryResConfigs(XFILES_ROOT) loop
XDB_OUTPUT.writeLogFileEntry(r.RESCONFIG_PATH);
DBMS_RESCONFIG.deleteRepositoryResConfig(r.POSITION);
XDB_OUTPUT.flushLogFile();
end loop;
commit;
-- Remove Repository Resource configurations under /home/XFILES
XDB_OUTPUT.writeLogFileEntry('Delete Repository Resconfig under ' || XFILES_HOME);
XDB_OUTPUT.flushLogFile();
for r in getRepositoryResConfigs(XFILES_HOME) loop
DBMS_RESCONFIG.deleteRepositoryResConfig(r.POSITION);
XDB_OUTPUT.flushLogFile();
DBMS_RESCONFIG.deleteRepositoryResConfig(r.POSITION);
end loop;
commit;
XDB_OUTPUT.writeLogFileEntry('Delete Resconfig under ' || XFILES_HOME);
XDB_OUTPUT.flushLogFile();
-- Remove Resource configurations from any documents under /home/XFILES that are protected by Resource Configurations under /home/XFILES
for r in getResConfigUsage(XFILES_HOME) loop
XDB_OUTPUT.writeLogFileEntry(r.RESCONFIG_PATH);
XDB_OUTPUT.flushLogFile();
DBMS_RESCONFIG.deleteResConfig(r.RESOURCE_PATH,r.RESCONFIG_PATH,DBMS_RESCONFIG.DELETE_RESOURCE );
end loop;
commit;
-- Move any Resource Configurations that protect resources outside of /home/XFILES into an archive folder
-- outside of /home/XFILES
XDB_UTILITIES.mkdir(FOLDER_RESCONFIG_ARCHIVE,TRUE);
XDB_OUTPUT.writeLogFileEntry('Moving Resconfigs under ' || XFILES_HOME || ' to ' || FOLDER_RESCONFIG_ARCHIVE);
XDB_OUTPUT.flushLogFile();
V_COUNTER := 0;
for r in getResConfigsInUse(XFILES_HOME) loop
V_COUNTER := V_COUNTER + 1;
V_TARGET_NAME := 'resConfig-' || to_char(systimestamp,'YYYY-MM-DD"T"HH24MISS') || '.' || LPAD(V_COUNTER,3,'0') || '.xml';
XDB_OUTPUT.writeLogFileEntry(r.RESCONFIG_PATH || ' --> ' || V_TARGET_NAME);
XDB_OUTPUT.flushLogFile();
DBMS_XDB.renameResource(r.RESCONFIG_PATH, FOLDER_RESCONFIG_ARCHIVE, V_TARGET_NAME);
end loop;
commit;
XDB_OUTPUT.writeLogFileEntry('Free ACL:' || ACL_ALLOW_XFILES_USERS);
XDB_OUTPUT.flushLogFile();
XDB_UTILITIES.freeAcl(ACL_ALLOW_XFILES_USERS,'/sys/acls/all_owner_acl.xml');
XDB_OUTPUT.writeLogFileEntry('Free ACL:' || ACL_DENY_XFILES_USERS);
XDB_OUTPUT.flushLogFile();
XDB_UTILITIES.freeAcl(ACL_DENY_XFILES_USERS,'/sys/acls/all_owner_acl.xml');
/*
**
** Fixed 11.2.0.3.0
**
** -- Workaround for bug 9866493.
**
** if (DBMS_XDB.existsResource('/home/XFILES/plugins/Xinha')) then
** DBMS_XDB.deleteResource('/home/XFILES/plugins/Xinha');
** end if;
** commit;
**
*/
-- End Workaround
if (DBMS_XDB.existsResource(XFILES_ROOT)) then
XDB_OUTPUT.writeLogFileEntry('Delete: ' || XFILES_ROOT);
XDB_OUTPUT.flushLogFile();
DBMS_XDB.deleteResource(XFILES_ROOT,DBMS_XDB.DELETE_RECURSIVE_FORCE);
end if;
commit;
if DBMS_XDB.existsResource(XFILES_HOME) then
XDB_OUTPUT.writeLogFileEntry('Delete: ' || XFILES_HOME);
XDB_OUTPUT.flushLogFile();
DBMS_XDB.deleteResource(XFILES_HOME,DBMS_XDB.DELETE_RECURSIVE_FORCE);
end if ;
commit;
XDB_OUTPUT.writeLogFileEntry('Create: ' || XFILES_HOME);
XDB_OUTPUT.flushLogFile();
V_RESULT := DBMS_XDB.createFolder(XFILES_ROOT);
DBMS_XDB.setAcl(XFILES_ROOT,'/sys/acls/bootstrap_acl.xml');
DBMS_XDB.changeOwner(XFILES_ROOT,'&XFILES_SCHEMA');
commit;
end;
/
column LOG format A240
set pages 100 lines 250 trimspool on
set long 1000000
--
select xdburitype('/public/xFilesInstallation.log').getClob() LOG
from dual
/
select PATH
from PATH_VIEW
where UNDER_PATH(RES,'/XFILES') = 1
/
select PATH
from PATH_VIEW
where UNDER_PATH(RES,'/home/&XFILES_SCHEMA') = 1
/
select r.any_path
from RESOURCE_VIEW r, RESOURCE_VIEW AR, XDB.XDB$ACL a
where extractValue(r.res,'/Resource/ACLOID') = a.object_id
and ref(a) = extractValue(ar.res,'/Resource/XMLRef')
and equals_path(ar.res,'/home/XFILES/src/acls/xfilesUserAcl.xml') = 1
/
grant CONNECT,
RESOURCE,
ALTER SESSION,
CREATE TABLE,
CREATE VIEW,
CREATE SYNONYM
to &XFILES_SCHEMA
/
grant CREATE ANY DIRECTORY,
DROP ANY DIRECTORY
to &XFILES_SCHEMA
/
grant CTXAPP
to &XFILES_SCHEMA
/
grant XDB_SET_INVOKER
to &XFILES_SCHEMA
with ADMIN OPTION
/
--
var XFILES_PERMISSIONS_SCRIPT varchar2(120);
--
declare
V_XFILES_PERMISSIONS_SCRIPT varchar2(120);
begin
V_XFILES_PERMISSIONS_SCRIPT := 'XFILES_SET_PERMISSIONS_12100.sql';
$IF DBMS_DB_VERSION.VER_LE_11_1 $THEN
V_XFILES_PERMISSIONS_SCRIPT := 'XFILES_DO_NOTHING.sql';
$ELSIF DBMS_DB_VERSION.VER_LE_11_2 $THEN
V_XFILES_PERMISSIONS_SCRIPT := 'XFILES_DO_NOTHING.sql';
$END
:XFILES_PERMISSIONS_SCRIPT := V_XFILES_PERMISSIONS_SCRIPT;
end;
/
column XFILES_PERMISSIONS_SCRIPT new_value XFILES_PERMISSIONS_SCRIPT
--
select :XFILES_PERMISSIONS_SCRIPT XFILES_PERMISSIONS_SCRIPT
from dual
/
def XFILES_PERMISSIONS_SCRIPT
--
@@&XFILES_PERMISSIONS_SCRIPT
--
call XDB_UTILITIES.createHomeFolder()
/
commit
/
--
-- Create Roles
--
create role XFILES_USER
/
grant XDB_WEBSERVICES
to XFILES_USER
/
grant XDB_WEBSERVICES_OVER_HTTP
to XFILES_USER
/
grant XDB_WEBSERVICES_WITH_PUBLIC
to XFILES_USER
/
create role XFILES_ADMINISTRATOR
/
grant XDB_WEBSERVICES
to XFILES_ADMINISTRATOR
with admin option
/
grant XDB_WEBSERVICES_OVER_HTTP
to XFILES_ADMINISTRATOR
with admin option
/
grant XDB_WEBSERVICES_WITH_PUBLIC
to XFILES_ADMINISTRATOR
with admin option
/
grant XFILES_USER
to XFILES_ADMINISTRATOR
with admin option
/
grant XFILES_USER
to &XFILES_SCHEMA
/
ALTER SESSION SET XML_DB_EVENTS = ENABLE
/
alter session set CURRENT_SCHEMA = &XFILES_SCHEMA
/
@@XFILES_LOG_QUEUE
--
@@XFILES_REGISTER_WIKI
--
quit | the_stack |
-- 2017-12-19T16:44:53.206
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540790,TO_TIMESTAMP('2017-12-19 16:44:52','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharma_UOM',TO_TIMESTAMP('2017-12-19 16:44:52','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T16:44:53.224
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540790 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T16:45:07.710
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541440,540790,TO_TIMESTAMP('2017-12-19 16:45:07','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Zentimeter',TO_TIMESTAMP('2017-12-19 16:45:07','YYYY-MM-DD HH24:MI:SS'),100,'CM','CM')
;
-- 2017-12-19T16:45:07.711
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541440 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:45:24.087
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541441,540790,TO_TIMESTAMP('2017-12-19 16:45:23','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Flasche',TO_TIMESTAMP('2017-12-19 16:45:23','YYYY-MM-DD HH24:MI:SS'),100,'FL','FL')
;
-- 2017-12-19T16:45:24.090
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541441 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:45:41.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541442,540790,TO_TIMESTAMP('2017-12-19 16:45:40','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Gramm',TO_TIMESTAMP('2017-12-19 16:45:40','YYYY-MM-DD HH24:MI:SS'),100,'G','G')
;
-- 2017-12-19T16:45:41.062
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541442 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:46:04.572
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541443,540790,TO_TIMESTAMP('2017-12-19 16:46:04','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Kilogramm',TO_TIMESTAMP('2017-12-19 16:46:04','YYYY-MM-DD HH24:MI:SS'),100,'KG','KG')
;
-- 2017-12-19T16:46:04.574
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541443 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:46:30.324
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541444,540790,TO_TIMESTAMP('2017-12-19 16:46:30','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Liter',TO_TIMESTAMP('2017-12-19 16:46:30','YYYY-MM-DD HH24:MI:SS'),100,'L','L')
;
-- 2017-12-19T16:46:30.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541444 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:46:41.646
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541445,540790,TO_TIMESTAMP('2017-12-19 16:46:41','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Meter',TO_TIMESTAMP('2017-12-19 16:46:41','YYYY-MM-DD HH24:MI:SS'),100,'M','M')
;
-- 2017-12-19T16:46:41.647
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541445 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:46:54.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541446,540790,TO_TIMESTAMP('2017-12-19 16:46:53','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Milligramm',TO_TIMESTAMP('2017-12-19 16:46:53','YYYY-MM-DD HH24:MI:SS'),100,'MG','MG')
;
-- 2017-12-19T16:46:54.073
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541446 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:47:08.424
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541447,540790,TO_TIMESTAMP('2017-12-19 16:47:08','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Milliliter',TO_TIMESTAMP('2017-12-19 16:47:08','YYYY-MM-DD HH24:MI:SS'),100,'ML','ML')
;
-- 2017-12-19T16:47:08.427
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541447 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:47:20.424
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541448,540790,TO_TIMESTAMP('2017-12-19 16:47:20','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Packung',TO_TIMESTAMP('2017-12-19 16:47:20','YYYY-MM-DD HH24:MI:SS'),100,'P','P')
;
-- 2017-12-19T16:47:20.427
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541448 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:47:32.046
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541449,540790,TO_TIMESTAMP('2017-12-19 16:47:31','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Stück',TO_TIMESTAMP('2017-12-19 16:47:31','YYYY-MM-DD HH24:MI:SS'),100,'ST','ST')
;
-- 2017-12-19T16:47:32.049
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541449 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:47:45.004
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541450,540790,TO_TIMESTAMP('2017-12-19 16:47:44','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Mikrogramm',TO_TIMESTAMP('2017-12-19 16:47:44','YYYY-MM-DD HH24:MI:SS'),100,'UG','UG')
;
-- 2017-12-19T16:47:45.005
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541450 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:47:59.094
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540790,Updated=TO_TIMESTAMP('2017-12-19 16:47:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558143
;
-- 2017-12-19T16:49:41.690
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540791,TO_TIMESTAMP('2017-12-19 16:49:41','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharma_ArticelType',TO_TIMESTAMP('2017-12-19 16:49:41','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T16:49:41.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540791 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T16:51:43.624
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541451,540791,TO_TIMESTAMP('2017-12-19 16:51:43','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Standard',TO_TIMESTAMP('2017-12-19 16:51:43','YYYY-MM-DD HH24:MI:SS'),100,'00','00')
;
-- 2017-12-19T16:51:43.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541451 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:51:56.909
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541452,540791,TO_TIMESTAMP('2017-12-19 16:51:56','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Klinikpackung',TO_TIMESTAMP('2017-12-19 16:51:56','YYYY-MM-DD HH24:MI:SS'),100,'01','01')
;
-- 2017-12-19T16:51:56.910
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541452 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:52:14.072
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541453,540791,TO_TIMESTAMP('2017-12-19 16:52:13','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Pandemieartikel',TO_TIMESTAMP('2017-12-19 16:52:13','YYYY-MM-DD HH24:MI:SS'),100,'03','03')
;
-- 2017-12-19T16:52:14.073
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541453 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:52:28.981
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541454,540791,TO_TIMESTAMP('2017-12-19 16:52:28','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Schüttware',TO_TIMESTAMP('2017-12-19 16:52:28','YYYY-MM-DD HH24:MI:SS'),100,'04','04')
;
-- 2017-12-19T16:52:28.983
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541454 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:52:48.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540791,Updated=TO_TIMESTAMP('2017-12-19 16:52:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558146
;
-- 2017-12-19T16:52:52.131
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Reference SET Name='Pharma_ArticleType',Updated=TO_TIMESTAMP('2017-12-19 16:52:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540791
;
-- 2017-12-19T16:53:55.888
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540792,TO_TIMESTAMP('2017-12-19 16:53:55','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharma_Group',TO_TIMESTAMP('2017-12-19 16:53:55','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T16:53:55.890
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540792 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T16:54:11.004
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541455,540792,TO_TIMESTAMP('2017-12-19 16:54:10','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Pharmazeutische Spezialitäten, human',TO_TIMESTAMP('2017-12-19 16:54:10','YYYY-MM-DD HH24:MI:SS'),100,'00','00')
;
-- 2017-12-19T16:54:11.007
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541455 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:54:31.913
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541456,540792,TO_TIMESTAMP('2017-12-19 16:54:30','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Pharmazeutische Spezialitäten, veterinär',TO_TIMESTAMP('2017-12-19 16:54:30','YYYY-MM-DD HH24:MI:SS'),100,'01','01')
;
-- 2017-12-19T16:54:31.914
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541456 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:54:47.155
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541457,540792,TO_TIMESTAMP('2017-12-19 16:54:46','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Homöopathie und Biologie',TO_TIMESTAMP('2017-12-19 16:54:46','YYYY-MM-DD HH24:MI:SS'),100,'02','02')
;
-- 2017-12-19T16:54:47.158
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541457 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:55:12.950
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541458,540792,TO_TIMESTAMP('2017-12-19 16:55:12','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Diätetika, Kindernahrung',TO_TIMESTAMP('2017-12-19 16:55:12','YYYY-MM-DD HH24:MI:SS'),100,'03','03')
;
-- 2017-12-19T16:55:12.952
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541458 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:55:26.123
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541459,540792,TO_TIMESTAMP('2017-12-19 16:55:26','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Verbandst., Krankenpfl., Hygiene, Med.prod.',TO_TIMESTAMP('2017-12-19 16:55:26','YYYY-MM-DD HH24:MI:SS'),100,'04','04')
;
-- 2017-12-19T16:55:26.125
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541459 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:55:39.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541460,540792,TO_TIMESTAMP('2017-12-19 16:55:39','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Drogen, Vegetabilien, Chemikalien, Galenika',TO_TIMESTAMP('2017-12-19 16:55:39','YYYY-MM-DD HH24:MI:SS'),100,'05','05')
;
-- 2017-12-19T16:55:39.605
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541460 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:55:56.821
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541461,540792,TO_TIMESTAMP('2017-12-19 16:55:56','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Pflegendes drogistisches Sortiment',TO_TIMESTAMP('2017-12-19 16:55:56','YYYY-MM-DD HH24:MI:SS'),100,'06','06')
;
-- 2017-12-19T16:55:56.821
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541461 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:56:09.337
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541462,540792,TO_TIMESTAMP('2017-12-19 16:56:09','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Technisches drogistisches Sortiment',TO_TIMESTAMP('2017-12-19 16:56:09','YYYY-MM-DD HH24:MI:SS'),100,'07','07')
;
-- 2017-12-19T16:56:09.338
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541462 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:56:22.951
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541463,540792,TO_TIMESTAMP('2017-12-19 16:56:22','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Randsortiment',TO_TIMESTAMP('2017-12-19 16:56:22','YYYY-MM-DD HH24:MI:SS'),100,'08','08')
;
-- 2017-12-19T16:56:22.953
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541463 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:56:39.305
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541464,540792,TO_TIMESTAMP('2017-12-19 16:56:39','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Hilfstaxeartikel',TO_TIMESTAMP('2017-12-19 16:56:39','YYYY-MM-DD HH24:MI:SS'),100,'55','55')
;
-- 2017-12-19T16:56:39.321
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541464 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T16:56:51.058
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540792,Updated=TO_TIMESTAMP('2017-12-19 16:56:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558152
;
-- 2017-12-19T16:58:50.027
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540793,TO_TIMESTAMP('2017-12-19 16:58:49','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharma_PackageType',TO_TIMESTAMP('2017-12-19 16:58:49','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T16:58:50.029
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540793 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T17:27:18.269
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541465,540793,TO_TIMESTAMP('2017-12-19 17:27:18','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','unverpackt',TO_TIMESTAMP('2017-12-19 17:27:18','YYYY-MM-DD HH24:MI:SS'),100,'01','01')
;
-- 2017-12-19T17:27:18.270
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541465 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:27:33.421
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541466,540793,TO_TIMESTAMP('2017-12-19 17:27:33','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Ballon',TO_TIMESTAMP('2017-12-19 17:27:33','YYYY-MM-DD HH24:MI:SS'),100,'02','02')
;
-- 2017-12-19T17:27:33.422
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541466 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:27:45.087
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541467,540793,TO_TIMESTAMP('2017-12-19 17:27:44','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Becher',TO_TIMESTAMP('2017-12-19 17:27:44','YYYY-MM-DD HH24:MI:SS'),100,'03','03')
;
-- 2017-12-19T17:27:45.089
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541467 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:27:58.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541468,540793,TO_TIMESTAMP('2017-12-19 17:27:58','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Beutel',TO_TIMESTAMP('2017-12-19 17:27:58','YYYY-MM-DD HH24:MI:SS'),100,'04','04')
;
-- 2017-12-19T17:27:58.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541468 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:28:11.114
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541469,540793,TO_TIMESTAMP('2017-12-19 17:28:11','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Dose',TO_TIMESTAMP('2017-12-19 17:28:11','YYYY-MM-DD HH24:MI:SS'),100,'05','05')
;
-- 2017-12-19T17:28:11.115
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541469 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:28:25.722
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541470,540793,TO_TIMESTAMP('2017-12-19 17:28:25','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Eimer',TO_TIMESTAMP('2017-12-19 17:28:25','YYYY-MM-DD HH24:MI:SS'),100,'06','06')
;
-- 2017-12-19T17:28:25.725
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541470 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:28:38.671
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541471,540793,TO_TIMESTAMP('2017-12-19 17:28:38','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Etui',TO_TIMESTAMP('2017-12-19 17:28:38','YYYY-MM-DD HH24:MI:SS'),100,'07','07')
;
-- 2017-12-19T17:28:38.672
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541471 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:28:51.590
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541472,540793,TO_TIMESTAMP('2017-12-19 17:28:51','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Faß',TO_TIMESTAMP('2017-12-19 17:28:51','YYYY-MM-DD HH24:MI:SS'),100,'08','08')
;
-- 2017-12-19T17:28:51.591
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541472 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:29:02.990
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541473,540793,TO_TIMESTAMP('2017-12-19 17:29:02','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Flasche',TO_TIMESTAMP('2017-12-19 17:29:02','YYYY-MM-DD HH24:MI:SS'),100,'09','09')
;
-- 2017-12-19T17:29:02.993
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541473 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:29:15.535
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541474,540793,TO_TIMESTAMP('2017-12-19 17:29:15','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Kanister',TO_TIMESTAMP('2017-12-19 17:29:15','YYYY-MM-DD HH24:MI:SS'),100,'10','10')
;
-- 2017-12-19T17:29:15.536
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541474 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:29:27.270
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541475,540793,TO_TIMESTAMP('2017-12-19 17:29:27','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Kanne',TO_TIMESTAMP('2017-12-19 17:29:27','YYYY-MM-DD HH24:MI:SS'),100,'11','11')
;
-- 2017-12-19T17:29:27.271
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541475 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:29:38.786
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541476,540793,TO_TIMESTAMP('2017-12-19 17:29:38','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Kartusche',TO_TIMESTAMP('2017-12-19 17:29:38','YYYY-MM-DD HH24:MI:SS'),100,'12','12')
;
-- 2017-12-19T17:29:38.786
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541476 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:29:53.020
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541477,540793,TO_TIMESTAMP('2017-12-19 17:29:52','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Kasten',TO_TIMESTAMP('2017-12-19 17:29:52','YYYY-MM-DD HH24:MI:SS'),100,'13','13')
;
-- 2017-12-19T17:29:53.022
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541477 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:30:05.281
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541478,540793,TO_TIMESTAMP('2017-12-19 17:30:05','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Kiste',TO_TIMESTAMP('2017-12-19 17:30:05','YYYY-MM-DD HH24:MI:SS'),100,'14','14')
;
-- 2017-12-19T17:30:05.281
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541478 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:30:18.687
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541479,540793,TO_TIMESTAMP('2017-12-19 17:30:18','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Korb',TO_TIMESTAMP('2017-12-19 17:30:18','YYYY-MM-DD HH24:MI:SS'),100,'15','15')
;
-- 2017-12-19T17:30:18.689
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541479 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:30:31.788
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541480,540793,TO_TIMESTAMP('2017-12-19 17:30:31','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Sack',TO_TIMESTAMP('2017-12-19 17:30:31','YYYY-MM-DD HH24:MI:SS'),100,'16','16')
;
-- 2017-12-19T17:30:31.789
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541480 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:30:44.019
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541481,540793,TO_TIMESTAMP('2017-12-19 17:30:43','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Schachtel',TO_TIMESTAMP('2017-12-19 17:30:43','YYYY-MM-DD HH24:MI:SS'),100,'17','17')
;
-- 2017-12-19T17:30:44.021
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541481 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:30:55.475
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541482,540793,TO_TIMESTAMP('2017-12-19 17:30:55','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Schale',TO_TIMESTAMP('2017-12-19 17:30:55','YYYY-MM-DD HH24:MI:SS'),100,'18','18')
;
-- 2017-12-19T17:30:55.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541482 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:31:07.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541483,540793,TO_TIMESTAMP('2017-12-19 17:31:07','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Tiegel',TO_TIMESTAMP('2017-12-19 17:31:07','YYYY-MM-DD HH24:MI:SS'),100,'19','19')
;
-- 2017-12-19T17:31:07.231
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541483 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:31:20.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541484,540793,TO_TIMESTAMP('2017-12-19 17:31:20','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Tube',TO_TIMESTAMP('2017-12-19 17:31:20','YYYY-MM-DD HH24:MI:SS'),100,'20','20')
;
-- 2017-12-19T17:31:20.479
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541484 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:31:32.076
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541485,540793,TO_TIMESTAMP('2017-12-19 17:31:31','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Versandrohr',TO_TIMESTAMP('2017-12-19 17:31:31','YYYY-MM-DD HH24:MI:SS'),100,'21','21')
;
-- 2017-12-19T17:31:32.078
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541485 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:31:42.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541486,540793,TO_TIMESTAMP('2017-12-19 17:31:42','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Weithalsglas',TO_TIMESTAMP('2017-12-19 17:31:42','YYYY-MM-DD HH24:MI:SS'),100,'22','22')
;
-- 2017-12-19T17:31:42.926
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541486 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:31:56.863
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541487,540793,TO_TIMESTAMP('2017-12-19 17:31:56','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Sonstige',TO_TIMESTAMP('2017-12-19 17:31:56','YYYY-MM-DD HH24:MI:SS'),100,'99','99')
;
-- 2017-12-19T17:31:56.865
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541487 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:32:14.216
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540793,Updated=TO_TIMESTAMP('2017-12-19 17:32:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558171
;
-- 2017-12-19T17:33:19.945
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:33:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558201
;
-- 2017-12-19T17:35:00.741
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540794,TO_TIMESTAMP('2017-12-19 17:35:00','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharma_LifeStyle',TO_TIMESTAMP('2017-12-19 17:35:00','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T17:35:00.744
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540794 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T17:35:16.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541488,540794,TO_TIMESTAMP('2017-12-19 17:35:16','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','nein',TO_TIMESTAMP('2017-12-19 17:35:16','YYYY-MM-DD HH24:MI:SS'),100,'00','00')
;
-- 2017-12-19T17:35:16.545
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541488 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:35:30.014
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541489,540794,TO_TIMESTAMP('2017-12-19 17:35:29','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','ja, ohne Ausnahme',TO_TIMESTAMP('2017-12-19 17:35:29','YYYY-MM-DD HH24:MI:SS'),100,'01','01')
;
-- 2017-12-19T17:35:30.016
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541489 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:35:44.023
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541490,540794,TO_TIMESTAMP('2017-12-19 17:35:43','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','ja, mit Ausnahme',TO_TIMESTAMP('2017-12-19 17:35:43','YYYY-MM-DD HH24:MI:SS'),100,'02','02')
;
-- 2017-12-19T17:35:44.025
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541490 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:35:51.091
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540794,Updated=TO_TIMESTAMP('2017-12-19 17:35:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558211
;
-- 2017-12-19T17:36:25.254
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:36:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558213
;
-- 2017-12-19T17:36:53.089
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:36:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558212
;
-- 2017-12-19T17:37:19.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:37:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558214
;
-- 2017-12-19T17:37:47.070
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:37:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558215
;
-- 2017-12-19T17:38:12.157
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:38:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558216
;
-- 2017-12-19T17:38:33.343
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:38:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558217
;
-- 2017-12-19T17:39:36.225
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540795,TO_TIMESTAMP('2017-12-19 17:39:36','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharma_Food',TO_TIMESTAMP('2017-12-19 17:39:36','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T17:39:36.227
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540795 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T17:39:51.202
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541491,540795,TO_TIMESTAMP('2017-12-19 17:39:51','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','nein',TO_TIMESTAMP('2017-12-19 17:39:51','YYYY-MM-DD HH24:MI:SS'),100,'00','00')
;
-- 2017-12-19T17:39:51.204
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541491 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:40:07.142
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541492,540795,TO_TIMESTAMP('2017-12-19 17:40:07','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','ja',TO_TIMESTAMP('2017-12-19 17:40:07','YYYY-MM-DD HH24:MI:SS'),100,'01','01')
;
-- 2017-12-19T17:40:07.144
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541492 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:40:18.897
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541493,540795,TO_TIMESTAMP('2017-12-19 17:40:18','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','sonstige Lebensmittel',TO_TIMESTAMP('2017-12-19 17:40:18','YYYY-MM-DD HH24:MI:SS'),100,'99','99')
;
-- 2017-12-19T17:40:18.899
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541493 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:40:25.277
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540795,Updated=TO_TIMESTAMP('2017-12-19 17:40:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558219
;
-- 2017-12-19T17:40:41.455
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:40:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558220
;
-- 2017-12-19T17:41:21.404
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540796,TO_TIMESTAMP('2017-12-19 17:41:21','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharam_Dietetic',TO_TIMESTAMP('2017-12-19 17:41:21','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T17:41:21.406
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540796 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T17:41:37.542
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541494,540796,TO_TIMESTAMP('2017-12-19 17:41:37','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','nein',TO_TIMESTAMP('2017-12-19 17:41:37','YYYY-MM-DD HH24:MI:SS'),100,'00','00')
;
-- 2017-12-19T17:41:37.544
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541494 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:41:53.263
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541495,540796,TO_TIMESTAMP('2017-12-19 17:41:53','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','ja',TO_TIMESTAMP('2017-12-19 17:41:53','YYYY-MM-DD HH24:MI:SS'),100,'01','01')
;
-- 2017-12-19T17:41:53.265
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541495 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:42:05.986
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541496,540796,TO_TIMESTAMP('2017-12-19 17:42:05','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','Sonstige Diätetikum',TO_TIMESTAMP('2017-12-19 17:42:05','YYYY-MM-DD HH24:MI:SS'),100,'99','99')
;
-- 2017-12-19T17:42:05.988
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541496 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:42:17.722
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540796,Updated=TO_TIMESTAMP('2017-12-19 17:42:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558221
;
-- 2017-12-19T17:42:36.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:42:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558222
;
-- 2017-12-19T17:43:05.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:43:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558223
;
-- 2017-12-19T17:43:28.958
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:43:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558224
;
-- 2017-12-19T17:43:57.173
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:43:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558225
;
-- 2017-12-19T17:44:22.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:44:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558226
;
-- 2017-12-19T17:44:31.702
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:44:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558227
;
-- 2017-12-19T17:44:48.209
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:44:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558228
;
-- 2017-12-19T17:45:04.176
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:45:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558229
;
-- 2017-12-19T17:45:20.154
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:45:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558230
;
-- 2017-12-19T17:45:37.705
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:45:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558231
;
-- 2017-12-19T17:45:51.353
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:45:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558233
;
-- 2017-12-19T17:46:07.496
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:46:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558234
;
-- 2017-12-19T17:46:18.504
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:46:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558235
;
-- 2017-12-19T17:46:31.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:46:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558236
;
-- 2017-12-19T17:46:51.094
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540797,TO_TIMESTAMP('2017-12-19 17:46:50','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharma_Biotech',TO_TIMESTAMP('2017-12-19 17:46:50','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T17:46:51.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540797 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T17:47:04.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541497,540797,TO_TIMESTAMP('2017-12-19 17:47:04','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','nein',TO_TIMESTAMP('2017-12-19 17:47:04','YYYY-MM-DD HH24:MI:SS'),100,'00','00')
;
-- 2017-12-19T17:47:04.454
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541497 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:47:18.484
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541498,540797,TO_TIMESTAMP('2017-12-19 17:47:18','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','ja, biotechnologisch herge-stelltes Original-AM',TO_TIMESTAMP('2017-12-19 17:47:18','YYYY-MM-DD HH24:MI:SS'),100,'01','01')
;
-- 2017-12-19T17:47:18.485
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541498 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:47:32.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541499,540797,TO_TIMESTAMP('2017-12-19 17:47:32','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','ja, Biosimilar',TO_TIMESTAMP('2017-12-19 17:47:32','YYYY-MM-DD HH24:MI:SS'),100,'02','02')
;
-- 2017-12-19T17:47:32.263
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541499 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:48:09.313
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541500,540797,TO_TIMESTAMP('2017-12-19 17:48:09','YYYY-MM-DD HH24:MI:SS'),100,'ja, biotechnologisch hergestelltes Arzneimittel, das zu einem weiteren biotechnologisch hergestellten Arzneimittel in Ausgangsstoffen und Herstellungsprozess identisch ist.','de.metas.vertical.pharma','Y','ja, biotechnologisch hergestelltes Arzneimittel',TO_TIMESTAMP('2017-12-19 17:48:09','YYYY-MM-DD HH24:MI:SS'),100,'03','02')
;
-- 2017-12-19T17:48:09.315
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541500 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:48:17.271
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_Value_ID=540797,Updated=TO_TIMESTAMP('2017-12-19 17:48:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558236
;
-- 2017-12-19T17:48:32.641
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:48:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558237
;
-- 2017-12-19T17:48:50.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:48:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558239
;
-- 2017-12-19T17:49:25.425
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:49:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558245
;
-- 2017-12-19T17:49:37.906
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Reference SET Name='Pharma_Dietetic',Updated=TO_TIMESTAMP('2017-12-19 17:49:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540796
;
-- 2017-12-19T17:50:09.298
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:50:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558251
;
-- 2017-12-19T17:50:25.031
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:50:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558252
;
-- 2017-12-19T17:50:39.104
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:50:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558253
;
-- 2017-12-19T17:50:57.961
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540782,Updated=TO_TIMESTAMP('2017-12-19 17:50:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558254
;
-- 2017-12-19T17:51:45.964
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540798,TO_TIMESTAMP('2017-12-19 17:51:45','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N','Pharma_PackSize',TO_TIMESTAMP('2017-12-19 17:51:45','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2017-12-19T17:51:45.967
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540798 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2017-12-19T17:52:06.471
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541501,540798,TO_TIMESTAMP('2017-12-19 17:52:06','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','keine Therapiegerechte Packungsgröße',TO_TIMESTAMP('2017-12-19 17:52:06','YYYY-MM-DD HH24:MI:SS'),100,'00','00')
;
-- 2017-12-19T17:52:06.474
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541501 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:52:24.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541502,540798,TO_TIMESTAMP('2017-12-19 17:52:24','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N1',TO_TIMESTAMP('2017-12-19 17:52:24','YYYY-MM-DD HH24:MI:SS'),100,'01','01')
;
-- 2017-12-19T17:52:24.154
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541502 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:52:36.318
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541503,540798,TO_TIMESTAMP('2017-12-19 17:52:36','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N2',TO_TIMESTAMP('2017-12-19 17:52:36','YYYY-MM-DD HH24:MI:SS'),100,'02','02')
;
-- 2017-12-19T17:52:36.321
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541503 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:52:49.963
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541504,540798,TO_TIMESTAMP('2017-12-19 17:52:49','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','N3',TO_TIMESTAMP('2017-12-19 17:52:49','YYYY-MM-DD HH24:MI:SS'),100,'03','03')
;
-- 2017-12-19T17:52:49.965
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541504 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:53:03.234
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541505,540798,TO_TIMESTAMP('2017-12-19 17:53:03','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.vertical.pharma','Y','nicht betroffen',TO_TIMESTAMP('2017-12-19 17:53:03','YYYY-MM-DD HH24:MI:SS'),100,'04','04')
;
-- 2017-12-19T17:53:03.237
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541505 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2017-12-19T17:53:11.490
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=17, AD_Reference_Value_ID=540798,Updated=TO_TIMESTAMP('2017-12-19 17:53:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=558260
; | the_stack |
--
-- Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
--
--
-- UNION (also INTERSECT, EXCEPT)
-- https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/union.sql
--
CREATE OR REPLACE TEMPORARY VIEW INT4_TBL AS SELECT * FROM
(VALUES (0), (123456), (-123456), (2147483647), (-2147483647))
AS v(f1);
CREATE OR REPLACE TEMPORARY VIEW INT8_TBL AS SELECT * FROM
(VALUES
(123, 456),
(123, 4567890123456789),
(4567890123456789, 123),
(4567890123456789, 4567890123456789),
(4567890123456789, -4567890123456789))
AS v(q1, q2);
CREATE OR REPLACE TEMPORARY VIEW FLOAT8_TBL AS SELECT * FROM
(VALUES (0.0), (-34.84), (-1004.30),
(CAST('-1.2345678901234e+200' AS DOUBLE)), (CAST('-1.2345678901234e-200' AS DOUBLE)))
AS v(f1);
-- Simple UNION constructs
SELECT 1 AS two UNION SELECT 2 ORDER BY 1;
SELECT 1 AS one UNION SELECT 1 ORDER BY 1;
SELECT 1 AS two UNION ALL SELECT 2;
SELECT 1 AS two UNION ALL SELECT 1;
SELECT 1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
SELECT 1 AS two UNION SELECT 2 UNION SELECT 2 ORDER BY 1;
SELECT 1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
SELECT 1.1 AS two UNION SELECT 2.2 ORDER BY 1;
-- Mixed types
SELECT 1.1 AS two UNION SELECT 2 ORDER BY 1;
SELECT 1 AS two UNION SELECT 2.2 ORDER BY 1;
SELECT 1 AS one UNION SELECT double(1.0) ORDER BY 1;
SELECT 1.1 AS two UNION ALL SELECT 2 ORDER BY 1;
SELECT double(1.0) AS two UNION ALL SELECT 1 ORDER BY 1;
SELECT 1.1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1;
SELECT double(1.1) AS two UNION SELECT 2 UNION SELECT double(2.0) ORDER BY 1;
SELECT 1.1 AS three UNION SELECT 2 UNION ALL SELECT 2 ORDER BY 1;
SELECT 1.1 AS two UNION (SELECT 2 UNION ALL SELECT 2) ORDER BY 1;
--
-- Try testing from tables...
--
SELECT f1 AS five FROM FLOAT8_TBL
UNION
SELECT f1 FROM FLOAT8_TBL
ORDER BY 1;
SELECT f1 AS ten FROM FLOAT8_TBL
UNION ALL
SELECT f1 FROM FLOAT8_TBL;
SELECT f1 AS nine FROM FLOAT8_TBL
UNION
SELECT f1 FROM INT4_TBL
ORDER BY 1;
SELECT f1 AS ten FROM FLOAT8_TBL
UNION ALL
SELECT f1 FROM INT4_TBL;
SELECT f1 AS five FROM FLOAT8_TBL
WHERE f1 BETWEEN -1e6 AND 1e6
UNION
SELECT f1 FROM INT4_TBL
WHERE f1 BETWEEN 0 AND 1000000
ORDER BY 1;
-- [SPARK-28298] Fully support char and varchar types
-- SELECT CAST(f1 AS char(4)) AS three FROM VARCHAR_TBL
-- UNION
-- SELECT f1 FROM CHAR_TBL
-- ORDER BY 1;
-- SELECT f1 AS three FROM VARCHAR_TBL
-- UNION
-- SELECT CAST(f1 AS varchar) FROM CHAR_TBL
-- ORDER BY 1;
-- SELECT f1 AS eight FROM VARCHAR_TBL
-- UNION ALL
-- SELECT f1 FROM CHAR_TBL;
-- SELECT f1 AS five FROM TEXT_TBL
-- UNION
-- SELECT f1 FROM VARCHAR_TBL
-- UNION
-- SELECT TRIM(TRAILING FROM f1) FROM CHAR_TBL
-- ORDER BY 1;
--
-- INTERSECT and EXCEPT
--
SELECT q2 FROM int8_tbl INTERSECT SELECT q1 FROM int8_tbl ORDER BY 1;
SELECT q2 FROM int8_tbl INTERSECT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
SELECT q2 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl ORDER BY 1;
SELECT q2 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q1 FROM int8_tbl ORDER BY 1;
SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY 1;
SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q2 FROM int8_tbl ORDER BY 1;
SELECT q1 FROM int8_tbl EXCEPT ALL SELECT DISTINCT q2 FROM int8_tbl ORDER BY 1;
-- Spark SQL do not support update
-- SELECT q1 FROM int8_tbl EXCEPT ALL SELECT q1 FROM int8_tbl FOR NO KEY UPDATE;
-- nested cases
(SELECT 1,2,3 UNION SELECT 4,5,6) INTERSECT SELECT 4,5,6;
(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) INTERSECT SELECT 4,5,6;
(SELECT 1,2,3 UNION SELECT 4,5,6) EXCEPT SELECT 4,5,6;
(SELECT 1,2,3 UNION SELECT 4,5,6 ORDER BY 1,2) EXCEPT SELECT 4,5,6;
-- exercise both hashed and sorted implementations of INTERSECT/EXCEPT
-- set enable_hashagg to on;
-- explain (costs off)
-- select count(*) from
-- ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
select count(*) from
( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
-- explain (costs off)
-- select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
-- set enable_hashagg to off;
-- explain (costs off)
-- select count(*) from
-- ( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
select count(*) from
( select unique1 from tenk1 intersect select fivethous from tenk1 ) ss;
-- explain (costs off)
-- select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
select unique1 from tenk1 except select unique2 from tenk1 where unique2 != 10;
-- reset enable_hashagg;
--
-- Mixed types
--
SELECT f1 FROM float8_tbl INTERSECT SELECT f1 FROM int4_tbl ORDER BY 1;
SELECT f1 FROM float8_tbl EXCEPT SELECT f1 FROM int4_tbl ORDER BY 1;
--
-- Operator precedence and (((((extra))))) parentheses
--
SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl ORDER BY 1;
SELECT q1 FROM int8_tbl INTERSECT (((SELECT q2 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) ORDER BY 1;
(((SELECT q1 FROM int8_tbl INTERSECT SELECT q2 FROM int8_tbl ORDER BY 1))) UNION ALL SELECT q2 FROM int8_tbl;
SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
SELECT q1 FROM int8_tbl UNION ALL (((SELECT q2 FROM int8_tbl EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1)));
(((SELECT q1 FROM int8_tbl UNION ALL SELECT q2 FROM int8_tbl))) EXCEPT SELECT q1 FROM int8_tbl ORDER BY 1;
--
-- Subqueries with ORDER BY & LIMIT clauses
--
-- In this syntax, ORDER BY/LIMIT apply to the result of the EXCEPT
SELECT q1,q2 FROM int8_tbl EXCEPT SELECT q2,q1 FROM int8_tbl
ORDER BY q2,q1;
-- This should fail, because q2 isn't a name of an EXCEPT output column
SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1;
-- But this should work:
SELECT q1 FROM int8_tbl EXCEPT (((SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1))) ORDER BY 1;
--
-- New syntaxes (7.1) permit new tests
--
(((((select * from int8_tbl)))));
-- [SPARK-28557] Support empty select list
--
-- Check behavior with empty select list (allowed since 9.4)
--
-- select union select;
-- select intersect select;
-- select except select;
-- check hashed implementation
-- set enable_hashagg = true;
-- set enable_sort = false;
-- explain (costs off)
-- select from generate_series(1,5) union select from generate_series(1,3);
-- explain (costs off)
-- select from generate_series(1,5) intersect select from generate_series(1,3);
-- [SPARK-28409] SELECT FROM syntax
-- [SPARK-27767] Built-in function: generate_series
select * from range(1,5) union select * from range(1,3);
select * from range(1,6) union all select * from range(1,4);
select * from range(1,6) intersect select * from range(1,4);
select * from range(1,6) intersect all select * from range(1,4);
select * from range(1,6) except select * from range(1,4);
select * from range(1,6) except all select * from range(1,4);
-- check sorted implementation
-- set enable_hashagg = false;
-- set enable_sort = true;
-- explain (costs off)
-- select from generate_series(1,5) union select from generate_series(1,3);
-- explain (costs off)
-- select from generate_series(1,5) intersect select from generate_series(1,3);
select * from range(1,6) union select * from range(1,4);
select * from range(1,6) union all select * from range(1,4);
select * from range(1,6) intersect select * from range(1,4);
select * from range(1,6) intersect all select * from range(1,4);
select * from range(1,6) except select * from range(1,4);
select * from range(1,6) except all select * from range(1,4);
-- reset enable_hashagg;
-- reset enable_sort;
--
-- Check handling of a case with unknown constants. We don't guarantee
-- an undecorated constant will work in all cases, but historically this
-- usage has worked, so test we don't break it.
--
-- SELECT a.f1 FROM (SELECT 'test' AS f1 FROM varchar_tbl) a
-- UNION
-- SELECT b.f1 FROM (SELECT f1 FROM varchar_tbl) b
-- ORDER BY 1;
-- This should fail, but it should produce an error cursor
SELECT cast('3.4' as decimal(38, 18)) UNION SELECT 'foo';
-- Skip this test because it only test explain
--
-- Test that expression-index constraints can be pushed down through
-- UNION or UNION ALL
--
-- CREATE TEMP TABLE t1 (a text, b text);
-- CREATE INDEX t1_ab_idx on t1 ((a || b));
-- CREATE TEMP TABLE t2 (ab text primary key);
-- INSERT INTO t1 VALUES ('a', 'b'), ('x', 'y');
-- INSERT INTO t2 VALUES ('ab'), ('xy');
-- set enable_seqscan = off;
-- set enable_indexscan = on;
-- set enable_bitmapscan = off;
-- explain (costs off)
-- SELECT * FROM
-- (SELECT a || b AS ab FROM t1
-- UNION ALL
-- SELECT * FROM t2) t
-- WHERE ab = 'ab';
-- explain (costs off)
-- SELECT * FROM
-- (SELECT a || b AS ab FROM t1
-- UNION
-- SELECT * FROM t2) t
-- WHERE ab = 'ab';
-- Skip this test because we do not support inheritance
--
-- Test that ORDER BY for UNION ALL can be pushed down to inheritance
-- children.
--
-- CREATE TEMP TABLE t1c (b text, a text);
-- ALTER TABLE t1c INHERIT t1;
-- CREATE TEMP TABLE t2c (primary key (ab)) INHERITS (t2);
-- INSERT INTO t1c VALUES ('v', 'w'), ('c', 'd'), ('m', 'n'), ('e', 'f');
-- INSERT INTO t2c VALUES ('vw'), ('cd'), ('mn'), ('ef');
-- CREATE INDEX t1c_ab_idx on t1c ((a || b));
-- set enable_seqscan = on;
-- set enable_indexonlyscan = off;
-- explain (costs off)
-- SELECT * FROM
-- (SELECT a || b AS ab FROM t1
-- UNION ALL
-- SELECT ab FROM t2) t
-- ORDER BY 1 LIMIT 8;
-- SELECT * FROM
-- (SELECT a || b AS ab FROM t1
-- UNION ALL
-- SELECT ab FROM t2) t
-- ORDER BY 1 LIMIT 8;
-- reset enable_seqscan;
-- reset enable_indexscan;
-- reset enable_bitmapscan;
-- This simpler variant of the above test has been observed to fail differently
-- create table events (event_id int primary key);
-- create table other_events (event_id int primary key);
-- create table events_child () inherits (events);
-- explain (costs off)
-- select event_id
-- from (select event_id from events
-- union all
-- select event_id from other_events) ss
-- order by event_id;
-- drop table events_child, events, other_events;
-- reset enable_indexonlyscan;
-- Test constraint exclusion of UNION ALL subqueries
-- explain (costs off)
-- SELECT * FROM
-- (SELECT 1 AS t, * FROM tenk1 a
-- UNION ALL
-- SELECT 2 AS t, * FROM tenk1 b) c
-- WHERE t = 2;
-- Test that we push quals into UNION sub-selects only when it's safe
-- explain (costs off)
-- SELECT * FROM
-- (SELECT 1 AS t, 2 AS x
-- UNION
-- SELECT 2 AS t, 4 AS x) ss
-- WHERE x < 4
-- ORDER BY x;
SELECT * FROM
(SELECT 1 AS t, 2 AS x
UNION
SELECT 2 AS t, 4 AS x) ss
WHERE x < 4
ORDER BY x;
-- explain (costs off)
-- SELECT * FROM
-- (SELECT 1 AS t, generate_series(1,10) AS x
-- UNION
-- SELECT 2 AS t, 4 AS x) ss
-- WHERE x < 4
-- ORDER BY x;
;
SELECT * FROM
(SELECT 1 AS t, id as x from range(1,11)
UNION
SELECT 2 AS t, 4 AS x) ss
WHERE x < 4
ORDER BY x;
-- explain (costs off)
-- SELECT * FROM
-- (SELECT 1 AS t, (random()*3)::int AS x
-- UNION
-- SELECT 2 AS t, 4 AS x) ss
-- WHERE x > 3
-- ORDER BY x;
SELECT * FROM
(SELECT 1 AS t, int((random()*3)) AS x
UNION
SELECT 2 AS t, 4 AS x) ss
WHERE x > 3
ORDER BY x;
-- Test cases where the native ordering of a sub-select has more pathkeys
-- than the outer query cares about
-- explain (costs off)
-- select distinct q1 from
-- (select distinct * from int8_tbl i81
-- union all
-- select distinct * from int8_tbl i82) ss
-- where q2 = q2;
select distinct q1 from
(select distinct * from int8_tbl i81
union all
select distinct * from int8_tbl i82) ss
where q2 = q2;
-- explain (costs off)
-- select distinct q1 from
-- (select distinct * from int8_tbl i81
-- union all
-- select distinct * from int8_tbl i82) ss
-- where -q1 = q2;
select distinct q1 from
(select distinct * from int8_tbl i81
union all
select distinct * from int8_tbl i82) ss
where -q1 = q2;
-- Skip this test because it only test explain
-- Test proper handling of parameterized appendrel paths when the
-- potential join qual is expensive
-- create function expensivefunc(int) returns int
-- language plpgsql immutable strict cost 10000
-- as $$begin return $1; end$$;
-- create temp table t3 as select generate_series(-1000,1000) as x;
-- create index t3i on t3 (expensivefunc(x));
-- analyze t3;
-- explain (costs off)
-- select * from
-- (select * from t3 a union all select * from t3 b) ss
-- join int4_tbl on f1 = expensivefunc(x);
-- select * from
-- (select * from t3 a union all select * from t3 b) ss
-- join int4_tbl on f1 = expensivefunc(x);
-- drop table t3;
-- drop function expensivefunc(int);
-- Test handling of appendrel quals that const-simplify into an AND
-- explain (costs off)
-- select * from
-- (select *, 0 as x from int8_tbl a
-- union all
-- select *, 1 as x from int8_tbl b) ss
-- where (x = 0) or (q1 >= q2 and q1 <= q2);
select * from
(select *, 0 as x from int8_tbl a
union all
select *, 1 as x from int8_tbl b) ss
where (x = 0) or (q1 >= q2 and q1 <= q2); | the_stack |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Anomaly Detection XYZ Job Movement Data]
(
[Date_Time] [nvarchar](4000) NULL,
[X-Axis Job Movement ] [nvarchar](4000) NULL,
[Y-Axis Job Movement ] [nvarchar](4000) NULL,
[Z-Axis Job Movement ] [nvarchar](4000) NULL,
[Longitude] [nvarchar](4000) NULL,
[Latitude] [nvarchar](4000) NULL,
[InstanceNum] [nvarchar](4000) NULL,
[PC1] [nvarchar](4000) NULL,
[PC2] [nvarchar](4000) NULL,
[Anomaly Detected ] [nvarchar](4000) NULL,
[Scored Probabilities] [nvarchar](4000) NULL,
[X-Movement] [nvarchar](4000) NULL,
[Y-Movement] [nvarchar](4000) NULL,
[Z-Movement] [nvarchar](4000) NULL,
[url] [nvarchar](4000) NULL,
[Location] [nvarchar](4000) NULL,
[Row Num] [nvarchar](4000) NULL,
[Probability Goal] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Campaign] Script Date: 8/30/2020 11:35:35 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Campaign]
(
[ID] [int] NOT NULL,
[CampaignName] [varchar](50) NULL,
[CampaignLaunchDate] [varchar](50) NULL,
[SortOrder] [int] NULL,
[RevenueTarget] [varchar](50) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[CampaignData] Script Date: 8/30/2020 11:35:36 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CampaignData]
(
[ID] [bigint] NOT NULL,
[CampaignName] [varchar](18) NOT NULL,
[CampaignTactic] [varchar](16) NOT NULL,
[CampaignStartDate] [datetime] NULL,
[Expense] [decimal](10, 2) NULL,
[MarketingCost] [decimal](10, 2) NULL,
[Profit] [decimal](10, 2) NULL,
[LocationID] [bigint] NULL,
[Revenue] [decimal](10, 2) NULL,
[RevenueTarget] [decimal](10, 2) NULL,
[ROI] [decimal](10, 2) NULL,
[Status] [varchar](13) NOT NULL,
[ProductID] [bigint] NULL,
[Sentiment] [nvarchar](20) NULL,
[Response] [bigint] NULL,
[CampaignID] [bigint] NULL,
[CampaignRowKey] [bigint] NOT NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[CampaignData_Bubble] Script Date: 8/30/2020 11:35:38 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CampaignData_Bubble]
(
[ID] [int] NOT NULL,
[CampaignName] [varchar](18) NOT NULL,
[CampaignTactic] [varchar](16) NOT NULL,
[Expense] [int] NOT NULL,
[MarketingCost] [int] NOT NULL,
[Profit] [int] NOT NULL,
[LocationID] [int] NOT NULL,
[Revenue] [numeric](9, 1) NOT NULL,
[RevenueTarget] [int] NOT NULL,
[ROI] [numeric](11, 5) NOT NULL,
[Status] [varchar](13) NOT NULL,
[ProductID] [int] NOT NULL,
[Sentiment] [varchar](8) NOT NULL,
[Response] [varchar](4) NOT NULL,
[CampaignStartDate] [datetime] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[CampaignData_exl] Script Date: 8/30/2020 11:35:41 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CampaignData_exl]
(
[ID] [nvarchar](4000) NULL,
[CampaignName] [nvarchar](4000) NULL,
[CampaignTactic] [nvarchar](4000) NULL,
[CampaignStartDate] [nvarchar](4000) NULL,
[Expense] [nvarchar](4000) NULL,
[MarketingCost] [nvarchar](4000) NULL,
[Profit] [nvarchar](4000) NULL,
[LocationID] [nvarchar](4000) NULL,
[Revenue] [nvarchar](4000) NULL,
[RevenueTarget] [nvarchar](4000) NULL,
[ROI] [nvarchar](4000) NULL,
[Status] [nvarchar](4000) NULL,
[ProductID] [nvarchar](4000) NULL,
[Sentiment] [nvarchar](4000) NULL,
[Response] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Campaignproducts] Script Date: 8/30/2020 11:35:43 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Campaignproducts]
(
[Campaign] [varchar](250) NULL,
[ProductCategory] [varchar](250) NULL,
[Hashtag] [varchar](250) NULL,
[Counts] [varchar](250) NULL,
[ProductID] [int] NULL,
[CampaignRowKey] [bigint] NULL,
[SelectedFlag] [varchar](40) NULL,
[Sentiment] [varchar](20) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Campaignsales] Script Date: 8/30/2020 11:35:44 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Campaignsales]
(
[Date] [datetime] NOT NULL,
[CustomerId] [bigint] NOT NULL,
[DeliveryDate] [datetime] NULL,
[ProductId] [bigint] NOT NULL,
[Quantity] [decimal](18, 2) NOT NULL,
[UnitPrice] [decimal](18, 2) NOT NULL,
[TaxAmount] [decimal](18, 2) NOT NULL,
[TotalExcludingTax] [decimal](18, 2) NOT NULL,
[TotalIncludingTax] [decimal](18, 2) NOT NULL,
[GrossPrice] [decimal](18, 2) NOT NULL,
[Discount] [decimal](18, 2) NOT NULL,
[NetPrice] [decimal](18, 2) NOT NULL,
[GrossRevenue] [decimal](18, 2) NOT NULL,
[NetRevenue] [decimal](18, 2) NOT NULL,
[COGS_PER] [decimal](18, 2) NOT NULL,
[COGS] [decimal](18, 2) NOT NULL,
[GrossProfit] [decimal](18, 2) NOT NULL,
[CampaignRowKey] [bigint] NULL
)
WITH
(
DISTRIBUTION = HASH ( [ProductId] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Customer] Script Date: 8/30/2020 11:35:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Customer]
(
[Id] [bigint] NULL,
[Age] [smallint] NULL,
[Gender] [nvarchar](4000) NULL,
[Pincode] [nvarchar](4000) NULL,
[FirstName] [nvarchar](4000) NULL,
[LastName] [nvarchar](4000) NULL,
[FullName] [nvarchar](4000) NULL,
[DateOfBirth] [nvarchar](4000) NULL,
[Address] [nvarchar](4000) NULL,
[Email] [nvarchar](4000) NULL,
[Mobile] [nvarchar](4000) NULL,
[UserName] [nvarchar](4000) NULL,
[Customer_type] [varchar](3) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Date] Script Date: 8/30/2020 11:35:49 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Date]
(
[Date] [date] NULL,
[Day] [int] NULL,
[DaySuffix] [char](2) NULL,
[DayName] [nvarchar](30) NULL,
[DayOfWeek] [int] NULL,
[DayOfWeekInMonth] [tinyint] NULL,
[DayOfYear] [int] NULL,
[IsWeekend] [int] NOT NULL,
[Week] [int] NULL,
[ISOweek] [int] NULL,
[FirstOfWeek] [date] NULL,
[LastOfWeek] [date] NULL,
[WeekOfMonth] [tinyint] NULL,
[Month] [int] NULL,
[MonthName] [nvarchar](30) NULL,
[FirstOfMonth] [date] NULL,
[LastOfMonth] [date] NULL,
[FirstOfNextMonth] [date] NULL,
[LastOfNextMonth] [date] NULL,
[Quarter] [int] NULL,
[FirstOfQuarter] [date] NULL,
[LastOfQuarter] [date] NULL,
[Year] [int] NULL,
[ISOYear] [int] NULL,
[FirstOfYear] [date] NULL,
[LastOfYear] [date] NULL,
[IsLeapYear] [bit] NULL,
[Has53Weeks] [int] NOT NULL,
[Has53ISOWeeks] [int] NOT NULL,
[MonthNumber] [int] NULL,
[DateKey] [int] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[FactoryOverviewTable] Script Date: 8/30/2020 11:35:54 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FactoryOverviewTable]
(
[Prop_0] [nvarchar](4000) NULL,
[Prop_1] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[historical-data-adf] Script Date: 8/30/2020 11:35:55 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[historical-data-adf]
(
[Timestamp] [datetime] NULL,
[Power] [float] NULL,
[Temperature] [float] NULL,
[SuctionPressure] [float] NULL,
[Vibration] [float] NULL,
[DischargePressure] [float] NULL,
[VibrationVelocity] [float] NULL,
[VibrationAcceleration] [float] NULL,
[AnomalyDischargeCavitation] [float] NULL,
[AnomalySealFailure] [float] NULL,
[AnomalyCouplingFailure] [float] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Incident Probabilities Rio and Stuttgart] Script Date: 8/30/2020 11:35:56 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Incident Probabilities Rio and Stuttgart]
(
[FactoryName] [nvarchar](4000) NULL,
[FactoryLocation] [nvarchar](4000) NULL,
[AreaName] [nvarchar](4000) NULL,
[FloorName] [nvarchar](4000) NULL,
[Score] [nvarchar](4000) NULL,
[P_Incident] [nvarchar](4000) NULL,
[Risk Category] [nvarchar](4000) NULL,
[Goal] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[jobquality] Script Date: 8/30/2020 11:35:58 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[jobquality]
(
[jobId] [nvarchar](50) NULL,
[good] [int] NULL,
[snag] [int] NULL,
[reject] [int] NULL,
[timestamp] [datetime] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Location] Script Date: 8/30/2020 11:35:59 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Location]
(
[LocationId] [bigint] NULL,
[LocationCode] [varchar](10) NULL,
[LocationName] [varchar](2000) NULL,
[Country] [nvarchar](50) NULL,
[Region] [varchar](50) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[mfg-AlertAlarm] Script Date: 8/30/2020 11:36:00 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-AlertAlarm]
(
[AlarmCodeId] [bigint] NOT NULL,
[AlarmCode] [varchar](2000) NULL,
[AlarmType] [varchar](2000) NULL,
[Severity] [varchar](2000) NULL,
[Description] [varchar](2000) NULL
)
WITH
(
DISTRIBUTION = HASH ( [AlarmCodeId] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[mfg-iot-lathe-peck-drill] Script Date: 8/30/2020 11:36:01 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-iot-lathe-peck-drill]
(
[EpochTime] [bigint] NULL,
[StringDateTime] [varchar](50) NULL,
[JobCode] [varchar](200) NULL,
[OperationId] [int] NULL,
[BatchCode] [varchar](2000) NULL,
[MachineCode] [varchar](2000) NULL,
[VibrationX] [float] NULL,
[VibrationY] [float] NULL,
[VibrationZ] [float] NULL,
[SpindleSpeed] [bigint] NULL,
[CoolantTemperature] [bigint] NULL,
[zAxis] [float] NULL,
[EventProcessedUtcTime] [datetime] NULL,
[PartitionId] [bigint] NULL,
[EventEnqueuedUtcTime] [datetime] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
ALTER TABLE [dbo].[Campaignproducts] ADD DEFAULT ((0)) FOR [SelectedFlag]
GO
/****** Object: Table [dbo].[mfg-iot-lathe-thread-cut] Script Date: 8/30/2020 11:37:56 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-iot-lathe-thread-cut]
(
[EpochTime] [bigint] NULL,
[StringDateTime] [varchar](50) NULL,
[JobCode] [varchar](200) NULL,
[OperationId] [int] NULL,
[BatchCode] [varchar](2000) NULL,
[MachineCode] [varchar](2000) NULL,
[VibrationX] [float] NULL,
[VibrationY] [float] NULL,
[VibrationZ] [float] NULL,
[SpindleSpeed] [bigint] NULL,
[CoolantTemperature] [bigint] NULL,
[xAxis] [float] NULL,
[zAxis] [float] NULL,
[EventProcessedUtcTime] [datetime] NULL,
[PartitionId] [bigint] NULL,
[EventEnqueuedUtcTime] [datetime] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[mfg-iot-milling-canning] Script Date: 8/30/2020 11:37:59 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-iot-milling-canning]
(
[EpochTime] [bigint] NULL,
[StringDateTime] [varchar](50) NULL,
[JobCode] [varchar](200) NULL,
[OperationId] [int] NULL,
[BatchCode] [varchar](2000) NULL,
[MachineCode] [varchar](2000) NULL,
[VibrationX] [float] NULL,
[VibrationY] [float] NULL,
[VibrationZ] [float] NULL,
[SpindleSpeed] [bigint] NULL,
[CoolantTemperature] [bigint] NULL,
[xAxis] [float] NULL,
[yAxis] [float] NULL,
[zAxis] [float] NULL,
[EventProcessedUtcTime] [datetime] NULL,
[PartitionId] [bigint] NULL,
[EventEnqueuedUtcTime] [datetime] NULL,
[AnomalyTemperature] [bigint] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[mfg-Location] Script Date: 8/30/2020 11:38:01 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-Location]
(
[LocationId] [bigint] NOT NULL,
[LocationCode] [varchar](10) NULL,
[LocationName] [varchar](2000) NULL,
[Country] [nvarchar](50) NULL
)
WITH
(
DISTRIBUTION = HASH ( [LocationId] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[mfg-MachineAlert] Script Date: 8/30/2020 11:38:02 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-MachineAlert]
(
[RaisedTime] [datetime] NULL,
[ClearedTime] [datetime] NULL,
[JobCode] [varchar](100) NULL,
[OperationId] [int] NULL,
[MachineCode] [varchar](2000) NULL,
[BatchCode] [varchar](2000) NULL,
[AlarmCodeId] [bigint] NULL
)
WITH
(
DISTRIBUTION = HASH ( [BatchCode] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[mfg-OEE] Script Date: 8/30/2020 11:38:03 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-OEE]
(
[OEEId] [bigint] NULL,
[Date] [datetime] NULL,
[LocationId] [bigint] NULL,
[Availability] [decimal](5, 2) NULL,
[Performance] [decimal](5, 2) NULL,
[Quality] [decimal](5, 2) NULL,
[OEE] [decimal](5, 2) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[mfg-OEE-Agg] Script Date: 8/30/2020 11:38:05 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-OEE-Agg]
(
[Date] [nvarchar](4000) NULL,
[LocationID] [int] NULL,
[Availability] [float] NULL,
[Performance] [float] NULL,
[Quality] [float] NULL,
[OEE] [float] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[mfg-ProductQuality] Script Date: 8/30/2020 11:38:06 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-ProductQuality]
(
[SKUs] [nvarchar](50) NULL,
[good] [int] NULL,
[snag] [int] NULL,
[reject] [int] NULL,
[OrderQty] [int] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[MSFT mfg demo] Script Date: 8/30/2020 11:38:07 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MSFT mfg demo]
(
[Timestamp] [nvarchar](4000) NULL,
[Power] [nvarchar](4000) NULL,
[Temperature] [nvarchar](4000) NULL,
[SuctionPressure] [nvarchar](4000) NULL,
[Vibration] [nvarchar](4000) NULL,
[DischargePressure] [nvarchar](4000) NULL,
[VibrationVelocity] [nvarchar](4000) NULL,
[VibrationAcceleration] [nvarchar](4000) NULL,
[AnomalyDischargeCavitation] [nvarchar](4000) NULL,
[AnomalySealFailure] [nvarchar](4000) NULL,
[AnomalyCouplingFailure] [nvarchar](4000) NULL,
[UpdatedDate] [nvarchar](4000) NULL,
[Date] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[OperationsCaseData] Script Date: 8/30/2020 11:38:09 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OperationsCaseData]
(
[City] [nvarchar](4000) NULL,
[CasesCreated] [nvarchar](4000) NULL,
[CasesResolved] [nvarchar](4000) NULL,
[CasesCancelled] [nvarchar](4000) NULL,
[CasesPending] [nvarchar](4000) NULL,
[SLACompliance] [nvarchar](4000) NULL,
[SLANonCompliance] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Product] Script Date: 8/30/2020 11:38:10 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Product]
(
[ProductID] [int] NOT NULL,
[ProductCode] [nvarchar](50) NULL,
[BarCode] [nvarchar](23) NULL,
[Name] [nvarchar](100) NULL,
[Description] [nvarchar](500) NULL,
[Price] [decimal](10, 2) NULL,
[Category] [nvarchar](20) NULL,
[Thumbnail_FileName] [nvarchar](500) NULL,
[AdImage_FileName] [nvarchar](500) NULL,
[SoundFile_FileName] [nvarchar](500) NULL,
[CreatedDate] [varchar](500) NULL,
[Dimensions] [nvarchar](50) NULL,
[Colour] [nvarchar](50) NULL,
[Weight] [decimal](10, 2) NULL,
[MaxLoad] [decimal](10, 2) NULL,
[BasePrice] [int] NULL,
[id] [int] NULL,
[TaxRate] [int] NULL,
[SellingPrice] [decimal](18, 2) NULL,
[COGS_PER] [int] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[Sales] Script Date: 8/30/2020 11:38:13 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Sales]
(
[Date] [date] NOT NULL,
[CustomerId] [bigint] NOT NULL,
[DeliveryDate] [date] NULL,
[ProductId] [bigint] NULL,
[Quantity] [decimal](18, 2) NOT NULL,
[UnitPrice] [decimal](18, 2) NOT NULL,
[TaxAmount] [decimal](18, 2) NOT NULL,
[TotalExcludingTax] [decimal](18, 2) NOT NULL,
[TotalIncludingTax] [decimal](18, 2) NOT NULL,
[GrossPrice] [decimal](18, 2) NOT NULL,
[Discount] [decimal](18, 2) NOT NULL,
[NetPrice] [decimal](18, 2) NOT NULL,
[GrossRevenue] [decimal](18, 2) NOT NULL,
[NetRevenue] [decimal](18, 2) NOT NULL,
[COGS_PER] [decimal](18, 2) NOT NULL,
[COGS] [decimal](18, 2) NOT NULL,
[GrossProfit] [decimal](18, 2) NOT NULL,
[OrderKey] [nvarchar](50) NULL,
[SaleKey] [nvarchar](100) NULL
)
WITH
(
DISTRIBUTION = HASH ( [CustomerId] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[vCampaignSales] Script Date: 8/30/2020 11:38:17 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[vCampaignSales]
(
[Year] [int] NULL,
[Month] [int] NULL,
[MonthName] [nvarchar](30) NULL,
[CampaignRowKey] [int] NULL,
[Profit] [decimal](38, 2) NULL,
[Revenue] [decimal](38, 2) NULL,
[QuantitySold] [decimal](38, 2) NULL,
[cb] [bigint] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-BatchSummary]
(
[BatchCode] [varchar](500) NOT NULL,
[StartTime] [datetime] NULL,
[EndTime] [datetime] NULL,
[PreparationTime] [float] NULL,
[TotalIdleTime] [float] NULL,
[JobOutput] [float] NULL,
[PoweringOffTime] [float] NULL
)
WITH
(
DISTRIBUTION = HASH ( [BatchCode] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
CREATE TABLE [dbo].[mfg-Product-BatchMapping]
(
[batchcode] [varchar](500) NOT NULL,
[productid] [int] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
CREATE VIEW [dbo].[Vw_Mfg_batchSummary]
AS SELECT SUM(jobOutput) AS ProducedQty,
BPM.ProductId
FROM [mfg-BatchSummary] AS BS
LEFT OUTER JOIN
[mfg-Product-BatchMapping] AS BPM ON BPM.BatchCode = BS.BatchCode
GROUP BY BPM.ProductId HAVING ProductId IS NOT NULL;
GO
/****** Object: Table [dbo].[mfg-iot-json] Script Date: 9/2/2020 5:51:41 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-iot-json]
(
[IoTData] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[CustomerInformation] Script Date: 9/2/2020 5:53:31 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CustomerInformation]
(
[UserName] [nvarchar](4000) NULL,
[Gender] [nvarchar](4000) NULL,
[Phone] [nvarchar](4000) NULL,
[Email] [nvarchar](4000) NULL,
[CreditCard] [nvarchar](19) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
/****** Object: Table [dbo].[MFG-FactSales] Script Date: 9/2/2020 5:55:49 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[MFG-FactSales]
(
[ProductID] [nvarchar](4000) NULL,
[Analyst] [nvarchar](4000) NULL,
[Product] [nvarchar](4000) NULL,
[CampaignName] [nvarchar](4000) NULL,
[Qty] [nvarchar](4000) NULL,
[Region] [nvarchar](4000) NULL,
[State] [nvarchar](4000) NULL,
[City] [nvarchar](4000) NULL,
[Revenue] [nvarchar](4000) NULL,
[RevenueTarget] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-EmergencyEvent]
(
[EmergencyEventId] [bigint] NULL,
[LocationAreaId] [bigint] NULL,
[OccurredOn] [date] NULL,
[Type] [varchar](200) NULL,
[Category] [varchar](200) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-EmergencyEventPerson]
(
[EmergencyEventPersonId] [bigint] NULL,
[EmergencyEventId] [bigint] NULL,
[PersonName] [nvarchar](2000) NULL,
[AbsenceStartDate] [date] NULL,
[AbsenceEndDate] [date] NULL,
[LostManHours] [int] NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[milling-canning]
(
[anomalytemperature] [nvarchar](4000) NULL,
[batchcode] [nvarchar](4000) NULL,
[coolanttemperature] [nvarchar](4000) NULL,
[epochtime] [nvarchar](4000) NULL,
[eventenqueuedutctime] [nvarchar](4000) NULL,
[eventprocessedutctime] [nvarchar](4000) NULL,
[jobcode] [nvarchar](4000) NULL,
[machinecode] [nvarchar](4000) NULL,
[operationid] [nvarchar](4000) NULL,
[partitionid] [nvarchar](4000) NULL,
[spindlespeed] [nvarchar](4000) NULL,
[stringdatetime] [nvarchar](4000) NULL,
[vibrationx] [nvarchar](4000) NULL,
[vibrationy] [nvarchar](4000) NULL,
[vibrationz] [nvarchar](4000) NULL,
[xaxis] [nvarchar](4000) NULL,
[yaxis] [nvarchar](4000) NULL,
[zaxis] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[racingcars]
(
[ActiveSensors] [nvarchar](4000) NULL,
[AlarmsIncidents] [nvarchar](4000) NULL,
[AverageRPM] [nvarchar](4000) NULL,
[AverageRPMEnd] [nvarchar](4000) NULL,
[AverageRPMR1] [nvarchar](4000) NULL,
[AverageRPMR2] [nvarchar](4000) NULL,
[AverageRPMR3] [nvarchar](4000) NULL,
[AverageRPMStart] [nvarchar](4000) NULL,
[axCG] [nvarchar](4000) NULL,
[ayCG] [nvarchar](4000) NULL,
[azCG] [nvarchar](4000) NULL,
[brake] [nvarchar](4000) NULL,
[CallsCountAverageResponseTime] [nvarchar](4000) NULL,
[chassisAccelFL] [nvarchar](4000) NULL,
[chassisAccelFR] [nvarchar](4000) NULL,
[chassisAccelRL] [nvarchar](4000) NULL,
[chassisAccelRR] [nvarchar](4000) NULL,
[clutch] [nvarchar](4000) NULL,
[distance] [nvarchar](4000) NULL,
[engineSpeed] [nvarchar](4000) NULL,
[EpochTime] [nvarchar](4000) NULL,
[EventEnqueuedUtcTime] [nvarchar](4000) NULL,
[EventProcessedUtcTime] [nvarchar](4000) NULL,
[horizontalSpeed] [nvarchar](4000) NULL,
[IoTHub] [nvarchar](4000) NULL,
[MachineStatus] [nvarchar](4000) NULL,
[PartitionId] [nvarchar](4000) NULL,
[StringDateTime] [nvarchar](4000) NULL,
[throttle] [nvarchar](4000) NULL,
[time] [nvarchar](4000) NULL,
[vxCG] [nvarchar](4000) NULL,
[vyCG] [nvarchar](4000) NULL,
[vzCG] [nvarchar](4000) NULL,
[wheelAccelFL] [nvarchar](4000) NULL,
[wheelAccelFR] [nvarchar](4000) NULL,
[wheelAccelRL] [nvarchar](4000) NULL,
[wheelAccelRR] [nvarchar](4000) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-MaintenanceCode]
(
[MaintenanceCodeId] [bigint] NOT NULL,
[MaintenanceCode] [varchar](200) NULL,
[MaintenanceType] [varchar](200) NULL,
[ActivityName] [varchar](2000) NULL,
[MaxTime] [int] NULL,
[ScheduleInterval] [varchar](200) NULL
)
WITH
(
DISTRIBUTION = HASH ( [MaintenanceCodeId] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-MaintenanceCost]
(
[MaintenanceCostId] [int] NULL,
[AggregatedFor] [date] NULL,
[EnergyConsumptionKwH] [decimal](20,2) NULL,
[EnergyCharge] [decimal](20,2) NULL,
[MaintenanceCharge] [decimal](20,2) NULL
)
WITH
(
DISTRIBUTION = HASH ( [AggregatedFor] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-PlannedMaintenanceActivity]
(
[PlannedMaintenanceActivityId] [bigint] NOT NULL,
[MaintenanceId] [bigint] NULL,
[MaintenanceCodeId] [bigint] NULL,
[StartTime] [datetime] NULL,
[EndTime] [datetime] NULL
)
WITH
(
DISTRIBUTION = HASH ( [PlannedMaintenanceActivityId] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[mfg-UnplannedMaintenanceActivity]
(
[UnplannedMaintenanceActivityId] [bigint] NOT NULL,
[MaintenanceId] [bigint] NULL,
[MaintenanceCodeId] [bigint] NULL,
[StartTime] [datetime] NULL,
[EndTime] [datetime] NULL
)
WITH
(
DISTRIBUTION = HASH ( [UnplannedMaintenanceActivityId] ),
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Role]
(
[RoleID] [int] NOT NULL,
[Name] [varchar](100) NOT NULL,
[Email] [varchar](100) NULL,
[Roles] [varchar](128) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Campaign_Analytics_New]
(
[Region] [varchar](50) NULL,
[Country] [varchar](50) NULL,
[Product_Category] [varchar](50) NULL,
[Campaign_Name] [varchar](50) NULL,
[Revenue] [varchar](50) NULL,
[Revenue_Target] [varchar](50) NULL,
[RoleID] [int] NULL,
[City] [nvarchar](100) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Campaign_Analytics]
(
[Region] [varchar](50) NULL,
[Country] [varchar](50) NULL,
[Product_Category] [varchar](50) NULL,
[Campaign_Name] [varchar](50) NULL,
[Revenue] [varchar](50) NULL,
[Revenue_Target] [varchar](50) NULL,
[City] [varchar](50) NULL,
[State] [varchar](50) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[CLS_DAM_AC_New] AS
GRANT SELECT ON Campaign_Analytics([Region],[Country],[Product_Category],[Campaign_Name],[Revenue_Target],[City],[State]) TO SalesStaff;
EXECUTE AS USER ='SalesStaff'
select [Region],[Country],[Product_Category],[Campaign_Name],[Revenue_Target],[City],[State] from Campaign_Analytics
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[CLS_DAM_F_New] AS
BEGIN TRY
-- Generate a divide-by-zero error
GRANT SELECT ON Campaign_Analytics([Region],[Country],[Product_Category],[Campaign_Name],[Revenue_Target],[CITY],[State]) TO SalesStaff;
EXECUTE AS USER ='SalesStaff'
select * from Campaign_Analytics
END TRY
BEGIN CATCH
SELECT
ERROR_NUMBER() AS ErrorNumber,
ERROR_STATE() AS ErrorState,
ERROR_SEVERITY() AS ErrorSeverity,
ERROR_PROCEDURE() AS ErrorProcedure,
ERROR_MESSAGE() AS ErrorMessage;
END CATCH;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[CLS_CEONew] AS
Revert;
GRANT SELECT ON Campaign_Analytics TO InventoryManager; --Full access to all columns.
-- Step:6 Let us check if our CEO user can see all the information that is present. Assign Current User As 'CEO' and the execute the query
EXECUTE AS USER ='InventoryManager'
select * from Campaign_Analytics
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[Sp_MFGRLS] AS
Begin
-- After creating the users, read access is provided to all three users on FactSales table
GRANT SELECT ON FactSales TO InventoryManager, SalesStaffMiami, SalesStaffSanDiego;
IF EXISts (SELECT 1 FROM sys.security_predicates sp where sp.predicate_definition='([Security].[fn_securitypredicate]([SalesRep]))')
BEGIN
DROP SECURITY POLICY SalesFilter;
DROP FUNCTION Security.fn_securitypredicate;
END
IF EXISTS (SELECT * FROM sys.schemas where name='Security')
BEGIN
DROP SCHEMA Security;
End
/* Moving ahead, we Create a new schema, and an inline table-valued function.
The function returns 1 when a row in the SalesRep column is the same as the user executing the query (@SalesRep = USER_NAME())
or if the user executing the query is the Manager user (USER_NAME() = 'InventoryManager').
*/
end
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[SP_RLS_InventoryManager] AS
EXECUTE AS USER = 'InventoryManager';
SELECT * FROM [MFG-FactSales];
revert;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[SP_RLS_SalesStaffMiami] AS
EXECUTE AS USER = 'SalesStaffMiami'
SELECT * FROM [MFG-FactSales];
revert;
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[SP_RLS_SalesStaffSanDiego] AS
EXECUTE AS USER = 'SalesStaffSanDiego';
SELECT * FROM [MFG-FactSales];
revert;
GO
CREATE TABLE [dbo].[FactSales]
(
[OrderID] [int] NULL,
[SalesRep] [sysname] NULL,
[Product] [varchar](50) NULL,
[Qty] [int] NULL,
[RoleID] [int] NULL,
[QtySold] [int] NULL,
[Analyst] [varchar](50) NULL
)
WITH
(
DISTRIBUTION = ROUND_ROBIN,
CLUSTERED COLUMNSTORE INDEX
)
GO
CREATE TABLE [dbo].[MfgMesQuality1]
(
[ProductionMonth] [datetime] NOT NULL,
[MachineInstance] [varchar](30) NULL,
[MachineName] [varchar](30) NULL,
[Good] [int] NULL,
[Snag] [int] NULL,
[Reject] [int] NULL,
[Avg] [float] NULL
)
WITH
(
DISTRIBUTION = HASH ( [MachineInstance] ),
CLUSTERED COLUMNSTORE INDEX
) | the_stack |
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION btree_gist" to load this file. \quit
ALTER EXTENSION btree_gist ADD type gbtreekey4;
ALTER EXTENSION btree_gist ADD function gbtreekey4_in(cstring);
ALTER EXTENSION btree_gist ADD function gbtreekey4_out(gbtreekey4);
ALTER EXTENSION btree_gist ADD type gbtreekey8;
ALTER EXTENSION btree_gist ADD function gbtreekey8_in(cstring);
ALTER EXTENSION btree_gist ADD function gbtreekey8_out(gbtreekey8);
ALTER EXTENSION btree_gist ADD type gbtreekey16;
ALTER EXTENSION btree_gist ADD function gbtreekey16_in(cstring);
ALTER EXTENSION btree_gist ADD function gbtreekey16_out(gbtreekey16);
ALTER EXTENSION btree_gist ADD type gbtreekey32;
ALTER EXTENSION btree_gist ADD function gbtreekey32_in(cstring);
ALTER EXTENSION btree_gist ADD function gbtreekey32_out(gbtreekey32);
ALTER EXTENSION btree_gist ADD type gbtreekey_var;
ALTER EXTENSION btree_gist ADD function gbtreekey_var_in(cstring);
ALTER EXTENSION btree_gist ADD function gbtreekey_var_out(gbtreekey_var);
ALTER EXTENSION btree_gist ADD function gbt_oid_consistent(internal,oid,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_oid_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_decompress(internal);
ALTER EXTENSION btree_gist ADD function gbt_var_decompress(internal);
ALTER EXTENSION btree_gist ADD function gbt_oid_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_oid_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_oid_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_oid_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_oid_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_oid_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_int2_consistent(internal,smallint,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_int2_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_int2_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_int2_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_int2_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_int2_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_int2_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_int2_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_int4_consistent(internal,integer,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_int4_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_int4_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_int4_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_int4_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_int4_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_int4_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_int4_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_int8_consistent(internal,bigint,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_int8_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_int8_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_int8_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_int8_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_int8_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_int8_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_int8_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_float4_consistent(internal,real,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_float4_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_float4_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_float4_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_float4_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_float4_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_float4_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_float4_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_float8_consistent(internal,double precision,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_float8_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_float8_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_float8_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_float8_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_float8_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_float8_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_float8_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_ts_consistent(internal,timestamp without time zone,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_tstz_consistent(internal,timestamp with time zone,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_ts_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_tstz_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_ts_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_ts_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_ts_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_ts_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_timestamp_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_timestamp_ops using gist;
ALTER EXTENSION btree_gist ADD operator family gist_timestamptz_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_timestamptz_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_time_consistent(internal,time without time zone,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_timetz_consistent(internal,time with time zone,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_time_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_timetz_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_time_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_time_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_time_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_time_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_time_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_time_ops using gist;
ALTER EXTENSION btree_gist ADD operator family gist_timetz_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_timetz_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_date_consistent(internal,date,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_date_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_date_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_date_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_date_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_date_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_date_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_date_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_intv_consistent(internal,interval,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_intv_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_intv_decompress(internal);
ALTER EXTENSION btree_gist ADD function gbt_intv_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_intv_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_intv_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_intv_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_interval_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_interval_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_cash_consistent(internal,money,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_cash_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_cash_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_cash_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_cash_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_cash_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_cash_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_cash_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_macad_consistent(internal,macaddr,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_macad_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_macad_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_macad_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_macad_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_macad_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_macaddr_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_macaddr_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_text_consistent(internal,text,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_bpchar_consistent(internal,character,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_text_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_bpchar_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_text_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_text_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_text_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_text_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_text_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_text_ops using gist;
ALTER EXTENSION btree_gist ADD operator family gist_bpchar_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_bpchar_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_bytea_consistent(internal,bytea,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_bytea_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_bytea_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_bytea_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_bytea_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_bytea_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_bytea_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_bytea_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_numeric_consistent(internal,numeric,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_numeric_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_numeric_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_numeric_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_numeric_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_numeric_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_numeric_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_numeric_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_bit_consistent(internal,bit,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_bit_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_bit_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_bit_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_bit_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_bit_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_bit_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_bit_ops using gist;
ALTER EXTENSION btree_gist ADD operator family gist_vbit_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_vbit_ops using gist;
ALTER EXTENSION btree_gist ADD function gbt_inet_consistent(internal,inet,smallint,oid,internal);
ALTER EXTENSION btree_gist ADD function gbt_inet_compress(internal);
ALTER EXTENSION btree_gist ADD function gbt_inet_penalty(internal,internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_inet_picksplit(internal,internal);
ALTER EXTENSION btree_gist ADD function gbt_inet_union(bytea,internal);
ALTER EXTENSION btree_gist ADD function gbt_inet_same(internal,internal,internal);
ALTER EXTENSION btree_gist ADD operator family gist_inet_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_inet_ops using gist;
ALTER EXTENSION btree_gist ADD operator family gist_cidr_ops using gist;
ALTER EXTENSION btree_gist ADD operator class gist_cidr_ops using gist;
-- Add functions and operators that are new in 9.1
--distance operators
CREATE FUNCTION cash_dist(money, money)
RETURNS money
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = money,
RIGHTARG = money,
PROCEDURE = cash_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION date_dist(date, date)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = date,
RIGHTARG = date,
PROCEDURE = date_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION float4_dist(float4, float4)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = float4,
RIGHTARG = float4,
PROCEDURE = float4_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION float8_dist(float8, float8)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = float8,
RIGHTARG = float8,
PROCEDURE = float8_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION int2_dist(int2, int2)
RETURNS int2
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = int2,
RIGHTARG = int2,
PROCEDURE = int2_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION int4_dist(int4, int4)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = int4,
RIGHTARG = int4,
PROCEDURE = int4_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION int8_dist(int8, int8)
RETURNS int8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = int8,
RIGHTARG = int8,
PROCEDURE = int8_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION interval_dist(interval, interval)
RETURNS interval
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = interval,
RIGHTARG = interval,
PROCEDURE = interval_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION oid_dist(oid, oid)
RETURNS oid
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = oid,
RIGHTARG = oid,
PROCEDURE = oid_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION time_dist(time, time)
RETURNS interval
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = time,
RIGHTARG = time,
PROCEDURE = time_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION ts_dist(timestamp, timestamp)
RETURNS interval
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = timestamp,
RIGHTARG = timestamp,
PROCEDURE = ts_dist,
COMMUTATOR = '<->'
);
CREATE FUNCTION tstz_dist(timestamptz, timestamptz)
RETURNS interval
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE OPERATOR <-> (
LEFTARG = timestamptz,
RIGHTARG = timestamptz,
PROCEDURE = tstz_dist,
COMMUTATOR = '<->'
);
-- Support functions for distance operators
CREATE FUNCTION gbt_oid_distance(internal,oid,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_int2_distance(internal,int2,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_int4_distance(internal,int4,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_int8_distance(internal,int8,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_float4_distance(internal,float4,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_float8_distance(internal,float8,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_ts_distance(internal,timestamp,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_tstz_distance(internal,timestamptz,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_time_distance(internal,time,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_date_distance(internal,date,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_intv_distance(internal,interval,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
CREATE FUNCTION gbt_cash_distance(internal,money,int2,oid)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-- Add new-in-9.1 stuff to the operator classes.
ALTER OPERATOR FAMILY gist_oid_ops USING gist ADD
OPERATOR 6 <> (oid, oid) ,
OPERATOR 15 <-> (oid, oid) FOR ORDER BY pg_catalog.oid_ops ,
FUNCTION 8 (oid, oid) gbt_oid_distance (internal, oid, int2, oid) ;
ALTER OPERATOR FAMILY gist_int2_ops USING gist ADD
OPERATOR 6 <> (int2, int2) ,
OPERATOR 15 <-> (int2, int2) FOR ORDER BY pg_catalog.integer_ops ,
FUNCTION 8 (int2, int2) gbt_int2_distance (internal, int2, int2, oid) ;
ALTER OPERATOR FAMILY gist_int4_ops USING gist ADD
OPERATOR 6 <> (int4, int4) ,
OPERATOR 15 <-> (int4, int4) FOR ORDER BY pg_catalog.integer_ops ,
FUNCTION 8 (int4, int4) gbt_int4_distance (internal, int4, int2, oid) ;
ALTER OPERATOR FAMILY gist_int8_ops USING gist ADD
OPERATOR 6 <> (int8, int8) ,
OPERATOR 15 <-> (int8, int8) FOR ORDER BY pg_catalog.integer_ops ,
FUNCTION 8 (int8, int8) gbt_int8_distance (internal, int8, int2, oid) ;
ALTER OPERATOR FAMILY gist_float4_ops USING gist ADD
OPERATOR 6 <> (float4, float4) ,
OPERATOR 15 <-> (float4, float4) FOR ORDER BY pg_catalog.float_ops ,
FUNCTION 8 (float4, float4) gbt_float4_distance (internal, float4, int2, oid) ;
ALTER OPERATOR FAMILY gist_float8_ops USING gist ADD
OPERATOR 6 <> (float8, float8) ,
OPERATOR 15 <-> (float8, float8) FOR ORDER BY pg_catalog.float_ops ,
FUNCTION 8 (float8, float8) gbt_float8_distance (internal, float8, int2, oid) ;
ALTER OPERATOR FAMILY gist_timestamp_ops USING gist ADD
OPERATOR 6 <> (timestamp, timestamp) ,
OPERATOR 15 <-> (timestamp, timestamp) FOR ORDER BY pg_catalog.interval_ops ,
FUNCTION 8 (timestamp, timestamp) gbt_ts_distance (internal, timestamp, int2, oid) ;
ALTER OPERATOR FAMILY gist_timestamptz_ops USING gist ADD
OPERATOR 6 <> (timestamptz, timestamptz) ,
OPERATOR 15 <-> (timestamptz, timestamptz) FOR ORDER BY pg_catalog.interval_ops ,
FUNCTION 8 (timestamptz, timestamptz) gbt_tstz_distance (internal, timestamptz, int2, oid) ;
ALTER OPERATOR FAMILY gist_time_ops USING gist ADD
OPERATOR 6 <> (time, time) ,
OPERATOR 15 <-> (time, time) FOR ORDER BY pg_catalog.interval_ops ,
FUNCTION 8 (time, time) gbt_time_distance (internal, time, int2, oid) ;
ALTER OPERATOR FAMILY gist_timetz_ops USING gist ADD
OPERATOR 6 <> (timetz, timetz) ;
ALTER OPERATOR FAMILY gist_date_ops USING gist ADD
OPERATOR 6 <> (date, date) ,
OPERATOR 15 <-> (date, date) FOR ORDER BY pg_catalog.integer_ops ,
FUNCTION 8 (date, date) gbt_date_distance (internal, date, int2, oid) ;
ALTER OPERATOR FAMILY gist_interval_ops USING gist ADD
OPERATOR 6 <> (interval, interval) ,
OPERATOR 15 <-> (interval, interval) FOR ORDER BY pg_catalog.interval_ops ,
FUNCTION 8 (interval, interval) gbt_intv_distance (internal, interval, int2, oid) ;
ALTER OPERATOR FAMILY gist_cash_ops USING gist ADD
OPERATOR 6 <> (money, money) ,
OPERATOR 15 <-> (money, money) FOR ORDER BY pg_catalog.money_ops ,
FUNCTION 8 (money, money) gbt_cash_distance (internal, money, int2, oid) ;
ALTER OPERATOR FAMILY gist_macaddr_ops USING gist ADD
OPERATOR 6 <> (macaddr, macaddr) ;
ALTER OPERATOR FAMILY gist_text_ops USING gist ADD
OPERATOR 6 <> (text, text) ;
ALTER OPERATOR FAMILY gist_bpchar_ops USING gist ADD
OPERATOR 6 <> (bpchar, bpchar) ;
ALTER OPERATOR FAMILY gist_bytea_ops USING gist ADD
OPERATOR 6 <> (bytea, bytea) ;
ALTER OPERATOR FAMILY gist_numeric_ops USING gist ADD
OPERATOR 6 <> (numeric, numeric) ;
ALTER OPERATOR FAMILY gist_bit_ops USING gist ADD
OPERATOR 6 <> (bit, bit) ;
ALTER OPERATOR FAMILY gist_vbit_ops USING gist ADD
OPERATOR 6 <> (varbit, varbit) ;
ALTER OPERATOR FAMILY gist_inet_ops USING gist ADD
OPERATOR 6 <> (inet, inet) ;
ALTER OPERATOR FAMILY gist_cidr_ops USING gist ADD
OPERATOR 6 <> (inet, inet) ; | the_stack |
/* Create AspNetUsers Table */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [{databaseOwner}].[{objectQualifier}AspNetUsers](
[Id] NVARCHAR (128) NOT NULL,
[UserName] NVARCHAR (MAX) NULL,
[PasswordHash] NVARCHAR (MAX) NULL,
[SecurityStamp] NVARCHAR (MAX) NULL,
[EmailConfirmed] BIT NOT NULL,
[PhoneNumber] NVARCHAR (MAX) NULL,
[PhoneNumberConfirmed] BIT NOT NULL,
[TwoFactorEnabled] BIT NOT NULL,
[LockoutEndDateUtc] DATETIME NULL,
[LockoutEnabled] BIT NOT NULL,
[AccessFailedCount] INT NOT NULL,
[ApplicationId] UNIQUEIDENTIFIER NOT NULL,
[LegacyPasswordHash] NVARCHAR (MAX) NULL,
[LoweredUserName] NVARCHAR (256) NOT NULL,
[MobileAlias] NVARCHAR (16) DEFAULT (NULL) NULL,
[IsAnonymous] BIT DEFAULT ((0)) NOT NULL,
[LastActivityDate] DATETIME2 NOT NULL,
[MobilePIN] NVARCHAR (16) NULL,
[Email] NVARCHAR (256) NULL,
[LoweredEmail] NVARCHAR (256) NULL,
[PasswordQuestion] NVARCHAR (256) NULL,
[PasswordAnswer] NVARCHAR (128) NULL,
[IsApproved] BIT NOT NULL,
[IsLockedOut] BIT NOT NULL,
[CreateDate] DATETIME2 NOT NULL,
[LastLoginDate] DATETIME2 NOT NULL,
[LastPasswordChangedDate] DATETIME2 NOT NULL,
[LastLockoutDate] DATETIME2 NOT NULL,
[FailedPasswordAttemptCount] INT NOT NULL,
[FailedPasswordAttemptWindowStart] DATETIME2 NOT NULL,
[FailedPasswordAnswerAttemptCount] INT NOT NULL,
[FailedPasswordAnswerAttemptWindowStart] DATETIME2 NOT NULL,
[Comment] NTEXT NULL,
[Profile_Birthday] DateTime NULL,
[Profile_Blog] NVARCHAR (255) NULL,
[Profile_Gender] INT NULL,
[Profile_GoogleId] NVARCHAR (255) NULL,
[Profile_Homepage] NVARCHAR (255) NULL,
[Profile_ICQ] NVARCHAR (255) NULL,
[Profile_Facebook] NVARCHAR (400) NULL,
[Profile_FacebookId] NVARCHAR (400) NULL,
[Profile_Twitter] NVARCHAR (400) NULL,
[Profile_TwitterId] NVARCHAR (400) NULL,
[Profile_Interests] NVARCHAR (400) NULL,
[Profile_Location] NVARCHAR (255) NULL,
[Profile_Country] NVARCHAR (2) NULL,
[Profile_Region] NVARCHAR (255) NULL,
[Profile_City] NVARCHAR (255) NULL,
[Profile_Occupation] NVARCHAR (400) NULL,
[Profile_RealName] NVARCHAR (255) NULL,
[Profile_Skype] NVARCHAR (255) NULL,
[Profile_XMPP] NVARCHAR (255) NULL
CONSTRAINT [PK_{databaseOwner}.AspNetUsers] PRIMARY KEY CLUSTERED ([Id] ASC)
/*FOREIGN KEY ([ApplicationId]) REFERENCES [{databaseOwner}].[aspnet_Applications] ([ApplicationId]),*/
);
GO
/* Create missing profile columns first if not exist */
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='GoogleId')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add GoogleId nvarchar(255) Null
end
GO
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='Facebook')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add Facebook nvarchar(255) Null
end
GO
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='FacebookId')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add FacebookId nvarchar(255) Null
end
GO
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='Twitter')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add Twitter nvarchar(255) Null
end
GO
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='TwitterId')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add TwitterId nvarchar(255) Null
end
GO
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='Country')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add Country nvarchar(255) Null
end
GO
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='Region')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add Region nvarchar(255) Null
end
GO
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='City')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add City nvarchar(255) Null
end
GO
if not exists (select top 1 1 from sys.columns where object_id=object_id('[{databaseOwner}].[{objectQualifier}prov_Profile]') and name='XMPP')
begin
alter table [{databaseOwner}].[{objectQualifier}prov_Profile] add XMPP nvarchar(255) Null
end
GO
/* Migrate users standard provider */
if exists (select top 1 1 from sys.objects WHERE object_id = OBJECT_ID(N'[{databaseOwner}].[aspnet_Users]') and type in (N'U'))
begin
INSERT INTO [{databaseOwner}].[{objectQualifier}AspNetUsers] (
ApplicationId,
Id,
UserName,
PasswordHash,
SecurityStamp,
EmailConfirmed,
PhoneNumber,
PhoneNumberConfirmed,
TwoFactorEnabled,
LockoutEndDateUtc,
LockoutEnabled,
AccessFailedCount,
Email,
LoweredUserName,
LastActivityDate,
IsApproved,
IsLockedOut,
CreateDate,
LastLoginDate,
LastPasswordChangedDate,
LastLockOutDate,
FailedPasswordAttemptCount,
FailedPasswordAnswerAttemptWindowStart,
FailedPasswordAnswerAttemptCount,
FailedPasswordAttemptWindowStart,
PasswordQuestion,
PasswordAnswer
)
SELECT
[{databaseOwner}].[aspnet_Users].ApplicationId,
[{databaseOwner}].[aspnet_Users].UserId,
[{databaseOwner}].[aspnet_Users].UserName,
([{databaseOwner}].[aspnet_Membership].Password+'|'+CAST([{databaseOwner}].[aspnet_Membership].PasswordFormat as varchar)+'|'+ [{databaseOwner}].[aspnet_Membership].PasswordSalt),
NewID(),
1,
NULL,
0,
1,
CASE WHEN [{databaseOwner}].[aspnet_Membership].IsLockedOut = 1 THEN DATEADD(YEAR, 1000, SYSUTCDATETIME()) ELSE NULL END,
1,
0,
[{databaseOwner}].[aspnet_Membership].Email,
[{databaseOwner}].[aspnet_Users].LoweredUserName,
[{databaseOwner}].[aspnet_Users].LastActivityDate,
[{databaseOwner}].[aspnet_Membership].IsApproved,
[{databaseOwner}].[aspnet_Membership].IsLockedOut,
[{databaseOwner}].[aspnet_Membership].CreateDate,
[{databaseOwner}].[aspnet_Membership].LastLoginDate,
[{databaseOwner}].[aspnet_Membership].LastPasswordChangedDate,
[{databaseOwner}].[aspnet_Membership].LastLockOutDate,
[{databaseOwner}].[aspnet_Membership].FailedPasswordAttemptCount,
[{databaseOwner}].[aspnet_Membership].FailedPasswordAnswerAttemptWindowStart,
[{databaseOwner}].[aspnet_Membership].FailedPasswordAnswerAttemptCount,
[{databaseOwner}].[aspnet_Membership].FailedPasswordAttemptWindowStart,
[{databaseOwner}].[aspnet_Membership].PasswordQuestion,
[{databaseOwner}].[aspnet_Membership].PasswordAnswer
FROM
[{databaseOwner}].[aspnet_Users]
LEFT OUTER JOIN [{databaseOwner}].[aspnet_Membership] ON [{databaseOwner}].[aspnet_Membership].ApplicationId = [{databaseOwner}].[aspnet_Users].ApplicationId
AND [{databaseOwner}].[aspnet_Users].UserId = [{databaseOwner}].[aspnet_Membership].UserId
LEFT OUTER JOIN [{databaseOwner}].[{objectQualifier}AspNetUsers] ON [{databaseOwner}].[aspnet_Membership].UserId = [{databaseOwner}].[{objectQualifier}AspNetUsers].Id
WHERE
[{databaseOwner}].[{objectQualifier}AspNetUsers].Id IS NULL and [{databaseOwner}].[aspnet_Membership].IsApproved is not null
end
GO
/****/
/* Migrate users yaf.net provider */
INSERT INTO [{databaseOwner}].[{objectQualifier}AspNetUsers] (
ApplicationId,
Id,
UserName,
PasswordHash,
SecurityStamp,
EmailConfirmed,
PhoneNumber,
PhoneNumberConfirmed,
TwoFactorEnabled,
LockoutEndDateUtc,
LockoutEnabled,
AccessFailedCount,
Email,
LoweredUserName,
LastActivityDate,
IsApproved,
IsLockedOut,
CreateDate,
LastLoginDate,
LastPasswordChangedDate,
LastLockOutDate,
FailedPasswordAttemptCount,
FailedPasswordAnswerAttemptWindowStart,
FailedPasswordAnswerAttemptCount,
FailedPasswordAttemptWindowStart,
PasswordQuestion,
PasswordAnswer,
Profile_Birthday,
Profile_Blog,
Profile_Gender,
Profile_GoogleId,
Profile_Homepage,
Profile_ICQ,
Profile_Facebook,
Profile_FacebookId,
Profile_Twitter,
Profile_TwitterId,
Profile_Interests,
Profile_Location,
Profile_Country,
Profile_Region,
Profile_City,
Profile_Occupation,
Profile_RealName,
Profile_Skype,
Profile_XMPP
)
SELECT
[{databaseOwner}].[{objectQualifier}prov_Membership].ApplicationId,
[{databaseOwner}].[{objectQualifier}prov_Membership].UserId,
[{databaseOwner}].[{objectQualifier}prov_Membership].UserName,
([{databaseOwner}].[{objectQualifier}prov_Membership].Password+'|'+CAST([{databaseOwner}].[{objectQualifier}prov_Membership].PasswordFormat as varchar)+'|'+ [{databaseOwner}].[{objectQualifier}prov_Membership].PasswordSalt),
NewID(),
1,
NULL,
0,
1,
CASE WHEN [{databaseOwner}].[{objectQualifier}prov_Membership].IsLockedOut = 1 THEN DATEADD(YEAR, 1000, SYSUTCDATETIME()) ELSE NULL END,
1,
0,
[{databaseOwner}].[{objectQualifier}prov_Membership].Email,
[{databaseOwner}].[{objectQualifier}prov_Membership].UsernameLwd,
IsNull([{databaseOwner}].[{objectQualifier}prov_Membership].LastActivity,cast('1753-1-1' as datetime)),
[{databaseOwner}].[{objectQualifier}prov_Membership].IsApproved,
0,
IsNull([{databaseOwner}].[{objectQualifier}prov_Membership].Joined,cast('1753-1-1' as datetime)),
IsNull([{databaseOwner}].[{objectQualifier}prov_Membership].Joined,cast('1753-1-1' as datetime)),
cast('1753-1-1' as datetime),
cast('1753-1-1' as datetime),
0,
cast('1753-1-1' as datetime),
0,
cast('1753-1-1' as datetime),
[{databaseOwner}].[{objectQualifier}prov_Membership].PasswordQuestion,
[{databaseOwner}].[{objectQualifier}prov_Membership].PasswordAnswer,
p.Birthday,
p.Blog,
p.Gender,
p.GoogleId,
p.Homepage,
p.ICQ,
p.Facebook,
p.FacebookId,
p.Twitter,
p.TwitterId,
p.Interests,
p.Location,
p.Country,
p.Region,
p.City,
p.Occupation,
p.RealName,
p.Skype,
p.XMPP
FROM
[{databaseOwner}].[{objectQualifier}prov_Membership]
LEFT OUTER JOIN [{databaseOwner}].[{objectQualifier}AspNetUsers] ON [{databaseOwner}].[{objectQualifier}prov_Membership].UserId = [{databaseOwner}].[{objectQualifier}AspNetUsers].Id
LEFT OUTER JOIN [{databaseOwner}].[{objectQualifier}prov_Profile] p ON (p.UserID = [{databaseOwner}].[{objectQualifier}prov_Membership].UserId)
WHERE [{databaseOwner}].[{objectQualifier}AspNetUsers].Id IS NULL
/*******/
/* Create AspNetRoles Table */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [{databaseOwner}].[{objectQualifier}AspNetRoles](
[Id] [nvarchar](128) NOT NULL,
[Name] [nvarchar](256) NOT NULL,
CONSTRAINT [PK_AspNetRoles] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
/* Create AspNetUserLogins Table */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [{databaseOwner}].[{objectQualifier}AspNetUserLogins](
[LoginProvider] [nvarchar](128) NOT NULL,
[ProviderKey] [nvarchar](128) NOT NULL,
[UserId] [nvarchar](128) NOT NULL,
CONSTRAINT [PK_AspNetUserLogins] PRIMARY KEY CLUSTERED
(
[LoginProvider] ASC,
[ProviderKey] ASC,
[UserId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
ALTER TABLE [{databaseOwner}].[{objectQualifier}AspNetUserLogins] WITH CHECK ADD CONSTRAINT [FK_AspNetUserLogins_AspNetUsers_UserId] FOREIGN KEY([UserId])
REFERENCES [{databaseOwner}].[{objectQualifier}AspNetUsers] ([Id])
ON DELETE CASCADE
GO
ALTER TABLE [{databaseOwner}].[{objectQualifier}AspNetUserLogins] CHECK CONSTRAINT [FK_AspNetUserLogins_AspNetUsers_UserId]
GO
/* Create AspNetUserClaims Table */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [{databaseOwner}].[{objectQualifier}AspNetUserClaims](
[Id] [int] IDENTITY(1,1) NOT NULL,
[UserId] [nvarchar](128) NOT NULL,
[ClaimType] [nvarchar](max) NULL,
[ClaimValue] [nvarchar](max) NULL,
CONSTRAINT [PK_AspNetUserClaims] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
GO
ALTER TABLE [{databaseOwner}].[{objectQualifier}AspNetUserClaims] WITH CHECK ADD CONSTRAINT [FK_AspNetUserClaims_AspNetUsers_UserId] FOREIGN KEY([UserId])
REFERENCES [{databaseOwner}].[{objectQualifier}AspNetUsers] ([Id])
ON DELETE CASCADE
GO
ALTER TABLE [{databaseOwner}].[{objectQualifier}AspNetUserClaims] CHECK CONSTRAINT [FK_AspNetUserClaims_AspNetUsers_UserId]
GO
-- Import Provider Roles
if exists (select top 1 1 from sys.objects WHERE object_id = OBJECT_ID(N'[{databaseOwner}].[aspnet_Roles]') and type in (N'U'))
begin
INSERT INTO [{databaseOwner}].[{objectQualifier}AspNetRoles](Id,Name)
SELECT RoleId,RoleName
FROM [{databaseOwner}].[aspnet_Roles]
end
GO
INSERT INTO [{databaseOwner}].[{objectQualifier}AspNetRoles](Id,Name)
SELECT RoleId,RoleName
FROM [{databaseOwner}].[{objectQualifier}prov_Role]
GO
/* Create AspNetUserRoles Table */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [{databaseOwner}].[{objectQualifier}AspNetUserRoles] (
[UserId] NVARCHAR (128) NOT NULL,
[RoleId] NVARCHAR (128) NOT NULL
);
GO
-- Import User Roles
if exists (select top 1 1 from sys.objects WHERE object_id = OBJECT_ID(N'[{databaseOwner}].[aspnet_usersInRoles]') and type in (N'U'))
begin
INSERT INTO [{databaseOwner}].[{objectQualifier}AspNetUserRoles](UserId,RoleId)
SELECT UserId,RoleId
FROM [{databaseOwner}].[aspnet_UsersInRoles]
end
GO
INSERT INTO [{databaseOwner}].[{objectQualifier}AspNetUserRoles](UserId,RoleId)
SELECT UserId,RoleId
FROM [{databaseOwner}].[{objectQualifier}prov_RoleMembership]
GO
declare @ApplicationID uniqueidentifier;
set @ApplicationID = (select top 1 ApplicationId from [{databaseOwner}].[{objectQualifier}AspNetUsers])
-- Import Application Id
insert into [{databaseOwner}].[{objectQualifier}Registry](Name,Value) values('applicationid',@ApplicationID)
go | the_stack |
CREATE SEQUENCE Region_seq START WITH 1 INCREMENT BY 1;
CREATE SEQUENCE Categories_seq START WITH 1 INCREMENT BY 1;
CREATE SEQUENCE Suppliers_seq START WITH 1 INCREMENT BY 1;
CREATE SEQUENCE Products_seq START WITH 1 INCREMENT BY 1;
CREATE SEQUENCE Orders_seq START WITH 1 INCREMENT BY 1;
CREATE SEQUENCE Employees_seq START WITH 1 INCREMENT BY 1;
COMMIT;\p\g
/********************************************************************/
CREATE TABLE Region (
RegionID INTEGER NOT NULL DEFAULT Region_seq.nextval,
RegionDescription VARCHAR(50) NOT NULL,
PRIMARY KEY(RegionID)
);
COMMIT;\p\g
CREATE TABLE Territories (
TerritoryID VARCHAR(20) NOT NULL,
TerritoryDescription VARCHAR(50) NOT NULL,
RegionID INTEGER NOT NULL,
PRIMARY KEY(TerritoryID),
FOREIGN KEY (RegionID) REFERENCES Region (RegionID)
);
COMMIT;\p\g
/********************************************************************/
CREATE TABLE Categories (
CategoryID INTEGER NOT NULL DEFAULT Categories_seq.nextval,
CategoryName VARCHAR(15) NOT NULL,
Description VARCHAR(500),
Picture LONG BYTE,
PRIMARY KEY(CategoryID)
);
COMMIT;\p\g
CREATE TABLE Suppliers (
SupplierID INTEGER NOT NULL DEFAULT Suppliers_seq.nextval,
CompanyName VARCHAR(40) NOT NULL,
ContactName VARCHAR(30),
ContactTitle VARCHAR(30),
Address VARCHAR(60),
City VARCHAR(15),
Region VARCHAR(15),
PostalCode VARCHAR(10),
Country VARCHAR(15),
Phone VARCHAR(24),
Fax VARCHAR(24),
PRIMARY KEY(SupplierID)
);
COMMIT;\p\g
/********************************************************************/
CREATE TABLE Products (
ProductID INTEGER NOT NULL DEFAULT Products_seq.nextval,
ProductName VARCHAR(40) NOT NULL,
SupplierID INTEGER,
CategoryID INTEGER,
QuantityPerUnit VARCHAR(20),
UnitPrice DECIMAL NULL,
UnitsInStock SMALLINT NULL,
UnitsOnOrder SMALLINT NULL,
ReorderLevel SMALLINT NULL,
Discontinued SMALLINT NOT NULL,
PRIMARY KEY(ProductID),
FOREIGN KEY (CategoryID) REFERENCES Categories (CategoryID),
FOREIGN KEY (SupplierID) REFERENCES Suppliers (SupplierID)
);
COMMIT;\p\g
CREATE TABLE Customers (
CustomerID VARCHAR(5) NOT NULL,
CompanyName VARCHAR(40) NOT NULL,
ContactName VARCHAR(30),
ContactTitle VARCHAR(30),
Address VARCHAR(60),
City VARCHAR(15),
Region VARCHAR(15),
PostalCode VARCHAR(10),
Country VARCHAR(15),
Phone VARCHAR(24),
Fax VARCHAR(24),
PRIMARY KEY(CustomerID)
);
COMMIT;\p\g
/********************************************************************/
CREATE TABLE Employees (
EmployeeID INTEGER NOT NULL DEFAULT Employees_seq.nextval,
LastName VARCHAR(20) NOT NULL,
FirstName VARCHAR(10) NOT NULL,
Title VARCHAR(30),
BirthDate INGRESDATE,
HireDate INGRESDATE,
Address VARCHAR(60),
City VARCHAR(15),
Region VARCHAR(15),
PostalCode VARCHAR(10),
Country VARCHAR(15),
HomePhone VARCHAR(24),
Photo LONG BYTE,
Notes VARCHAR(100),
TitleOfCourtesy VARCHAR(25),
PhotoPath VARCHAR (255),
Extension VARCHAR(5),
ReportsTo INTEGER,
PRIMARY KEY(EmployeeID),
FOREIGN KEY (ReportsTo) REFERENCES Employees (EmployeeID)
);
COMMIT;\p\g
CREATE TABLE EmployeeTerritories (
EmployeeID INTEGER NOT NULL,
TerritoryID VARCHAR(20) NOT NULL,
PRIMARY KEY(EmployeeID,TerritoryID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID),
FOREIGN KEY (TerritoryID) REFERENCES Territories (TerritoryID)
);
COMMIT;\p\g
/********************************************************************/
CREATE TABLE Orders (
OrderID INTEGER NOT NULL DEFAULT Orders_seq.nextval,
CustomerID VARCHAR(5),
EmployeeID INTEGER,
OrderDate INGRESDATE,
RequiredDate INGRESDATE,
ShippedDate INGRESDATE,
ShipVia INT NULL,
Freight DECIMAL,
ShipName VARCHAR(40),
ShipAddress VARCHAR(60),
ShipCity VARCHAR(15),
ShipRegion VARCHAR(15),
ShipPostalCode VARCHAR(10),
ShipCountry VARCHAR(15),
PRIMARY KEY(OrderID),
FOREIGN KEY (CustomerID) REFERENCES Customers (CustomerID),
FOREIGN KEY (EmployeeID) REFERENCES Employees (EmployeeID)
);
COMMIT;\p\g
/********************************************************************/
CREATE TABLE OrderDetails (
OrderID INTEGER NOT NULL,
ProductID INTEGER NOT NULL,
UnitPrice DECIMAL NOT NULL,
Quantity SMALLINT NOT NULL,
Discount FLOAT NOT NULL,
PRIMARY KEY(OrderID,ProductID),
FOREIGN KEY (OrderID) REFERENCES Orders (OrderID),
FOREIGN KEY (ProductID) REFERENCES Products (ProductID)
);
COMMIT;\p\g
/********************************************************************/
INSERT INTO Categories (CategoryName, Description)
VALUES ('Beverages', 'Soft drinks, coffees, teas, beers, and ales');
INSERT INTO Categories (CategoryName,Description)
VALUES ('Condiments','Sweet and savory sauces, relishes, spreads, and seasonings');
INSERT INTO Categories (CategoryName,Description)
VALUES ('Seafood','Seaweed and fish');
COMMIT;\p\g
/********************************************************************/
INSERT INTO Region (RegionDescription) VALUES ('North America');
INSERT INTO Region (RegionDescription) VALUES ('Europe');
COMMIT;\p\g
/********************************************************************/
INSERT INTO Customers (CustomerID, CompanyName,ContactName,Country,PostalCode,City)
VALUES ('AIRBU', 'airbus','jacques','France','10000','Paris');
INSERT INTO Customers (CustomerID, CompanyName,ContactName,Country,PostalCode,City)
VALUES ('BT___','BT','graeme','U.K.','E14','London');
INSERT INTO Customers (CustomerID, CompanyName,ContactName,Country,PostalCode,City)
VALUES ('ATT__','ATT','bob','USA','10021','New York');
INSERT INTO Customers (CustomerID, CompanyName,ContactName,Country,PostalCode,City)
VALUES ('UKMOD', 'MOD','(secret)','U.K.','E14','London');
INSERT INTO Customers (CustomerID, CompanyName,ContactName, ContactTitle, Country,PostalCode,City, Phone)
VALUES ('ALFKI', 'Alfreds Futterkiste','Maria Anders','Sales Representative','Germany','12209','Berlin','030-0074321');
INSERT INTO Customers (CustomerID, CompanyName,ContactName, ContactTitle, Country,PostalCode,Address,City, Phone, Fax)
values ('BONAP', 'Bon app''','Laurence Lebihan','Owner','France','13008','12, rue des Bouchers','Marseille','91.24.45.40', '91.24.45.41');
INSERT INTO Customers (CustomerID, CompanyName,ContactName, ContactTitle, Country,PostalCode,City, Phone)
VALUES ('WARTH', 'Wartian Herkku','Pirkko Koskitalo','Accounting Manager','Finland','90110','Oulu','981-443655');
COMMIT;\p\g
/********************************************************************/
INSERT INTO Suppliers (CompanyName, ContactName, ContactTitle, Address, City, Region, Country)
VALUES ('alles AG', 'Harald Reitmeyer', 'Prof', 'Fischergasse 8', 'Heidelberg', 'B-W', 'Germany');
INSERT INTO Suppliers (CompanyName, ContactName, ContactTitle, Address, City, Region, Country)
VALUES ('Microsoft', 'Mr Allen', 'Monopolist', '1 MS', 'Redmond', 'WA', 'USA');
INSERT INTO Suppliers (CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax)
VALUES ('Pavlova, Ltd.', 'Ian Devling', 'Marketing Manager', '74 Rose St. Moonie Ponds', 'Melbourne', 'Victoria', '3058', 'Australia', '(03) 444-2343', '(03) 444-6588');
INSERT INTO Products (ProductName,SupplierID, QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Pen',1, 10, 12, 2, 0);
INSERT INTO Products (ProductName,SupplierID, QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Bicycle',1, 1, 6, 0, 0);
INSERT INTO Products (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Phone',3, 7, 0, 0);
INSERT INTO Products (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('SAM',1, 51, 11, 0);
INSERT INTO Products (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('iPod',0, 11, 0, 0);
INSERT INTO Products (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Toilet Paper',2, 0, 3, 1);
INSERT INTO Products (ProductName,QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Fork',5, 111, 0, 0);
INSERT INTO Products (ProductName,SupplierID, QuantityPerUnit,UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Linq Book',2, 1, 0, 26, 0);
INSERT INTO Products (ProductName,SupplierID, QuantityPerUnit,UnitPrice, UnitsInStock,UnitsOnOrder,Discontinued)
VALUES ('Carnarvon Tigers', 3,'16 kg pkg.',62.50, 42, 0, 0);
COMMIT;\p\g
/********************************************************************/
INSERT INTO Employees (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo,Country,HomePhone)
VALUES ('Fuller','Andrew','Vice President, Sales',date('01-jan-1964'), date('01-jan-1989'), '908 W. Capital Way','Tacoma',NULL,'USA','(111)222333');
INSERT INTO Employees (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo,Country,HomePhone)
VALUES ('Davolio','Nancy','Sales Representative',date('01-jan-1964'), date('01-jan-1994'),'507 - 20th Ave. E. Apt. 2A','Seattle',1,'USA','(444)555666');
INSERT INTO Employees (LastName,FirstName,Title,BirthDate,HireDate,Address,City,ReportsTo,Country,HomePhone)
VALUES ('Builder', 'Bob', 'Handyman',date('01-jan-1964'), date('01-jan-1964'),'666 dark street','Seattle',2,'USA','(777)888999');
COMMIT;\p\g
INSERT INTO Territories (TerritoryID, TerritoryDescription, RegionID) VALUES ('US.Northwest', 'Northwest', 1);
COMMIT;\p\g
INSERT INTO EmployeeTerritories (EmployeeID,TerritoryID)
VALUES (2,'US.Northwest');
COMMIT;\p\g
/********************************************************************/
/*truncate table Orders;*/
/********************************************************************/
INSERT INTO Orders (CustomerID, EmployeeID, OrderDate, Freight)
VALUES ('AIRBU', 1, date('now'), 21.3);
INSERT INTO Orders (CustomerID, EmployeeID, OrderDate, Freight)
VALUES ('BT___', 1, date('now'), 11.1);
INSERT INTO Orders (CustomerID, EmployeeID, OrderDate, Freight)
VALUES ('BT___', 1, date('now'), 11.5);
INSERT INTO Orders (CustomerID, EmployeeID, OrderDate, Freight)
VALUES ('UKMOD', 1, date('now'), 32.5);
INSERT INTO Orders (CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, Freight, ShipName, ShipAddress, ShipCity, ShipCountry)
VALUES ('BONAP', 1, '16-oct-1996', '27-nov-1996', '21-oct-1996', 10.21, 'Bon app''', '12, rue des Bouchers', 'Marseille', 'France' );
INSERT INTO OrderDetails (OrderID, ProductID, UnitPrice, Quantity, Discount)
VALUES (1, 2, 33, 5, 11);
INSERT INTO OrderDetails (OrderID, ProductID, UnitPrice, Quantity, Discount)
VALUES (5,9, 50, 20, 0.05); /* CanarvonTigers for customer BONAP */
COMMIT;\p\g
\q | the_stack |
-- 29.03.2016 14:31
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,JasperReport,Name,RefreshAllAfterExecution,ShowHelp,Statistic_Count,Statistic_Seconds,Type,Updated,UpdatedBy,Value) VALUES ('3',0,0,540674,'Y','org.compiere.report.ReportStarter',TO_TIMESTAMP('2016-03-29 14:31:19','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','N','Y','N','Y','N','@PREFIX@de/metas/reports/all_procurement_conditions/report.jasper','Anbauplanung Auswertung','N','Y',0,0,'Java',TO_TIMESTAMP('2016-03-29 14:31:19','YYYY-MM-DD HH24:MI:SS'),100,'Anbauplanung Auswertung (Jasper)')
;
-- 29.03.2016 14:31
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Trl (AD_Language,AD_Process_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_ID=540674 AND NOT EXISTS (SELECT * FROM AD_Process_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_ID=t.AD_Process_ID)
;
-- 29.03.2016 14:32
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,187,0,540674,540928,30,'C_BPartner_ID',TO_TIMESTAMP('2016-03-29 14:32:36','YYYY-MM-DD HH24:MI:SS'),100,'Bezeichnet einen Geschäftspartner','de.metas.fresh',0,'Ein Geschäftspartner ist jemand, mit dem Sie interagieren. Dies kann Lieferanten, Kunden, Mitarbeiter oder Handelsvertreter umfassen.','Y','Y','Y','N','N','N','Geschäftspartner',10,TO_TIMESTAMP('2016-03-29 14:32:36','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 29.03.2016 14:32
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540928 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 29.03.2016 14:32
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,454,0,540674,540929,30,'M_Product_ID',TO_TIMESTAMP('2016-03-29 14:32:49','YYYY-MM-DD HH24:MI:SS'),100,'Produkt, Leistung, Artikel','de.metas.fresh',0,'Bezeichnet eine Einheit, die in dieser Organisation gekauft oder verkauft wird.','Y','Y','Y','N','N','N','Produkt',20,TO_TIMESTAMP('2016-03-29 14:32:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 29.03.2016 14:32
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Process_Para_ID=540929 AND NOT EXISTS (SELECT * FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Process_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES ('R',0,540701,0,540674,TO_TIMESTAMP('2016-03-29 14:35:16','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Anbauplanung Auswertung (Jasper)','Y','N','N','N','Anbauplanung Auswertung',TO_TIMESTAMP('2016-03-29 14:35:16','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=540701 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 540701, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=540701)
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=540614 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=540616 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=540681 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540617 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=540618 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=540619 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=540632 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=540635 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=540698 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=540637 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540638 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540648 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=12, Updated=now(), UpdatedBy=100 WHERE Node_ID=540674 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=13, Updated=now(), UpdatedBy=100 WHERE Node_ID=540676 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=14, Updated=now(), UpdatedBy=100 WHERE Node_ID=540679 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=15, Updated=now(), UpdatedBy=100 WHERE Node_ID=540678 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=16, Updated=now(), UpdatedBy=100 WHERE Node_ID=540684 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=17, Updated=now(), UpdatedBy=100 WHERE Node_ID=540686 AND AD_Tree_ID=10
;
-- 29.03.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540613, SeqNo=18, Updated=now(), UpdatedBy=100 WHERE Node_ID=540701 AND AD_Tree_ID=10
;
-- 30.03.2016 09:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET JasperReport='@PREFIX@de/metas/reports/all_procurements_conditions/report.jasper',Updated=TO_TIMESTAMP('2016-03-30 09:19:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540674
;
-- 30.03.2016 10:36
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET EntityType='de.metas.procurement',Updated=TO_TIMESTAMP('2016-03-30 10:36:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=540674
; | the_stack |
-- 2018-02-20T16:21:25.316
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Sofort Kommissionieren',Updated=TO_TIMESTAMP('2018-02-20 16:21:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=561482
;
-- 2018-02-20T16:21:49.619
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 16:21:49','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Automatic Picking',Description='' WHERE AD_Field_ID=561482 AND AD_Language='en_US'
;
-- 2018-02-20T16:22:33.416
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561482,0,53030,540382,551007,'F',TO_TIMESTAMP('2018-02-20 16:22:33','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Sofort Kommissionieren',115,0,0,TO_TIMESTAMP('2018-02-20 16:22:33','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T16:22:45.014
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543905
;
-- 2018-02-20T16:22:45.021
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543907
;
-- 2018-02-20T16:22:45.027
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543914
;
-- 2018-02-20T16:22:45.034
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543906
;
-- 2018-02-20T16:22:45.040
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543904
;
-- 2018-02-20T16:22:45.046
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543911
;
-- 2018-02-20T16:22:45.050
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543918
;
-- 2018-02-20T16:22:45.056
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543915
;
-- 2018-02-20T16:22:45.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551007
;
-- 2018-02-20T16:22:45.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543919
;
-- 2018-02-20T16:22:45.068
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543917
;
-- 2018-02-20T16:22:45.071
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543910
;
-- 2018-02-20T16:22:45.073
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2018-02-20 16:22:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543902
;
-- 2018-02-20T16:27:44.047
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Eingekauft',Updated=TO_TIMESTAMP('2018-02-20 16:27:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=554084
;
-- 2018-02-20T16:28:05.264
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Wird gehandelt',Updated=TO_TIMESTAMP('2018-02-20 16:28:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556495
;
-- 2018-02-20T16:28:21.131
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Distributionsauftrag erstellen',Updated=TO_TIMESTAMP('2018-02-20 16:28:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=562652
;
-- 2018-02-20T16:29:03.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,562652,0,53030,540382,551008,'F',TO_TIMESTAMP('2018-02-20 16:29:03','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Distributionsauftrag erstellen',117,0,0,TO_TIMESTAMP('2018-02-20 16:29:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T16:29:50.576
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-02-20 16:29:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551008
;
-- 2018-02-20T16:29:50.583
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2018-02-20 16:29:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543919
;
-- 2018-02-20T16:29:50.589
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2018-02-20 16:29:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543917
;
-- 2018-02-20T16:29:50.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2018-02-20 16:29:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543910
;
-- 2018-02-20T16:29:50.597
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2018-02-20 16:29:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543902
;
-- 2018-02-20T16:30:11.828
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 16:30:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Create Distributionorder' WHERE AD_Field_ID=562652 AND AD_Language='en_US'
;
-- 2018-02-20T16:30:32.756
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 16:30:32','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Purchased' WHERE AD_Field_ID=554084 AND AD_Language='en_US'
;
-- 2018-02-20T16:31:01.428
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 16:31:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Trading Product',Description='',Help='' WHERE AD_Field_ID=556495 AND AD_Language='en_US'
;
-- 2018-02-20T16:31:25.869
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 16:31:25','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Manufactured' WHERE AD_Field_ID=554085 AND AD_Language='en_US'
;
-- 2018-02-20T16:32:08.159
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 16:32:08','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Complete Document' WHERE AD_Field_ID=555188 AND AD_Language='en_US'
;
-- 2018-02-20T16:54:04.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561345,0,540811,541175,551009,'F',TO_TIMESTAMP('2018-02-20 16:54:04','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Vom System vorgeschlagen',130,0,0,TO_TIMESTAMP('2018-02-20 16:54:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T16:54:16.759
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561346,0,540811,541175,551010,'F',TO_TIMESTAMP('2018-02-20 16:54:16','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Geplante Menge',140,0,0,TO_TIMESTAMP('2018-02-20 16:54:16','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T16:54:28.315
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561347,0,540811,541175,551011,'F',TO_TIMESTAMP('2018-02-20 16:54:28','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Istmenge',150,0,0,TO_TIMESTAMP('2018-02-20 16:54:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T16:54:51.435
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561483,0,540811,541175,551012,'F',TO_TIMESTAMP('2018-02-20 16:54:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Sofort kommissionieren',160,0,0,TO_TIMESTAMP('2018-02-20 16:54:51','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T16:55:18.818
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548836
;
-- 2018-02-20T16:55:18.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548840
;
-- 2018-02-20T16:55:18.830
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548841
;
-- 2018-02-20T16:55:18.836
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551010
;
-- 2018-02-20T16:55:18.842
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551011
;
-- 2018-02-20T16:55:18.847
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548830
;
-- 2018-02-20T16:55:18.852
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551012
;
-- 2018-02-20T16:55:18.857
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551009
;
-- 2018-02-20T16:55:18.862
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2018-02-20 16:55:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548831
;
-- 2018-02-20T17:03:02.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561487,0,540821,541176,551013,'F',TO_TIMESTAMP('2018-02-20 17:03:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Sofort kommissionieren',120,0,0,TO_TIMESTAMP('2018-02-20 17:03:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T17:03:14.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561484,0,540821,541176,551014,'F',TO_TIMESTAMP('2018-02-20 17:03:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Istmenge',130,0,0,TO_TIMESTAMP('2018-02-20 17:03:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T17:03:27.751
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561486,0,540821,541176,551015,'F',TO_TIMESTAMP('2018-02-20 17:03:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Geplante Menge',140,0,0,TO_TIMESTAMP('2018-02-20 17:03:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T17:04:31.073
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N',Updated=TO_TIMESTAMP('2018-02-20 17:04:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548837
;
-- 2018-02-20T17:04:33.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2018-02-20 17:04:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548836
;
-- 2018-02-20T17:04:35.241
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2018-02-20 17:04:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548840
;
-- 2018-02-20T17:04:36.724
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2018-02-20 17:04:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548841
;
-- 2018-02-20T17:04:38.194
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2018-02-20 17:04:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551010
;
-- 2018-02-20T17:04:39.668
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2018-02-20 17:04:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551011
;
-- 2018-02-20T17:04:41.561
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2018-02-20 17:04:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548830
;
-- 2018-02-20T17:05:09.567
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2018-02-20 17:05:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548830
;
-- 2018-02-20T17:05:09.570
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-02-20 17:05:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551012
;
-- 2018-02-20T17:05:09.572
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-02-20 17:05:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551009
;
-- 2018-02-20T17:05:09.574
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-02-20 17:05:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548831
;
-- 2018-02-20T17:05:26.300
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2018-02-20 17:05:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548830
;
-- 2018-02-20T17:05:31.026
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2018-02-20 17:05:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548837
;
-- 2018-02-20T17:05:33.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2018-02-20 17:05:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551012
;
-- 2018-02-20T17:05:34.938
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2018-02-20 17:05:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551009
;
-- 2018-02-20T17:05:38.346
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=110,Updated=TO_TIMESTAMP('2018-02-20 17:05:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551009
;
-- 2018-02-20T17:05:40.530
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2018-02-20 17:05:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548831
;
-- 2018-02-20T17:08:06.504
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=130,Updated=TO_TIMESTAMP('2018-02-20 17:08:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548830
;
-- 2018-02-20T17:09:06.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2018-02-20 17:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548847
;
-- 2018-02-20T17:09:06.158
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2018-02-20 17:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548851
;
-- 2018-02-20T17:09:06.160
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2018-02-20 17:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548852
;
-- 2018-02-20T17:09:06.161
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2018-02-20 17:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548846
;
-- 2018-02-20T17:09:06.163
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2018-02-20 17:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548843
;
-- 2018-02-20T17:09:06.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2018-02-20 17:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551015
;
-- 2018-02-20T17:09:06.167
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-02-20 17:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551013
;
-- 2018-02-20T17:09:06.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-02-20 17:09:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551014
;
-- 2018-02-20T17:09:38.259
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,561485,0,540821,541176,551016,'F',TO_TIMESTAMP('2018-02-20 17:09:38','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','Vom System vorgeschlagen',150,0,0,TO_TIMESTAMP('2018-02-20 17:09:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2018-02-20T17:09:51.372
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2018-02-20 17:09:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551015
;
-- 2018-02-20T17:09:51.375
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2018-02-20 17:09:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551013
;
-- 2018-02-20T17:09:51.376
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-02-20 17:09:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551014
;
-- 2018-02-20T17:09:51.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2018-02-20 17:09:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551016
;
-- 2018-02-20T17:09:51.378
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2018-02-20 17:09:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548843
;
-- 2018-02-20T17:16:57.253
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=0,Updated=TO_TIMESTAMP('2018-02-20 17:16:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548842
;
-- 2018-02-20T17:17:02.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='N', SeqNo=0,Updated=TO_TIMESTAMP('2018-02-20 17:17:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548845
;
-- 2018-02-20T17:17:04.433
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2018-02-20 17:17:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548847
;
-- 2018-02-20T17:17:06.385
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2018-02-20 17:17:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548851
;
-- 2018-02-20T17:17:08.221
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2018-02-20 17:17:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548852
;
-- 2018-02-20T17:17:09.960
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2018-02-20 17:17:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548846
;
-- 2018-02-20T17:17:11.469
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2018-02-20 17:17:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551015
;
-- 2018-02-20T17:17:12.838
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=90,Updated=TO_TIMESTAMP('2018-02-20 17:17:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551013
;
-- 2018-02-20T17:17:14.776
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=100,Updated=TO_TIMESTAMP('2018-02-20 17:17:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551014
;
-- 2018-02-20T17:17:16.806
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=110,Updated=TO_TIMESTAMP('2018-02-20 17:17:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551016
;
-- 2018-02-20T17:17:19.243
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=120,Updated=TO_TIMESTAMP('2018-02-20 17:17:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548843
;
-- 2018-02-20T17:17:23.406
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=130,Updated=TO_TIMESTAMP('2018-02-20 17:17:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548842
;
-- 2018-02-20T17:22:37.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:22:37','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Advised',Description='' WHERE AD_Field_ID=561345 AND AD_Language='en_US'
;
-- 2018-02-20T17:22:48.644
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:22:48','YYYY-MM-DD HH24:MI:SS'),Name='System Advised' WHERE AD_Field_ID=561345 AND AD_Language='en_US'
;
-- 2018-02-20T17:23:01.629
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:23:01','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Planned Qty' WHERE AD_Field_ID=561346 AND AD_Language='en_US'
;
-- 2018-02-20T17:23:10.532
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:23:10','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Actual Qty' WHERE AD_Field_ID=561347 AND AD_Language='en_US'
;
-- 2018-02-20T17:23:36.116
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:23:36','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Auto Picking',Description='' WHERE AD_Field_ID=561483 AND AD_Language='en_US'
;
-- 2018-02-20T17:23:56.452
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:23:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Auto Picking',Description='' WHERE AD_Field_ID=561487 AND AD_Language='en_US'
;
-- 2018-02-20T17:24:14.088
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:24:14','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Actual Qty' WHERE AD_Field_ID=561484 AND AD_Language='en_US'
;
-- 2018-02-20T17:24:30.334
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:24:30','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='System Advised',Description='' WHERE AD_Field_ID=561485 AND AD_Language='en_US'
;
-- 2018-02-20T17:24:41.789
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:24:41','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Planned Qty' WHERE AD_Field_ID=561486 AND AD_Language='en_US'
;
-- 2018-02-20T17:26:01.733
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2018-02-20 17:26:01','YYYY-MM-DD HH24:MI:SS'),Name='Distribution Details' WHERE AD_Tab_ID=540821 AND AD_Language='en_US'
;
-- 2018-02-20T17:26:42.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2018-02-20 17:26:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551014
;
-- 2018-02-20T17:26:42.638
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2018-02-20 17:26:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=551013
; | the_stack |
-- -------------------------------------------------------------------------------
--
-- Create the eICU tables
--
-- -------------------------------------------------------------------------------
-- NOTE: unless specified here or when calling this script via psql, all tables
-- will be created on the public schema. To redefine the search path, call:
-- SET search_path TO schema_name_you_want;
-- Restoring the search path to its default value can be accomplished as follows:
-- SET search_path TO "$user",public;
--------------------------------------------------------
-- DDL for Table ADMISSIONDRUG
--------------------------------------------------------
DROP TABLE IF EXISTS admissiondrug CASCADE;
CREATE TABLE admissiondrug
(
admissiondrugid INT NOT NULL,
patientunitstayid INT NOT NULL,
drugoffset INT NOT NULL,
drugenteredoffset INT NOT NULL,
drugnotetype VARCHAR(255),
specialtytype VARCHAR(255),
usertype VARCHAR(255) NOT NULL,
rxincluded VARCHAR(5),
writtenineicu VARCHAR(5),
drugname VARCHAR(255) NOT NULL,
drugdosage NUMERIC(11,4),
drugunit VARCHAR(1000),
drugadmitfrequency VARCHAR(1000) NOT NULL,
drughiclseqno INT
) ;
--------------------------------------------------------
-- DDL for Table ADMISSIONDX
--------------------------------------------------------
DROP TABLE IF EXISTS admissiondx CASCADE;
CREATE TABLE admissiondx
(
admissiondxid INT NOT NULL,
patientunitstayid INT NOT NULL,
admitdxenteredoffset INT NOT NULL,
admitdxpath VARCHAR(500) NOT NULL,
admitdxname VARCHAR(255),
admitdxtext VARCHAR(255)
) ;
--------------------------------------------------------
-- DDL for Table ALLERGY
--------------------------------------------------------
DROP TABLE IF EXISTS allergy CASCADE;
CREATE TABLE allergy
(
allergyid INT NOT NULL,
patientunitstayid INT NOT NULL,
allergyoffset INT NOT NULL,
allergyenteredoffset INT NOT NULL,
allergynotetype VARCHAR(255),
specialtytype VARCHAR(255),
usertype VARCHAR(255) NOT NULL,
rxincluded VARCHAR(5),
writtenineicu VARCHAR(5),
drugname VARCHAR(255) NOT NULL,
allergytype VARCHAR(255),
allergyname VARCHAR(255),
drughiclseqno INT
) ;
--------------------------------------------------------
-- DDL for Table APACHEAPSVAR
--------------------------------------------------------
DROP TABLE IF EXISTS apacheapsvar CASCADE;
CREATE TABLE apacheapsvar
(
apacheapsvarid INT,
patientunitstayid INT,
intubated SMALLINT,
vent SMALLINT,
dialysis SMALLINT,
eyes SMALLINT,
motor SMALLINT,
verbal SMALLINT,
meds SMALLINT,
urine DOUBLE PRECISION,
wbc DOUBLE PRECISION,
temperature DOUBLE PRECISION,
respiratoryrate DOUBLE PRECISION,
sodium DOUBLE PRECISION,
heartrate DOUBLE PRECISION,
meanbp DOUBLE PRECISION,
ph DOUBLE PRECISION,
hematocrit DOUBLE PRECISION,
creatinine DOUBLE PRECISION,
albumin DOUBLE PRECISION,
pao2 DOUBLE PRECISION,
pco2 DOUBLE PRECISION,
bun DOUBLE PRECISION,
glucose DOUBLE PRECISION,
bilirubin DOUBLE PRECISION,
fio2 DOUBLE PRECISION
) ;
--------------------------------------------------------
-- DDL for Table APACHEPATIENTRESULT
--------------------------------------------------------
DROP TABLE IF EXISTS apachepatientresult CASCADE;
CREATE TABLE apachepatientresult
(
apachepatientresultsid INT NOT NULL,
patientunitstayid INT NOT NULL,
physicianspeciality VARCHAR(50),
physicianinterventioncategory VARCHAR(50),
acutephysiologyscore INT,
apachescore INT,
apacheversion VARCHAR(5) NOT NULL,
predictedicumortality VARCHAR(50),
actualicumortality VARCHAR(50),
predictediculos DOUBLE PRECISION,
actualiculos DOUBLE PRECISION,
predictedhospitalmortality VARCHAR(50),
actualhospitalmortality VARCHAR(50),
predictedhospitallos DOUBLE PRECISION,
actualhospitallos DOUBLE PRECISION,
preopmi INT,
preopcardiaccath INT,
ptcawithin24h INT,
unabridgedunitlos DOUBLE PRECISION,
unabridgedhosplos DOUBLE PRECISION,
actualventdays DOUBLE PRECISION,
predventdays DOUBLE PRECISION,
unabridgedactualventdays DOUBLE PRECISION
) ;
--------------------------------------------------------
-- DDL for Table APACHEPREDVAR
--------------------------------------------------------
DROP TABLE IF EXISTS apachepredvar CASCADE;
CREATE TABLE apachepredvar
(
apachepredvarid INT,
patientunitstayid INT,
sicuday SMALLINT,
saps3day1 SMALLINT,
saps3today SMALLINT,
saps3yesterday SMALLINT,
gender SMALLINT,
teachtype SMALLINT,
region SMALLINT,
bedcount SMALLINT,
admitsource SMALLINT,
graftcount SMALLINT,
meds SMALLINT,
verbal SMALLINT,
motor SMALLINT,
eyes SMALLINT,
age SMALLINT,
admitdiagnosis VARCHAR(11),
thrombolytics SMALLINT,
diedinhospital SMALLINT,
aids SMALLINT,
hepaticfailure SMALLINT,
lymphoma SMALLINT,
metastaticcancer SMALLINT,
leukemia SMALLINT,
immunosuppression SMALLINT,
cirrhosis SMALLINT,
electivesurgery SMALLINT,
activetx SMALLINT,
readmit SMALLINT,
ima SMALLINT,
midur SMALLINT,
ventday1 SMALLINT,
oobventday1 SMALLINT,
oobintubday1 SMALLINT,
diabetes SMALLINT,
managementsystem SMALLINT,
var03hspxlos DOUBLE PRECISION,
pao2 DOUBLE PRECISION,
fio2 DOUBLE PRECISION,
ejectfx DOUBLE PRECISION,
creatinine DOUBLE PRECISION,
dischargelocation SMALLINT,
visitnumber SMALLINT,
amilocation SMALLINT,
day1meds SMALLINT,
day1verbal SMALLINT,
day1motor SMALLINT,
day1eyes SMALLINT,
day1pao2 DOUBLE PRECISION,
day1fio2 DOUBLE PRECISION
) ;
--------------------------------------------------------
-- DDL for Table CAREPLANCAREPROVIDER
--------------------------------------------------------
DROP TABLE IF EXISTS careplancareprovider CASCADE;
CREATE TABLE careplancareprovider
(
cplcareprovderid INT NOT NULL,
patientunitstayid INT NOT NULL,
careprovidersaveoffset INT NOT NULL,
providertype VARCHAR(255),
specialty VARCHAR(255),
interventioncategory VARCHAR(255),
managingphysician VARCHAR(50),
activeupondischarge VARCHAR(10) NOT NULL
) ;
--------------------------------------------------------
-- DDL for Table CAREPLANEOL
--------------------------------------------------------
DROP TABLE IF EXISTS careplaneol CASCADE;
CREATE TABLE careplaneol
(
cpleolid INT NOT NULL,
patientunitstayid INT NOT NULL,
cpleolsaveoffset INT NOT NULL,
cpleoldiscussionoffset INT,
activeupondischarge VARCHAR(10)
) ;
--------------------------------------------------------
-- DDL for Table CAREPLANGENERAL
--------------------------------------------------------
DROP TABLE IF EXISTS careplangeneral CASCADE;
CREATE TABLE careplangeneral
(
cplgeneralid INT NOT NULL,
patientunitstayid INT NOT NULL,
activeupondischarge VARCHAR(10) NOT NULL,
cplitemoffset INT NOT NULL,
cplgroup VARCHAR(255) NOT NULL,
cplitemvalue VARCHAR(1024)
) ;
--------------------------------------------------------
-- DDL for Table CAREPLANGOAL
--------------------------------------------------------
DROP TABLE IF EXISTS careplangoal CASCADE;
CREATE TABLE careplangoal
(
cplgoalid INT NOT NULL,
patientunitstayid INT NOT NULL,
CPLGOALoffset INT NOT NULL,
CPLGOALCATEGORY VARCHAR(255),
CPLGOALVALUE VARCHAR(1000),
CPLGOALSTATUS VARCHAR(255),
ACTIVEUPONDISCHARGE VARCHAR(10) NOT NULL
) ;
--------------------------------------------------------
-- DDL for Table CAREPLANINFECTIOUSDISEASE
--------------------------------------------------------
DROP TABLE IF EXISTS careplaninfectiousdisease CASCADE;
CREATE TABLE careplaninfectiousdisease
(
cplinfectid INT NOT NULL,
patientunitstayid INT NOT NULL,
activeupondischarge VARCHAR(10) NOT NULL,
cplinfectdiseaseoffset INT NOT NULL,
infectdiseasesite VARCHAR(64),
infectdiseaseassessment VARCHAR(64),
responsetotherapy VARCHAR(32),
treatment VARCHAR(32)
) ;
--------------------------------------------------------
-- DDL for Table CUSTOMLAB
--------------------------------------------------------
DROP TABLE IF EXISTS customlab CASCADE;
CREATE TABLE customlab
(
customlabid INT NOT NULL,
patientunitstayid INT NOT NULL,
labotheroffset INT NOT NULL,
labothertypeid INT NOT NULL,
labothername VARCHAR(64),
labotherresult VARCHAR(64),
labothervaluetext VARCHAR(128)
) ;
--------------------------------------------------------
-- DDL for Table DIAGNOSIS
--------------------------------------------------------
DROP TABLE IF EXISTS diagnosis CASCADE;
CREATE TABLE diagnosis
(
diagnosisid INT NOT NULL,
patientunitstayid INT NOT NULL,
activeupondischarge VARCHAR(64),
diagnosisoffset INT NOT NULL,
diagnosisstring VARCHAR(200) NOT NULL,
icd9code VARCHAR(100),
diagnosispriority VARCHAR(10) NOT NULL
) ;
--------------------------------------------------------
-- DDL for Table HOSPITAL
--------------------------------------------------------
DROP TABLE IF EXISTS hospital CASCADE;
CREATE TABLE hospital
(
hospitalid INT NOT NULL,
numbedscategory VARCHAR(32),
teachingstatus BOOLEAN,
region VARCHAR(64)
) ;
--------------------------------------------------------
-- DDL for Table INFUSIONDRUG
--------------------------------------------------------
DROP TABLE IF EXISTS infusiondrug CASCADE;
CREATE TABLE infusiondrug
(
infusiondrugid INT NOT NULL,
patientunitstayid INT NOT NULL,
infusionoffset INT NOT NULL,
drugname VARCHAR(255) NOT NULL,
drugrate VARCHAR(255),
infusionrate VARCHAR(255),
drugamount VARCHAR(255),
volumeoffluid VARCHAR(255),
patientweight VARCHAR(255)
) ;
--------------------------------------------------------
-- DDL for Table INTAKEOUTPUT
--------------------------------------------------------
DROP TABLE IF EXISTS intakeoutput CASCADE;
CREATE TABLE intakeoutput
(
intakeoutputid INT NOT NULL,
patientunitstayid INT NOT NULL,
intakeoutputoffset INT NOT NULL,
intaketotal NUMERIC(12,4),
outputtotal NUMERIC(12,4),
dialysistotal NUMERIC(12,4),
nettotal NUMERIC(12,4),
intakeoutputentryoffset INT NOT NULL,
cellpath VARCHAR(500),
celllabel VARCHAR(255),
cellvaluenumeric NUMERIC(12,4) NOT NULL,
cellvaluetext VARCHAR(255) NOT NULL
) ;
--------------------------------------------------------
-- DDL for Table LAB
--------------------------------------------------------
DROP TABLE IF EXISTS lab CASCADE;
CREATE TABLE lab
(
labid INT NOT NULL,
patientunitstayid INT NOT NULL,
labresultoffset INT NOT NULL,
labtypeid NUMERIC(3,0) NOT NULL,
labname VARCHAR(256),
labresult NUMERIC(11,4),
labresulttext VARCHAR(255),
labmeasurenamesystem VARCHAR(255),
labmeasurenameinterface VARCHAR(255),
labresultrevisedoffset INT
) ;
--------------------------------------------------------
-- DDL for Table MEDICATION
--------------------------------------------------------
DROP TABLE IF EXISTS medication CASCADE;
CREATE TABLE medication
(
medicationid INT NOT NULL,
patientunitstayid INT NOT NULL,
drugorderoffset INT NOT NULL,
drugstartoffset INT NOT NULL,
drugivadmixture VARCHAR(6) NOT NULL,
drugordercancelled VARCHAR(6) NOT NULL,
drugname VARCHAR(220),
drughiclseqno INT,
dosage VARCHAR(60),
routeadmin VARCHAR(120),
frequency VARCHAR(255),
loadingdose VARCHAR(120) NOT NULL,
prn VARCHAR(6) NOT NULL,
drugstopoffset INT NOT NULL,
gtc INT NOT NULL
) ;
--------------------------------------------------------
-- DDL for Table MICROLAB
--------------------------------------------------------
DROP TABLE IF EXISTS microlab CASCADE;
CREATE TABLE microlab
(
microlabid INT NOT NULL,
patientunitstayid INT NOT NULL,
culturetakenoffset INT NOT NULL,
culturesite VARCHAR(255) NOT NULL,
organism VARCHAR(255) NOT NULL,
antibiotic VARCHAR(255),
sensitivitylevel VARCHAR(255)
) ;
--------------------------------------------------------
-- DDL for Table NOTE
--------------------------------------------------------
DROP TABLE IF EXISTS note CASCADE;
CREATE TABLE note
(
NOTEID INT NOT NULL,
patientunitstayid INT NOT NULL,
NOTEOFFSET INT NOT NULL,
NOTEENTEREDOFFSET INT NOT NULL,
NOTETYPE VARCHAR(50) NOT NULL,
NOTEPATH VARCHAR(255) NOT NULL,
NOTEVALUE VARCHAR(150),
NOTETEXT VARCHAR(500)
) ;
--------------------------------------------------------
-- DDL for Table NURSEASSESSMENT
--------------------------------------------------------
DROP TABLE IF EXISTS NURSEASSESSMENT CASCADE;
CREATE TABLE NURSEASSESSMENT
(
nurseassessid INT NOT NULL,
patientunitstayid INT NOT NULL,
NURSEASSESSOFFSET INT NOT NULL,
NURSEASSESSENTRYOFFSET INT NOT NULL,
CELLATTRIBUTEPATH VARCHAR(255) NOT NULL,
CELLLABEL VARCHAR(255) NOT NULL,
CELLATTRIBUTE VARCHAR(255) NOT NULL,
CELLATTRIBUTEVALUE VARCHAR(4000)
) ;
--------------------------------------------------------
-- DDL for Table NURSECARE
--------------------------------------------------------
DROP TABLE IF EXISTS NURSECARE CASCADE;
CREATE TABLE NURSECARE
(
nursecareid INT NOT NULL,
patientunitstayid INT NOT NULL,
CELLLABEL VARCHAR(255) NOT NULL,
NURSECAREOFFSET INT NOT NULL,
NURSECAREENTRYOFFSET INT NOT NULL,
CELLATTRIBUTEPATH VARCHAR(255) NOT NULL,
CELLATTRIBUTE VARCHAR(255) NOT NULL,
CELLATTRIBUTEVALUE VARCHAR(4000)
) ;
--------------------------------------------------------
-- DDL for Table NURSECHARTING
--------------------------------------------------------
DROP TABLE IF EXISTS NURSECHARTING CASCADE;
CREATE TABLE NURSECHARTING
(
nursingchartid BIGINT NOT NULL,
patientunitstayid INT NOT NULL,
NURSINGCHARTOFFSET INT NOT NULL,
NURSINGCHARTENTRYOFFSET INT NOT NULL,
NURSINGCHARTCELLTYPECAT VARCHAR(255) NOT NULL,
NURSINGCHARTCELLTYPEVALLABEL VARCHAR(255),
NURSINGCHARTCELLTYPEVALNAME VARCHAR(255),
NURSINGCHARTVALUE VARCHAR(255)
) ;
--------------------------------------------------------
-- DDL for Table PASTHISTORY
--------------------------------------------------------
DROP TABLE IF EXISTS pasthistory CASCADE;
CREATE TABLE pasthistory
(
pasthistoryid INT NOT NULL,
patientunitstayid INT NOT NULL,
pasthistoryoffset INT NOT NULL,
pasthistoryenteredoffset INT NOT NULL,
pasthistorynotetype VARCHAR(40),
pasthistorypath VARCHAR(255) NOT NULL,
pasthistoryvalue VARCHAR(100),
pasthistoryvaluetext VARCHAR(255)
) ;
--------------------------------------------------------
-- DDL for Table PATIENT
--------------------------------------------------------
DROP TABLE IF EXISTS patient CASCADE;
CREATE TABLE patient
(
patientunitstayid INT,
patienthealthsystemstayid INT,
gender VARCHAR(25),
age VARCHAR(10),
ethnicity VARCHAR(50),
hospitalid INT,
wardid INT,
apacheadmissiondx VARCHAR(1000),
admissionheight NUMERIC(10,2),
hospitaladmittime24 VARCHAR(8),
hospitaladmitoffset INT,
hospitaladmitsource VARCHAR(30),
hospitaldischargeyear SMALLINT,
hospitaldischargetime24 VARCHAR(8),
hospitaldischargeoffset INT,
hospitaldischargelocation VARCHAR(100),
hospitaldischargestatus VARCHAR(10),
unittype VARCHAR(50),
unitadmittime24 VARCHAR(8),
unitadmitsource VARCHAR(100),
unitvisitnumber INT,
unitstaytype VARCHAR(15),
admissionweight NUMERIC(10,2),
dischargeweight NUMERIC(10,2),
unitdischargetime24 VARCHAR(8),
unitdischargeoffset INT,
unitdischargelocation VARCHAR(100),
unitdischargestatus VARCHAR(10),
uniquepid VARCHAR(10)
) ;
--------------------------------------------------------
-- DDL for Table PHYSICALEXAM
--------------------------------------------------------
DROP TABLE IF EXISTS physicalexam CASCADE;
CREATE TABLE physicalexam
(
physicalexamid INT,
patientunitstayid INT NOT NULL,
physicalexamoffset INT NOT NULL,
physicalexampath VARCHAR(255) NOT NULL,
physicalexamvalue VARCHAR(100),
physicalexamtext VARCHAR(500)
) ;
--------------------------------------------------------
-- DDL for Table RESPIRATORYCARE
--------------------------------------------------------
DROP TABLE IF EXISTS RESPIRATORYCARE CASCADE;
CREATE TABLE RESPIRATORYCARE
(
RESPCAREID INT,
PATIENTUNITSTAYID INT,
RESPCARESTATUSOFFSET INT,
CURRENTHISTORYSEQNUM INT,
AIRWAYTYPE VARCHAR(30),
AIRWAYSIZE VARCHAR(10),
AIRWAYPOSITION VARCHAR(32),
CUFFPRESSURE NUMERIC(5,1),
VENTSTARTOFFSET INT,
VENTENDOFFSET INT,
PRIORVENTSTARTOFFSET INT,
PRIORVENTENDOFFSET INT,
APNEAPARAMS VARCHAR(80),
LOWEXHMVLIMIT NUMERIC(11,4),
HIEXHMVLIMIT NUMERIC(11,4),
LOWEXHTVLIMIT NUMERIC(11,4),
HIPEAKPRESLIMIT NUMERIC(11,4),
LOWPEAKPRESLIMIT NUMERIC(11,4),
HIRESPRATELIMIT NUMERIC(11,4),
LOWRESPRATELIMIT NUMERIC(11,4),
SIGHPRESLIMIT NUMERIC(11,4),
LOWIRONOXLIMIT NUMERIC(11,4),
HIGHIRONOXLIMIT NUMERIC(11,4),
MEANAIRWAYPRESLIMIT NUMERIC(11,4),
PEEPLIMIT NUMERIC(11,4),
CPAPLIMIT NUMERIC(11,4),
SETAPNEAINTERVAL VARCHAR(80),
SETAPNEATV VARCHAR(80),
SETAPNEAIPPEEPHIGH VARCHAR(80),
SETAPNEARR VARCHAR(80),
SETAPNEAPEAKFLOW VARCHAR(80),
SETAPNEAINSPTIME VARCHAR(80),
SETAPNEAIE VARCHAR(80),
SETAPNEAFIO2 VARCHAR(80)
) ;
--------------------------------------------------------
-- DDL for Table RESPIRATORYCHARTING
--------------------------------------------------------
DROP TABLE IF EXISTS RESPIRATORYCHARTING CASCADE;
CREATE TABLE RESPIRATORYCHARTING
(
RESPCHARTID INT,
PATIENTUNITSTAYID INT,
RESPCHARTOFFSET INT,
RESPCHARTENTRYOFFSET INT,
RESPCHARTTYPECAT VARCHAR(255),
RESPCHARTVALUELABEL VARCHAR(255),
RESPCHARTVALUE VARCHAR(1000)
) ;
--------------------------------------------------------
-- DDL for Table TREATMENT
--------------------------------------------------------
DROP TABLE IF EXISTS treatment CASCADE;
CREATE TABLE treatment
(
treatmentid INT,
patientunitstayid INT,
treatmentoffset INT,
treatmentstring VARCHAR(200),
activeupondischarge VARCHAR(10)
) ;
--------------------------------------------------------
-- DDL for Table VITALAPERIODIC
--------------------------------------------------------
DROP TABLE IF EXISTS vitalaperiodic CASCADE;
CREATE TABLE vitalaperiodic
(
vitalaperiodicid INT NOT NULL,
patientunitstayid INT NOT NULL,
observationoffset INT NOT NULL,
noninvasivesystolic DOUBLE PRECISION,
noninvasivediastolic DOUBLE PRECISION,
noninvasivemean DOUBLE PRECISION,
paop DOUBLE PRECISION,
cardiacoutput DOUBLE PRECISION,
cardiacinput DOUBLE PRECISION,
svr DOUBLE PRECISION,
svri DOUBLE PRECISION,
pvr DOUBLE PRECISION,
pvri DOUBLE PRECISION
) ;
--------------------------------------------------------
-- DDL for Table VITALPERIODIC
--------------------------------------------------------
DROP TABLE IF EXISTS vitalperiodic CASCADE;
CREATE TABLE vitalperiodic
(
vitalperiodicid BIGINT,
patientunitstayid INT,
observationoffset INT,
temperature NUMERIC(11,4),
sao2 INT,
heartrate INT,
respiration INT,
cvp INT,
etco2 INT,
systemicsystolic INT,
systemicdiastolic INT,
systemicmean INT,
pasystolic INT,
padiastolic INT,
pamean INT,
st1 DOUBLE PRECISION,
st2 DOUBLE PRECISION,
st3 DOUBLE PRECISION,
icp INT
) ; | the_stack |
-- 2017-04-22T18:02:51.999
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540010,540286,TO_TIMESTAMP('2017-04-22 18:02:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','advanced edit',999,TO_TIMESTAMP('2017-04-22 18:02:51','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:03:42.049
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1077,0,186,540286,543168,TO_TIMESTAMP('2017-04-22 18:03:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Preisliste',10,0,0,TO_TIMESTAMP('2017-04-22 18:03:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:04:00.574
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1078,0,186,540286,543169,TO_TIMESTAMP('2017-04-22 18:04:00','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Auftrag',20,0,0,TO_TIMESTAMP('2017-04-22 18:04:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:04:11.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1079,0,186,540286,543170,TO_TIMESTAMP('2017-04-22 18:04:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',30,0,0,TO_TIMESTAMP('2017-04-22 18:04:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:04:24.290
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1080,0,186,540286,543171,TO_TIMESTAMP('2017-04-22 18:04:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Aktiv',40,0,0,TO_TIMESTAMP('2017-04-22 18:04:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:04:40.898
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1087,0,186,540286,543172,TO_TIMESTAMP('2017-04-22 18:04:40','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Freigegeben',50,0,0,TO_TIMESTAMP('2017-04-22 18:04:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:04:53.686
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1088,0,186,540286,543173,TO_TIMESTAMP('2017-04-22 18:04:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Kredit gebilligt',60,0,0,TO_TIMESTAMP('2017-04-22 18:04:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:05:03.071
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1089,0,186,540286,543174,TO_TIMESTAMP('2017-04-22 18:05:03','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zugestellt',70,0,0,TO_TIMESTAMP('2017-04-22 18:05:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:05:13.407
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1090,0,186,540286,543175,TO_TIMESTAMP('2017-04-22 18:05:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Berechnete Menge',80,0,0,TO_TIMESTAMP('2017-04-22 18:05:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:05:24.053
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1091,0,186,540286,543176,TO_TIMESTAMP('2017-04-22 18:05:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','andrucken',90,0,0,TO_TIMESTAMP('2017-04-22 18:05:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:05:34.524
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1092,0,186,540286,543177,TO_TIMESTAMP('2017-04-22 18:05:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Transferred',100,0,0,TO_TIMESTAMP('2017-04-22 18:05:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:05:47.110
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1095,0,186,540286,543178,TO_TIMESTAMP('2017-04-22 18:05:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Buchungsdatum',110,0,0,TO_TIMESTAMP('2017-04-22 18:05:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:06:04.237
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1099,0,186,540286,543179,TO_TIMESTAMP('2017-04-22 18:06:04','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zahlungsbedigung',120,0,0,TO_TIMESTAMP('2017-04-22 18:06:04','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:06:18.892
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1112,0,186,540286,543180,TO_TIMESTAMP('2017-04-22 18:06:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Summe Zeilen',130,0,0,TO_TIMESTAMP('2017-04-22 18:06:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:06:30.430
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1113,0,186,540286,543181,TO_TIMESTAMP('2017-04-22 18:06:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Summe Gesamt',140,0,0,TO_TIMESTAMP('2017-04-22 18:06:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:06:48.734
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,2594,0,186,540286,543182,TO_TIMESTAMP('2017-04-22 18:06:48','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Verarbeitet',150,0,0,TO_TIMESTAMP('2017-04-22 18:06:48','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:07:08.121
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,2876,0,186,540286,543183,TO_TIMESTAMP('2017-04-22 18:07:08','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Date printed',160,0,0,TO_TIMESTAMP('2017-04-22 18:07:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:07:25.776
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,2879,0,186,540286,543184,TO_TIMESTAMP('2017-04-22 18:07:25','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Verkaufs Transaktion',170,0,0,TO_TIMESTAMP('2017-04-22 18:07:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:07:42.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3660,0,186,540286,543185,TO_TIMESTAMP('2017-04-22 18:07:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Verbucht',180,0,0,TO_TIMESTAMP('2017-04-22 18:07:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:08:00.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3661,0,186,540286,543186,TO_TIMESTAMP('2017-04-22 18:08:00','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Preis inkl. Steuern',190,0,0,TO_TIMESTAMP('2017-04-22 18:08:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:08:03.984
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Preise inkl. Steuern',Updated=TO_TIMESTAMP('2017-04-22 18:08:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543186
;
-- 2017-04-22T18:08:24.796
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,3704,0,186,540286,543187,TO_TIMESTAMP('2017-04-22 18:08:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Selektiert',200,0,0,TO_TIMESTAMP('2017-04-22 18:08:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:08:45.154
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,4233,0,186,540286,543188,TO_TIMESTAMP('2017-04-22 18:08:45','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Kassenjournal Zeile',210,0,0,TO_TIMESTAMP('2017-04-22 18:08:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:08:57.706
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,4234,0,186,540286,543189,TO_TIMESTAMP('2017-04-22 18:08:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zahlung',220,0,0,TO_TIMESTAMP('2017-04-22 18:08:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:09:19.103
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,6227,0,186,540286,543190,TO_TIMESTAMP('2017-04-22 18:09:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','eMail senden',230,0,0,TO_TIMESTAMP('2017-04-22 18:09:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:09:35.672
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,6560,0,186,540286,543191,TO_TIMESTAMP('2017-04-22 18:09:35','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Positionen kopieren',240,0,0,TO_TIMESTAMP('2017-04-22 18:09:35','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:09:56.884
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,6562,0,186,540286,543192,TO_TIMESTAMP('2017-04-22 18:09:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Selbstbedienung',250,0,0,TO_TIMESTAMP('2017-04-22 18:09:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:10:12.700
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,9427,0,186,540286,543193,TO_TIMESTAMP('2017-04-22 18:10:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Payment Location',260,0,0,TO_TIMESTAMP('2017-04-22 18:10:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:10:32.487
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,9428,0,186,540286,543194,TO_TIMESTAMP('2017-04-22 18:10:32','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Payment BPartner',270,0,0,TO_TIMESTAMP('2017-04-22 18:10:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:10:40.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Zahlung Anschrift',Updated=TO_TIMESTAMP('2017-04-22 18:10:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543193
;
-- 2017-04-22T18:10:52.245
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Zahlung Geschäftspartner',Updated=TO_TIMESTAMP('2017-04-22 18:10:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543194
;
-- 2017-04-22T18:11:10.827
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,52014,0,186,540286,543195,TO_TIMESTAMP('2017-04-22 18:11:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Auftragsart',280,0,0,TO_TIMESTAMP('2017-04-22 18:11:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:11:30.344
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,56446,0,186,540286,543196,TO_TIMESTAMP('2017-04-22 18:11:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Fracht Kategorie',290,0,0,TO_TIMESTAMP('2017-04-22 18:11:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:11:46.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,56906,0,186,540286,543197,TO_TIMESTAMP('2017-04-22 18:11:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Promotionscode',300,0,0,TO_TIMESTAMP('2017-04-22 18:11:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:11:59.614
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,501620,0,186,540286,543198,TO_TIMESTAMP('2017-04-22 18:11:59','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Incoterm',310,0,0,TO_TIMESTAMP('2017-04-22 18:11:59','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:12:23.003
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,501621,0,186,540286,543199,TO_TIMESTAMP('2017-04-22 18:12:22','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Incoterm Anschrift',320,0,0,TO_TIMESTAMP('2017-04-22 18:12:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:12:43.086
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,501675,0,186,540286,543200,TO_TIMESTAMP('2017-04-22 18:12:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Gesamtauftragsrabatt',330,0,0,TO_TIMESTAMP('2017-04-22 18:12:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:13:01.202
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,502200,0,186,540286,543201,TO_TIMESTAMP('2017-04-22 18:13:01','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bankverbindung',340,0,0,TO_TIMESTAMP('2017-04-22 18:13:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:13:19.826
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,502201,0,186,540286,543202,TO_TIMESTAMP('2017-04-22 18:13:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Volumen',350,0,0,TO_TIMESTAMP('2017-04-22 18:13:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:13:33.004
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,502202,0,186,540286,543203,TO_TIMESTAMP('2017-04-22 18:13:32','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Gewicht',360,0,0,TO_TIMESTAMP('2017-04-22 18:13:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:13:58.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,505100,0,186,540286,543204,TO_TIMESTAMP('2017-04-22 18:13:58','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Abw. Lieferanschrift verwenden',370,0,0,TO_TIMESTAMP('2017-04-22 18:13:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:14:20.219
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,505101,0,186,540286,543205,TO_TIMESTAMP('2017-04-22 18:14:20','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Abw. Rechnungsanschrift verwenden',380,0,0,TO_TIMESTAMP('2017-04-22 18:14:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:14:38.285
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,545267,0,186,540286,543206,TO_TIMESTAMP('2017-04-22 18:14:38','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Anzahl Zeilen',390,0,0,TO_TIMESTAMP('2017-04-22 18:14:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:14:56.964
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,545268,0,186,540286,543207,TO_TIMESTAMP('2017-04-22 18:14:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Währung Symbol',400,0,0,TO_TIMESTAMP('2017-04-22 18:14:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:15:41.684
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,545269,0,186,540286,543208,TO_TIMESTAMP('2017-04-22 18:15:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Steuersumme',410,0,0,TO_TIMESTAMP('2017-04-22 18:15:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:16:05.680
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,545270,0,186,540286,543209,TO_TIMESTAMP('2017-04-22 18:16:05','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Netto in Basiswährung',420,0,0,TO_TIMESTAMP('2017-04-22 18:16:05','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:16:30.547
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,546256,0,186,540286,543210,TO_TIMESTAMP('2017-04-22 18:16:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Netto Summe',430,0,0,TO_TIMESTAMP('2017-04-22 18:16:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:16:51.580
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556289,0,186,540286,543211,TO_TIMESTAMP('2017-04-22 18:16:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Status Lieferung',440,0,0,TO_TIMESTAMP('2017-04-22 18:16:51','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:17:06.311
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556278,0,186,540286,543212,TO_TIMESTAMP('2017-04-22 18:17:06','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Status Abrechnung',450,0,0,TO_TIMESTAMP('2017-04-22 18:17:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:18:18.775
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,543186,0,186,540286,543213,TO_TIMESTAMP('2017-04-22 18:18:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Eingegangen via',460,0,0,TO_TIMESTAMP('2017-04-22 18:18:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:18:52.099
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547120,0,186,540286,543214,TO_TIMESTAMP('2017-04-22 18:18:52','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Gültgkeit (Tage)',470,0,0,TO_TIMESTAMP('2017-04-22 18:18:52','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:19:06.454
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547121,0,186,540286,543215,TO_TIMESTAMP('2017-04-22 18:19:06','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Gültig bis',480,0,0,TO_TIMESTAMP('2017-04-22 18:19:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:20:14.217
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,2878,0,186,540286,543216,TO_TIMESTAMP('2017-04-22 18:20:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Varsandkostenberechnung',490,0,0,TO_TIMESTAMP('2017-04-22 18:20:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:20:28.358
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,1107,0,186,540286,543217,TO_TIMESTAMP('2017-04-22 18:20:28','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Frachtbetrag',500,0,0,TO_TIMESTAMP('2017-04-22 18:20:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:21:07.933
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,2593,0,186,540286,543218,TO_TIMESTAMP('2017-04-22 18:21:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Projekt',510,0,0,TO_TIMESTAMP('2017-04-22 18:21:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:22:46.903
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,2589,0,186,540286,543219,TO_TIMESTAMP('2017-04-22 18:22:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Kostenstelle',520,0,0,TO_TIMESTAMP('2017-04-22 18:22:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-04-22T18:23:32.286
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543168
;
-- 2017-04-22T18:23:32.739
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543169
;
-- 2017-04-22T18:23:33.347
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543170
;
-- 2017-04-22T18:23:33.795
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543171
;
-- 2017-04-22T18:23:34.163
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543172
;
-- 2017-04-22T18:23:34.516
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543173
;
-- 2017-04-22T18:23:34.978
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543174
;
-- 2017-04-22T18:23:35.396
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543175
;
-- 2017-04-22T18:23:35.770
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543176
;
-- 2017-04-22T18:23:36.538
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543177
;
-- 2017-04-22T18:23:37.002
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543178
;
-- 2017-04-22T18:23:37.534
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543179
;
-- 2017-04-22T18:23:37.988
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543180
;
-- 2017-04-22T18:23:38.484
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543181
;
-- 2017-04-22T18:23:38.947
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543182
;
-- 2017-04-22T18:23:40.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543183
;
-- 2017-04-22T18:23:40.594
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543184
;
-- 2017-04-22T18:23:41.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543185
;
-- 2017-04-22T18:23:43.541
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543186
;
-- 2017-04-22T18:23:45.292
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543187
;
-- 2017-04-22T18:23:47.874
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543188
;
-- 2017-04-22T18:23:48.311
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543189
;
-- 2017-04-22T18:23:48.931
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543190
;
-- 2017-04-22T18:23:49.530
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543191
;
-- 2017-04-22T18:23:50.227
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543192
;
-- 2017-04-22T18:23:51.507
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:23:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543193
;
-- 2017-04-22T18:24:01.445
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543194
;
-- 2017-04-22T18:24:02.154
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543195
;
-- 2017-04-22T18:24:02.683
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543196
;
-- 2017-04-22T18:24:03.168
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543197
;
-- 2017-04-22T18:24:10.585
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543198
;
-- 2017-04-22T18:24:13.954
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543199
;
-- 2017-04-22T18:24:14.378
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543200
;
-- 2017-04-22T18:24:16.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543201
;
-- 2017-04-22T18:24:17.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543202
;
-- 2017-04-22T18:24:18.053
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543203
;
-- 2017-04-22T18:24:18.844
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543204
;
-- 2017-04-22T18:24:29.411
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543205
;
-- 2017-04-22T18:24:30.055
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543206
;
-- 2017-04-22T18:24:30.539
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543207
;
-- 2017-04-22T18:24:31.027
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543208
;
-- 2017-04-22T18:24:31.923
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543209
;
-- 2017-04-22T18:24:32.468
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543210
;
-- 2017-04-22T18:24:47.867
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543211
;
-- 2017-04-22T18:24:48.320
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543212
;
-- 2017-04-22T18:24:48.899
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543213
;
-- 2017-04-22T18:24:49.955
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543214
;
-- 2017-04-22T18:24:50.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543215
;
-- 2017-04-22T18:24:50.978
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543216
;
-- 2017-04-22T18:24:55.065
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543217
;
-- 2017-04-22T18:24:55.492
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543218
;
-- 2017-04-22T18:24:57.035
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-04-22 18:24:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=543219
; | the_stack |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.8
-- Dumped by pg_dump version 10.3
-- Started on 2018-04-30 14:45:37 CEST
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- TOC entry 8 (class 2615 OID 16715)
-- Name: wicked; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA wicked;
--
-- TOC entry 197 (class 1255 OID 16858)
-- Name: webhooknotify(); Type: FUNCTION; Schema: wicked; Owner: postgres
--
CREATE FUNCTION wicked.webhook_notify() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
PERFORM pg_notify('webhook_insert', row_to_json(NEW)::text);
RETURN new;
END;
$$;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 186 (class 1259 OID 16716)
-- Name: applications; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.applications (
id character varying(128) NOT NULL,
data jsonb
);
--
-- TOC entry 187 (class 1259 OID 16722)
-- Name: approvals; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.approvals (
id character varying(128) NOT NULL,
subscriptions_id character varying(128) NOT NULL,
data jsonb
);
--
-- TOC entry 188 (class 1259 OID 16728)
-- Name: grants; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.grants (
id character varying(128) NOT NULL,
users_id character varying(128) NOT NULL,
api_id character varying(128) NOT NULL,
application_id character varying(128) NOT NULL,
data jsonb
);
--
-- TOC entry 189 (class 1259 OID 16734)
-- Name: meta; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.meta (
id bigint NOT NULL,
data jsonb
);
--
-- TOC entry 190 (class 1259 OID 16740)
-- Name: owners; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.owners (
id character varying(128) NOT NULL,
users_id character varying(128) NOT NULL,
applications_id character varying(128) NOT NULL,
data jsonb
);
--
-- TOC entry 191 (class 1259 OID 16746)
-- Name: registrations; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.registrations (
id character varying(128) NOT NULL,
pool_id character varying(128) NOT NULL,
users_id character varying(128) NOT NULL,
namespace character varying(128),
name character varying(256),
data jsonb
);
--
-- TOC entry 192 (class 1259 OID 16752)
-- Name: subscriptions; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.subscriptions (
id character varying(128) NOT NULL,
applications_id character varying(128) NOT NULL,
plan_id character varying(128) NOT NULL,
api_id character varying(128) NOT NULL,
client_id character varying(256),
data jsonb
);
--
-- TOC entry 193 (class 1259 OID 16758)
-- Name: users; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.users (
id character varying(64) NOT NULL,
email character varying(256) NOT NULL,
custom_id character varying(256),
data jsonb NOT NULL
);
--
-- TOC entry 194 (class 1259 OID 16764)
-- Name: verifications; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.verifications (
id character varying(128) NOT NULL,
users_id character varying(128) NOT NULL,
data jsonb
);
--
-- TOC entry 195 (class 1259 OID 16770)
-- Name: webhook_events; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.webhook_events (
id character varying(128) NOT NULL,
webhook_listeners_id character varying(128),
data jsonb
);
--
-- TOC entry 196 (class 1259 OID 16776)
-- Name: webhook_listeners; Type: TABLE; Schema: wicked; Owner: postgres
--
CREATE TABLE wicked.webhook_listeners (
id character varying(128) NOT NULL,
data jsonb
);
--
-- TOC entry 2057 (class 2606 OID 16783)
-- Name: applications applications_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.applications
ADD CONSTRAINT applications_pkey PRIMARY KEY (id);
--
-- TOC entry 2059 (class 2606 OID 16785)
-- Name: approvals approvals_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.approvals
ADD CONSTRAINT approvals_pkey PRIMARY KEY (id);
--
-- TOC entry 2061 (class 2606 OID 16787)
-- Name: grants grants_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.grants
ADD CONSTRAINT grants_pkey PRIMARY KEY (id);
--
-- TOC entry 2066 (class 2606 OID 16789)
-- Name: meta meta_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.meta
ADD CONSTRAINT meta_pkey PRIMARY KEY (id);
--
-- TOC entry 2070 (class 2606 OID 16791)
-- Name: owners owners_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.owners
ADD CONSTRAINT owners_pkey PRIMARY KEY (id);
--
-- TOC entry 2073 (class 2606 OID 16793)
-- Name: registrations registrations_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.registrations
ADD CONSTRAINT registrations_pkey PRIMARY KEY (id);
--
-- TOC entry 2078 (class 2606 OID 16795)
-- Name: subscriptions subscriptions_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.subscriptions
ADD CONSTRAINT subscriptions_pkey PRIMARY KEY (id);
--
-- TOC entry 2083 (class 2606 OID 16797)
-- Name: users users_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- TOC entry 2086 (class 2606 OID 16799)
-- Name: verifications verifications_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.verifications
ADD CONSTRAINT verifications_pkey PRIMARY KEY (id);
--
-- TOC entry 2088 (class 2606 OID 16801)
-- Name: webhook_events webhook_events_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.webhook_events
ADD CONSTRAINT webhook_events_pkey PRIMARY KEY (id);
--
-- TOC entry 2090 (class 2606 OID 16803)
-- Name: webhook_listeners webhook_listeners_pkey; Type: CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.webhook_listeners
ADD CONSTRAINT webhook_listeners_pkey PRIMARY KEY (id);
--
-- TOC entry 2067 (class 1259 OID 16804)
-- Name: fki_applications_fkey; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX fki_applications_fkey ON wicked.owners USING btree (applications_id);
--
-- TOC entry 2084 (class 1259 OID 16805)
-- Name: fki_users_fkey; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX fki_users_fkey ON wicked.verifications USING btree (users_id);
--
-- TOC entry 2068 (class 1259 OID 16806)
-- Name: fki_users_id; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX fki_users_id ON wicked.owners USING btree (users_id);
--
-- TOC entry 2062 (class 1259 OID 16807)
-- Name: grants_user_api_application_id_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX grants_user_api_application_id_idx ON wicked.grants USING btree (users_id, api_id, application_id);
--
-- TOC entry 2064 (class 1259 OID 16809)
-- Name: grants_users_id_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX grants_users_id_idx ON wicked.grants USING btree (users_id);
--
-- TOC entry 2071 (class 1259 OID 16810)
-- Name: registrations_name_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX registrations_name_idx ON wicked.registrations USING btree (name);
--
-- TOC entry 2074 (class 1259 OID 16811)
-- Name: registrations_users_pool_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE UNIQUE INDEX registrations_users_pool_idx ON wicked.registrations USING btree (users_id, pool_id, namespace);
--
-- TOC entry 2075 (class 1259 OID 16812)
-- Name: subscriptions_applications_id_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX subscriptions_applications_id_idx ON wicked.subscriptions USING btree (applications_id);
--
-- TOC entry 2076 (class 1259 OID 16813)
-- Name: subscriptions_client_id_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX subscriptions_client_id_idx ON wicked.subscriptions USING btree (client_id);
--
-- TOC entry 2079 (class 1259 OID 16814)
-- Name: users_custom_id_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE UNIQUE INDEX users_custom_id_idx ON wicked.users USING btree (custom_id);
--
-- TOC entry 2080 (class 1259 OID 16815)
-- Name: users_email_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE UNIQUE INDEX users_email_idx ON wicked.users USING btree (email);
--
-- TOC entry 2081 (class 1259 OID 16816)
-- Name: users_name_idx; Type: INDEX; Schema: wicked; Owner: postgres
--
CREATE INDEX users_name_idx ON wicked.users USING btree (custom_id);
--
-- TOC entry 2099 (class 2620 OID 16859)
-- Name: webhook_events webhookinsertionevent; Type: TRIGGER; Schema: wicked; Owner: postgres
--
CREATE TRIGGER webhookinsertionevent AFTER INSERT ON wicked.webhook_events FOR EACH ROW EXECUTE PROCEDURE wicked.webhook_notify();
--
-- TOC entry 2093 (class 2606 OID 16817)
-- Name: owners applications_fkey; Type: FK CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.owners
ADD CONSTRAINT applications_fkey FOREIGN KEY (applications_id) REFERENCES wicked.applications(id) ON DELETE CASCADE;
--
-- TOC entry 2096 (class 2606 OID 16822)
-- Name: subscriptions subscriptions_applications_id_fkey; Type: FK CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.subscriptions
ADD CONSTRAINT subscriptions_applications_id_fkey FOREIGN KEY (applications_id) REFERENCES wicked.applications(id) ON DELETE CASCADE;
--
-- TOC entry 2091 (class 2606 OID 16827)
-- Name: approvals subscriptions_fkey; Type: FK CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.approvals
ADD CONSTRAINT subscriptions_fkey FOREIGN KEY (subscriptions_id) REFERENCES wicked.subscriptions(id) ON DELETE CASCADE;
--
-- TOC entry 2094 (class 2606 OID 16832)
-- Name: owners users_fkey; Type: FK CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.owners
ADD CONSTRAINT users_fkey FOREIGN KEY (users_id) REFERENCES wicked.users(id) ON DELETE CASCADE;
--
-- TOC entry 2097 (class 2606 OID 16837)
-- Name: verifications users_fkey; Type: FK CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.verifications
ADD CONSTRAINT users_fkey FOREIGN KEY (users_id) REFERENCES wicked.users(id) ON DELETE CASCADE;
--
-- TOC entry 2095 (class 2606 OID 16842)
-- Name: registrations users_fkey; Type: FK CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.registrations
ADD CONSTRAINT users_fkey FOREIGN KEY (users_id) REFERENCES wicked.users(id) ON DELETE CASCADE;
--
-- TOC entry 2092 (class 2606 OID 16847)
-- Name: grants users_fkey; Type: FK CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.grants
ADD CONSTRAINT users_fkey FOREIGN KEY (users_id) REFERENCES wicked.users(id) ON DELETE CASCADE;
--
-- TOC entry 2098 (class 2606 OID 16852)
-- Name: webhook_events webhook_listeners_fkey; Type: FK CONSTRAINT; Schema: wicked; Owner: postgres
--
ALTER TABLE ONLY wicked.webhook_events
ADD CONSTRAINT webhook_listeners_fkey FOREIGN KEY (webhook_listeners_id) REFERENCES wicked.webhook_listeners(id) ON DELETE CASCADE;
-- Completed on 2018-04-30 14:45:37 CEST
--
-- PostgreSQL database dump complete
-- | the_stack |
-- 2017-10-03T08:05:20.195
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-03 08:05:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556991
;
-- 2017-10-03T08:05:22.394
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-03 08:05:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557009
;
-- 2017-10-03T08:05:23.240
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-03 08:05:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556994
;
-- 2017-10-03T08:05:24.368
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-03 08:05:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556992
;
-- 2017-10-03T08:05:25.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-03 08:05:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556998
;
-- 2017-10-03T08:06:02.395
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-03 08:06:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557007
;
-- 2017-10-03T08:06:07.200
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-03 08:06:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556997
;
-- 2017-10-03T08:06:46.883
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='N', SelectionColumnSeqNo=0,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556992
;
-- 2017-10-03T08:06:46.890
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=10,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556997
;
-- 2017-10-03T08:06:46.896
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=20,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556991
;
-- 2017-10-03T08:06:46.902
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=30,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557009
;
-- 2017-10-03T08:06:46.907
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556994
;
-- 2017-10-03T08:06:46.911
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=50,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557007
;
-- 2017-10-03T08:06:46.913
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=60,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557006
;
-- 2017-10-03T08:06:46.914
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=70,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556998
;
-- 2017-10-03T08:06:46.916
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=80,Updated=TO_TIMESTAMP('2017-10-03 08:06:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556984
;
-- 2017-10-03T08:07:06.691
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y',Updated=TO_TIMESTAMP('2017-10-03 08:07:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556993
;
-- 2017-10-03T08:07:29.659
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2017-10-03 08:07:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556993
;
-- 2017-10-03T08:07:29.662
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=60,Updated=TO_TIMESTAMP('2017-10-03 08:07:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556994
;
-- 2017-10-03T08:07:29.664
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=70,Updated=TO_TIMESTAMP('2017-10-03 08:07:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557006
;
-- 2017-10-03T08:07:29.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=80,Updated=TO_TIMESTAMP('2017-10-03 08:07:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556998
;
-- 2017-10-03T08:07:29.670
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=90,Updated=TO_TIMESTAMP('2017-10-03 08:07:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556984
;
-- 2017-10-03T08:08:34.472
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=20,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557001
;
-- 2017-10-03T08:08:34.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=30,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556991
;
-- 2017-10-03T08:08:34.482
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=40,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557009
;
-- 2017-10-03T08:08:34.486
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=50,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556993
;
-- 2017-10-03T08:08:34.491
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=60,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557007
;
-- 2017-10-03T08:08:34.496
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=70,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556994
;
-- 2017-10-03T08:08:34.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=80,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=557006
;
-- 2017-10-03T08:08:34.503
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=90,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556998
;
-- 2017-10-03T08:08:34.506
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsSelectionColumn='Y', SelectionColumnSeqNo=100,Updated=TO_TIMESTAMP('2017-10-03 08:08:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556984
;
-- 2017-10-03T08:09:08.463
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Customer Unit',Updated=TO_TIMESTAMP('2017-10-03 08:09:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558806
;
-- 2017-10-03T08:09:27.121
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Gebindestatus Customer Unit',Updated=TO_TIMESTAMP('2017-10-03 08:09:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558807
;
-- 2017-10-03T08:09:37.206
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Ursprungs HU',Updated=TO_TIMESTAMP('2017-10-03 08:09:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558800
;
-- 2017-10-03T08:09:51.145
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Transaktionszeile HU',Updated=TO_TIMESTAMP('2017-10-03 08:09:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558808
;
-- 2017-10-03T08:10:24.829
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Produktion Cost Collector',Updated=TO_TIMESTAMP('2017-10-03 08:10:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558802
;
-- 2017-10-03T08:10:55.822
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-03 08:10:55','YYYY-MM-DD HH24:MI:SS'),Name='Trace Type' WHERE AD_Field_ID=558805 AND AD_Language='en_US'
;
-- 2017-10-03T08:11:09.750
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-03 08:11:09','YYYY-MM-DD HH24:MI:SS'),Name='Customer Unit' WHERE AD_Field_ID=558806 AND AD_Language='en_US'
;
-- 2017-10-03T08:11:30.460
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-03 08:11:30','YYYY-MM-DD HH24:MI:SS'),Name='Status Customer Unit' WHERE AD_Field_ID=558807 AND AD_Language='en_US'
;
-- 2017-10-03T08:11:42.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-03 08:11:42','YYYY-MM-DD HH24:MI:SS'),Name='Status' WHERE AD_Field_ID=558804 AND AD_Language='en_US'
;
-- 2017-10-03T08:11:47.765
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Status',Updated=TO_TIMESTAMP('2017-10-03 08:11:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558804
;
-- 2017-10-03T08:12:04.850
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Datum/Zeit',Updated=TO_TIMESTAMP('2017-10-03 08:12:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558801
;
-- 2017-10-03T08:12:11.582
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-03 08:12:11','YYYY-MM-DD HH24:MI:SS'),Name='Date/Time' WHERE AD_Field_ID=558801 AND AD_Language='en_US'
;
-- 2017-10-03T08:12:26.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-03 08:12:26','YYYY-MM-DD HH24:MI:SS'),Name='Receipt/Shipment' WHERE AD_Field_ID=558798 AND AD_Language='en_US'
;
-- 2017-10-03T08:12:35.373
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-03 08:12:35','YYYY-MM-DD HH24:MI:SS'),Name='Movement' WHERE AD_Field_ID=558799 AND AD_Language='en_US'
;
-- 2017-10-03T08:12:53.641
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-03 08:12:53','YYYY-MM-DD HH24:MI:SS'),Name='Transaction Line HU' WHERE AD_Field_ID=558808 AND AD_Language='en_US'
;
-- 2017-10-03T08:15:02.915
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=-1.000000000000,Updated=TO_TIMESTAMP('2017-10-03 08:15:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=558801
; | the_stack |
-- 2017-10-08T15:17:40.814
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:17:40','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Shipment Candidates',Description='Maintain Shipment Candidates',WEBUI_NameBrowse='Shipment Candidates' WHERE AD_Menu_ID=540728 AND AD_Language='en_US'
;
-- 2017-10-08T15:19:46.427
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:19:46','YYYY-MM-DD HH24:MI:SS'),Name='Shipment Disposition',WEBUI_NameBrowse='Shipment Disposition' WHERE AD_Menu_ID=540728 AND AD_Language='en_US'
;
-- 2017-10-08T15:20:26.743
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:20:26','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Shipment Disposition' WHERE AD_Tab_ID=500221 AND AD_Language='en_US'
;
-- 2017-10-08T15:22:34.864
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Gelieferte Menge',Updated=TO_TIMESTAMP('2017-10-08 15:22:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=546827
;
-- 2017-10-08T15:23:11.808
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:23:11','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Packing Instruction override' WHERE AD_Field_ID=554350 AND AD_Language='en_US'
;
-- 2017-10-08T15:23:38.852
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Status Info',Updated=TO_TIMESTAMP('2017-10-08 15:23:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=501596
;
-- 2017-10-08T15:23:46.976
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:23:46','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Status Info' WHERE AD_Field_ID=501596 AND AD_Language='en_US'
;
-- 2017-10-08T15:25:03.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:25:03','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Customer Unit' WHERE AD_Field_ID=554952 AND AD_Language='en_US'
;
-- 2017-10-08T15:25:29.566
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:25:29','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=554346 AND AD_Language='en_US'
;
-- 2017-10-08T15:25:39.765
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:25:39','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=553763 AND AD_Language='en_US'
;
-- 2017-10-08T15:26:03.628
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:26:03','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Shipment Disposition' WHERE AD_Field_ID=553764 AND AD_Language='en_US'
;
-- 2017-10-08T15:26:20.508
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:26:20','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=553766 AND AD_Language='en_US'
;
-- 2017-10-08T15:26:56.631
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:26:56','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y',Name='Picked Qty' WHERE AD_Field_ID=553768 AND AD_Language='en_US'
;
-- 2017-10-08T15:27:13.889
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Kommisisonierte Menge',Updated=TO_TIMESTAMP('2017-10-08 15:27:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=553768
;
-- 2017-10-08T15:27:28.008
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET UpdatedBy=100,Updated=TO_TIMESTAMP('2017-10-08 15:27:28','YYYY-MM-DD HH24:MI:SS'),IsTranslated='Y' WHERE AD_Field_ID=554649 AND AD_Language='en_US'
;
-- 2017-10-08T15:29:26.706
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-10-08 15:29:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540020
;
-- 2017-10-08T15:45:48.144
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=2.000000000000,Updated=TO_TIMESTAMP('2017-10-08 15:45:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500227
;
-- 2017-10-08T15:46:26.075
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=-1.000000000000,Updated=TO_TIMESTAMP('2017-10-08 15:46:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500231
;
-- 2017-10-08T15:47:02.047
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500226
;
-- 2017-10-08T15:47:04.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500228
;
-- 2017-10-08T15:47:06.395
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500229
;
-- 2017-10-08T15:47:08.604
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500232
;
-- 2017-10-08T15:47:10.766
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500223
;
-- 2017-10-08T15:47:12.795
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556206
;
-- 2017-10-08T15:47:20.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555277
;
-- 2017-10-08T15:47:23.160
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=501597
;
-- 2017-10-08T15:47:25.278
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=547785
;
-- 2017-10-08T15:47:27.391
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=553949
;
-- 2017-10-08T15:47:29.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556128
;
-- 2017-10-08T15:47:31.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556129
;
-- 2017-10-08T15:47:33.917
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500234
;
-- 2017-10-08T15:47:35.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=550476
;
-- 2017-10-08T15:47:38.037
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=550477
;
-- 2017-10-08T15:47:40.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=547264
;
-- 2017-10-08T15:47:42.582
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555941
;
-- 2017-10-08T15:47:44.503
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500224
;
-- 2017-10-08T15:47:46.635
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500225
;
-- 2017-10-08T15:47:48.804
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500230
;
-- 2017-10-08T15:47:50.751
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=560386
;
-- 2017-10-08T15:47:52.877
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:47:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555864
;
-- 2017-10-08T15:48:03.751
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=546695
;
-- 2017-10-08T15:48:06.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=541240
;
-- 2017-10-08T15:48:08.371
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=66950
;
-- 2017-10-08T15:48:10.718
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=542497
;
-- 2017-10-08T15:48:18.517
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=542110
;
-- 2017-10-08T15:48:21.082
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=542111
;
-- 2017-10-08T15:48:23.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=547689
;
-- 2017-10-08T15:48:25.217
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=553948
;
-- 2017-10-08T15:48:27.386
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556127
;
-- 2017-10-08T15:48:29.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500238
;
-- 2017-10-08T15:48:31.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500239
;
-- 2017-10-08T15:48:34.637
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=542496
;
-- 2017-10-08T15:48:36.919
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=547784
;
-- 2017-10-08T15:48:39.127
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500221
;
-- 2017-10-08T15:48:41.308
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=554688
;
-- 2017-10-08T15:48:43.260
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500240
;
-- 2017-10-08T15:48:45.418
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500237
;
-- 2017-10-08T15:48:51.432
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=553029
;
-- 2017-10-08T15:48:53.378
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=553027
;
-- 2017-10-08T15:48:55.239
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=70267
;
-- 2017-10-08T15:48:58.994
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:48:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500235
;
-- 2017-10-08T15:49:01.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500236
;
-- 2017-10-08T15:49:03.617
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500233
;
-- 2017-10-08T15:49:05.764
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=555942
;
-- 2017-10-08T15:49:08.078
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=500222
;
-- 2017-10-08T15:49:10.017
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=501596
;
-- 2017-10-08T15:49:12.009
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=550490
;
-- 2017-10-08T15:49:14.246
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=553028
;
-- 2017-10-08T15:49:16.297
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=554689
;
-- 2017-10-08T15:49:26.246
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SortNo=NULL,Updated=TO_TIMESTAMP('2017-10-08 15:49:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=549449
; | the_stack |
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540725,540066,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','main',10,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540095,540066,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540096,540066,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540095,540135,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556657,0,540725,540135,541886,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Zugesagter Termin für diesen Auftrag','Der "Zugesagte Termin" gibt das Datum an, für den (wenn zutreffend) dieser Auftrag zugesagt wurde.','Y','N','Y','Y','N','Zugesagter Termin',10,10,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556650,0,540725,540135,541887,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Organisatorische Einheit des Mandanten','Eine Organisation ist ein Bereich ihres Mandanten - z.B. Laden oder Abteilung. Sie können Daten über Organisationen hinweg gemeinsam verwenden.','Y','N','Y','Y','N','Sektion',20,20,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556656,0,540725,540135,541888,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Lager oder Ort für Dienstleistung','Das Lager identifiziert ein einzelnes Lager für Artikel oder einen Standort an dem Dienstleistungen geboten werden.','Y','N','Y','Y','N','Lager',30,30,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556653,0,540725,540135,541889,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Bezeichnet einen Geschäftspartner','Ein Geschäftspartner ist jemand, mit dem Sie interagieren. Dies kann Lieferanten, Kunden, Mitarbeiter oder Handelsvertreter umfassen.','Y','N','Y','Y','N','Geschäftspartner',40,40,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556860,0,540725,540135,541890,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Abrechnungssatz',50,0,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556654,0,540725,540135,541891,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Produkt, Leistung, Artikel','Bezeichnet eine Einheit, die in dieser Organisation gekauft oder verkauft wird.','Y','N','Y','Y','N','Produkt',60,50,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556863,0,540725,540135,541892,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Instanz des Merkmals-Satzes zum Produkt','The values of the actual Product Attribute Instances. The product level attributes are defined on Product level.','Y','N','Y','Y','N','Ausprägung Merkmals-Satz',70,60,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556687,0,540725,540135,541893,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Maßeinheit','Eine eindeutige (nicht monetäre) Maßeinheit','Y','N','Y','Y','N','Maßeinheit',80,70,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,556689,0,540093,541891,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556920,0,540725,540135,541894,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Packvorschrift-Produkt Zuordnung abw.',90,80,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,557040,0,540725,540135,541895,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Vertrag','Y','N','Y','Y','N','V',100,90,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556858,0,540725,540135,541896,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Zusagbar (TU)',110,100,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556700,0,540725,540135,541897,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Zusagbar TU (diese Woche)',120,110,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556701,0,540725,540135,541898,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Zusagbar TU (nächste Woche)',130,120,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556798,0,540725,540135,541899,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Trend (in zwei Wochen)',140,130,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556857,0,540725,540135,541900,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Bestellte Menge (TU)','Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.','Y','N','Y','Y','N','Bestellte Menge (TU)',150,140,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556698,0,540725,540135,541901,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Bestellte Menge TU (this week)',160,150,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556699,0,540725,540135,541902,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Bestellte Menge TU (next week)',170,160,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556859,0,540725,540135,541903,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Quantity to Order (TU)',180,170,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556692,0,540725,540135,541904,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Preis','Bezeichnet den Preis für ein Produkt oder eine Dienstleistung.','Y','N','Y','Y','N','Preis',190,180,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556915,0,540725,540135,541905,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Preis abweichend',200,190,0,TO_TIMESTAMP('2017-02-28 16:11:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556695,0,540725,540135,541906,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100,'Die Währung für diesen Eintrag','Bezeichnet die auf Dokumenten oder Berichten verwendete Währung','Y','N','Y','Y','N','Währung',210,200,0,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556668,0,540725,540135,541907,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','Y','N','Process Now',220,210,0,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540726,540067,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','main',10,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540097,540067,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540097,540136,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556666,0,540726,540136,541908,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100,'Auftragsposition','"Auftragsposition" bezeichnet eine einzelne Position in einem Auftrag.','Y','N','N','Y','N','Auftragsposition',0,10,0,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556667,0,540726,540136,541909,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100,'Bestellte Menge','Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.','Y','N','N','Y','N','Bestellte Menge',0,20,0,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,Description,Help,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556861,0,540726,540136,541910,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100,'Bestellte Menge (TU)','Die "Bestellte Menge" bezeichnet die Menge einer Ware, die bestellt wurde.','Y','N','N','Y','N','Bestellte Menge (TU)',0,30,0,TO_TIMESTAMP('2017-02-28 16:11:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,540095,540137,TO_TIMESTAMP('2017-02-28 16:11:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2017-02-28 16:11:51','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:12
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='advanced edit', SeqNo=99, UIStyle='',Updated=TO_TIMESTAMP('2017-02-28 16:12:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540135
;
-- 28.02.2017 16:13
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556653,0,540725,540137,541911,TO_TIMESTAMP('2017-02-28 16:13:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Geschäftspartner',10,0,0,TO_TIMESTAMP('2017-02-28 16:13:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:13
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556654,0,540725,540137,541912,TO_TIMESTAMP('2017-02-28 16:13:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Produkt',20,0,0,TO_TIMESTAMP('2017-02-28 16:13:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:14
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556863,0,540725,540137,541913,TO_TIMESTAMP('2017-02-28 16:14:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Merkmale',30,0,0,TO_TIMESTAMP('2017-02-28 16:14:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:14
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556687,0,540725,540137,541914,TO_TIMESTAMP('2017-02-28 16:14:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mengeneinheit',40,0,0,TO_TIMESTAMP('2017-02-28 16:14:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:15
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementField (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_UI_ElementField_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,556689,0,540094,541912,TO_TIMESTAMP('2017-02-28 16:15:33','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-02-28 16:15:33','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:17
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556659,0,540725,540137,541915,TO_TIMESTAMP('2017-02-28 16:17:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellmenge',50,0,0,TO_TIMESTAMP('2017-02-28 16:17:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556859,0,540725,540137,541916,TO_TIMESTAMP('2017-02-28 16:18:02','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellmenge (TU)',60,0,0,TO_TIMESTAMP('2017-02-28 16:18:02','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-02-28 16:18:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541911
;
-- 28.02.2017 16:18
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540096,540138,TO_TIMESTAMP('2017-02-28 16:18:49','YYYY-MM-DD HH24:MI:SS'),100,'Y','preise',10,TO_TIMESTAMP('2017-02-28 16:18:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556692,0,540725,540138,541917,TO_TIMESTAMP('2017-02-28 16:19:05','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Preis',10,0,0,TO_TIMESTAMP('2017-02-28 16:19:05','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556915,0,540725,540138,541918,TO_TIMESTAMP('2017-02-28 16:19:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Preis abweichend',20,0,0,TO_TIMESTAMP('2017-02-28 16:19:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:19
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556695,0,540725,540138,541919,TO_TIMESTAMP('2017-02-28 16:19:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Währung',30,0,0,TO_TIMESTAMP('2017-02-28 16:19:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=20,Updated=TO_TIMESTAMP('2017-02-28 16:21:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540138
;
-- 28.02.2017 16:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540096,540139,TO_TIMESTAMP('2017-02-28 16:21:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','flags',10,TO_TIMESTAMP('2017-02-28 16:21:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556651,0,540725,540139,541920,TO_TIMESTAMP('2017-02-28 16:21:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Aktiv',10,0,0,TO_TIMESTAMP('2017-02-28 16:21:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556693,0,540725,540139,541921,TO_TIMESTAMP('2017-02-28 16:21:43','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Verarbeitet',20,0,0,TO_TIMESTAMP('2017-02-28 16:21:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540095,540140,TO_TIMESTAMP('2017-02-28 16:22:16','YYYY-MM-DD HH24:MI:SS'),100,'Y','zusagbar',20,TO_TIMESTAMP('2017-02-28 16:22:16','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556655,0,540725,540140,541922,TO_TIMESTAMP('2017-02-28 16:22:29','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zusagbar',10,0,0,TO_TIMESTAMP('2017-02-28 16:22:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556858,0,540725,540140,541923,TO_TIMESTAMP('2017-02-28 16:22:42','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zusagbar (TU)',20,0,0,TO_TIMESTAMP('2017-02-28 16:22:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556700,0,540725,540140,541924,TO_TIMESTAMP('2017-02-28 16:23:05','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zusagbar TU (diese Woche)',30,0,0,TO_TIMESTAMP('2017-02-28 16:23:05','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Zusagbar TU',Updated=TO_TIMESTAMP('2017-02-28 16:23:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541923
;
-- 28.02.2017 16:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556701,0,540725,540140,541925,TO_TIMESTAMP('2017-02-28 16:23:31','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zusagbar TU (nächste Woche)',40,0,0,TO_TIMESTAMP('2017-02-28 16:23:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:25
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540096,540141,TO_TIMESTAMP('2017-02-28 16:25:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','bestellt',30,TO_TIMESTAMP('2017-02-28 16:25:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:25
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556658,0,540725,540141,541926,TO_TIMESTAMP('2017-02-28 16:25:28','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellte Menge',10,0,0,TO_TIMESTAMP('2017-02-28 16:25:28','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:25
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556857,0,540725,540141,541927,TO_TIMESTAMP('2017-02-28 16:25:41','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellte Menge TU',20,0,0,TO_TIMESTAMP('2017-02-28 16:25:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:26
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556698,0,540725,540141,541928,TO_TIMESTAMP('2017-02-28 16:26:06','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellte Menge TU (diese Woche)',30,0,0,TO_TIMESTAMP('2017-02-28 16:26:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:26
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556699,0,540725,540141,541929,TO_TIMESTAMP('2017-02-28 16:26:27','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellte Menge TU (nächste Woche)',40,0,0,TO_TIMESTAMP('2017-02-28 16:26:27','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541889
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementField WHERE AD_UI_ElementField_ID=540093
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541891
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541892
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541893
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541896
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541897
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541898
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541900
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541901
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541902
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541903
;
-- 28.02.2017 16:27
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541904
;
-- 28.02.2017 16:28
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541906
;
-- 28.02.2017 16:39
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540725,540068,TO_TIMESTAMP('2017-02-28 16:39:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','secondary',20,TO_TIMESTAMP('2017-02-28 16:39:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:39
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540098,540068,TO_TIMESTAMP('2017-02-28 16:39:40','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-02-28 16:39:40','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:39
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540099,540068,TO_TIMESTAMP('2017-02-28 16:39:43','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2017-02-28 16:39:43','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:39
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540098,540142,TO_TIMESTAMP('2017-02-28 16:39:52','YYYY-MM-DD HH24:MI:SS'),100,'Y','zusagbar',10,TO_TIMESTAMP('2017-02-28 16:39:52','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:40
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556655,0,540725,540142,541930,TO_TIMESTAMP('2017-02-28 16:40:14','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zusagbar',10,0,0,TO_TIMESTAMP('2017-02-28 16:40:14','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:40
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556858,0,540725,540142,541931,TO_TIMESTAMP('2017-02-28 16:40:32','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zusagbar TU',20,0,0,TO_TIMESTAMP('2017-02-28 16:40:32','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:40
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556700,0,540725,540142,541932,TO_TIMESTAMP('2017-02-28 16:40:47','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zusagbar TU (diese Woche)',30,0,0,TO_TIMESTAMP('2017-02-28 16:40:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:41
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556701,0,540725,540142,541933,TO_TIMESTAMP('2017-02-28 16:41:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zusagbar TU (nächste Woche)',40,0,0,TO_TIMESTAMP('2017-02-28 16:41:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:41
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540099,540143,TO_TIMESTAMP('2017-02-28 16:41:26','YYYY-MM-DD HH24:MI:SS'),100,'Y','bestellt',10,TO_TIMESTAMP('2017-02-28 16:41:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:41
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556658,0,540725,540143,541934,TO_TIMESTAMP('2017-02-28 16:41:39','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellte Menge',10,0,0,TO_TIMESTAMP('2017-02-28 16:41:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:41
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556857,0,540725,540143,541935,TO_TIMESTAMP('2017-02-28 16:41:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellte Menge TU',20,0,0,TO_TIMESTAMP('2017-02-28 16:41:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:42
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556698,0,540725,540143,541936,TO_TIMESTAMP('2017-02-28 16:42:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellte Menge TU (diese Woche)',30,0,0,TO_TIMESTAMP('2017-02-28 16:42:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:42
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556699,0,540725,540143,541937,TO_TIMESTAMP('2017-02-28 16:42:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Bestellte Menge TU (nächste Woche)',40,0,0,TO_TIMESTAMP('2017-02-28 16:42:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:42
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541922
;
-- 28.02.2017 16:42
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541923
;
-- 28.02.2017 16:42
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541924
;
-- 28.02.2017 16:42
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541925
;
-- 28.02.2017 16:42
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540140
;
-- 28.02.2017 16:43
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541926
;
-- 28.02.2017 16:43
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541927
;
-- 28.02.2017 16:43
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541928
;
-- 28.02.2017 16:43
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541929
;
-- 28.02.2017 16:43
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540141
;
-- 28.02.2017 16:44
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556657,0,540725,540137,541938,TO_TIMESTAMP('2017-02-28 16:44:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zugesagter Termin',35,0,0,TO_TIMESTAMP('2017-02-28 16:44:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:45
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541886
;
-- 28.02.2017 16:45
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541905
;
-- 28.02.2017 16:46
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540096,540144,TO_TIMESTAMP('2017-02-28 16:46:08','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',30,TO_TIMESTAMP('2017-02-28 16:46:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:46
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556650,0,540725,540144,541939,TO_TIMESTAMP('2017-02-28 16:46:19','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',10,0,0,TO_TIMESTAMP('2017-02-28 16:46:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:46
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556656,0,540725,540144,541940,TO_TIMESTAMP('2017-02-28 16:46:34','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Lager',5,0,0,TO_TIMESTAMP('2017-02-28 16:46:34','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 16:46
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541887
;
-- 28.02.2017 16:46
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541888
;
-- 28.02.2017 16:47
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 16:47:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541890
;
-- 28.02.2017 16:47
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 16:47:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541894
;
-- 28.02.2017 16:47
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 16:47:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541895
;
-- 28.02.2017 16:47
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 16:47:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541899
;
-- 28.02.2017 16:47
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 16:47:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541907
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541907
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='N', SeqNoGrid=0,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541895
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=10,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541938
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=20,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541940
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=30,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541911
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541912
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541913
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541914
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541894
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541931
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541932
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541933
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541899
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541935
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541936
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541937
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=150,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541917
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=160,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541918
;
-- 28.02.2017 16:54
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=170,Updated=TO_TIMESTAMP('2017-02-28 16:54:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541919
;
-- 28.02.2017 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=10,Updated=TO_TIMESTAMP('2017-02-28 16:55:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541911
;
-- 28.02.2017 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=20,Updated=TO_TIMESTAMP('2017-02-28 16:55:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541912
;
-- 28.02.2017 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=30,Updated=TO_TIMESTAMP('2017-02-28 16:55:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541915
;
-- 28.02.2017 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=40,Updated=TO_TIMESTAMP('2017-02-28 16:55:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541914
;
-- 28.02.2017 16:55
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed_SideList='Y', SeqNo_SideList=50,Updated=TO_TIMESTAMP('2017-02-28 16:55:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541940
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556663,0,540726,540136,541941,TO_TIMESTAMP('2017-02-28 17:00:33','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Aktiv',10,0,0,TO_TIMESTAMP('2017-02-28 17:00:33','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,556662,0,540726,540136,541942,TO_TIMESTAMP('2017-02-28 17:00:50','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Sektion',20,0,0,TO_TIMESTAMP('2017-02-28 17:00:50','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2017-02-28 17:00:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541908
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2017-02-28 17:00:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541909
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayed='Y',Updated=TO_TIMESTAMP('2017-02-28 17:00:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541910
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 17:00:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541908
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 17:00:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541909
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 17:00:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541910
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 17:00:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541941
;
-- 28.02.2017 17:00
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2017-02-28 17:00:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541942
;
-- 28.02.2017 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-02-28 17:01:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541908
;
-- 28.02.2017 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-02-28 17:01:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541909
;
-- 28.02.2017 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-02-28 17:01:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541910
;
-- 28.02.2017 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-02-28 17:01:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541941
;
-- 28.02.2017 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-02-28 17:01:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541942
;
-- 28.02.2017 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=40,Updated=TO_TIMESTAMP('2017-02-28 17:01:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541941
;
-- 28.02.2017 17:01
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=50,Updated=TO_TIMESTAMP('2017-02-28 17:01:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541942
;
-- 28.02.2017 17:02
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='N',Updated=TO_TIMESTAMP('2017-02-28 17:02:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541909
;
-- 28.02.2017 17:02
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='N',Updated=TO_TIMESTAMP('2017-02-28 17:02:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541910
;
-- 28.02.2017 17:02
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='N',Updated=TO_TIMESTAMP('2017-02-28 17:02:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541908
;
-- 28.02.2017 17:02
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='N',Updated=TO_TIMESTAMP('2017-02-28 17:02:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541941
;
-- 28.02.2017 17:02
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsAdvancedField='N',Updated=TO_TIMESTAMP('2017-02-28 17:02:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541942
; | the_stack |
-- 2019-03-08T18:09:49.135
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Trl WHERE AD_Process_ID=53065
;
-- 2019-03-08T18:09:49.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process WHERE AD_Process_ID=53065
;
-- 2019-03-08T18:09:59.724
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process_Trl WHERE AD_Process_ID=53067
;
-- 2019-03-08T18:09:59.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Process WHERE AD_Process_ID=53067
;
-- 2019-03-08T18:16:33.784
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54286
;
-- 2019-03-08T18:16:33.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54286
;
-- 2019-03-08T18:16:33.787
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608485
;
-- 2019-03-08T18:16:41.226
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54287
;
-- 2019-03-08T18:16:41.227
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54287
;
-- 2019-03-08T18:16:41.233
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608486
;
-- 2019-03-08T18:16:41.278
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54288
;
-- 2019-03-08T18:16:41.279
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54288
;
-- 2019-03-08T18:16:41.282
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608487
;
-- 2019-03-08T18:16:41.323
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54289
;
-- 2019-03-08T18:16:41.324
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54289
;
-- 2019-03-08T18:16:41.328
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608488
;
-- 2019-03-08T18:16:41.370
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54290
;
-- 2019-03-08T18:16:41.371
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54290
;
-- 2019-03-08T18:16:41.375
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608489
;
-- 2019-03-08T18:16:41.410
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54291
;
-- 2019-03-08T18:16:41.411
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54291
;
-- 2019-03-08T18:16:41.414
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608490
;
-- 2019-03-08T18:16:41.452
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56617
;
-- 2019-03-08T18:16:41.453
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56617
;
-- 2019-03-08T18:16:41.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610424
;
-- 2019-03-08T18:31:04.345
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Menu_Trl WHERE AD_Menu_ID=53083
;
-- 2019-03-08T18:31:04.347
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Menu WHERE AD_Menu_ID=53083
;
-- 2019-03-08T18:31:04.350
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_TreeNodeMM n WHERE Node_ID=53083 AND EXISTS (SELECT * FROM AD_Tree t WHERE t.AD_Tree_ID=n.AD_Tree_ID AND t.AD_Table_ID=116)
;
-- 2019-03-08T18:31:46.893
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624254
;
-- 2019-03-08T18:31:46.905
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54292
;
-- 2019-03-08T18:31:46.907
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54292
;
-- 2019-03-08T18:31:46.913
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608491
;
-- 2019-03-08T18:31:46.921
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54293
;
-- 2019-03-08T18:31:46.924
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54293
;
-- 2019-03-08T18:31:46.930
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608492
;
-- 2019-03-08T18:31:46.943
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54295
;
-- 2019-03-08T18:31:46.946
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54295
;
-- 2019-03-08T18:31:46.957
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608494
;
-- 2019-03-08T18:31:46.969
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54299
;
-- 2019-03-08T18:31:46.972
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54299
;
-- 2019-03-08T18:31:46.977
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608498
;
-- 2019-03-08T18:31:46.983
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54294
;
-- 2019-03-08T18:31:46.986
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54294
;
-- 2019-03-08T18:31:46.990
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608493
;
-- 2019-03-08T18:31:46.996
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54298
;
-- 2019-03-08T18:31:46.997
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54298
;
-- 2019-03-08T18:31:47.002
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608497
;
-- 2019-03-08T18:31:47.005
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54297
;
-- 2019-03-08T18:31:47.007
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54297
;
-- 2019-03-08T18:31:47.010
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608496
;
-- 2019-03-08T18:31:47.014
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54296
;
-- 2019-03-08T18:31:47.015
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54296
;
-- 2019-03-08T18:31:47.018
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608495
;
-- 2019-03-08T18:31:47.021
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53064
;
-- 2019-03-08T18:31:47.024
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53064
;
-- 2019-03-08T18:31:47.034
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624255
;
-- 2019-03-08T18:31:47.039
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54308
;
-- 2019-03-08T18:31:47.040
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54308
;
-- 2019-03-08T18:31:47.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608507
;
-- 2019-03-08T18:31:47.047
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54300
;
-- 2019-03-08T18:31:47.048
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54300
;
-- 2019-03-08T18:31:47.050
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608499
;
-- 2019-03-08T18:31:47.054
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54301
;
-- 2019-03-08T18:31:47.055
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54301
;
-- 2019-03-08T18:31:47.057
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608500
;
-- 2019-03-08T18:31:47.060
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54309
;
-- 2019-03-08T18:31:47.061
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54309
;
-- 2019-03-08T18:31:47.063
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608508
;
-- 2019-03-08T18:31:47.067
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54302
;
-- 2019-03-08T18:31:47.068
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54302
;
-- 2019-03-08T18:31:47.071
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608501
;
-- 2019-03-08T18:31:47.074
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54304
;
-- 2019-03-08T18:31:47.075
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54304
;
-- 2019-03-08T18:31:47.077
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608503
;
-- 2019-03-08T18:31:47.081
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54303
;
-- 2019-03-08T18:31:47.083
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54303
;
-- 2019-03-08T18:31:47.087
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608502
;
-- 2019-03-08T18:31:47.091
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54307
;
-- 2019-03-08T18:31:47.092
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54307
;
-- 2019-03-08T18:31:47.095
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608506
;
-- 2019-03-08T18:31:47.099
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54306
;
-- 2019-03-08T18:31:47.100
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54306
;
-- 2019-03-08T18:31:47.103
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608505
;
-- 2019-03-08T18:31:47.108
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54305
;
-- 2019-03-08T18:31:47.109
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54305
;
-- 2019-03-08T18:31:47.112
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608504
;
-- 2019-03-08T18:31:47.113
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53065
;
-- 2019-03-08T18:31:47.115
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53065
;
-- 2019-03-08T18:31:47.124
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624246
;
-- 2019-03-08T18:31:47.130
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54243
;
-- 2019-03-08T18:31:47.131
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54243
;
-- 2019-03-08T18:31:47.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608448
;
-- 2019-03-08T18:31:47.139
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56607
;
-- 2019-03-08T18:31:47.140
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56607
;
-- 2019-03-08T18:31:47.143
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610414
;
-- 2019-03-08T18:31:47.149
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54239
;
-- 2019-03-08T18:31:47.150
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54239
;
-- 2019-03-08T18:31:47.154
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608444
;
-- 2019-03-08T18:31:47.159
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54242
;
-- 2019-03-08T18:31:47.160
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54242
;
-- 2019-03-08T18:31:47.163
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608447
;
-- 2019-03-08T18:31:47.168
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54244
;
-- 2019-03-08T18:31:47.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54244
;
-- 2019-03-08T18:31:47.172
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608449
;
-- 2019-03-08T18:31:47.177
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54240
;
-- 2019-03-08T18:31:47.179
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54240
;
-- 2019-03-08T18:31:47.182
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608445
;
-- 2019-03-08T18:31:47.186
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54241
;
-- 2019-03-08T18:31:47.187
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54241
;
-- 2019-03-08T18:31:47.191
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608446
;
-- 2019-03-08T18:31:47.193
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53056
;
-- 2019-03-08T18:31:47.194
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53056
;
-- 2019-03-08T18:31:47.202
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624247
;
-- 2019-03-08T18:31:47.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56608
;
-- 2019-03-08T18:31:47.210
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56608
;
-- 2019-03-08T18:31:47.213
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610415
;
-- 2019-03-08T18:31:47.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54245
;
-- 2019-03-08T18:31:47.220
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54245
;
-- 2019-03-08T18:31:47.224
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608450
;
-- 2019-03-08T18:31:47.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54249
;
-- 2019-03-08T18:31:47.232
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54249
;
-- 2019-03-08T18:31:47.235
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608452
;
-- 2019-03-08T18:31:47.240
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54250
;
-- 2019-03-08T18:31:47.241
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54250
;
-- 2019-03-08T18:31:47.244
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608453
;
-- 2019-03-08T18:31:47.250
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54251
;
-- 2019-03-08T18:31:47.251
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54251
;
-- 2019-03-08T18:31:47.256
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608454
;
-- 2019-03-08T18:31:47.261
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54252
;
-- 2019-03-08T18:31:47.263
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54252
;
-- 2019-03-08T18:31:47.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608455
;
-- 2019-03-08T18:31:47.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54253
;
-- 2019-03-08T18:31:47.275
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54253
;
-- 2019-03-08T18:31:47.279
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608456
;
-- 2019-03-08T18:31:47.284
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54246
;
-- 2019-03-08T18:31:47.286
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54246
;
-- 2019-03-08T18:31:47.290
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608451
;
-- 2019-03-08T18:31:47.297
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56609
;
-- 2019-03-08T18:31:47.298
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56609
;
-- 2019-03-08T18:31:47.303
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610416
;
-- 2019-03-08T18:31:47.304
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53057
;
-- 2019-03-08T18:31:47.307
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53057
;
-- 2019-03-08T18:31:47.317
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624248
;
-- 2019-03-08T18:31:47.325
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56611
;
-- 2019-03-08T18:31:47.326
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56611
;
-- 2019-03-08T18:31:47.330
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610418
;
-- 2019-03-08T18:31:47.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56610
;
-- 2019-03-08T18:31:47.337
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56610
;
-- 2019-03-08T18:31:47.339
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610417
;
-- 2019-03-08T18:31:47.345
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54254
;
-- 2019-03-08T18:31:47.346
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54254
;
-- 2019-03-08T18:31:47.349
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608457
;
-- 2019-03-08T18:31:47.354
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54259
;
-- 2019-03-08T18:31:47.356
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54259
;
-- 2019-03-08T18:31:47.360
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608460
;
-- 2019-03-08T18:31:47.367
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54258
;
-- 2019-03-08T18:31:47.369
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54258
;
-- 2019-03-08T18:31:47.373
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608459
;
-- 2019-03-08T18:31:47.377
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54260
;
-- 2019-03-08T18:31:47.378
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54260
;
-- 2019-03-08T18:31:47.383
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608461
;
-- 2019-03-08T18:31:47.389
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54255
;
-- 2019-03-08T18:31:47.391
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54255
;
-- 2019-03-08T18:31:47.395
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608458
;
-- 2019-03-08T18:31:47.397
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53058
;
-- 2019-03-08T18:31:47.398
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53058
;
-- 2019-03-08T18:31:47.409
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624249
;
-- 2019-03-08T18:31:47.416
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56612
;
-- 2019-03-08T18:31:47.417
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56612
;
-- 2019-03-08T18:31:47.421
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610419
;
-- 2019-03-08T18:31:47.426
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54261
;
-- 2019-03-08T18:31:47.428
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54261
;
-- 2019-03-08T18:31:47.430
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608462
;
-- 2019-03-08T18:31:47.436
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54264
;
-- 2019-03-08T18:31:47.437
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54264
;
-- 2019-03-08T18:31:47.441
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608465
;
-- 2019-03-08T18:31:47.446
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54265
;
-- 2019-03-08T18:31:47.448
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54265
;
-- 2019-03-08T18:31:47.451
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608466
;
-- 2019-03-08T18:31:47.456
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54266
;
-- 2019-03-08T18:31:47.458
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54266
;
-- 2019-03-08T18:31:47.461
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608467
;
-- 2019-03-08T18:31:47.467
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54262
;
-- 2019-03-08T18:31:47.468
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54262
;
-- 2019-03-08T18:31:47.471
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608463
;
-- 2019-03-08T18:31:47.477
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54263
;
-- 2019-03-08T18:31:47.478
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54263
;
-- 2019-03-08T18:31:47.482
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608464
;
-- 2019-03-08T18:31:47.483
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53059
;
-- 2019-03-08T18:31:47.485
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53059
;
-- 2019-03-08T18:31:47.495
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624250
;
-- 2019-03-08T18:31:47.502
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56614
;
-- 2019-03-08T18:31:47.503
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56614
;
-- 2019-03-08T18:31:47.507
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610421
;
-- 2019-03-08T18:31:47.511
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54267
;
-- 2019-03-08T18:31:47.513
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54267
;
-- 2019-03-08T18:31:47.516
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608468
;
-- 2019-03-08T18:31:47.521
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54272
;
-- 2019-03-08T18:31:47.522
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54272
;
-- 2019-03-08T18:31:47.526
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608471
;
-- 2019-03-08T18:31:47.530
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54271
;
-- 2019-03-08T18:31:47.531
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54271
;
-- 2019-03-08T18:31:47.534
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608470
;
-- 2019-03-08T18:31:47.539
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54273
;
-- 2019-03-08T18:31:47.540
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54273
;
-- 2019-03-08T18:31:47.544
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608472
;
-- 2019-03-08T18:31:47.549
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54268
;
-- 2019-03-08T18:31:47.550
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54268
;
-- 2019-03-08T18:31:47.553
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608469
;
-- 2019-03-08T18:31:47.558
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56613
;
-- 2019-03-08T18:31:47.559
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56613
;
-- 2019-03-08T18:31:47.562
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610420
;
-- 2019-03-08T18:31:47.563
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53060
;
-- 2019-03-08T18:31:47.565
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53060
;
-- 2019-03-08T18:31:47.571
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624251
;
-- 2019-03-08T18:31:47.579
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56615
;
-- 2019-03-08T18:31:47.581
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56615
;
-- 2019-03-08T18:31:47.584
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610422
;
-- 2019-03-08T18:31:47.589
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54274
;
-- 2019-03-08T18:31:47.590
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54274
;
-- 2019-03-08T18:31:47.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608473
;
-- 2019-03-08T18:31:47.598
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54277
;
-- 2019-03-08T18:31:47.599
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54277
;
-- 2019-03-08T18:31:47.602
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608476
;
-- 2019-03-08T18:31:47.607
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54278
;
-- 2019-03-08T18:31:47.608
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54278
;
-- 2019-03-08T18:31:47.612
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608477
;
-- 2019-03-08T18:31:47.618
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54279
;
-- 2019-03-08T18:31:47.619
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54279
;
-- 2019-03-08T18:31:47.625
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608478
;
-- 2019-03-08T18:31:47.631
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54275
;
-- 2019-03-08T18:31:47.632
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54275
;
-- 2019-03-08T18:31:47.635
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608474
;
-- 2019-03-08T18:31:47.640
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54276
;
-- 2019-03-08T18:31:47.641
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54276
;
-- 2019-03-08T18:31:47.646
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608475
;
-- 2019-03-08T18:31:47.647
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53061
;
-- 2019-03-08T18:31:47.648
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53061
;
-- 2019-03-08T18:31:47.658
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624252
;
-- 2019-03-08T18:31:47.666
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=56616
;
-- 2019-03-08T18:31:47.667
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=56616
;
-- 2019-03-08T18:31:47.670
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=610423
;
-- 2019-03-08T18:31:47.675
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54284
;
-- 2019-03-08T18:31:47.676
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54284
;
-- 2019-03-08T18:31:47.678
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608483
;
-- 2019-03-08T18:31:47.682
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54280
;
-- 2019-03-08T18:31:47.683
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54280
;
-- 2019-03-08T18:31:47.686
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608479
;
-- 2019-03-08T18:31:47.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54285
;
-- 2019-03-08T18:31:47.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54285
;
-- 2019-03-08T18:31:47.696
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608484
;
-- 2019-03-08T18:31:47.700
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54281
;
-- 2019-03-08T18:31:47.702
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54281
;
-- 2019-03-08T18:31:47.705
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608480
;
-- 2019-03-08T18:31:47.710
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54282
;
-- 2019-03-08T18:31:47.712
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54282
;
-- 2019-03-08T18:31:47.715
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608481
;
-- 2019-03-08T18:31:47.720
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54283
;
-- 2019-03-08T18:31:47.721
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54283
;
-- 2019-03-08T18:31:47.723
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608482
;
-- 2019-03-08T18:31:47.725
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53062
;
-- 2019-03-08T18:31:47.726
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53062
;
-- 2019-03-08T18:31:47.733
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624253
;
-- 2019-03-08T18:31:47.735
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53063
;
-- 2019-03-08T18:31:47.735
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53063
;
DELETE FROM AD_Element_Link WHERE AD_Window_ID=53015;
-- 2019-03-08T18:31:47.740
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Window_Trl WHERE AD_Window_ID=53015
;
-- 2019-03-08T18:31:47.742
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Window WHERE AD_Window_ID=53015
;
-- 2019-03-08T18:32:28.613
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Menu_Trl WHERE AD_Menu_ID=53084
;
-- 2019-03-08T18:32:28.615
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Menu WHERE AD_Menu_ID=53084
;
-- 2019-03-08T18:32:28.617
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_TreeNodeMM n WHERE Node_ID=53084 AND EXISTS (SELECT * FROM AD_Tree t WHERE t.AD_Tree_ID=n.AD_Tree_ID AND t.AD_Table_ID=116)
;
-- 2019-03-08T18:32:56.102
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624256
;
-- 2019-03-08T18:32:56.123
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54310
;
-- 2019-03-08T18:32:56.127
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54310
;
-- 2019-03-08T18:32:56.133
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608509
;
-- 2019-03-08T18:32:56.139
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54311
;
-- 2019-03-08T18:32:56.141
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54311
;
-- 2019-03-08T18:32:56.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608510
;
-- 2019-03-08T18:32:56.151
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54313
;
-- 2019-03-08T18:32:56.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54313
;
-- 2019-03-08T18:32:56.157
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608512
;
-- 2019-03-08T18:32:56.164
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54314
;
-- 2019-03-08T18:32:56.166
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54314
;
-- 2019-03-08T18:32:56.169
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608513
;
-- 2019-03-08T18:32:56.177
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54316
;
-- 2019-03-08T18:32:56.179
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54316
;
-- 2019-03-08T18:32:56.183
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608515
;
-- 2019-03-08T18:32:56.188
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54312
;
-- 2019-03-08T18:32:56.189
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54312
;
-- 2019-03-08T18:32:56.192
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608511
;
-- 2019-03-08T18:32:56.197
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54315
;
-- 2019-03-08T18:32:56.199
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54315
;
-- 2019-03-08T18:32:56.203
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608514
;
-- 2019-03-08T18:32:56.206
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53066
;
-- 2019-03-08T18:32:56.208
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53066
;
-- 2019-03-08T18:32:56.220
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=624257
;
-- 2019-03-08T18:32:56.229
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54322
;
-- 2019-03-08T18:32:56.230
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54322
;
-- 2019-03-08T18:32:56.235
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608521
;
-- 2019-03-08T18:32:56.240
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54324
;
-- 2019-03-08T18:32:56.241
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54324
;
-- 2019-03-08T18:32:56.246
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608523
;
-- 2019-03-08T18:32:56.250
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54325
;
-- 2019-03-08T18:32:56.252
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54325
;
-- 2019-03-08T18:32:56.255
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608524
;
-- 2019-03-08T18:32:56.262
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54317
;
-- 2019-03-08T18:32:56.264
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54317
;
-- 2019-03-08T18:32:56.267
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608516
;
-- 2019-03-08T18:32:56.271
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54318
;
-- 2019-03-08T18:32:56.272
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54318
;
-- 2019-03-08T18:32:56.274
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608517
;
-- 2019-03-08T18:32:56.278
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54320
;
-- 2019-03-08T18:32:56.280
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54320
;
-- 2019-03-08T18:32:56.283
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608519
;
-- 2019-03-08T18:32:56.288
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54321
;
-- 2019-03-08T18:32:56.289
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54321
;
-- 2019-03-08T18:32:56.291
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608520
;
-- 2019-03-08T18:32:56.295
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54323
;
-- 2019-03-08T18:32:56.296
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54323
;
-- 2019-03-08T18:32:56.298
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608522
;
-- 2019-03-08T18:32:56.302
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54327
;
-- 2019-03-08T18:32:56.303
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54327
;
-- 2019-03-08T18:32:56.306
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608526
;
-- 2019-03-08T18:32:56.310
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54328
;
-- 2019-03-08T18:32:56.311
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54328
;
-- 2019-03-08T18:32:56.314
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608527
;
-- 2019-03-08T18:32:56.317
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54329
;
-- 2019-03-08T18:32:56.318
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54329
;
-- 2019-03-08T18:32:56.321
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608528
;
-- 2019-03-08T18:32:56.326
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54319
;
-- 2019-03-08T18:32:56.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54319
;
-- 2019-03-08T18:32:56.329
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608518
;
-- 2019-03-08T18:32:56.334
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field_Trl WHERE AD_Field_ID=54326
;
-- 2019-03-08T18:32:56.335
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Field WHERE AD_Field_ID=54326
;
-- 2019-03-08T18:32:56.337
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Element_Link_ID=608525
;
-- 2019-03-08T18:32:56.338
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab_Trl WHERE AD_Tab_ID=53067
;
-- 2019-03-08T18:32:56.339
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Tab WHERE AD_Tab_ID=53067
;
DELETE FROM AD_Element_Link WHERE AD_Window_ID=53016;
-- 2019-03-08T18:32:56.343
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Window_Trl WHERE AD_Window_ID=53016
;
-- 2019-03-08T18:32:56.344
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Window WHERE AD_Window_ID=53016
;
-- 2019-03-08T18:33:50.407
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53057
;
-- 2019-03-08T18:33:50.409
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53057
;
-- 2019-03-08T18:34:01.385
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53056
;
-- 2019-03-08T18:34:01.391
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53056
;
-- 2019-03-08T18:34:01.524
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53048
;
-- 2019-03-08T18:34:01.527
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53048
;
-- 2019-03-08T18:34:01.593
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53051
;
-- 2019-03-08T18:34:01.594
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53051
;
-- 2019-03-08T18:34:01.661
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53055
;
-- 2019-03-08T18:34:01.663
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53055
;
-- 2019-03-08T18:34:01.732
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53054
;
-- 2019-03-08T18:34:01.733
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53054
;
-- 2019-03-08T18:34:01.794
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53049
;
-- 2019-03-08T18:34:01.795
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53049
;
-- 2019-03-08T18:34:01.856
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53050
;
-- 2019-03-08T18:34:01.857
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53050
;
-- 2019-03-08T18:34:01.918
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53047
;
-- 2019-03-08T18:34:01.919
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53047
;
-- 2019-03-08T18:34:01.978
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53052
;
-- 2019-03-08T18:34:01.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53052
;
-- 2019-03-08T18:34:02.039
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53046
;
-- 2019-03-08T18:34:02.039
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53046
;
-- 2019-03-08T18:34:02.093
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table_Trl WHERE AD_Table_ID=53053
;
-- 2019-03-08T18:34:02.094
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Table WHERE AD_Table_ID=53053
;
delete from AD_Sequence
where IsTableId='Y'
and Name in (
'ASP_Window',
'ASP_Tab',
'ASP_Field',
'ASP_Process',
'ASP_Process_Para',
'ASP_Form',
'ASP_Task',
'ASP_Workflow',
'ASP_Module',
'ASP_Level',
'ASP_ClientLevel',
'ASP_ClientException'
);
-- 2019-03-08T18:37:50.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53331
;
-- 2019-03-08T18:37:50.875
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53331
;
-- 2019-03-08T18:37:50.912
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53330
;
-- 2019-03-08T18:37:50.915
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53330
;
-- 2019-03-08T18:37:50.937
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53752
;
-- 2019-03-08T18:37:50.941
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53752
;
-- 2019-03-08T18:37:50.956
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53755
;
-- 2019-03-08T18:37:50.960
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53755
;
-- 2019-03-08T18:37:50.977
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53326
;
-- 2019-03-08T18:37:50.980
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53326
;
-- 2019-03-08T18:37:51
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53329
;
-- 2019-03-08T18:37:51.003
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53329
;
-- 2019-03-08T18:37:51.019
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53753
;
-- 2019-03-08T18:37:51.022
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53753
;
-- 2019-03-08T18:37:51.044
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53754
;
-- 2019-03-08T18:37:51.046
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53754
;
-- 2019-03-08T18:37:51.066
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53327
;
-- 2019-03-08T18:37:51.068
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53327
;
-- 2019-03-08T18:37:51.090
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53751
;
-- 2019-03-08T18:37:51.092
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53751
;
-- 2019-03-08T18:37:51.112
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53756
;
-- 2019-03-08T18:37:51.113
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53756
;
-- 2019-03-08T18:37:51.131
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53750
;
-- 2019-03-08T18:37:51.134
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53750
;
-- 2019-03-08T18:37:51.170
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Trl WHERE AD_Element_ID=53757
;
-- 2019-03-08T18:37:51.172
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element WHERE AD_Element_ID=53757
;
-- 2019-03-08T18:38:17.027
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Reference_Trl WHERE AD_Reference_ID=53234
;
-- 2019-03-08T18:38:17.029
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Reference WHERE AD_Reference_ID=53234
;
-- 2019-03-08T18:40:04.857
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Val_Rule WHERE AD_Val_Rule_ID=52007
; | the_stack |
USE [msdb]
GO
IF EXISTS(SELECT [object_id] FROM sys.views WHERE [name] = 'vw_MaintenanceLog')
BEGIN
DROP VIEW vw_MaintenanceLog;
PRINT 'View vw_MaintenanceLog dropped'
END
GO
CREATE VIEW vw_MaintenanceLog AS
SELECT [name]
,[step_name]
,(SELECT REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
[log],
NCHAR(1),N'?'),NCHAR(2),N'?'),NCHAR(3),N'?'),NCHAR(4),N'?'),NCHAR(5),N'?'),NCHAR(6),N'?'),NCHAR(7),N'?'),NCHAR(8),N'?'),NCHAR(11),N'?'),NCHAR(12),N'?'),NCHAR(14),N'?'),NCHAR(15),N'?'),NCHAR(16),N'?'),NCHAR(17),N'?'),NCHAR(18),N'?'),NCHAR(19),N'?'),NCHAR(20),N'?'),NCHAR(21),N'?'),NCHAR(22),N'?'),NCHAR(23),N'?'),NCHAR(24),N'?'),NCHAR(25),N'?'),NCHAR(26),N'?'),NCHAR(27),N'?'),NCHAR(28),N'?'),NCHAR(29),N'?'),NCHAR(30),N'?'),NCHAR(31),N'?')
AS [text()] FROM [msdb].[dbo].[sysjobstepslogs] sjsl2 WHERE sjsl2.log_id = sjsl.log_id FOR XML PATH(''), TYPE) AS 'Log'
,sjsl.[date_created]
,sjsl.[date_modified]
,([log_size]/1024) AS [log_size_kb]
FROM [msdb].[dbo].[sysjobstepslogs] sjsl
INNER JOIN [msdb].[dbo].[sysjobsteps] sjs ON sjs.[step_uid] = sjsl.[step_uid]
INNER JOIN [msdb].[dbo].[sysjobs] sj ON sj.[job_id] = sjs.[job_id]
WHERE [name] = 'Weekly Maintenance';
GO
PRINT 'View vw_MaintenanceLog view created';
GO
IF OBJECTPROPERTY(OBJECT_ID('dbo.usp_CheckIntegrity'), N'IsProcedure') = 1
BEGIN
DROP PROCEDURE dbo.usp_CheckIntegrity;
PRINT 'Procedure usp_CheckIntegrity dropped'
END
GO
CREATE PROCEDURE usp_CheckIntegrity @VLDBMode bit = 1, @SingleUser bit = 0, @CreateSnap bit = 1, @SnapPath NVARCHAR(1000) = NULL, @AO_Secondary bit = 0, @Physical bit = 0
AS
/*
This checks the logical and physical integrity of all the objects in the specified database by performing the following operations:
|-For VLDBs (larger than 1TB):
|- On Fridays, if VLDB Mode = 0, runs DBCC CHECKALLOC.
|- On Fridays, runs DBCC CHECKCATALOG.
|- Everyday, if VLDB Mode = 0, runs DBCC CHECKTABLE or if VLDB Mode = 1, DBCC CHECKFILEGROUP on a subset of tables and views, divided by daily buckets.
|-For DBs smaller than 1TB:
|- Every Friday a DBCC CHECKDB checks the logical and physical integrity of all the objects in the specified database.
To set how VLDBs are handled, set @VLDBMode to 0 = Bucket by Table Size or 1 = Bucket by Filegroup Size
Buckets are built weekly, on Friday.
IMPORTANT: Consider running DBCC CHECKDB routinely (at least, weekly). On large databases and for more frequent checks, consider using the PHYSICAL_ONLY parameter.
http://msdn.microsoft.com/en-us/library/ms176064.aspx
http://blogs.msdn.com/b/sqlserverstorageengine/archive/2006/10/20/consistency-checking-options-for-a-vldb.aspx
Excludes all Offline and Read-Only DBs, and works on databases over 1TB
If a database has Read-Only filegroups, any integrity check will fail if there are other open connections to the database.
Setting @CreateSnap = 1 will create a database snapshot before running the check on the snapshot, and drop it at the end (default).
Setting @CreateSnap = 0 means the integrity check might fail if there are other open connection on the database.
Note: set a custom snapshot creation path in @SnapPath or the same path as the database in scope will be used.
Ex.: @SnapPath = 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data'
If snapshots are not allowed and a database has Read-Only filegroups, any integrity check will fail if there are other openned connections to the database.
Setting @SingleUser = 1 will set the database in single user mode before running the check, and to multi user afterwards.
Setting @SingleUser = 0 means the integrity check might fail if there are other open connection on the database.
If on SQL Server 2012 or above and you are using Availability Replicas:
Setting @AO_Secondary = 0 then AlwaysOn primary replicas are eligible for Integrity Checks, but secondary replicas are skipped.
Setting @AO_Secondary = 1 then AlwaysOn secondary replicas are eligible for Integrity Checks, but primary replicas are skipped.
If more frequent checks are required, consider using the PHYSICAL_ONLY parameter:
Setting @Physical = 0 does not consider PHYSICAL_ONLY option.
Setting @Physical = 1 enables PHYSICAL_ONLY option (where available).
*/
SET NOCOUNT ON;
IF @VLDBMode NOT IN (0,1)
BEGIN
RAISERROR('[ERROR: Must set a integrity check strategy for any VLDBs we encounter - 0 = Bucket by Table Size; 1 = Bucket by Filegroup Size]', 16, 1, N'VLDB')
RETURN
END
IF @CreateSnap = 1 AND @SingleUser = 1
BEGIN
RAISERROR('[ERROR: Must select only one method of checking databases with Read-Only FGs]', 16, 1, N'ReadOnlyFGs')
RETURN
END
DECLARE @dbid int, @dbname sysname, @sqlcmdROFG NVARCHAR(1000), @sqlcmd NVARCHAR(max), @sqlcmd_Create NVARCHAR(max), @sqlcmd_Drop NVARCHAR(500)
DECLARE @msg NVARCHAR(500), @params NVARCHAR(500), @sqlcmd_AO NVARCHAR(4000);
DECLARE @filename sysname, @filecreateid int, @Message VARCHAR(1000);
DECLARE @Buckets tinyint, @BucketCnt tinyint, @BucketPages bigint, @TodayBucket tinyint, @dbsize bigint, @fg_id int, @HasROFG bigint, @sqlsnapcmd NVARCHAR(max);
DECLARE @BucketId tinyint, @object_id int, @name sysname, @schema sysname, @type CHAR(2), @type_desc NVARCHAR(60), @used_page_count bigint;
DECLARE @sqlmajorver int, @ErrorMessage NVARCHAR(4000)
IF NOT EXISTS(SELECT [object_id] FROM sys.tables WHERE [name] = 'tblDbBuckets')
CREATE TABLE tblDbBuckets (BucketId int, [database_id] int, [object_id] int, [name] sysname, [schema] sysname, [type] CHAR(2), type_desc NVARCHAR(60), used_page_count bigint, isdone bit);
IF NOT EXISTS(SELECT [object_id] FROM sys.tables WHERE [name] = 'tblFgBuckets')
CREATE TABLE tblFgBuckets (BucketId int, [database_id] int, [data_space_id] int, [name] sysname, used_page_count bigint, isdone bit);
IF NOT EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tmpdbs'))
CREATE TABLE #tmpdbs (id int IDENTITY(1,1), [dbid] int, [dbname] sysname, rows_size_MB bigint, isdone bit)
IF NOT EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblBuckets'))
CREATE TABLE #tblBuckets (BucketId int, MaxAmount bigint, CurrentRunTotal bigint)
IF NOT EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblObj'))
CREATE TABLE #tblObj ([object_id] int, [name] sysname, [schema] sysname, [type] CHAR(2), type_desc NVARCHAR(60), used_page_count bigint, isdone bit)
IF NOT EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblFGs'))
CREATE TABLE #tblFGs ([data_space_id] int, [name] sysname, used_page_count bigint, isdone bit)
IF NOT EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblSnapFiles'))
CREATE TABLE #tblSnapFiles ([name] sysname, isdone bit)
SELECT @sqlmajorver = CONVERT(int, (@@microsoftversion / 0x1000000) & 0xff);
SELECT @Message = '** Start: ' + CONVERT(VARCHAR, GETDATE())
RAISERROR(@Message, 0, 42) WITH NOWAIT;
SET @sqlcmd_AO = 'SELECT sd.database_id, sd.name, SUM((size * 8) / 1024) AS rows_size_MB, 0
FROM sys.databases sd (NOLOCK)
INNER JOIN sys.master_files smf (NOLOCK) ON sd.database_id = smf.database_id
WHERE sd.is_read_only = 0 AND sd.state = 0 AND sd.database_id <> 2 AND smf.[type] = 0';
IF @sqlmajorver >= 11 AND @AO_Secondary = 0 -- Skip all local AlwaysOn secondary replicas
BEGIN
SET @sqlcmd_AO = @sqlcmd_AO + CHAR(10) + 'AND sd.[database_id] NOT IN (SELECT dr.database_id FROM sys.dm_hadr_database_replica_states dr
INNER JOIN sys.dm_hadr_availability_replica_states rs ON dr.group_id = rs.group_id
INNER JOIN sys.databases d ON dr.database_id = d.database_id
WHERE rs.role = 2 -- Is Secondary
AND dr.is_local = 1
AND rs.is_local = 1)'
END;
IF @sqlmajorver >= 11 AND @AO_Secondary = 1 -- Skip all local AlwaysOn primary replicas
BEGIN
SET @sqlcmd_AO = @sqlcmd_AO + CHAR(10) + 'AND sd.[database_id] NOT IN (SELECT dr.database_id FROM sys.dm_hadr_database_replica_states dr
INNER JOIN sys.dm_hadr_availability_replica_states rs ON dr.group_id = rs.group_id
INNER JOIN sys.databases d ON dr.database_id = d.database_id
WHERE rs.role = 1 -- Is Primary
AND dr.is_local = 1
AND rs.is_local = 0)'
END;
SET @sqlcmd_AO = @sqlcmd_AO + CHAR(10) + 'GROUP BY sd.database_id, sd.name';
INSERT INTO #tmpdbs ([dbid], [dbname], rows_size_MB, isdone)
EXEC sp_executesql @sqlcmd_AO;
WHILE (SELECT COUNT([dbid]) FROM #tmpdbs WHERE isdone = 0) > 0
BEGIN
SET @dbid = (SELECT TOP 1 [dbid] FROM #tmpdbs WHERE isdone = 0)
SET @dbname = (SELECT TOP 1 [dbname] FROM #tmpdbs WHERE isdone = 0)
SET @dbsize = (SELECT TOP 1 [rows_size_MB] FROM #tmpdbs WHERE isdone = 0)
-- If a snapshot is to be created, set the proper path
IF @SnapPath IS NULL
BEGIN
SELECT TOP 1 @SnapPath = physical_name FROM sys.master_files WHERE database_id = @dbid AND [type] = 0 AND [state] = 0
IF @SnapPath IS NOT NULL
BEGIN
SELECT @SnapPath = LEFT(@SnapPath, LEN(@SnapPath)-CHARINDEX('\',REVERSE(@SnapPath)))
END
END;
-- Find if database has Read-Only FGs
SET @sqlcmd = N'USE [' + @dbname + ']; SELECT @HasROFGOUT = COUNT(data_space_id) FROM sys.filegroups WHERE is_read_only = 1'
SET @params = N'@HasROFGOUT bigint OUTPUT';
EXECUTE sp_executesql @sqlcmd, @params, @HasROFGOUT=@HasROFG OUTPUT;
SET @sqlcmd = ''
IF @dbsize < 1048576 -- smaller than 1TB
BEGIN
-- Is it Friday yet? If so, start database check
IF (SELECT 32 & POWER(2, DATEPART(weekday, GETDATE())-1)) > 0
BEGIN
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NOT NULL
SELECT @msg = CHAR(10) + CONVERT(VARCHAR, GETDATE(), 9) + ' - Started integrity checks on ' + @dbname + '_CheckDB_Snapshot';
IF (@HasROFG > 0 AND @SingleUser = 1) OR (@HasROFG = 0)
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Started integrity checks on ' + @dbname;
RAISERROR (@msg, 10, 1) WITH NOWAIT
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NOT NULL
SET @sqlcmd = 'DBCC CHECKDB (''' + @dbname + '_CheckDB_Snapshot'') WITH '
IF (@HasROFG > 0 AND @SingleUser = 1) OR (@HasROFG = 0)
SET @sqlcmd = 'DBCC CHECKDB (' + CONVERT(NVARCHAR(10),@dbid) + ') WITH '
IF @Physical = 1
BEGIN
SET @sqlcmd = @sqlcmd + 'PHYSICAL_ONLY;'
END
ELSE
BEGIN
SET @sqlcmd = @sqlcmd + 'DATA_PURITY;'
END;
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NOT NULL
BEGIN
TRUNCATE TABLE #tblSnapFiles;
INSERT INTO #tblSnapFiles
SELECT name, 0 FROM sys.master_files WHERE database_id = @dbid AND [type] = 0;
SET @filecreateid = 1
SET @sqlsnapcmd = ''
WHILE (SELECT COUNT([name]) FROM #tblSnapFiles WHERE isdone = 0) > 0
BEGIN
SELECT TOP 1 @filename = [name] FROM #tblSnapFiles WHERE isdone = 0
SET @sqlsnapcmd = @sqlsnapcmd + CHAR(10) + '(NAME = [' + @filename + '], FILENAME = ''' + @SnapPath + '\' + @dbname + '_CheckDB_Snapshot_Data_' + CONVERT(VARCHAR(10), @filecreateid) + '.ss''),'
SET @filecreateid = @filecreateid + 1
UPDATE #tblSnapFiles
SET isdone = 1 WHERE [name] = @filename;
END;
SELECT @sqlsnapcmd = LEFT(@sqlsnapcmd, LEN(@sqlsnapcmd)-1);
SET @sqlcmd_Create = 'USE master;
IF NOT EXISTS (SELECT 1 FROM sys.databases WHERE [name] = ''' + @dbname + '_CheckDB_Snapshot'')
CREATE DATABASE [' + @dbname + '_CheckDB_Snapshot] ON ' + @sqlsnapcmd + CHAR(10) + 'AS SNAPSHOT OF [' + @dbname + '];'
SET @sqlcmd_Drop = 'USE master;
IF EXISTS (SELECT 1 FROM sys.databases WHERE [name] = ''' + @dbname + '_CheckDB_Snapshot'')
DROP DATABASE [' + @dbname + '_CheckDB_Snapshot];'
END
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NULL
BEGIN
SET @sqlcmd = NULL
SELECT @Message = '** Skipping database ' + @dbname + ': Could not find a valid path to create DB snapshot - ' + CONVERT(VARCHAR, GETDATE())
RAISERROR(@Message, 0, 42) WITH NOWAIT;
END
IF @HasROFG > 0 AND @SingleUser = 1
BEGIN
SET @sqlcmd = 'USE master;
ALTER DATABASE [' + @dbname + '] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;' + CHAR(10) + @sqlcmd + CHAR(10) +
'USE master;
ALTER DATABASE [' + @dbname + '] SET MULTI_USER WITH ROLLBACK IMMEDIATE;'
END
IF @sqlcmd_Create IS NOT NULL
BEGIN TRY
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Creating database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
EXEC sp_executesql @sqlcmd_Create;
END TRY
BEGIN CATCH
EXEC sp_executesql @sqlcmd_Drop;
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Create Snapshot - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH
IF @sqlcmd IS NOT NULL
BEGIN TRY
EXEC sp_executesql @sqlcmd;
UPDATE tblFgBuckets
SET isdone = 1
FROM tblFgBuckets
WHERE [database_id] = @dbid AND [data_space_id] = @fg_id AND used_page_count = @used_page_count AND isdone = 0 AND BucketId = @TodayBucket
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Check cycle - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
RETURN
END CATCH
IF @sqlcmd_Drop IS NOT NULL
BEGIN TRY
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Droping database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
EXEC sp_executesql @sqlcmd_Drop;
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Drop Snapshot - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH
END
ELSE
BEGIN
SELECT @Message = '** Skipping database ' + @dbname + ': Today is not Sunday - ' + CONVERT(VARCHAR, GETDATE())
RAISERROR(@Message, 0, 42) WITH NOWAIT;
END
END;
IF @dbsize >= 1048576 -- 1TB or Larger, then create buckets
BEGIN
-- Buckets are built on a weekly basis, so is it Friday yet? If so, start building
IF (SELECT 32 & POWER(2, DATEPART(weekday, GETDATE())-1)) > 0
BEGIN
TRUNCATE TABLE #tblObj
TRUNCATE TABLE #tblBuckets
TRUNCATE TABLE #tblFGs
TRUNCATE TABLE tblFgBuckets
TRUNCATE TABLE tblDbBuckets
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Creating database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
IF @VLDBMode = 0 -- Setup to bucketize by Table Size
BEGIN
SET @sqlcmd = 'SELECT so.[object_id], so.[name], ss.name, so.[type], so.type_desc, SUM(sps.used_page_count) AS used_page_count, 0
FROM [' + @dbname + '].sys.objects so
INNER JOIN [' + @dbname + '].sys.dm_db_partition_stats sps ON so.[object_id] = sps.[object_id]
INNER JOIN [' + @dbname + '].sys.indexes si ON so.[object_id] = si.[object_id]
INNER JOIN [' + @dbname + '].sys.schemas ss ON so.[schema_id] = ss.[schema_id]
WHERE so.[type] IN (''S'', ''U'', ''V'')
GROUP BY so.[object_id], so.[name], ss.name, so.[type], so.type_desc
ORDER BY used_page_count DESC'
INSERT INTO #tblObj
EXEC sp_executesql @sqlcmd;
END
IF @VLDBMode = 1 -- Setup to bucketize by Filegroup Size
BEGIN
SET @sqlcmd = 'SELECT fg.data_space_id, fg.name AS [filegroup_name], SUM(sps.used_page_count) AS used_page_count, 0
FROM [' + @dbname + '].sys.dm_db_partition_stats sps
INNER JOIN [' + @dbname + '].sys.indexes i ON sps.object_id = i.object_id
INNER JOIN [' + @dbname + '].sys.partition_schemes ps ON ps.data_space_id = i.data_space_id
INNER JOIN [' + @dbname + '].sys.destination_data_spaces dds ON dds.partition_scheme_id = ps.data_space_id AND dds.destination_id = sps.partition_number
INNER JOIN [' + @dbname + '].sys.filegroups fg ON dds.data_space_id = fg.data_space_id
--WHERE fg.is_read_only = 0
GROUP BY fg.name, ps.name, fg.data_space_id
ORDER BY SUM(sps.used_page_count) DESC, fg.data_space_id'
INSERT INTO #tblFGs
EXEC sp_executesql @sqlcmd;
END
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Bucketizing by ' + CASE WHEN @VLDBMode = 1 THEN 'Filegroup Size' ELSE 'Table Size' END;
RAISERROR (@msg, 10, 1) WITH NOWAIT
-- Create buckets
SET @Buckets = 8
SET @BucketCnt = 1
SET @sqlcmd = N'SELECT @BucketPagesOUT = SUM(used_page_count)/7 FROM ' + CASE WHEN @VLDBMode = 0 THEN '#tblObj' WHEN @VLDBMode = 1 THEN '#tblFGs' END
SET @params = N'@BucketPagesOUT bigint OUTPUT';
EXECUTE sp_executesql @sqlcmd, @params, @BucketPagesOUT=@BucketPages OUTPUT;
WHILE @BucketCnt <> @Buckets
BEGIN
INSERT INTO #tblBuckets VALUES (@BucketCnt, @BucketPages, 0)
SET @BucketCnt = @BucketCnt + 1
END
IF @VLDBMode = 0 -- Populate buckets by Table Size
BEGIN
WHILE (SELECT COUNT(*) FROM #tblObj WHERE isdone = 0) > 0
BEGIN
SELECT TOP 1 @object_id = [object_id], @name = [name], @schema = [schema], @type = [type], @type_desc = type_desc, @used_page_count = used_page_count
FROM #tblObj
WHERE isdone = 0
ORDER BY used_page_count DESC
SELECT TOP 1 @BucketId = BucketId FROM #tblBuckets ORDER BY CurrentRunTotal
INSERT INTO tblDbBuckets
SELECT @BucketId, @dbid, @object_id, @name, @schema, @type, @type_desc, @used_page_count, 0;
UPDATE #tblObj
SET isdone = 1
FROM #tblObj
WHERE [object_id] = @object_id AND used_page_count = @used_page_count AND isdone = 0;
UPDATE #tblBuckets
SET CurrentRunTotal = CurrentRunTotal + @used_page_count
WHERE BucketId = @BucketId;
END
END;
IF @VLDBMode = 1 -- Populate buckets by Filegroup Size
BEGIN
WHILE (SELECT COUNT(*) FROM #tblFGs WHERE isdone = 0) > 0
BEGIN
SELECT TOP 1 @fg_id = [data_space_id], @name = [name], @used_page_count = used_page_count
FROM #tblFGs
WHERE isdone = 0
ORDER BY used_page_count DESC
SELECT TOP 1 @BucketId = BucketId FROM #tblBuckets ORDER BY CurrentRunTotal
INSERT INTO tblFgBuckets
SELECT @BucketId, @dbid, @fg_id, @name, @used_page_count, 0;
UPDATE #tblFGs
SET isdone = 1
FROM #tblFGs
WHERE [data_space_id] = @fg_id AND used_page_count = @used_page_count AND isdone = 0;
UPDATE #tblBuckets
SET CurrentRunTotal = CurrentRunTotal + @used_page_count
WHERE BucketId = @BucketId;
END
END
END;
-- What day is today? 1=Sunday, 2=Monday, 4=Tuesday, 8=Wednesday, 16=Thursday, 32=Friday, 64=Saturday
SELECT @TodayBucket = CASE WHEN 1 & POWER(2, DATEPART(weekday, GETDATE())-1) = 1 THEN 1
WHEN 2 & POWER(2, DATEPART(weekday, GETDATE())-1) = 2 THEN 2
WHEN 4 & POWER(2, DATEPART(weekday, GETDATE())-1) = 4 THEN 3
WHEN 8 & POWER(2, DATEPART(weekday, GETDATE())-1) = 8 THEN 4
WHEN 16 & POWER(2, DATEPART(weekday, GETDATE())-1) = 16 THEN 5
WHEN 32 & POWER(2, DATEPART(weekday, GETDATE())-1) = 32 THEN 6
WHEN 64 & POWER(2, DATEPART(weekday, GETDATE())-1) = 64 THEN 7
END;
-- Is it Friday yet? If so, start working on allocation and catalog checks on todays bucket
IF (SELECT 32 & POWER(2, DATEPART(weekday, GETDATE())-1)) > 0
BEGIN
IF @VLDBMode = 0
BEGIN
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NOT NULL
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Started allocation checks on ' + @dbname + '_CheckDB_Snapshot]';
IF (@HasROFG > 0 AND @SingleUser = 1) OR (@HasROFG = 0)
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Started allocation checks on ' + @dbname;
RAISERROR (@msg, 10, 1) WITH NOWAIT
IF @HasROFG > 0 AND @CreateSnap = 1
SET @sqlcmd = 'DBCC CHECKALLOC (''' + @dbname + '_CheckDB_Snapshot'');'
IF (@HasROFG > 0 AND @SingleUser = 1) OR (@HasROFG = 0)
SET @sqlcmd = 'DBCC CHECKALLOC (' + CONVERT(NVARCHAR(10),@dbid) + ');'
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NOT NULL
BEGIN
TRUNCATE TABLE #tblSnapFiles;
INSERT INTO #tblSnapFiles
SELECT name, 0 FROM sys.master_files WHERE database_id = @dbid AND [type] = 0;
SET @filecreateid = 1
SET @sqlsnapcmd = ''
WHILE (SELECT COUNT([name]) FROM #tblSnapFiles WHERE isdone = 0) > 0
BEGIN
SELECT TOP 1 @filename = [name] FROM #tblSnapFiles WHERE isdone = 0
SET @sqlsnapcmd = @sqlsnapcmd + CHAR(10) + '(NAME = [' + @filename + '], FILENAME = ''' + @SnapPath + '\' + @dbname + '_CheckDB_Snapshot_Data_' + CONVERT(VARCHAR(10), @filecreateid) + '.ss''),'
SET @filecreateid = @filecreateid + 1
UPDATE #tblSnapFiles
SET isdone = 1 WHERE [name] = @filename;
END;
SELECT @sqlsnapcmd = LEFT(@sqlsnapcmd, LEN(@sqlsnapcmd)-1);
SET @sqlcmd_Create = 'USE master;
IF NOT EXISTS (SELECT 1 FROM sys.databases WHERE [name] = ''' + @dbname + '_CheckDB_Snapshot'')
CREATE DATABASE [' + @dbname + '_CheckDB_Snapshot] ON ' + @sqlsnapcmd + CHAR(10) + 'AS SNAPSHOT OF [' + @dbname + '];'
SET @sqlcmd_Drop = 'USE master;
IF EXISTS (SELECT 1 FROM sys.databases WHERE [name] = ''' + @dbname + '_CheckDB_Snapshot'')
DROP DATABASE [' + @dbname + '_CheckDB_Snapshot];'
END
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NULL
BEGIN
SET @sqlcmd = NULL
SELECT @Message = '** Skipping database ' + @dbname + ': Could not find a valid path to create DB snapshot - ' + CONVERT(VARCHAR, GETDATE())
RAISERROR(@Message, 0, 42) WITH NOWAIT;
END
IF @HasROFG > 0 AND @SingleUser = 1
BEGIN
SET @sqlcmd = 'USE master;
ALTER DATABASE [' + @dbname + '] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;' + CHAR(10) + @sqlcmd + CHAR(10) +
'USE master;
ALTER DATABASE [' + @dbname + '] SET MULTI_USER WITH ROLLBACK IMMEDIATE;'
END
IF @sqlcmd_Create IS NOT NULL
BEGIN TRY
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Creating database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
EXEC sp_executesql @sqlcmd_Create;
END TRY
BEGIN CATCH
EXEC sp_executesql @sqlcmd_Drop;
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Create Snapshot - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH
IF @sqlcmd IS NOT NULL
BEGIN TRY
EXEC sp_executesql @sqlcmd;
UPDATE tblFgBuckets
SET isdone = 1
FROM tblFgBuckets
WHERE [database_id] = @dbid AND [data_space_id] = @fg_id AND used_page_count = @used_page_count AND isdone = 0 AND BucketId = @TodayBucket
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Check cycle - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
RETURN
END CATCH
IF @sqlcmd_Drop IS NOT NULL
BEGIN TRY
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Droping database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
EXEC sp_executesql @sqlcmd_Drop;
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Drop Snapshot - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH
END;
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NOT NULL
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Started catalog checks on ' + @dbname + '_CheckDB_Snapshot';
IF (@HasROFG > 0 AND @SingleUser = 1) OR (@HasROFG = 0)
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Started catalog checks on ' + @dbname;
RAISERROR (@msg, 10, 1) WITH NOWAIT
IF @HasROFG > 0 AND @CreateSnap = 1
SET @sqlcmd = 'DBCC CHECKCATALOG (''' + @dbname + '_CheckDB_Snapshot'');'
IF (@HasROFG > 0 AND @SingleUser = 1) OR (@HasROFG = 0)
SET @sqlcmd = 'DBCC CHECKCATALOG (' + CONVERT(NVARCHAR(10),@dbid) + ');'
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NOT NULL
BEGIN
TRUNCATE TABLE #tblSnapFiles;
INSERT INTO #tblSnapFiles
SELECT name, 0 FROM sys.master_files WHERE database_id = @dbid AND [type] = 0;
SET @filecreateid = 1
SET @sqlsnapcmd = ''
WHILE (SELECT COUNT([name]) FROM #tblSnapFiles WHERE isdone = 0) > 0
BEGIN
SELECT TOP 1 @filename = [name] FROM #tblSnapFiles WHERE isdone = 0
SET @sqlsnapcmd = @sqlsnapcmd + CHAR(10) + '(NAME = [' + @filename + '], FILENAME = ''' + @SnapPath + '\' + @dbname + '_CheckDB_Snapshot_Data_' + CONVERT(VARCHAR(10), @filecreateid) + '.ss''),'
SET @filecreateid = @filecreateid + 1
UPDATE #tblSnapFiles
SET isdone = 1 WHERE [name] = @filename;
END;
SELECT @sqlsnapcmd = LEFT(@sqlsnapcmd, LEN(@sqlsnapcmd)-1);
SET @sqlcmd_Create = 'USE master;
IF NOT EXISTS (SELECT 1 FROM sys.databases WHERE [name] = ''' + @dbname + '_CheckDB_Snapshot'')
CREATE DATABASE [' + @dbname + '_CheckDB_Snapshot] ON ' + @sqlsnapcmd + CHAR(10) + 'AS SNAPSHOT OF [' + @dbname + '];'
SET @sqlcmd_Drop = 'USE master;
IF EXISTS (SELECT 1 FROM sys.databases WHERE [name] = ''' + @dbname + '_CheckDB_Snapshot'')
DROP DATABASE [' + @dbname + '_CheckDB_Snapshot];'
END
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NULL
BEGIN
SET @sqlcmd = NULL
SELECT @Message = '** Skipping database ' + @dbname + ': Could not find a valid path to create DB snapshot - ' + CONVERT(VARCHAR, GETDATE())
RAISERROR(@Message, 0, 42) WITH NOWAIT;
END
IF @HasROFG > 0 AND @SingleUser = 1
BEGIN
SET @sqlcmd = 'USE master;
ALTER DATABASE [' + @dbname + '] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;' + CHAR(10) + @sqlcmd + CHAR(10) +
'USE master;
ALTER DATABASE [' + @dbname + '] SET MULTI_USER WITH ROLLBACK IMMEDIATE;'
END
IF @sqlcmd_Create IS NOT NULL
BEGIN TRY
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Creating database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
EXEC sp_executesql @sqlcmd_Create;
END TRY
BEGIN CATCH
EXEC sp_executesql @sqlcmd_Drop;
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Create Snapshot - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH
IF @sqlcmd IS NOT NULL
BEGIN TRY
EXEC sp_executesql @sqlcmd;
UPDATE tblFgBuckets
SET isdone = 1
FROM tblFgBuckets
WHERE [database_id] = @dbid AND [data_space_id] = @fg_id AND used_page_count = @used_page_count AND isdone = 0 AND BucketId = @TodayBucket
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Check cycle - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
RETURN
END CATCH
IF @sqlcmd_Drop IS NOT NULL
BEGIN TRY
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Droping database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
EXEC sp_executesql @sqlcmd_Drop;
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Drop Snapshot - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH
END
IF @VLDBMode = 0 -- Now do table checks on todays bucket
BEGIN
WHILE (SELECT COUNT(*) FROM tblDbBuckets WHERE [database_id] = @dbid AND isdone = 0 AND BucketId = @TodayBucket
-- Confirm the table still exists
AND OBJECT_ID(N'[' + DB_NAME(database_id) + '].[' + [schema] + '].[' + [name] + ']') IS NOT NULL) > 0
BEGIN
SELECT TOP 1 @name = [name], @schema = [schema], @used_page_count = used_page_count
FROM tblDbBuckets
WHERE [database_id] = @dbid AND isdone = 0 AND BucketId = @TodayBucket
ORDER BY used_page_count DESC
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Started table checks on ' + @dbname + ' - table ' + @schema + '.' + @name;
RAISERROR (@msg, 10, 1) WITH NOWAIT
SET @sqlcmd = 'USE [' + @dbname + '];
DBCC CHECKTABLE (''' + @schema + '.' + @name + ''') WITH '
IF @Physical = 1
BEGIN
SET @sqlcmd = @sqlcmd + 'PHYSICAL_ONLY;'
END
ELSE
BEGIN
SET @sqlcmd = @sqlcmd + 'DATA_PURITY;'
END;
IF @sqlcmd IS NOT NULL
BEGIN TRY
EXEC sp_executesql @sqlcmd;
UPDATE tblDbBuckets
SET isdone = 1
FROM tblDbBuckets
WHERE [database_id] = @dbid AND [name] = @name AND [schema] = @schema AND used_page_count = @used_page_count AND isdone = 0 AND BucketId = @TodayBucket
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH
END
END
IF @VLDBMode = 1 -- Now do filegroup checks on todays bucket
BEGIN
WHILE (SELECT COUNT(*) FROM tblFgBuckets WHERE [database_id] = @dbid AND isdone = 0 AND BucketId = @TodayBucket) > 0
BEGIN
SELECT TOP 1 @fg_id = [data_space_id], @name = [name], @used_page_count = used_page_count
FROM tblFgBuckets
WHERE [database_id] = @dbid AND isdone = 0 AND BucketId = @TodayBucket
ORDER BY used_page_count DESC
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Started filegroup checks on [' + @dbname + '] - filegroup ' + @name;
RAISERROR (@msg, 10, 1) WITH NOWAIT
IF @HasROFG > 0 AND @CreateSnap = 1
SET @sqlcmd = 'USE [' + @dbname + '_CheckDB_Snapshot];
DBCC CHECKFILEGROUP (' + CONVERT(NVARCHAR(10), @fg_id) + ')'
IF (@HasROFG > 0 AND @SingleUser = 1) OR (@HasROFG = 0)
SET @sqlcmd = 'USE [' + @dbname + '];
DBCC CHECKFILEGROUP (' + CONVERT(NVARCHAR(10), @fg_id) + ')'
IF @Physical = 1
BEGIN
SET @sqlcmd = @sqlcmd + ' WITH PHYSICAL_ONLY;'
END
ELSE
BEGIN
SET @sqlcmd = @sqlcmd + ';'
END;
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NOT NULL
BEGIN
TRUNCATE TABLE #tblSnapFiles;
INSERT INTO #tblSnapFiles
SELECT name, 0 FROM sys.master_files WHERE database_id = @dbid AND [type] = 0;
SET @filecreateid = 1
SET @sqlsnapcmd = ''
WHILE (SELECT COUNT([name]) FROM #tblSnapFiles WHERE isdone = 0) > 0
BEGIN
SELECT TOP 1 @filename = [name] FROM #tblSnapFiles WHERE isdone = 0
SET @sqlsnapcmd = @sqlsnapcmd + CHAR(10) + '(NAME = [' + @filename + '], FILENAME = ''' + @SnapPath + '\' + @dbname + '_CheckDB_Snapshot_Data_' + CONVERT(VARCHAR(10), @filecreateid) + '.ss''),'
SET @filecreateid = @filecreateid + 1
UPDATE #tblSnapFiles
SET isdone = 1 WHERE [name] = @filename;
END;
SELECT @sqlsnapcmd = LEFT(@sqlsnapcmd, LEN(@sqlsnapcmd)-1);
SET @sqlcmd_Create = 'USE master;
IF NOT EXISTS (SELECT 1 FROM sys.databases WHERE [name] = ''' + @dbname + '_CheckDB_Snapshot'')
CREATE DATABASE [' + @dbname + '_CheckDB_Snapshot] ON ' + @sqlsnapcmd + CHAR(10) + 'AS SNAPSHOT OF [' + @dbname + '];'
SET @sqlcmd_Drop = 'USE master;
IF EXISTS (SELECT 1 FROM sys.databases WHERE [name] = ''' + @dbname + '_CheckDB_Snapshot'')
DROP DATABASE [' + @dbname + '_CheckDB_Snapshot];'
END;
IF @HasROFG > 0 AND @CreateSnap = 1 AND @SnapPath IS NULL
BEGIN
SET @sqlcmd = NULL
SELECT @Message = '** Skipping database ' + @dbname + ': Could not find a valid path to create DB snapshot - ' + CONVERT(VARCHAR, GETDATE())
RAISERROR(@Message, 0, 42) WITH NOWAIT;
END
IF @HasROFG > 0 AND @SingleUser = 1
BEGIN
SET @sqlcmd = 'USE master;
ALTER DATABASE [' + @dbname + '] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;' + CHAR(10) + @sqlcmd + CHAR(10) +
'USE master;
ALTER DATABASE [' + @dbname + '] SET MULTI_USER WITH ROLLBACK IMMEDIATE;'
END
IF @sqlcmd_Create IS NOT NULL
BEGIN TRY
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Creating database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
EXEC sp_executesql @sqlcmd_Create;
END TRY
BEGIN CATCH
EXEC sp_executesql @sqlcmd_Drop;
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Create Snapshot - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH
IF @sqlcmd IS NOT NULL
BEGIN TRY
EXEC sp_executesql @sqlcmd;
UPDATE tblFgBuckets
SET isdone = 1
FROM tblFgBuckets
WHERE [database_id] = @dbid AND [data_space_id] = @fg_id AND used_page_count = @used_page_count AND isdone = 0 AND BucketId = @TodayBucket
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Check cycle - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
RETURN
END CATCH
IF @sqlcmd_Drop IS NOT NULL
BEGIN TRY
SELECT @msg = CONVERT(VARCHAR, GETDATE(), 9) + ' - Droping database snapshot ' + @dbname + '_CheckDB_Snapshot';
RAISERROR (@msg, 10, 1) WITH NOWAIT
EXEC sp_executesql @sqlcmd_Drop;
END TRY
BEGIN CATCH
SELECT ERROR_NUMBER() AS ErrorNumber, ERROR_MESSAGE() AS ErrorMessage;
SELECT @ErrorMessage = 'Drop Snapshot - Error raised in TRY block. ' + ERROR_MESSAGE()
RAISERROR (@ErrorMessage, 16, 1);
END CATCH END
END
END;
UPDATE #tmpdbs
SET isdone = 1
FROM #tmpdbs
WHERE [dbid] = @dbid AND isdone = 0
END;
IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tmpdbs'))
DROP TABLE #tmpdbs
IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblObj'))
DROP TABLE #tblObj;
IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblBuckets'))
DROP TABLE #tblBuckets;
IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblFGs'))
DROP TABLE #tblFGs;
IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID('tempdb.dbo.#tblSnapFiles'))
DROP TABLE #tblSnapFiles;
SELECT @Message = '** Finished: ' + CONVERT(VARCHAR, GETDATE())
RAISERROR(@Message, 0, 42) WITH NOWAIT;
GO
PRINT 'Procedure usp_CheckIntegrity created';
GO
------------------------------------------------------------------------------------------------------------------------------
IF EXISTS (SELECT job_id FROM msdb.dbo.sysjobs_view WHERE name = N'Weekly Maintenance')
EXEC msdb.dbo.sp_delete_job @job_name=N'Weekly Maintenance', @delete_unused_schedule=1
GO
PRINT 'Creating Weekly Maintenance job';
GO
BEGIN TRANSACTION
-- Set the Operator name to receive notifications, if any. Set the job owner, if not sa.
DECLARE @customoper sysname, @jobowner sysname
SET @customoper = 'SQLAdmins'
SET @jobowner = 'sa'
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'Database Maintenance' AND category_class=1)
BEGIN
EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N'JOB', @type=N'LOCAL', @name=N'Database Maintenance'
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
END
DECLARE @jobId BINARY(16)
IF EXISTS (SELECT name FROM msdb.dbo.sysoperators WHERE name = @customoper)
BEGIN
EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N'Weekly Maintenance',
@enabled=1,
@notify_level_eventlog=2,
@notify_level_email=3,
@notify_level_netsend=2,
@notify_level_page=2,
@delete_level=0,
@description=N'Runs weekly maintenance cycle. Most steps execute on Fridays only. For integrity checks, depending on whether the database in scope is a VLDB or not, different actions are executed. See job steps for further detail.',
@category_name=N'Database Maintenance',
@owner_login_name=@jobowner,
@notify_email_operator_name=@customoper,
@job_id = @jobId OUTPUT
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
END
ELSE
BEGIN
EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N'Weekly Maintenance',
@enabled=1,
@notify_level_eventlog=2,
@notify_level_email=3,
@notify_level_netsend=0,
@notify_level_page=0,
@delete_level=0,
@description=N'Runs weekly maintenance cycle. Most steps execute on Fridays only. For integrity checks, depending on whether the database in scope is a VLDB or not, different actions are executed. See job steps for further detail.',
@category_name=N'Database Maintenance',
@owner_login_name=@jobowner,
@job_id = @jobId OUTPUT
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
END
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'DBCC CheckDB',
@step_id=1,
@cmdexec_success_code=0,
@on_success_action=3,
@on_success_step_id=0,
@on_fail_action=2,
@on_fail_step_id=0,
@retry_attempts=0,
@retry_interval=0,
@os_run_priority=0, @subsystem=N'TSQL',
@command=N'/*
This checks the logical and physical integrity of all the objects in the specified database by performing the following operations:
|-For VLDBs (larger than 1TB):
|- On Fridays, if VLDB Mode = 0, runs DBCC CHECKALLOC.
|- On Fridays, runs DBCC CHECKCATALOG.
|- Everyday, if VLDB Mode = 0, runs DBCC CHECKTABLE or if VLDB Mode = 1, DBCC CHECKFILEGROUP on a subset of tables and views, divided by daily buckets.
|-For DBs smaller than 1TB:
|- Every Friday a DBCC CHECKDB checks the logical and physical integrity of all the objects in the specified database.
To set how VLDBs are handled, set @VLDBMode to 0 = Bucket by Table Size or 1 = Bucket by Filegroup Size
IMPORTANT: Consider running DBCC CHECKDB routinely (at least, weekly). On large databases and for more frequent checks, consider using the PHYSICAL_ONLY parameter.
http://msdn.microsoft.com/en-us/library/ms176064.aspx
http://blogs.msdn.com/b/sqlserverstorageengine/archive/2006/10/20/consistency-checking-options-for-a-vldb.aspx
If a database has Read-Only filegroups, any integrity check will fail if there are other open connections to the database.
Setting @CreateSnap = 1 will create a database snapshot before running the check on the snapshot, and drop it at the end (default).
Setting @CreateSnap = 0 means the integrity check might fail if there are other open connection on the database.
If snapshots are not allowed and a database has Read-Only filegroups, any integrity check will fail if there are other openned connections to the database.
Setting @SingleUser = 1 will set the database in single user mode before running the check, and to multi user afterwards.
Setting @SingleUser = 0 means the integrity check might fail if there are other open connection on the database.
*/
EXEC msdb.dbo.usp_CheckIntegrity @VLDBMode = 1, @SingleUser = 0, @CreateSnap = 1
',
@database_name=N'master',
@flags=20
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'update usage',
@step_id=2,
@cmdexec_success_code=0,
@on_success_action=3,
@on_success_step_id=0,
@on_fail_action=2,
@on_fail_step_id=0,
@retry_attempts=0,
@retry_interval=0,
@os_run_priority=0, @subsystem=N'TSQL',
@command=N'/*
DBCC UPDATEUSAGE corrects the rows, used pages, reserved pages, leaf pages and data page counts for each partition in a table or index.
IMPORTANT: Consider running DBCC UPDATEUSAGE routinely (for example, weekly) only if the database undergoes frequent Data Definition Language (DDL) modifications, such as CREATE, ALTER, or DROP statements.
http://msdn.microsoft.com/en-us/library/ms188414.aspx
Exludes all Offline or Read-Only DBs. Also excludes all databases over 4GB in size.
*/
SET NOCOUNT ON;
-- Is it Friday yet?
IF (SELECT 32 & POWER(2, DATEPART(weekday, GETDATE())-1)) > 0
BEGIN
PRINT ''** Start: '' + CONVERT(VARCHAR, GETDATE())
DECLARE @dbname sysname, @sqlcmd NVARCHAR(500)
IF NOT EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID(''tempdb.dbo.#tmpdbs''))
CREATE TABLE #tmpdbs (id int IDENTITY(1,1), [dbname] sysname, isdone bit)
INSERT INTO #tmpdbs ([dbname], isdone)
SELECT QUOTENAME(d.name), 0 FROM sys.databases d INNER JOIN sys.master_files smf ON d.database_id = smf.database_id
WHERE d.is_read_only = 0 AND d.state = 0 AND d.database_id <> 2 AND smf.type = 0 AND (smf.size * 8)/1024 < 4096;
WHILE (SELECT COUNT([dbname]) FROM #tmpdbs WHERE isdone = 0) > 0
BEGIN
SET @dbname = (SELECT TOP 1 [dbname] FROM #tmpdbs WHERE isdone = 0)
SET @sqlcmd = ''DBCC UPDATEUSAGE ('' + @dbname + '')''
PRINT CHAR(10) + CONVERT(VARCHAR, GETDATE()) + '' - Started space corrections on '' + @dbname
EXECUTE sp_executesql @sqlcmd
PRINT CONVERT(VARCHAR, GETDATE()) + '' - Ended space corrections on '' + @dbname
UPDATE #tmpdbs
SET isdone = 1
FROM #tmpdbs
WHERE [dbname] = @dbname AND isdone = 0
END;
IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID(''tempdb.dbo.#tmpdbs''))
DROP TABLE #tmpdbs;
PRINT ''** Finished: '' + CONVERT(VARCHAR, GETDATE())
END
ELSE
BEGIN
PRINT ''** Skipping: Today is not Friday - '' + CONVERT(VARCHAR, GETDATE())
END;',
@database_name=N'master',
@flags=20
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'sp_createstats',
@step_id=3,
@cmdexec_success_code=0,
@on_success_action=3,
@on_success_step_id=0,
@on_fail_action=2,
@on_fail_step_id=0,
@retry_attempts=0,
@retry_interval=0,
@os_run_priority=0, @subsystem=N'TSQL',
@command=N'/*
Creates statistics only on columns that are part of an existing index, and are not the first column in any index definition.
Creating single-column statistics increases the number of histograms, which can improve cardinality estimates, query plans, and query performance.
The first column of a statistics object has a histogram; other columns do not have a histogram.
http://msdn.microsoft.com/en-us/library/ms186834.aspx
Exludes all Offline and Read-Only DBs
*/
SET NOCOUNT ON;
-- Is it Friday yet?
IF (SELECT 32 & POWER(2, DATEPART(weekday, GETDATE())-1)) > 0
BEGIN
PRINT ''** Start: '' + CONVERT(VARCHAR, GETDATE())
DECLARE @dbname sysname, @sqlcmd NVARCHAR(500)
IF NOT EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID(''tempdb.dbo.#tmpdbs''))
CREATE TABLE #tmpdbs (id int IDENTITY(1,1), [dbname] sysname, isdone bit)
INSERT INTO #tmpdbs ([dbname], isdone)
SELECT QUOTENAME(name), 0 FROM sys.databases WHERE is_read_only = 0 AND state = 0 AND database_id > 4 AND is_distributor = 0;
WHILE (SELECT COUNT([dbname]) FROM #tmpdbs WHERE isdone = 0) > 0
BEGIN
SET @dbname = (SELECT TOP 1 [dbname] FROM #tmpdbs WHERE isdone = 0)
SET @sqlcmd = @dbname + ''.dbo.sp_createstats @indexonly = ''''indexonly''''''
SELECT CHAR(10) + CONVERT(VARCHAR, GETDATE()) + '' - Started indexed stats creation on '' + @dbname
EXECUTE sp_executesql @sqlcmd
SELECT CONVERT(VARCHAR, GETDATE()) + '' - Ended indexed stats creation on '' + @dbname
UPDATE #tmpdbs
SET isdone = 1
FROM #tmpdbs
WHERE [dbname] = @dbname AND isdone = 0
END;
IF EXISTS (SELECT [object_id] FROM tempdb.sys.objects (NOLOCK) WHERE [object_id] = OBJECT_ID(''tempdb.dbo.#tmpdbs''))
DROP TABLE #tmpdbs;
PRINT ''** Finished: '' + CONVERT(VARCHAR, GETDATE())
END
ELSE
BEGIN
PRINT ''** Skipping: Today is not Friday - '' + CONVERT(VARCHAR, GETDATE())
END;',
@database_name=N'master',
@flags=20
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'Cleanup Job History',
@step_id=4,
@cmdexec_success_code=0,
@on_success_action=3,
@on_success_step_id=0,
@on_fail_action=2,
@on_fail_step_id=0,
@retry_attempts=0,
@retry_interval=0,
@os_run_priority=0, @subsystem=N'TSQL',
@command=N'-- Cleans msdb job history older than 30 days
SET NOCOUNT ON;
-- Is it Friday yet?
IF (SELECT 32 & POWER(2, DATEPART(weekday, GETDATE())-1)) > 0
BEGIN
DECLARE @date DATETIME
SET @date = GETDATE()-30
EXEC msdb.dbo.sp_purge_jobhistory @oldest_date=@date;
END
ELSE
BEGIN
PRINT ''** Skipping: Today is not Friday - '' + CONVERT(VARCHAR, GETDATE())
END;',
@database_name=N'msdb',
@flags=20
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'Cleanup Maintenance Plan txt reports',
@step_id=5,
@cmdexec_success_code=0,
@on_success_action=1,
@on_success_step_id=0,
@on_fail_action=2,
@on_fail_step_id=0,
@retry_attempts=0,
@retry_interval=0,
@os_run_priority=0, @subsystem=N'TSQL',
@command=N'-- Cleans maintenance plans txt reports older than 30 days
SET NOCOUNT ON;
-- Is it Friday yet?
IF (SELECT 32 & POWER(2, DATEPART(weekday, GETDATE())-1)) > 0
BEGIN
DECLARE @path NVARCHAR(500), @date DATETIME
DECLARE @sqlcmd NVARCHAR(1000), @params NVARCHAR(100), @sqlmajorver int
SELECT @sqlmajorver = CONVERT(int, (@@microsoftversion / 0x1000000) & 0xff);
SET @date = GETDATE()-30
IF @sqlmajorver < 11
BEGIN
EXEC master..xp_instance_regread N''HKEY_LOCAL_MACHINE'',N''Software\Microsoft\MSSQLServer\Setup'',N''SQLPath'', @path OUTPUT
SET @path = @path + ''\LOG''
END
ELSE
BEGIN
SET @sqlcmd = N''SELECT @pathOUT = LEFT([path], LEN([path])-1) FROM sys.dm_os_server_diagnostics_log_configurations'';
SET @params = N''@pathOUT NVARCHAR(2048) OUTPUT'';
EXECUTE sp_executesql @sqlcmd, @params, @pathOUT=@path OUTPUT;
END
-- Default location for maintenance plan txt files is the Log folder.
-- If you changed from the default location since you last installed SQL Server, uncomment below and set the custom desired path.
--SET @path = ''C:\custom_location''
EXECUTE master..xp_delete_file 1,@path,N''txt'',@date,1
END
ELSE
BEGIN
PRINT ''** Skipping: Today is not Friday - '' + CONVERT(VARCHAR, GETDATE())
END;',
@database_name=N'master',
@flags=20
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id=@jobId, @name=N'Weekly Maintenance - Fridays',
@enabled=1,
@freq_type=8,
@freq_interval=1,
@freq_subday_type=1,
@freq_subday_interval=0,
@freq_relative_interval=0,
@freq_recurrence_factor=1,
@active_start_date=20071009,
@active_end_date=99991231,
@active_start_time=83000,
@active_end_time=235959
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobschedule @job_id=@jobId, @name=N'Weekly Maintenance - Weekdays and Saturdays',
@enabled=1,
@freq_type=8,
@freq_interval=126,
@freq_subday_type=1,
@freq_subday_interval=0,
@freq_relative_interval=0,
@freq_recurrence_factor=1,
@active_start_date=20131017,
@active_end_date=99991231,
@active_start_time=10000,
@active_end_time=235959
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N'(local)'
IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback
COMMIT TRANSACTION
GOTO EndSave
QuitWithRollback:
IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION
EndSave:
GO
PRINT 'Weekly Maintenance job created';
GO | the_stack |
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: `toloka`
--
-- --------------------------------------------------------
--
-- Table structure for table `bb_attachments`
--
CREATE TABLE `bb_attachments` (
`attach_id` mediumint(8) UNSIGNED NOT NULL,
`post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`user_id_1` mediumint(8) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_attachments_config`
--
CREATE TABLE `bb_attachments_config` (
`config_name` varchar(255) NOT NULL DEFAULT '',
`config_value` varchar(255) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_attachments_config`
--
INSERT INTO `bb_attachments_config` (`config_name`, `config_value`) VALUES
('allow_pm_attach', '1'),
('attachment_quota', '52428800'),
('attach_version', '2.3.14'),
('default_pm_quota', '0'),
('default_upload_quota', '0'),
('disable_mod', '0'),
('display_order', '0'),
('flash_autoplay', '0'),
('img_create_thumbnail', '0'),
('img_display_inlined', '1'),
('img_imagick', '/usr/bin/convert'),
('img_link_height', '0'),
('img_link_width', '0'),
('img_max_height', '200'),
('img_max_width', '200'),
('img_min_thumb_filesize', '12000'),
('max_attachments', '1'),
('max_attachments_pm', '1'),
('max_filesize', '262144'),
('max_filesize_pm', '262144'),
('topic_icon', 'styles/images/icon_clip.gif'),
('upload_dir', 'data/torrent_files'),
('upload_img', 'styles/images/icon_clip.gif'),
('use_gd2', '1'),
('wma_autoplay', '0');
-- --------------------------------------------------------
--
-- Table structure for table `bb_attachments_desc`
--
CREATE TABLE `bb_attachments_desc` (
`attach_id` mediumint(8) UNSIGNED NOT NULL,
`physical_filename` varchar(255) NOT NULL DEFAULT '',
`real_filename` varchar(255) NOT NULL DEFAULT '',
`download_count` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`comment` varchar(255) NOT NULL DEFAULT '',
`extension` varchar(100) NOT NULL DEFAULT '',
`mimetype` varchar(100) NOT NULL DEFAULT '',
`filesize` int(20) NOT NULL DEFAULT 0,
`filetime` int(11) NOT NULL DEFAULT 0,
`thumbnail` tinyint(1) NOT NULL DEFAULT 0,
`tracker_status` tinyint(1) NOT NULL DEFAULT 0,
`thanks_count` int(10) unsigned NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_attachments_rating`
--
CREATE TABLE `bb_attachments_rating` (
`attach_id` int(10) unsigned NOT NULL,
`user_id` int(11) NOT NULL,
`thanked` tinyint(1) NOT NULL DEFAULT 0,
`rating` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`attach_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_attach_quota`
--
CREATE TABLE `bb_attach_quota` (
`user_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`group_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`quota_type` smallint(2) NOT NULL DEFAULT 0,
`quota_limit_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_auth_access`
--
CREATE TABLE `bb_auth_access` (
`group_id` mediumint(8) NOT NULL DEFAULT 0,
`forum_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`forum_perm` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_auth_access_snap`
--
CREATE TABLE `bb_auth_access_snap` (
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`forum_id` smallint(6) NOT NULL DEFAULT 0,
`forum_perm` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_banlist`
--
CREATE TABLE `bb_banlist` (
`ban_id` mediumint(8) UNSIGNED NOT NULL,
`ban_userid` mediumint(8) NOT NULL DEFAULT 0,
`ban_ip` varchar(42) NOT NULL DEFAULT '0',
`ban_email` varchar(255) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_dlstatus`
--
CREATE TABLE `bb_bt_dlstatus` (
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`user_status` tinyint(1) NOT NULL DEFAULT 0,
`last_modified_dlstatus` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_dlstatus_snap`
--
CREATE TABLE `bb_bt_dlstatus_snap` (
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`dl_status` tinyint(4) NOT NULL DEFAULT 0,
`users_count` smallint(5) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_last_torstat`
--
CREATE TABLE `bb_bt_last_torstat` (
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`dl_status` tinyint(1) NOT NULL DEFAULT 0,
`up_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`down_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`release_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`bonus_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`speed_up` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`speed_down` bigint(20) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_last_userstat`
--
CREATE TABLE `bb_bt_last_userstat` (
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`up_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`down_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`release_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`bonus_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`speed_up` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`speed_down` bigint(20) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_torhelp`
--
CREATE TABLE `bb_bt_torhelp` (
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`topic_id_csv` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_torrents`
--
CREATE TABLE `bb_bt_torrents` (
`info_hash` varbinary(20) NOT NULL DEFAULT '',
`post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`poster_id` mediumint(9) NOT NULL DEFAULT 0,
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`forum_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`attach_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`size` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`reg_time` int(11) NOT NULL DEFAULT 0,
`call_seed_time` int(11) NOT NULL DEFAULT 0,
`complete_count` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`seeder_last_seen` int(11) NOT NULL DEFAULT 0,
`tor_status` tinyint(4) NOT NULL DEFAULT 0,
`checked_user_id` mediumint(8) NOT NULL DEFAULT 0,
`checked_time` int(11) NOT NULL DEFAULT 0,
`tor_type` tinyint(1) NOT NULL DEFAULT 0,
`speed_up` int(11) NOT NULL DEFAULT 0,
`speed_down` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_torstat`
--
CREATE TABLE `bb_bt_torstat` (
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`last_modified_torstat` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`completed` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_tor_dl_stat`
--
CREATE TABLE `bb_bt_tor_dl_stat` (
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`attach_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`t_up_total` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`t_down_total` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`t_bonus_total` bigint(20) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_tracker`
--
CREATE TABLE `bb_bt_tracker` (
`peer_hash` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`peer_id` varchar(20) NOT NULL DEFAULT '0',
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`ip` varchar(42) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '0',
`ipv6` varchar(32) DEFAULT NULL,
`port` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`client` varchar(51) NOT NULL DEFAULT 'Unknown',
`seeder` tinyint(1) NOT NULL DEFAULT 0,
`releaser` tinyint(1) NOT NULL DEFAULT 0,
`tor_type` tinyint(1) NOT NULL DEFAULT 0,
`uploaded` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`downloaded` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`remain` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`speed_up` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`speed_down` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`up_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`down_add` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`update_time` int(11) NOT NULL DEFAULT 0,
`complete_percent` bigint(20) NOT NULL DEFAULT 0,
`complete` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_tracker_snap`
--
CREATE TABLE `bb_bt_tracker_snap` (
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`seeders` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`leechers` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`speed_up` int(10) UNSIGNED NOT NULL DEFAULT 0,
`speed_down` int(10) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_users`
--
CREATE TABLE `bb_bt_users` (
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`auth_key` char(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`u_up_total` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`u_down_total` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`u_up_release` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`u_up_bonus` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`up_today` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`down_today` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`up_release_today` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`up_bonus_today` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`points_today` float(16,2) UNSIGNED NOT NULL DEFAULT 0.00,
`up_yesterday` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`down_yesterday` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`up_release_yesterday` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`up_bonus_yesterday` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`points_yesterday` float(16,2) UNSIGNED NOT NULL DEFAULT 0.00
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_bt_user_settings`
--
CREATE TABLE `bb_bt_user_settings` (
`user_id` mediumint(9) NOT NULL DEFAULT 0,
`tor_search_set` text NOT NULL,
`last_modified` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_categories`
--
CREATE TABLE `bb_categories` (
`cat_id` smallint(5) UNSIGNED NOT NULL,
`cat_title` varchar(100) NOT NULL DEFAULT '',
`cat_order` smallint(5) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_categories`
--
INSERT INTO `bb_categories` (`cat_id`, `cat_title`, `cat_order`) VALUES
(1, 'Відео', 10);
-- --------------------------------------------------------
--
-- Table structure for table `bb_config`
--
CREATE TABLE `bb_config` (
`config_name` varchar(255) NOT NULL DEFAULT '',
`config_value` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_config`
--
INSERT INTO `bb_config` (`config_name`, `config_value`) VALUES
('allow_autologin', '1'),
('allow_bbcode', '1'),
('allow_namechange', '0'),
('allow_sig', '1'),
('allow_smilies', '1'),
('birthday_check_day', '7'),
('birthday_enabled', '1'),
('birthday_max_age', '99'),
('birthday_min_age', '10'),
('board_disable', '0'),
('board_startdate', '0'),
('board_timezone', '0'),
('bonus_upload', ''),
('bonus_upload_price', ''),
('bt_add_auth_key', '1'),
('bt_allow_spmode_change', '1'),
('bt_announce_url', 'https://demo.torrentpier.com/bt/announce.php'),
('bt_check_announce_url', '0'),
('bt_del_addit_ann_urls', '1'),
('bt_disable_dht', '0'),
('bt_dl_list_only_1st_page', '1'),
('bt_dl_list_only_count', '1'),
('bt_newtopic_auto_reg', '1'),
('bt_replace_ann_url', '1'),
('bt_search_bool_mode', '1'),
('bt_set_dltype_on_tor_reg', '1'),
('bt_show_dl_but_cancel', '1'),
('bt_show_dl_but_compl', '1'),
('bt_show_dl_but_down', '0'),
('bt_show_dl_but_will', '1'),
('bt_show_dl_list', '0'),
('bt_show_dl_list_buttons', '1'),
('bt_show_dl_stat_on_index', '1'),
('bt_show_ip_only_moder', '1'),
('bt_show_peers', '1'),
('bt_show_peers_mode', '1'),
('bt_show_port_only_moder', '1'),
('bt_tor_browse_only_reg', '0'),
('bt_unset_dltype_on_tor_unreg', '1'),
('callseed', '0'),
('cron_check_interval', '180'),
('cron_enabled', '0'),
('cron_last_check', '0'),
('default_dateformat', 'Y-m-d H:i'),
('default_lang', 'uk'),
('flood_interval', '15'),
('gender', '1'),
('hot_threshold', '300'),
('latest_news_count', '5'),
('latest_news_forum_id', '1'),
('login_reset_time', '30'),
('magnet_links_enabled', '1'),
('max_autologin_time', '10'),
('max_login_attempts', '5'),
('max_net_title', '50'),
('max_news_title', '50'),
('max_poll_options', '6'),
('max_sig_chars', '255'),
('network_news_count', '5'),
('network_news_forum_id', '2'),
('posts_per_page', '15'),
('premod', '0'),
('prune_enable', '1'),
('record_online_date', '0'),
('record_online_users', '2'),
('seed_bonus_enabled', '1'),
('seed_bonus_points', ''),
('seed_bonus_release', ''),
('seed_bonus_tor_size', '0'),
('seed_bonus_user_regdate', '0'),
('show_latest_news', '1'),
('show_mod_index', '0'),
('show_network_news', '1'),
('sitemap_time', '0'),
('sitename', 'TorrentPier - Bittorrent-tracker engine'),
('site_desc', 'A little text to describe your forum'),
('smilies_path', 'styles/images/smiles'),
('static_sitemap', ''),
('terms', ''),
('topics_per_page', '50'),
('tor_comment', '1'),
('tor_stats', '1'),
('whois_info', 'http://whatismyipaddress.com/ip/'),
('xs_use_cache', '1');
-- --------------------------------------------------------
--
-- Table structure for table `bb_cron`
--
CREATE TABLE `bb_cron` (
`cron_id` smallint(5) UNSIGNED NOT NULL,
`cron_active` tinyint(4) NOT NULL DEFAULT 1,
`cron_title` char(120) NOT NULL DEFAULT '',
`cron_script` char(120) NOT NULL DEFAULT '',
`schedule` enum('hourly','daily','weekly','monthly','interval') NOT NULL DEFAULT 'daily',
`run_day` enum('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28') DEFAULT NULL,
`run_time` time DEFAULT '04:00:00',
`run_order` tinyint(4) UNSIGNED NOT NULL DEFAULT 0,
`last_run` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`next_run` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`run_interval` time DEFAULT '00:00:00',
`log_enabled` tinyint(1) NOT NULL DEFAULT 0,
`log_file` char(120) NOT NULL DEFAULT '',
`log_sql_queries` tinyint(4) NOT NULL DEFAULT 0,
`disable_board` tinyint(1) NOT NULL DEFAULT 0,
`run_counter` bigint(20) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_cron`
--
INSERT INTO `bb_cron` (`cron_id`, `cron_active`, `cron_title`, `cron_script`, `schedule`, `run_day`, `run_time`, `run_order`, `last_run`, `next_run`, `run_interval`, `log_enabled`, `log_file`, `log_sql_queries`, `disable_board`, `run_counter`) VALUES
(1, 1, 'Attach maintenance', 'attach_maintenance.php', 'daily', '', '05:00:00', 40, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 1, '', 0, 1, 0),
(2, 1, 'Board maintenance', 'board_maintenance.php', 'daily', '', '05:00:00', 40, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 1, '', 0, 1, 0),
(3, 1, 'Prune forums', 'prune_forums.php', 'daily', '', '05:00:00', 50, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 1, '', 0, 1, 0),
(4, 1, 'Prune topic moved stubs', 'prune_topic_moved.php', 'daily', '', '05:00:00', 60, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 1, '', 0, 1, 0),
(5, 1, 'Logs cleanup', 'clean_log.php', 'daily', '', '05:00:00', 70, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 1, '', 0, 1, 0),
(6, 1, 'Tracker maintenance', 'tr_maintenance.php', 'daily', '', '05:00:00', 90, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 1, '', 0, 1, 0),
(7, 1, 'Clean dlstat', 'clean_dlstat.php', 'daily', '', '05:00:00', 100, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 1, '', 0, 1, 0),
(8, 1, 'Prune inactive users', 'prune_inactive_users.php', 'daily', '', '05:00:00', 110, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 1, '', 0, 1, 0),
(9, 1, 'Sessions cleanup', 'sessions_cleanup.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:03:00', 0, '', 0, 0, 0),
(10, 1, 'DS update cat_forums', 'ds_update_cat_forums.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:05:00', 0, '', 0, 0, 0),
(11, 1, 'DS update stats', 'ds_update_stats.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:10:00', 0, '', 0, 0, 0),
(12, 1, 'Flash topic view', 'flash_topic_view.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:10:00', 0, '', 0, 0, 0),
(13, 1, 'Clean search results', 'clean_search_results.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:10:00', 0, '', 0, 0, 0),
(14, 1, 'Tracker cleanup and dlstat', 'tr_cleanup_and_dlstat.php', 'interval', '', '00:00:00', 20, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:15:00', 0, '', 0, 0, 0),
(15, 1, 'Accrual seedbonus', 'tr_seed_bonus.php', 'interval', '', '00:00:00', 25, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:15:00', 0, '', 0, 0, 0),
(16, 1, 'Make tracker snapshot', 'tr_make_snapshot.php', 'interval', '', '00:00:00', 10, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:10:00', 0, '', 0, 0, 0),
(17, 1, 'Seeder last seen', 'tr_update_seeder_last_seen.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '01:00:00', 0, '', 0, 0, 0),
(18, 1, 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '06:00:00', 0, '', 0, 0, 0),
(19, 1, 'Cache garbage collector', 'cache_gc.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:05:00', 0, '', 0, 0, 0),
(20, 1, 'Sitemap update', 'sitemap.php', 'daily', '', '06:00:00', 30, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:00:00', 0, '', 0, 0, 0),
(21, 1, 'Update forums atom', 'update_forums_atom.php', 'interval', '', '00:00:00', 255, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '00:15:00', 0, '', 0, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `bb_disallow`
--
CREATE TABLE `bb_disallow` (
`disallow_id` mediumint(8) UNSIGNED NOT NULL,
`disallow_username` varchar(25) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_extensions`
--
CREATE TABLE `bb_extensions` (
`ext_id` mediumint(8) UNSIGNED NOT NULL,
`group_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`extension` varchar(100) NOT NULL DEFAULT '',
`comment` varchar(100) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_extensions`
--
INSERT INTO `bb_extensions` (`ext_id`, `group_id`, `extension`, `comment`) VALUES
(1, 1, 'gif', ''),
(2, 1, 'png', ''),
(3, 1, 'jpeg', ''),
(4, 1, 'jpg', ''),
(5, 1, 'tif', ''),
(6, 1, 'tga', ''),
(7, 2, 'gtar', ''),
(8, 2, 'gz', ''),
(9, 2, 'tar', ''),
(10, 2, 'zip', ''),
(11, 2, 'rar', ''),
(12, 2, 'ace', ''),
(13, 3, 'txt', ''),
(14, 3, 'c', ''),
(15, 3, 'h', ''),
(16, 3, 'cpp', ''),
(17, 3, 'hpp', ''),
(18, 3, 'diz', ''),
(19, 4, 'xls', ''),
(20, 4, 'doc', ''),
(21, 4, 'dot', ''),
(22, 4, 'pdf', ''),
(23, 4, 'ai', ''),
(24, 4, 'ps', ''),
(25, 4, 'ppt', ''),
(26, 5, 'rm', ''),
(27, 6, 'torrent', '');
-- --------------------------------------------------------
--
-- Table structure for table `bb_extension_groups`
--
CREATE TABLE `bb_extension_groups` (
`group_id` mediumint(8) NOT NULL,
`group_name` varchar(20) NOT NULL DEFAULT '',
`cat_id` tinyint(2) NOT NULL DEFAULT 0,
`allow_group` tinyint(1) NOT NULL DEFAULT 0,
`download_mode` tinyint(1) UNSIGNED NOT NULL DEFAULT 1,
`upload_icon` varchar(100) NOT NULL DEFAULT '',
`max_filesize` int(20) NOT NULL DEFAULT 0,
`forum_permissions` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_extension_groups`
--
INSERT INTO `bb_extension_groups` (`group_id`, `group_name`, `cat_id`, `allow_group`, `download_mode`, `upload_icon`, `max_filesize`, `forum_permissions`) VALUES
(1, 'Images', 1, 1, 1, '', 262144, ''),
(2, 'Archives', 0, 1, 1, '', 262144, ''),
(3, 'Plain text', 0, 0, 1, '', 262144, ''),
(4, 'Documents', 0, 0, 1, '', 262144, ''),
(5, 'Real media', 0, 0, 2, '', 262144, ''),
(6, 'Torrent', 0, 1, 1, '', 122880, '');
-- --------------------------------------------------------
--
-- Table structure for table `bb_forums`
--
CREATE TABLE `bb_forums` (
`forum_id` smallint(5) UNSIGNED NOT NULL,
`cat_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`forum_name` varchar(150) NOT NULL DEFAULT '',
`forum_desc` text NOT NULL,
`forum_status` tinyint(4) NOT NULL DEFAULT 0,
`forum_order` smallint(5) UNSIGNED NOT NULL DEFAULT 1,
`forum_posts` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`forum_topics` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`forum_last_post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`forum_tpl_id` smallint(6) NOT NULL DEFAULT 0,
`prune_days` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`auth_view` tinyint(2) NOT NULL DEFAULT 0,
`auth_read` tinyint(2) NOT NULL DEFAULT 0,
`auth_post` tinyint(2) NOT NULL DEFAULT 0,
`auth_reply` tinyint(2) NOT NULL DEFAULT 0,
`auth_edit` tinyint(2) NOT NULL DEFAULT 0,
`auth_delete` tinyint(2) NOT NULL DEFAULT 0,
`auth_sticky` tinyint(2) NOT NULL DEFAULT 0,
`auth_announce` tinyint(2) NOT NULL DEFAULT 0,
`auth_vote` tinyint(2) NOT NULL DEFAULT 0,
`auth_pollcreate` tinyint(2) NOT NULL DEFAULT 0,
`auth_attachments` tinyint(2) NOT NULL DEFAULT 0,
`auth_download` tinyint(2) NOT NULL DEFAULT 0,
`allow_reg_tracker` tinyint(1) NOT NULL DEFAULT 0,
`allow_porno_topic` tinyint(1) NOT NULL DEFAULT 0,
`self_moderated` tinyint(1) NOT NULL DEFAULT 0,
`forum_parent` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`show_on_index` tinyint(1) NOT NULL DEFAULT 1,
`forum_display_sort` tinyint(1) NOT NULL DEFAULT 0,
`forum_display_order` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_forums`
--
INSERT INTO `bb_forums` (`forum_id`, `cat_id`, `forum_name`, `forum_desc`, `forum_status`, `forum_order`, `forum_posts`, `forum_topics`, `forum_last_post_id`, `forum_tpl_id`, `prune_days`, `auth_view`, `auth_read`, `auth_post`, `auth_reply`, `auth_edit`, `auth_delete`, `auth_sticky`, `auth_announce`, `auth_vote`, `auth_pollcreate`, `auth_attachments`, `auth_download`, `allow_reg_tracker`, `allow_porno_topic`, `self_moderated`, `forum_parent`, `show_on_index`, `forum_display_sort`, `forum_display_order`) VALUES
(1, 1, 'Фільми', '', 0, 10, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `bb_groups`
--
CREATE TABLE `bb_groups` (
`group_id` mediumint(8) NOT NULL,
`avatar_ext_id` int(15) NOT NULL DEFAULT 0,
`group_time` int(11) NOT NULL DEFAULT 0,
`mod_time` int(11) NOT NULL DEFAULT 0,
`group_type` tinyint(4) NOT NULL DEFAULT 1,
`release_group` tinyint(4) NOT NULL DEFAULT 0,
`group_name` varchar(40) NOT NULL DEFAULT '',
`group_description` text NOT NULL,
`group_signature` text NOT NULL,
`group_moderator` mediumint(8) NOT NULL DEFAULT 0,
`group_single_user` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_log`
--
CREATE TABLE `bb_log` (
`log_type_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`log_user_id` mediumint(9) NOT NULL DEFAULT 0,
`log_user_ip` varchar(42) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '0',
`log_forum_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`log_forum_id_new` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`log_topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`log_topic_id_new` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`log_topic_title` varchar(250) NOT NULL DEFAULT '',
`log_topic_title_new` varchar(250) NOT NULL DEFAULT '',
`log_time` int(11) NOT NULL DEFAULT 0,
`log_msg` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_poll_users`
--
CREATE TABLE `bb_poll_users` (
`topic_id` int(10) UNSIGNED NOT NULL,
`user_id` int(11) NOT NULL,
`vote_ip` varchar(42) NOT NULL DEFAULT '0',
`vote_dt` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_poll_votes`
--
CREATE TABLE `bb_poll_votes` (
`topic_id` int(10) UNSIGNED NOT NULL,
`vote_id` tinyint(4) UNSIGNED NOT NULL,
`vote_text` varchar(255) NOT NULL,
`vote_result` mediumint(8) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_posts`
--
CREATE TABLE `bb_posts` (
`post_id` mediumint(8) UNSIGNED NOT NULL,
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`forum_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`poster_id` mediumint(8) NOT NULL DEFAULT 0,
`post_time` int(11) NOT NULL DEFAULT 0,
`poster_ip` char(42) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '0',
`poster_rg_id` mediumint(8) NOT NULL DEFAULT 0,
`attach_rg_sig` tinyint(4) NOT NULL DEFAULT 0,
`post_username` varchar(25) NOT NULL DEFAULT '',
`post_edit_time` int(11) NOT NULL DEFAULT 0,
`post_edit_count` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`post_attachment` tinyint(1) NOT NULL DEFAULT 0,
`user_post` tinyint(1) NOT NULL DEFAULT 1,
`mc_comment` text DEFAULT NULL,
`mc_type` tinyint(1) NOT NULL DEFAULT 0,
`mc_user_id` mediumint(8) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_posts`
--
INSERT INTO `bb_posts` (`post_id`, `topic_id`, `forum_id`, `poster_id`, `post_time`, `poster_ip`, `poster_rg_id`, `attach_rg_sig`, `post_username`, `post_edit_time`, `post_edit_count`, `post_attachment`, `user_post`, `mc_comment`, `mc_type`, `mc_user_id`) VALUES
(1, 1, 1, 2, 0, '0', 0, 0, '', 0, 0, 0, 1, '', 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `bb_posts_html`
--
CREATE TABLE `bb_posts_html` (
`post_id` mediumint(9) NOT NULL DEFAULT 0,
`post_html_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`post_html` mediumtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_posts_html`
--
INSERT INTO `bb_posts_html` (`post_id`, `post_html_time`, `post_html`) VALUES
(1, '0000-00-00 00:00:00', 'Перше повідомлення');
-- --------------------------------------------------------
--
-- Table structure for table `bb_posts_search`
--
CREATE TABLE `bb_posts_search` (
`post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`search_words` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_posts_search`
--
INSERT INTO `bb_posts_search` (`post_id`, `search_words`) VALUES
(1, 'тестова\nтема\nперше\nповідомлення');
-- --------------------------------------------------------
--
-- Table structure for table `bb_posts_text`
--
CREATE TABLE `bb_posts_text` (
`post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`post_text` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_posts_text`
--
INSERT INTO `bb_posts_text` (`post_id`, `post_text`) VALUES
(1, 'Перше повідомлення');
-- --------------------------------------------------------
--
-- Table structure for table `bb_privmsgs`
--
CREATE TABLE `bb_privmsgs` (
`privmsgs_id` mediumint(8) UNSIGNED NOT NULL,
`privmsgs_type` tinyint(4) NOT NULL DEFAULT 0,
`privmsgs_subject` varchar(255) NOT NULL DEFAULT '0',
`privmsgs_from_userid` mediumint(8) NOT NULL DEFAULT 0,
`privmsgs_to_userid` mediumint(8) NOT NULL DEFAULT 0,
`privmsgs_date` int(11) NOT NULL DEFAULT 0,
`privmsgs_ip` varchar(42) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_privmsgs_text`
--
CREATE TABLE `bb_privmsgs_text` (
`privmsgs_text_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`privmsgs_text` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_quota_limits`
--
CREATE TABLE `bb_quota_limits` (
`quota_limit_id` mediumint(8) UNSIGNED NOT NULL,
`quota_desc` varchar(20) NOT NULL DEFAULT '',
`quota_limit` bigint(20) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_quota_limits`
--
INSERT INTO `bb_quota_limits` (`quota_limit_id`, `quota_desc`, `quota_limit`) VALUES
(1, 'Low', 262144),
(2, 'Medium', 10485760),
(3, 'High', 15728640);
-- --------------------------------------------------------
--
-- Table structure for table `bb_ranks`
--
CREATE TABLE `bb_ranks` (
`rank_id` smallint(5) UNSIGNED NOT NULL,
`rank_title` varchar(50) NOT NULL DEFAULT '',
`rank_image` varchar(255) NOT NULL DEFAULT '',
`rank_style` varchar(255) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_ranks`
--
INSERT INTO `bb_ranks` (`rank_id`, `rank_title`, `rank_image`, `rank_style`) VALUES
(1, 'Адміністратор', 'styles/images/ranks/admin.png', 'colorAdmin');
-- --------------------------------------------------------
--
-- Table structure for table `bb_search_rebuild`
--
CREATE TABLE `bb_search_rebuild` (
`rebuild_session_id` mediumint(8) UNSIGNED NOT NULL,
`start_post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`end_post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`start_time` int(11) NOT NULL DEFAULT 0,
`end_time` int(11) NOT NULL DEFAULT 0,
`last_cycle_time` int(11) NOT NULL DEFAULT 0,
`session_time` int(11) NOT NULL DEFAULT 0,
`session_posts` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`session_cycles` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`search_size` int(10) UNSIGNED NOT NULL DEFAULT 0,
`rebuild_session_status` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_search_results`
--
CREATE TABLE `bb_search_results` (
`session_id` char(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`search_type` tinyint(4) NOT NULL DEFAULT 0,
`search_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`search_time` int(11) NOT NULL DEFAULT 0,
`search_settings` text NOT NULL,
`search_array` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_sessions`
--
CREATE TABLE `bb_sessions` (
`session_id` char(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`session_user_id` mediumint(8) NOT NULL DEFAULT 0,
`session_start` int(11) NOT NULL DEFAULT 0,
`session_time` int(11) NOT NULL DEFAULT 0,
`session_ip` char(42) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '0',
`session_logged_in` tinyint(1) NOT NULL DEFAULT 0,
`session_admin` tinyint(2) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_smilies`
--
CREATE TABLE `bb_smilies` (
`smilies_id` smallint(5) UNSIGNED NOT NULL,
`code` varchar(50) NOT NULL DEFAULT '',
`smile_url` varchar(100) NOT NULL DEFAULT '',
`emoticon` varchar(75) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_smilies`
--
INSERT INTO `bb_smilies` (`smilies_id`, `code`, `smile_url`, `emoticon`) VALUES
(1, ':aa:', 'aa.gif', 'aa'),
(2, ':ab:', 'ab.gif', 'ab'),
(3, ':ac:', 'ac.gif', 'ac'),
(4, ':ae:', 'ae.gif', 'ae'),
(5, ':af:', 'af.gif', 'af'),
(6, ':ag:', 'ag.gif', 'ag'),
(7, ':ah:', 'ah.gif', 'ah'),
(8, ':ai:', 'ai.gif', 'ai'),
(9, ':aj:', 'aj.gif', 'aj'),
(10, ':ak:', 'ak.gif', 'ak'),
(11, ':al:', 'al.gif', 'al'),
(12, ':am:', 'am.gif', 'am'),
(13, ':an:', 'an.gif', 'an'),
(14, ':ao:', 'ao.gif', 'ao'),
(15, ':ap:', 'ap.gif', 'ap'),
(16, ':aq:', 'aq.gif', 'aq'),
(17, ':ar:', 'ar.gif', 'ar'),
(18, ':as:', 'as.gif', 'as'),
(19, ':at:', 'at.gif', 'at'),
(20, ':au:', 'au.gif', 'au'),
(21, ':av:', 'av.gif', 'av'),
(22, ':aw:', 'aw.gif', 'aw'),
(23, ':ax:', 'ax.gif', 'ax'),
(24, ':ay:', 'ay.gif', 'ay'),
(25, ':az:', 'az.gif', 'az'),
(26, ':ba:', 'ba.gif', 'ba'),
(27, ':bb:', 'bb.gif', 'bb'),
(28, ':bc:', 'bc.gif', 'bc'),
(29, ':bd:', 'bd.gif', 'bd'),
(30, ':be:', 'be.gif', 'be'),
(31, ':bf:', 'bf.gif', 'bf'),
(32, ':bg:', 'bg.gif', 'bg'),
(33, ':bh:', 'bh.gif', 'bh'),
(34, ':bi:', 'bi.gif', 'bi'),
(35, ':bj:', 'bj.gif', 'bj'),
(36, ':bk:', 'bk.gif', 'bk'),
(37, ':bl:', 'bl.gif', 'bl'),
(38, ':bm:', 'bm.gif', 'bm'),
(39, ':bn:', 'bn.gif', 'bn'),
(40, ':bo:', 'bo.gif', 'bo'),
(41, ':bp:', 'bp.gif', 'bp'),
(42, ':bq:', 'bq.gif', 'bq'),
(43, ':br:', 'br.gif', 'br'),
(44, ':bs:', 'bs.gif', 'bs'),
(45, ':bt:', 'bt.gif', 'bt'),
(46, ':bu:', 'bu.gif', 'bu'),
(47, ':bv:', 'bv.gif', 'bv'),
(48, ':bw:', 'bw.gif', 'bw'),
(49, ':bx:', 'bx.gif', 'bx'),
(50, ':by:', 'by.gif', 'by'),
(51, ':bz:', 'bz.gif', 'bz'),
(52, ':ca:', 'ca.gif', 'ca'),
(53, ':cb:', 'cb.gif', 'cb'),
(54, ':cc:', 'cc.gif', 'cc'),
(55, ':сd:', 'сd.gif', 'сd');
-- --------------------------------------------------------
--
-- Table structure for table `bb_topics`
--
CREATE TABLE `bb_topics` (
`topic_id` mediumint(8) UNSIGNED NOT NULL,
`forum_id` smallint(8) UNSIGNED NOT NULL DEFAULT 0,
`topic_title` varchar(250) NOT NULL DEFAULT '',
`topic_poster` mediumint(8) NOT NULL DEFAULT 0,
`topic_time` int(11) NOT NULL DEFAULT 0,
`topic_views` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`topic_replies` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`topic_status` tinyint(3) NOT NULL DEFAULT 0,
`topic_vote` tinyint(1) NOT NULL DEFAULT 0,
`topic_type` tinyint(3) NOT NULL DEFAULT 0,
`topic_first_post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`topic_last_post_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`topic_moved_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`topic_attachment` tinyint(1) NOT NULL DEFAULT 0,
`topic_dl_type` tinyint(1) NOT NULL DEFAULT 0,
`topic_last_post_time` int(11) NOT NULL DEFAULT 0,
`topic_show_first_post` tinyint(1) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_topics`
--
INSERT INTO `bb_topics` (`topic_id`, `forum_id`, `topic_title`, `topic_poster`, `topic_time`, `topic_views`, `topic_replies`, `topic_status`, `topic_vote`, `topic_type`, `topic_first_post_id`, `topic_last_post_id`, `topic_moved_id`, `topic_attachment`, `topic_dl_type`, `topic_last_post_time`, `topic_show_first_post`) VALUES
(1, 1, 'Тестова тема', 2, 0, 14, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `bb_topics_watch`
--
CREATE TABLE `bb_topics_watch` (
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`user_id` mediumint(8) NOT NULL DEFAULT 0,
`notify_status` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_topics_watch`
--
INSERT INTO `bb_topics_watch` (`topic_id`, `user_id`, `notify_status`) VALUES
(1, 2, 1);
-- --------------------------------------------------------
--
-- Table structure for table `bb_topic_tpl`
--
CREATE TABLE `bb_topic_tpl` (
`tpl_id` smallint(6) NOT NULL,
`tpl_name` varchar(60) NOT NULL DEFAULT '',
`tpl_src_form` text NOT NULL,
`tpl_src_title` text NOT NULL,
`tpl_src_msg` text NOT NULL,
`tpl_comment` text NOT NULL,
`tpl_rules_post_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
`tpl_last_edit_tm` int(11) NOT NULL DEFAULT 0,
`tpl_last_edit_by` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_users`
--
CREATE TABLE `bb_users` (
`user_id` mediumint(8) NOT NULL,
`user_active` tinyint(1) NOT NULL DEFAULT 1,
`username` varchar(25) NOT NULL DEFAULT '',
`user_password` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`user_session_time` int(11) NOT NULL DEFAULT 0,
`user_lastvisit` int(11) NOT NULL DEFAULT 0,
`user_last_ip` char(42) NOT NULL DEFAULT '0',
`user_regdate` int(11) NOT NULL DEFAULT 0,
`user_reg_ip` char(42) NOT NULL DEFAULT '0',
`user_level` tinyint(4) NOT NULL DEFAULT 0,
`user_posts` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`user_timezone` decimal(5,2) NOT NULL DEFAULT 0.00,
`user_lang` varchar(255) NOT NULL DEFAULT 'uk',
`user_new_privmsg` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`user_unread_privmsg` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
`user_last_privmsg` int(11) NOT NULL DEFAULT 0,
`user_opt` int(11) NOT NULL DEFAULT 0,
`user_rank` int(11) NOT NULL DEFAULT 0,
`avatar_ext_id` tinyint(4) NOT NULL DEFAULT 0,
`user_gender` tinyint(1) NOT NULL DEFAULT 0,
`user_birthday` date NOT NULL DEFAULT '0000-00-00',
`user_email` varchar(255) NOT NULL DEFAULT '',
`user_skype` varchar(32) NOT NULL DEFAULT '',
`user_twitter` varchar(15) NOT NULL DEFAULT '',
`user_icq` varchar(15) NOT NULL DEFAULT '',
`user_website` varchar(100) NOT NULL DEFAULT '',
`user_from` varchar(100) NOT NULL DEFAULT '',
`user_sig` text NOT NULL,
`user_occ` varchar(100) NOT NULL DEFAULT '',
`user_interests` varchar(255) NOT NULL DEFAULT '',
`user_actkey` varchar(32) NOT NULL DEFAULT '',
`user_newpasswd` varchar(32) NOT NULL DEFAULT '',
`autologin_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`user_newest_pm_id` mediumint(8) NOT NULL DEFAULT 0,
`user_points` float(16,2) NOT NULL DEFAULT 0.00,
`tpl_name` varchar(255) NOT NULL DEFAULT 'default'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `bb_users`
--
INSERT INTO `bb_users` (`user_id`, `user_active`, `username`, `user_password`, `user_session_time`, `user_lastvisit`, `user_last_ip`, `user_regdate`, `user_reg_ip`, `user_level`, `user_posts`, `user_timezone`, `user_lang`, `user_new_privmsg`, `user_unread_privmsg`, `user_last_privmsg`, `user_opt`, `user_rank`, `avatar_ext_id`, `user_gender`, `user_birthday`, `user_email`, `user_skype`, `user_twitter`, `user_icq`, `user_website`, `user_from`, `user_sig`, `user_occ`, `user_interests`, `user_actkey`, `user_newpasswd`, `autologin_id`, `user_newest_pm_id`, `user_points`, `tpl_name`) VALUES
(-746, 0, 'bot', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 144, 0, 0, 0, '0000-00-00', 'bot@torrentpier.com', '', '', '', '', '', '', '', '', '', '', '', 0, 0.00, 'default'),
(-1, 0, 'Guest', 'd41d8cd98f00b204e9800998ecf8427e', 0, 0, '0', 0, '0', 0, 0, 0.00, '', 0, 0, 0, 0, 0, 0, 0, '0000-00-00', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0.00, 'default'),
(2, 1, 'admin', 'c3284d0f94606de1fd2af172aba15bf3', 0, 0, 'c0a86301', 0, '0', 1, 1, 2.00, '', 0, 0, 0, 304, 1, 0, 0, '0000-00-00', 'admin@torrentpier.com', '', '', '', '', '', '', '', '', '', '', 'XCbkm1SmP1GB', 0, 0.00, 'default');
-- --------------------------------------------------------
--
-- Table structure for table `bb_user_group`
--
CREATE TABLE `bb_user_group` (
`group_id` mediumint(8) NOT NULL DEFAULT 0,
`user_id` mediumint(8) NOT NULL DEFAULT 0,
`user_pending` tinyint(1) NOT NULL DEFAULT 0,
`user_time` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `bb_words`
--
CREATE TABLE `bb_words` (
`word_id` mediumint(8) UNSIGNED NOT NULL,
`word` char(100) NOT NULL DEFAULT '',
`replacement` char(100) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `buf_last_seeder`
--
CREATE TABLE `buf_last_seeder` (
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`seeder_last_seen` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `buf_topic_view`
--
CREATE TABLE `buf_topic_view` (
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
`topic_views` mediumint(8) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `buf_topic_view`
--
INSERT INTO `buf_topic_view` (`topic_id`, `topic_views`) VALUES
(1, 2);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bb_attachments`
--
ALTER TABLE `bb_attachments`
ADD PRIMARY KEY (`attach_id`,`post_id`);
--
-- Indexes for table `bb_attachments_config`
--
ALTER TABLE `bb_attachments_config`
ADD PRIMARY KEY (`config_name`);
--
-- Indexes for table `bb_attachments_desc`
--
ALTER TABLE `bb_attachments_desc`
ADD PRIMARY KEY (`attach_id`),
ADD KEY `filetime` (`filetime`),
ADD KEY `filesize` (`filesize`),
ADD KEY `physical_filename` (`physical_filename`(10));
--
-- Indexes for table `bb_attach_quota`
--
ALTER TABLE `bb_attach_quota`
ADD KEY `quota_type` (`quota_type`);
--
-- Indexes for table `bb_auth_access`
--
ALTER TABLE `bb_auth_access`
ADD PRIMARY KEY (`group_id`,`forum_id`),
ADD KEY `forum_id` (`forum_id`);
--
-- Indexes for table `bb_auth_access_snap`
--
ALTER TABLE `bb_auth_access_snap`
ADD PRIMARY KEY (`user_id`,`forum_id`);
--
-- Indexes for table `bb_banlist`
--
ALTER TABLE `bb_banlist`
ADD PRIMARY KEY (`ban_id`),
ADD KEY `ban_ip_user_id` (`ban_ip`,`ban_userid`);
--
-- Indexes for table `bb_bt_dlstatus`
--
ALTER TABLE `bb_bt_dlstatus`
ADD PRIMARY KEY (`user_id`,`topic_id`),
ADD KEY `topic_id` (`topic_id`);
--
-- Indexes for table `bb_bt_dlstatus_snap`
--
ALTER TABLE `bb_bt_dlstatus_snap`
ADD KEY `topic_id` (`topic_id`);
--
-- Indexes for table `bb_bt_last_torstat`
--
ALTER TABLE `bb_bt_last_torstat`
ADD PRIMARY KEY (`topic_id`,`user_id`) USING BTREE;
--
-- Indexes for table `bb_bt_last_userstat`
--
ALTER TABLE `bb_bt_last_userstat`
ADD PRIMARY KEY (`user_id`);
--
-- Indexes for table `bb_bt_torhelp`
--
ALTER TABLE `bb_bt_torhelp`
ADD PRIMARY KEY (`user_id`);
--
-- Indexes for table `bb_bt_torrents`
--
ALTER TABLE `bb_bt_torrents`
ADD PRIMARY KEY (`info_hash`),
ADD UNIQUE KEY `post_id` (`post_id`),
ADD UNIQUE KEY `topic_id` (`topic_id`),
ADD UNIQUE KEY `attach_id` (`attach_id`),
ADD KEY `reg_time` (`reg_time`),
ADD KEY `forum_id` (`forum_id`),
ADD KEY `poster_id` (`poster_id`);
--
-- Indexes for table `bb_bt_torstat`
--
ALTER TABLE `bb_bt_torstat`
ADD PRIMARY KEY (`topic_id`,`user_id`);
--
-- Indexes for table `bb_bt_tor_dl_stat`
--
ALTER TABLE `bb_bt_tor_dl_stat`
ADD PRIMARY KEY (`topic_id`,`user_id`);
--
-- Indexes for table `bb_bt_tracker`
--
ALTER TABLE `bb_bt_tracker`
ADD PRIMARY KEY (`peer_hash`),
ADD KEY `topic_id` (`topic_id`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `bb_bt_tracker_snap`
--
ALTER TABLE `bb_bt_tracker_snap`
ADD PRIMARY KEY (`topic_id`);
--
-- Indexes for table `bb_bt_users`
--
ALTER TABLE `bb_bt_users`
ADD PRIMARY KEY (`user_id`),
ADD UNIQUE KEY `auth_key` (`auth_key`);
--
-- Indexes for table `bb_bt_user_settings`
--
ALTER TABLE `bb_bt_user_settings`
ADD PRIMARY KEY (`user_id`);
--
-- Indexes for table `bb_categories`
--
ALTER TABLE `bb_categories`
ADD PRIMARY KEY (`cat_id`),
ADD KEY `cat_order` (`cat_order`);
--
-- Indexes for table `bb_config`
--
ALTER TABLE `bb_config`
ADD PRIMARY KEY (`config_name`);
--
-- Indexes for table `bb_cron`
--
ALTER TABLE `bb_cron`
ADD PRIMARY KEY (`cron_id`),
ADD UNIQUE KEY `title` (`cron_title`),
ADD UNIQUE KEY `script` (`cron_script`);
--
-- Indexes for table `bb_disallow`
--
ALTER TABLE `bb_disallow`
ADD PRIMARY KEY (`disallow_id`);
--
-- Indexes for table `bb_extensions`
--
ALTER TABLE `bb_extensions`
ADD PRIMARY KEY (`ext_id`);
--
-- Indexes for table `bb_extension_groups`
--
ALTER TABLE `bb_extension_groups`
ADD PRIMARY KEY (`group_id`);
--
-- Indexes for table `bb_forums`
--
ALTER TABLE `bb_forums`
ADD PRIMARY KEY (`forum_id`),
ADD KEY `forums_order` (`forum_order`),
ADD KEY `cat_id` (`cat_id`),
ADD KEY `forum_last_post_id` (`forum_last_post_id`),
ADD KEY `forum_parent` (`forum_parent`);
--
-- Indexes for table `bb_groups`
--
ALTER TABLE `bb_groups`
ADD PRIMARY KEY (`group_id`),
ADD KEY `group_single_user` (`group_single_user`);
--
-- Indexes for table `bb_log`
--
ALTER TABLE `bb_log`
ADD KEY `log_time` (`log_time`);
ALTER TABLE `bb_log` ADD FULLTEXT KEY `log_topic_title` (`log_topic_title`);
--
-- Indexes for table `bb_poll_users`
--
ALTER TABLE `bb_poll_users`
ADD PRIMARY KEY (`topic_id`,`user_id`);
--
-- Indexes for table `bb_poll_votes`
--
ALTER TABLE `bb_poll_votes`
ADD PRIMARY KEY (`topic_id`,`vote_id`);
--
-- Indexes for table `bb_posts`
--
ALTER TABLE `bb_posts`
ADD PRIMARY KEY (`post_id`),
ADD KEY `topic_id` (`topic_id`),
ADD KEY `poster_id` (`poster_id`),
ADD KEY `post_time` (`post_time`),
ADD KEY `forum_id_post_time` (`forum_id`,`post_time`);
--
-- Indexes for table `bb_posts_html`
--
ALTER TABLE `bb_posts_html`
ADD PRIMARY KEY (`post_id`);
--
-- Indexes for table `bb_posts_search`
--
ALTER TABLE `bb_posts_search`
ADD PRIMARY KEY (`post_id`);
ALTER TABLE `bb_posts_search` ADD FULLTEXT KEY `search_words` (`search_words`);
--
-- Indexes for table `bb_posts_text`
--
ALTER TABLE `bb_posts_text`
ADD PRIMARY KEY (`post_id`);
--
-- Indexes for table `bb_privmsgs`
--
ALTER TABLE `bb_privmsgs`
ADD PRIMARY KEY (`privmsgs_id`),
ADD KEY `privmsgs_from_userid` (`privmsgs_from_userid`),
ADD KEY `privmsgs_to_userid` (`privmsgs_to_userid`);
--
-- Indexes for table `bb_privmsgs_text`
--
ALTER TABLE `bb_privmsgs_text`
ADD PRIMARY KEY (`privmsgs_text_id`);
--
-- Indexes for table `bb_quota_limits`
--
ALTER TABLE `bb_quota_limits`
ADD PRIMARY KEY (`quota_limit_id`);
--
-- Indexes for table `bb_ranks`
--
ALTER TABLE `bb_ranks`
ADD PRIMARY KEY (`rank_id`);
--
-- Indexes for table `bb_search_rebuild`
--
ALTER TABLE `bb_search_rebuild`
ADD PRIMARY KEY (`rebuild_session_id`);
--
-- Indexes for table `bb_search_results`
--
ALTER TABLE `bb_search_results`
ADD PRIMARY KEY (`session_id`,`search_type`);
--
-- Indexes for table `bb_sessions`
--
ALTER TABLE `bb_sessions`
ADD PRIMARY KEY (`session_id`);
--
-- Indexes for table `bb_smilies`
--
ALTER TABLE `bb_smilies`
ADD PRIMARY KEY (`smilies_id`);
--
-- Indexes for table `bb_topics`
--
ALTER TABLE `bb_topics`
ADD PRIMARY KEY (`topic_id`),
ADD KEY `forum_id` (`forum_id`),
ADD KEY `topic_last_post_id` (`topic_last_post_id`),
ADD KEY `topic_last_post_time` (`topic_last_post_time`);
ALTER TABLE `bb_topics` ADD FULLTEXT KEY `topic_title` (`topic_title`);
--
-- Indexes for table `bb_topics_watch`
--
ALTER TABLE `bb_topics_watch`
ADD KEY `topic_id` (`topic_id`),
ADD KEY `user_id` (`user_id`),
ADD KEY `notify_status` (`notify_status`);
--
-- Indexes for table `bb_topic_tpl`
--
ALTER TABLE `bb_topic_tpl`
ADD PRIMARY KEY (`tpl_id`),
ADD UNIQUE KEY `tpl_name` (`tpl_name`);
--
-- Indexes for table `bb_users`
--
ALTER TABLE `bb_users`
ADD PRIMARY KEY (`user_id`),
ADD KEY `username` (`username`(10)),
ADD KEY `user_email` (`user_email`(10)),
ADD KEY `user_level` (`user_level`);
--
-- Indexes for table `bb_user_group`
--
ALTER TABLE `bb_user_group`
ADD PRIMARY KEY (`group_id`,`user_id`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `bb_words`
--
ALTER TABLE `bb_words`
ADD PRIMARY KEY (`word_id`);
--
-- Indexes for table `buf_last_seeder`
--
ALTER TABLE `buf_last_seeder`
ADD PRIMARY KEY (`topic_id`);
--
-- Indexes for table `buf_topic_view`
--
ALTER TABLE `buf_topic_view`
ADD PRIMARY KEY (`topic_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `bb_attachments_desc`
--
ALTER TABLE `bb_attachments_desc`
MODIFY `attach_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bb_banlist`
--
ALTER TABLE `bb_banlist`
MODIFY `ban_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bb_categories`
--
ALTER TABLE `bb_categories`
MODIFY `cat_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `bb_cron`
--
ALTER TABLE `bb_cron`
MODIFY `cron_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `bb_disallow`
--
ALTER TABLE `bb_disallow`
MODIFY `disallow_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bb_extensions`
--
ALTER TABLE `bb_extensions`
MODIFY `ext_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT for table `bb_extension_groups`
--
ALTER TABLE `bb_extension_groups`
MODIFY `group_id` mediumint(8) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `bb_forums`
--
ALTER TABLE `bb_forums`
MODIFY `forum_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `bb_groups`
--
ALTER TABLE `bb_groups`
MODIFY `group_id` mediumint(8) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bb_posts`
--
ALTER TABLE `bb_posts`
MODIFY `post_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `bb_privmsgs`
--
ALTER TABLE `bb_privmsgs`
MODIFY `privmsgs_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bb_quota_limits`
--
ALTER TABLE `bb_quota_limits`
MODIFY `quota_limit_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `bb_ranks`
--
ALTER TABLE `bb_ranks`
MODIFY `rank_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `bb_search_rebuild`
--
ALTER TABLE `bb_search_rebuild`
MODIFY `rebuild_session_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bb_smilies`
--
ALTER TABLE `bb_smilies`
MODIFY `smilies_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;
--
-- AUTO_INCREMENT for table `bb_topics`
--
ALTER TABLE `bb_topics`
MODIFY `topic_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `bb_topic_tpl`
--
ALTER TABLE `bb_topic_tpl`
MODIFY `tpl_id` smallint(6) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bb_users`
--
ALTER TABLE `bb_users`
MODIFY `user_id` mediumint(8) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `bb_words`
--
ALTER TABLE `bb_words`
MODIFY `word_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT;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 */; | the_stack |
-- 2021-06-18T06:13:19.107Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Schema-Zeilen werden in der Auftragsschnellerfassung automatisch eingefügt, wenn zu dem betreffenden Produkt ein Kompensationsschema konfiguriert ist', IsTranslated='Y', Name='Schema-Zeilen', PrintName='Schema-Zeilen',Updated=TO_TIMESTAMP('2021-06-18 09:13:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579311 AND AD_Language='de_CH'
;
-- 2021-06-18T06:13:19.116Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579311,'de_CH')
;
-- 2021-06-18T06:13:24.213Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Schema-Zeilen',Updated=TO_TIMESTAMP('2021-06-18 09:13:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579311 AND AD_Language='de_DE'
;
-- 2021-06-18T06:13:24.214Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579311,'de_DE')
;
-- 2021-06-18T06:13:24.232Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(579311,'de_DE')
;
-- 2021-06-18T06:13:24.248Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='C_CompensationGroup_Schema_TemplateLine_ID', Name='Schema-Zeilen', Description=NULL, Help=NULL WHERE AD_Element_ID=579311
;
-- 2021-06-18T06:13:24.250Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_CompensationGroup_Schema_TemplateLine_ID', Name='Schema-Zeilen', Description=NULL, Help=NULL, AD_Element_ID=579311 WHERE UPPER(ColumnName)='C_COMPENSATIONGROUP_SCHEMA_TEMPLATELINE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-06-18T06:13:24.251Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_CompensationGroup_Schema_TemplateLine_ID', Name='Schema-Zeilen', Description=NULL, Help=NULL WHERE AD_Element_ID=579311 AND IsCentrallyMaintained='Y'
;
-- 2021-06-18T06:13:24.252Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Schema-Zeilen', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=579311) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 579311)
;
-- 2021-06-18T06:13:24.291Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Compensation Group Template Line', Name='Schema-Zeilen' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=579311)
;
-- 2021-06-18T06:13:24.294Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Schema-Zeilen', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 579311
;
-- 2021-06-18T06:13:24.295Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Schema-Zeilen', Description=NULL, Help=NULL WHERE AD_Element_ID = 579311
;
-- 2021-06-18T06:13:24.295Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Schema-Zeilen', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 579311
;
-- 2021-06-18T06:13:51.190Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Template lines are added automatically when using order batch entry with a product which is defined to trigger a compensation group creation', Name='Template Lines', PrintName='Template Lines',Updated=TO_TIMESTAMP('2021-06-18 09:13:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579311 AND AD_Language='en_US'
;
-- 2021-06-18T06:13:51.191Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579311,'en_US')
;
-- 2021-06-18T06:18:52.270Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='Kompensationszeilen', PrintName='Kompensationszeilen',Updated=TO_TIMESTAMP('2021-06-18 09:18:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543890 AND AD_Language='de_CH'
;
-- 2021-06-18T06:18:52.271Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543890,'de_CH')
;
-- 2021-06-18T06:19:02.328Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Compensations', PrintName='Compensations',Updated=TO_TIMESTAMP('2021-06-18 09:19:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543890 AND AD_Language='en_US'
;
-- 2021-06-18T06:19:02.341Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543890,'en_US')
;
-- 2021-06-18T06:19:03.569Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-06-18 09:19:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543890 AND AD_Language='de_CH'
;
-- 2021-06-18T06:19:03.569Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543890,'de_CH')
;
-- 2021-06-18T06:19:19.670Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', IsTranslated='Y', Name='Kompensationszeilen', PrintName='Kompensationszeilen',Updated=TO_TIMESTAMP('2021-06-18 09:19:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543890 AND AD_Language='de_DE'
;
-- 2021-06-18T06:19:19.675Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543890,'de_DE')
;
-- 2021-06-18T06:19:19.687Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(543890,'de_DE')
;
-- 2021-06-18T06:19:19.689Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='C_CompensationGroup_SchemaLine_ID', Name='Kompensationszeilen', Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', Help=NULL WHERE AD_Element_ID=543890
;
-- 2021-06-18T06:19:19.690Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_CompensationGroup_SchemaLine_ID', Name='Kompensationszeilen', Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', Help=NULL, AD_Element_ID=543890 WHERE UPPER(ColumnName)='C_COMPENSATIONGROUP_SCHEMALINE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-06-18T06:19:19.691Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='C_CompensationGroup_SchemaLine_ID', Name='Kompensationszeilen', Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', Help=NULL WHERE AD_Element_ID=543890 AND IsCentrallyMaintained='Y'
;
-- 2021-06-18T06:19:19.691Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Kompensationszeilen', Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=543890) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 543890)
;
-- 2021-06-18T06:19:19.708Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Kompensationszeilen', Name='Kompensationszeilen' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=543890)
;
-- 2021-06-18T06:19:19.709Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Kompensationszeilen', Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 543890
;
-- 2021-06-18T06:19:19.710Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Kompensationszeilen', Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', Help=NULL WHERE AD_Element_ID = 543890
;
-- 2021-06-18T06:19:19.711Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Kompensationszeilen', Description = 'Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 543890
;
-- 2021-06-18T06:19:22.809Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.',Updated=TO_TIMESTAMP('2021-06-18 09:19:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543890 AND AD_Language='de_CH'
;
-- 2021-06-18T06:19:22.810Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543890,'de_CH')
;
-- 2021-06-18T06:19:28.587Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Compensation lines are lines which are added at the bottom of the group (when created or updated) in order to apply discounts or surcharges.',Updated=TO_TIMESTAMP('2021-06-18 09:19:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543890 AND AD_Language='en_US'
;
-- 2021-06-18T06:19:28.588Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(543890,'en_US')
;
-- 2021-06-18T06:19:55.170Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Element_ID=543890, CommitWarning=NULL, Description='Kompensationszeilen werden bei der Auftragserfassung automatisch eingefügt, um Rabatte oder Gebühren abzubilden.', Help=NULL, Name='Kompensationszeilen',Updated=TO_TIMESTAMP('2021-06-18 09:19:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=541042
;
-- 2021-06-18T06:19:55.192Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_tab_translation_from_ad_element(543890)
;
-- 2021-06-18T06:19:55.227Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Tab(541042)
;
-- 2021-06-18T06:20:33.031Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Products listed in this tab are allowed to have no contract conditions even though the compensation group has contract conditions set.', IsTranslated='Y', Name='Products excl. from subscription', PrintName='Products excl. from subscription',Updated=TO_TIMESTAMP('2021-06-18 09:20:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579275 AND AD_Language='en_US'
;
-- 2021-06-18T06:20:33.032Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579275,'en_US')
;
-- 2021-06-18T06:21:13.318Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Produkte ohne Vertrag', PrintName='Produkte ohne Vertrag',Updated=TO_TIMESTAMP('2021-06-18 09:21:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579275 AND AD_Language='de_DE'
;
-- 2021-06-18T06:21:13.319Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579275,'de_DE')
;
-- 2021-06-18T06:21:13.324Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(579275,'de_DE')
;
-- 2021-06-18T06:21:13.326Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='M_Product_Exclude_FlatrateConditions_ID', Name='Produkte ohne Vertrag', Description=NULL, Help=NULL WHERE AD_Element_ID=579275
;
-- 2021-06-18T06:21:13.327Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='M_Product_Exclude_FlatrateConditions_ID', Name='Produkte ohne Vertrag', Description=NULL, Help=NULL, AD_Element_ID=579275 WHERE UPPER(ColumnName)='M_PRODUCT_EXCLUDE_FLATRATECONDITIONS_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-06-18T06:21:13.327Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='M_Product_Exclude_FlatrateConditions_ID', Name='Produkte ohne Vertrag', Description=NULL, Help=NULL WHERE AD_Element_ID=579275 AND IsCentrallyMaintained='Y'
;
-- 2021-06-18T06:21:13.327Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Produkte ohne Vertrag', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=579275) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 579275)
;
-- 2021-06-18T06:21:13.339Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Produkte ohne Vertrag', Name='Produkte ohne Vertrag' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=579275)
;
-- 2021-06-18T06:21:13.340Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Produkte ohne Vertrag', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 579275
;
-- 2021-06-18T06:21:13.342Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Produkte ohne Vertrag', Description=NULL, Help=NULL WHERE AD_Element_ID = 579275
;
-- 2021-06-18T06:21:13.343Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Produkte ohne Vertrag', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 579275
;
-- 2021-06-18T06:21:20.368Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Produkte ohne Vertrag', PrintName='Produkte ohne Vertrag',Updated=TO_TIMESTAMP('2021-06-18 09:21:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579275 AND AD_Language='de_CH'
;
-- 2021-06-18T06:21:20.369Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579275,'de_CH')
;
-- 2021-06-18T06:21:28.903Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.',Updated=TO_TIMESTAMP('2021-06-18 09:21:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579275 AND AD_Language='de_CH'
;
-- 2021-06-18T06:21:28.904Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579275,'de_CH')
;
-- 2021-06-18T06:21:31.175Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Description='Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.',Updated=TO_TIMESTAMP('2021-06-18 09:21:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579275 AND AD_Language='de_DE'
;
-- 2021-06-18T06:21:31.176Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579275,'de_DE')
;
-- 2021-06-18T06:21:31.182Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_ad_element_on_ad_element_trl_update(579275,'de_DE')
;
-- 2021-06-18T06:21:31.182Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='M_Product_Exclude_FlatrateConditions_ID', Name='Produkte ohne Vertrag', Description='Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.', Help=NULL WHERE AD_Element_ID=579275
;
/*
* #%L
* de.metas.adempiere.adempiere.migration-sql
* %%
* Copyright (C) 2021 metas GmbH
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
-- 2021-06-18T06:21:31.182Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='M_Product_Exclude_FlatrateConditions_ID', Name='Produkte ohne Vertrag', Description='Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.', Help=NULL, AD_Element_ID=579275 WHERE UPPER(ColumnName)='M_PRODUCT_EXCLUDE_FLATRATECONDITIONS_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-06-18T06:21:31.183Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='M_Product_Exclude_FlatrateConditions_ID', Name='Produkte ohne Vertrag', Description='Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.', Help=NULL WHERE AD_Element_ID=579275 AND IsCentrallyMaintained='Y'
;
-- 2021-06-18T06:21:31.183Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Produkte ohne Vertrag', Description='Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.', Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=579275) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 579275)
;
-- 2021-06-18T06:21:31.197Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET Name='Produkte ohne Vertrag', Description='Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.', Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 579275
;
-- 2021-06-18T06:21:31.198Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_WINDOW SET Name='Produkte ohne Vertrag', Description='Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.', Help=NULL WHERE AD_Element_ID = 579275
;
-- 2021-06-18T06:21:31.198Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Name = 'Produkte ohne Vertrag', Description = 'Hier aufgelistete Produkte können bei der Auftragserfassung ohne Vertrag erfasst werden, auch wenn bei der Kompensationsguppe Vertragsbedingungen hinterlegt sind.', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 579275
; | the_stack |
-- Create schema for teleport tables teleport
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_namespace WHERE nspname = 'teleport') THEN
CREATE SCHEMA teleport;
END IF;
END
$$;
-- Define event_kind type.
-- ddl = schema changes
-- dml = data manipulation changes
-- outgoing events are created by triggers on the source
-- incoming events are created and consumed by teleport on the target
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'event_kind') THEN
CREATE TYPE teleport.event_kind AS ENUM ('ddl', 'dml', 'dml_batch');
END IF;
END
$$;
-- Define event_status type.
-- building = DDL/DML started and the previous state is saved
-- waiting_replication = events that need to be replayed to target
-- replicated = replicated events to target
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'event_status') THEN
CREATE TYPE teleport.event_status AS ENUM ('building', 'waiting_batch', 'batched', 'ignored');
END IF;
END
$$;
-- Define batch_status type.
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'batch_status') THEN
CREATE TYPE teleport.batch_status AS ENUM ('waiting_data', 'waiting_transmission', 'transmitted', 'waiting_apply', 'applied');
END IF;
END
$$;
-- Define batch_storage_type type.
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'batch_storage_type') THEN
CREATE TYPE teleport.batch_storage_type AS ENUM ('db', 'fs');
END IF;
END
$$;
-- Create table to store teleport events
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_tables WHERE schemaname = 'teleport' AND tablename = 'event') THEN
CREATE TABLE teleport.event (
id bigserial primary key,
kind teleport.event_kind,
status teleport.event_status,
trigger_tag text,
trigger_event text,
transaction_id bigint,
data text
);
END IF;
END
$$;
-- Create status index to make removal of events faster by the vacuum
DO $$
BEGIN
-- We need to check the event_status_index doesn't
-- exist before creating it
IF NOT EXISTS (
SELECT 1
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relname = 'event_status_index'
AND n.nspname = 'teleport'
) THEN
CREATE INDEX event_status_index ON teleport.event (status);
END IF;
END
$$;
-- Create table to store batches of data
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_tables WHERE schemaname = 'teleport' AND tablename = 'batch') THEN
CREATE TABLE teleport.batch (
id bigserial primary key,
status teleport.batch_status,
data_status teleport.batch_status,
storage_type teleport.batch_storage_type,
data text,
source text,
target text,
waiting_reexecution boolean not null default false,
last_executed_statement bigint default 0
);
END IF;
END
$$;
-- Create table to store events of a given batch
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_tables WHERE schemaname = 'teleport' AND tablename = 'batch_events') THEN
CREATE TABLE teleport.batch_events (
batch_id bigint,
event_id bigint
);
END IF;
END
$$;
-- Returns current schema of all tables in all schemas as a JSON
-- JSON array containing each column's definition.
CREATE OR REPLACE FUNCTION teleport.get_schema() RETURNS text AS $$
BEGIN
RETURN (
SELECT array_to_json(array_agg(row_to_json(data))) FROM (
-- The catalog pg_namespace stores namespaces. A namespace is the structure
-- underlying SQL schemas: each namespace can have a separate collection of
-- relations, types, etc. without name conflicts.
SELECT
oid AS oid,
nspname AS schema_name,
nspowner AS owner_id,
(
-- The catalog pg_class catalogs tables and most everything else that has columns
-- or is otherwise similar to a table. This includes indexes (but see also
-- pg_index), sequences, views, composite types, and some kinds of special
-- relation; see relkind. Below, when we mean all of these kinds of objects we
-- speak of "relations". Not all columns are meaningful for all relation types.
SELECT array_to_json(array_agg(row_to_json(class)))
FROM (
SELECT
oid AS oid,
relnamespace AS namespace_oid,
relkind AS relation_kind,
relname AS relation_name,
(
-- The catalog pg_attribute stores information about table columns. There will be
-- exactly one pg_attribute row for every column in every table in the database.
-- (There will also be attribute entries for indexes, and indeed all objects that
-- have pg_class entries.)
SELECT array_to_json(array_agg(row_to_json(attr)))
FROM (
SELECT
a.attrelid AS class_oid,
a.attname AS attr_name,
a.attnum AS attr_num,
t.typname AS type_name,
(
SELECT n.nspname
FROM pg_namespace n
WHERE n.oid = t.typnamespace
) AS type_schema,
t.oid AS type_oid,
COALESCE((
SELECT (a.attnum = ANY(indkey))
FROM pg_index i
WHERE indrelid = a.attrelid AND indisprimary
), false) AS is_primary_key
FROM pg_attribute a
INNER JOIN pg_type t
ON a.atttypid = t.oid
) attr
WHERE
attr.class_oid = class.oid AND
-- Ordinary columns are numbered from 1 up.
-- System columns have negative numbers.
attr.attr_num > 0
) AS columns,
(
-- The view pg_indexes provides access to useful information about each index
-- in the database.
SELECT array_to_json(array_agg(row_to_json(ind)))
FROM (
SELECT
i.indexrelid AS index_oid,
i.indrelid AS class_oid,
ic.relname AS index_name,
(
SELECT indexdef
FROM pg_indexes
WHERE
indexname = ic.relname AND
tablename = class.relname AND
schemaname = namespace.nspname
) AS index_def
FROM pg_index i
INNER JOIN pg_class ic
ON ic.oid = i.indexrelid
WHERE i.indisprimary = false
) ind
WHERE
ind.class_oid = class.oid
) AS indexes
FROM pg_class class
-- r = ordinary table,
-- i = index,
-- S = sequence,
-- v = view,
-- c = composite type,
-- s = special,
-- t = TOAST table
WHERE class.relkind IN ('r', 'i')
) class
WHERE class.namespace_oid = namespace.oid
) AS classes,
(
-- The catalog pg_type stores information about data types. Base types and enum
-- types (scalar types) are created with CREATE TYPE, and domains with CREATE
-- DOMAIN. A composite type is automatically created for each table in the
-- database, to represent the row structure of the table. It is also possible to
-- create composite types with CREATE TYPE AS.
SELECT array_to_json(array_agg(row_to_json(pgtype)))
FROM (
SELECT
pgtype.oid AS oid,
pgtype.typnamespace AS namespace_oid,
pgtype.typtype AS type_type,
pgtype.typname AS type_name,
(
-- The catalog pg_attribute stores information about table columns. There will be
-- exactly one pg_attribute row for every column in every table in the database.
-- (There will also be attribute entries for indexes, and indeed all objects that
-- have pg_class entries.)
SELECT array_to_json(array_agg(row_to_json(enum)))
FROM (
SELECT
oid AS oid,
enumtypid AS type_oid,
enumlabel AS name
FROM pg_enum
) enum
WHERE
enum.type_oid = pgtype.oid
) AS enums,
(
-- The catalog pg_attribute stores information about table columns. There will be
-- exactly one pg_attribute row for every column in every table in the database.
-- (There will also be attribute entries for indexes, and indeed all objects that
-- have pg_class entries.)
SELECT array_to_json(array_agg(row_to_json(attr)))
FROM (
SELECT
a.attrelid AS class_oid,
a.attname AS attr_name,
a.attnum AS attr_num,
t.typname AS type_name,
(
SELECT n.nspname
FROM pg_namespace n
WHERE n.oid = t.typnamespace
) AS type_schema,
t.oid AS type_oid
FROM pg_attribute a
INNER JOIN pg_type t
ON a.atttypid = t.oid
) attr
WHERE
attr.class_oid = pgtype.typrelid AND
-- Ordinary columns are numbered from 1 up.
-- System columns have negative numbers.
attr.attr_num > 0
) AS attributes
FROM pg_type pgtype
LEFT JOIN pg_class class
ON class.oid = pgtype.typrelid
-- typtype is:
-- b for a base type
-- c for a composite type (e.g., a table's row type)
-- d for a domain
-- e for an enum type
-- p for a pseudo-type
-- r for a range type
WHERE
(pgtype.typtype = 'e') OR
(pgtype.typtype = 'c' AND class.relkind = 'c')
) pgtype
WHERE pgtype.namespace_oid = namespace.oid
) AS types,
(
-- The catalog pg_proc stores information about functions (or procedures).
SELECT array_to_json(array_agg(row_to_json(proc)))
FROM (
SELECT
proc.oid AS oid,
proc.pronamespace AS namespace_oid,
proc.proname AS function_name,
pg_get_function_arguments(proc.oid) AS function_arguments,
pg_get_functiondef(proc.oid) AS function_def
FROM pg_proc proc
WHERE proc.proisagg = false
AND proc.proname NOT LIKE 'teleport%'
AND proc.prolang IN (
SELECT oid FROM pg_language WHERE lanname IN ('plpgsql', 'sql')
)
) proc
WHERE proc.namespace_oid = namespace.oid
) AS functions,
(
-- The catalog pg_extension stores information about the installed extensions.
SELECT array_to_json(array_agg(row_to_json(extension)))
FROM (
SELECT
ext.oid AS oid,
ext.extnamespace AS namespace_oid,
ext.extname AS extension_name
FROM pg_extension ext
) extension
WHERE extension.namespace_oid = namespace.oid
) AS extensions
FROM pg_namespace namespace
WHERE
namespace.nspname NOT IN ('pg_catalog', 'information_schema', 'pg_toast', 'teleport')
) data
);
END;
$$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION get_cuid() RETURNS text AS $$
BEGIN
END;
$$ LANGUAGE plpgsql;
-- Creates an event whenever there is a DML event
CREATE OR REPLACE FUNCTION teleport_dml_event() RETURNS TRIGGER AS $$
BEGIN
INSERT INTO teleport.event (data, kind, trigger_tag, trigger_event, transaction_id, status) VALUES
(
(
SELECT row_to_json(data) FROM (
SELECT
(CASE WHEN TG_OP = 'INSERT' THEN NULL ELSE OLD END) as pre,
(CASE WHEN TG_OP = 'DELETE' THEN NULL ELSE NEW END) as post
) data
)::text,
-- row_to_json(CASE WHEN TG_OP = 'DELETE' THEN OLD ELSE NEW END)::text,
'dml',
CONCAT(TG_TABLE_SCHEMA, '.', TG_RELNAME),
TG_OP,
txid_current(),
'waiting_batch'
);
RETURN NULL;
EXCEPTION WHEN OTHERS THEN
RETURN NULL;
END;
$$ LANGUAGE plpgsql; | the_stack |
-- start query 1 in stream 0 using template query10.tpl and seed 797269820
select
cd_gender,
cd_marital_status,
cd_education_status,
count(*) cnt1,
cd_purchase_estimate,
count(*) cnt2,
cd_credit_rating,
count(*) cnt3,
cd_dep_count,
count(*) cnt4,
cd_dep_employed_count,
count(*) cnt5,
cd_dep_college_count,
count(*) cnt6
from
customer c,customer_address ca,customer_demographics
where
c.c_current_addr_sk = ca.ca_address_sk and
ca_county in ('Fillmore County','McPherson County','Bonneville County','Boone County','Brown County') and
cd_demo_sk = c.c_current_cdemo_sk and
exists (select *
from store_sales,date_dim
where c.c_customer_sk = ss_customer_sk and
ss_sold_date_sk = d_date_sk and
d_year = 2000 and
d_moy between 3 and 3+3) and
(exists (select *
from web_sales,date_dim
where c.c_customer_sk = ws_bill_customer_sk and
ws_sold_date_sk = d_date_sk and
d_year = 2000 and
d_moy between 3 ANd 3+3) or
exists (select *
from catalog_sales,date_dim
where c.c_customer_sk = cs_ship_customer_sk and
cs_sold_date_sk = d_date_sk and
d_year = 2000 and
d_moy between 3 and 3+3))
group by cd_gender,
cd_marital_status,
cd_education_status,
cd_purchase_estimate,
cd_credit_rating,
cd_dep_count,
cd_dep_employed_count,
cd_dep_college_count
order by cd_gender,
cd_marital_status,
cd_education_status,
cd_purchase_estimate,
cd_credit_rating,
cd_dep_count,
cd_dep_employed_count,
cd_dep_college_count
limit 100;
-- end query 1 in stream 0 using template query10.tpl
-- start query 1 in stream 0 using template query11.tpl and seed 1819994127
with year_total as (
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,c_preferred_cust_flag customer_preferred_cust_flag
,c_birth_country customer_birth_country
,c_login customer_login
,c_email_address customer_email_address
,d_year dyear
,sum(ss_ext_list_price-ss_ext_discount_amt) year_total
,'s' sale_type
from customer
,store_sales
,date_dim
where c_customer_sk = ss_customer_sk
and ss_sold_date_sk = d_date_sk
group by c_customer_id
,c_first_name
,c_last_name
,c_preferred_cust_flag
,c_birth_country
,c_login
,c_email_address
,d_year
union all
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,c_preferred_cust_flag customer_preferred_cust_flag
,c_birth_country customer_birth_country
,c_login customer_login
,c_email_address customer_email_address
,d_year dyear
,sum(ws_ext_list_price-ws_ext_discount_amt) year_total
,'w' sale_type
from customer
,web_sales
,date_dim
where c_customer_sk = ws_bill_customer_sk
and ws_sold_date_sk = d_date_sk
group by c_customer_id
,c_first_name
,c_last_name
,c_preferred_cust_flag
,c_birth_country
,c_login
,c_email_address
,d_year
)
select
t_s_secyear.customer_id
,t_s_secyear.customer_first_name
,t_s_secyear.customer_last_name
,t_s_secyear.customer_birth_country
from year_total t_s_firstyear
,year_total t_s_secyear
,year_total t_w_firstyear
,year_total t_w_secyear
where t_s_secyear.customer_id = t_s_firstyear.customer_id
and t_s_firstyear.customer_id = t_w_secyear.customer_id
and t_s_firstyear.customer_id = t_w_firstyear.customer_id
and t_s_firstyear.sale_type = 's'
and t_w_firstyear.sale_type = 'w'
and t_s_secyear.sale_type = 's'
and t_w_secyear.sale_type = 'w'
and t_s_firstyear.dyear = 1999
and t_s_secyear.dyear = 1999+1
and t_w_firstyear.dyear = 1999
and t_w_secyear.dyear = 1999+1
and t_s_firstyear.year_total > 0
and t_w_firstyear.year_total > 0
and case when t_w_firstyear.year_total > 0 then t_w_secyear.year_total / t_w_firstyear.year_total else 0.0 end
> case when t_s_firstyear.year_total > 0 then t_s_secyear.year_total / t_s_firstyear.year_total else 0.0 end
order by t_s_secyear.customer_id
,t_s_secyear.customer_first_name
,t_s_secyear.customer_last_name
,t_s_secyear.customer_birth_country
limit 100;
-- end query 1 in stream 0 using template query11.tpl
-- start query 1 in stream 0 using template query12.tpl and seed 345591136
select i_item_id
,i_item_desc
,i_category
,i_class
,i_current_price
,sum(ws_ext_sales_price) as itemrevenue
,sum(ws_ext_sales_price)*100/sum(sum(ws_ext_sales_price)) over
(partition by i_class) as revenueratio
from
web_sales
,item
,date_dim
where
ws_item_sk = i_item_sk
and i_category in ('Electronics', 'Books', 'Women')
and ws_sold_date_sk = d_date_sk
and d_date between cast('1998-01-06' as date)
and (cast('1998-01-06' as date) + 30 days)
group by
i_item_id
,i_item_desc
,i_category
,i_class
,i_current_price
order by
i_category
,i_class
,i_item_id
,i_item_desc
,revenueratio
limit 100;
-- end query 1 in stream 0 using template query12.tpl
-- start query 1 in stream 0 using template query13.tpl and seed 622697896
select avg(ss_quantity)
,avg(ss_ext_sales_price)
,avg(ss_ext_wholesale_cost)
,sum(ss_ext_wholesale_cost)
from store_sales
,store
,customer_demographics
,household_demographics
,customer_address
,date_dim
where s_store_sk = ss_store_sk
and ss_sold_date_sk = d_date_sk and d_year = 2001
and((ss_hdemo_sk=hd_demo_sk
and cd_demo_sk = ss_cdemo_sk
and cd_marital_status = 'U'
and cd_education_status = 'Secondary'
and ss_sales_price between 100.00 and 150.00
and hd_dep_count = 3
)or
(ss_hdemo_sk=hd_demo_sk
and cd_demo_sk = ss_cdemo_sk
and cd_marital_status = 'W'
and cd_education_status = 'College'
and ss_sales_price between 50.00 and 100.00
and hd_dep_count = 1
) or
(ss_hdemo_sk=hd_demo_sk
and cd_demo_sk = ss_cdemo_sk
and cd_marital_status = 'D'
and cd_education_status = 'Primary'
and ss_sales_price between 150.00 and 200.00
and hd_dep_count = 1
))
and((ss_addr_sk = ca_address_sk
and ca_country = 'United States'
and ca_state in ('TX', 'OK', 'MI')
and ss_net_profit between 100 and 200
) or
(ss_addr_sk = ca_address_sk
and ca_country = 'United States'
and ca_state in ('WA', 'NC', 'OH')
and ss_net_profit between 150 and 300
) or
(ss_addr_sk = ca_address_sk
and ca_country = 'United States'
and ca_state in ('MT', 'FL', 'GA')
and ss_net_profit between 50 and 250
))
;
-- end query 1 in stream 0 using template query13.tpl
-- start query 1 in stream 0 using template query14.tpl and seed 1819994127
with cross_items as
(select i_item_sk ss_item_sk
from item,
(select iss.i_brand_id brand_id
,iss.i_class_id class_id
,iss.i_category_id category_id
from store_sales
,item iss
,date_dim d1
where ss_item_sk = iss.i_item_sk
and ss_sold_date_sk = d1.d_date_sk
and d1.d_year between 2000 AND 2000 + 2
intersect
select ics.i_brand_id
,ics.i_class_id
,ics.i_category_id
from catalog_sales
,item ics
,date_dim d2
where cs_item_sk = ics.i_item_sk
and cs_sold_date_sk = d2.d_date_sk
and d2.d_year between 2000 AND 2000 + 2
intersect
select iws.i_brand_id
,iws.i_class_id
,iws.i_category_id
from web_sales
,item iws
,date_dim d3
where ws_item_sk = iws.i_item_sk
and ws_sold_date_sk = d3.d_date_sk
and d3.d_year between 2000 AND 2000 + 2) x
where i_brand_id = brand_id
and i_class_id = class_id
and i_category_id = category_id
),
avg_sales as
(select avg(quantity*list_price) average_sales
from (select ss_quantity quantity
,ss_list_price list_price
from store_sales
,date_dim
where ss_sold_date_sk = d_date_sk
and d_year between 2000 and 2000 + 2
union all
select cs_quantity quantity
,cs_list_price list_price
from catalog_sales
,date_dim
where cs_sold_date_sk = d_date_sk
and d_year between 2000 and 2000 + 2
union all
select ws_quantity quantity
,ws_list_price list_price
from web_sales
,date_dim
where ws_sold_date_sk = d_date_sk
and d_year between 2000 and 2000 + 2) x)
select channel, i_brand_id,i_class_id,i_category_id,sum(sales), sum(number_sales)
from(
select 'store' channel, i_brand_id,i_class_id
,i_category_id,sum(ss_quantity*ss_list_price) sales
, count(*) number_sales
from store_sales
,item
,date_dim
where ss_item_sk in (select ss_item_sk from cross_items)
and ss_item_sk = i_item_sk
and ss_sold_date_sk = d_date_sk
and d_year = 2000+2
and d_moy = 11
group by i_brand_id,i_class_id,i_category_id
having sum(ss_quantity*ss_list_price) > (select average_sales from avg_sales)
union all
select 'catalog' channel, i_brand_id,i_class_id,i_category_id, sum(cs_quantity*cs_list_price) sales, count(*) number_sales
from catalog_sales
,item
,date_dim
where cs_item_sk in (select ss_item_sk from cross_items)
and cs_item_sk = i_item_sk
and cs_sold_date_sk = d_date_sk
and d_year = 2000+2
and d_moy = 11
group by i_brand_id,i_class_id,i_category_id
having sum(cs_quantity*cs_list_price) > (select average_sales from avg_sales)
union all
select 'web' channel, i_brand_id,i_class_id,i_category_id, sum(ws_quantity*ws_list_price) sales , count(*) number_sales
from web_sales
,item
,date_dim
where ws_item_sk in (select ss_item_sk from cross_items)
and ws_item_sk = i_item_sk
and ws_sold_date_sk = d_date_sk
and d_year = 2000+2
and d_moy = 11
group by i_brand_id,i_class_id,i_category_id
having sum(ws_quantity*ws_list_price) > (select average_sales from avg_sales)
) y
group by rollup (channel, i_brand_id,i_class_id,i_category_id)
order by channel,i_brand_id,i_class_id,i_category_id
limit 100;
with cross_items as
(select i_item_sk ss_item_sk
from item,
(select iss.i_brand_id brand_id
,iss.i_class_id class_id
,iss.i_category_id category_id
from store_sales
,item iss
,date_dim d1
where ss_item_sk = iss.i_item_sk
and ss_sold_date_sk = d1.d_date_sk
and d1.d_year between 2000 AND 2000 + 2
intersect
select ics.i_brand_id
,ics.i_class_id
,ics.i_category_id
from catalog_sales
,item ics
,date_dim d2
where cs_item_sk = ics.i_item_sk
and cs_sold_date_sk = d2.d_date_sk
and d2.d_year between 2000 AND 2000 + 2
intersect
select iws.i_brand_id
,iws.i_class_id
,iws.i_category_id
from web_sales
,item iws
,date_dim d3
where ws_item_sk = iws.i_item_sk
and ws_sold_date_sk = d3.d_date_sk
and d3.d_year between 2000 AND 2000 + 2) x
where i_brand_id = brand_id
and i_class_id = class_id
and i_category_id = category_id
),
avg_sales as
(select avg(quantity*list_price) average_sales
from (select ss_quantity quantity
,ss_list_price list_price
from store_sales
,date_dim
where ss_sold_date_sk = d_date_sk
and d_year between 2000 and 2000 + 2
union all
select cs_quantity quantity
,cs_list_price list_price
from catalog_sales
,date_dim
where cs_sold_date_sk = d_date_sk
and d_year between 2000 and 2000 + 2
union all
select ws_quantity quantity
,ws_list_price list_price
from web_sales
,date_dim
where ws_sold_date_sk = d_date_sk
and d_year between 2000 and 2000 + 2) x)
select this_year.channel ty_channel
,this_year.i_brand_id ty_brand
,this_year.i_class_id ty_class
,this_year.i_category_id ty_category
,this_year.sales ty_sales
,this_year.number_sales ty_number_sales
,last_year.channel ly_channel
,last_year.i_brand_id ly_brand
,last_year.i_class_id ly_class
,last_year.i_category_id ly_category
,last_year.sales ly_sales
,last_year.number_sales ly_number_sales
from
(select 'store' channel, i_brand_id,i_class_id,i_category_id
,sum(ss_quantity*ss_list_price) sales, count(*) number_sales
from store_sales
,item
,date_dim
where ss_item_sk in (select ss_item_sk from cross_items)
and ss_item_sk = i_item_sk
and ss_sold_date_sk = d_date_sk
and d_week_seq = (select d_week_seq
from date_dim
where d_year = 2000 + 1
and d_moy = 12
and d_dom = 15)
group by i_brand_id,i_class_id,i_category_id
having sum(ss_quantity*ss_list_price) > (select average_sales from avg_sales)) this_year,
(select 'store' channel, i_brand_id,i_class_id
,i_category_id, sum(ss_quantity*ss_list_price) sales, count(*) number_sales
from store_sales
,item
,date_dim
where ss_item_sk in (select ss_item_sk from cross_items)
and ss_item_sk = i_item_sk
and ss_sold_date_sk = d_date_sk
and d_week_seq = (select d_week_seq
from date_dim
where d_year = 2000
and d_moy = 12
and d_dom = 15)
group by i_brand_id,i_class_id,i_category_id
having sum(ss_quantity*ss_list_price) > (select average_sales from avg_sales)) last_year
where this_year.i_brand_id= last_year.i_brand_id
and this_year.i_class_id = last_year.i_class_id
and this_year.i_category_id = last_year.i_category_id
order by this_year.channel, this_year.i_brand_id, this_year.i_class_id, this_year.i_category_id
limit 100;
-- end query 1 in stream 0 using template query14.tpl
-- start query 1 in stream 0 using template query15.tpl and seed 1819994127
select ca_zip
,sum(cs_sales_price)
from catalog_sales
,customer
,customer_address
,date_dim
where cs_bill_customer_sk = c_customer_sk
and c_current_addr_sk = ca_address_sk
and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475',
'85392', '85460', '80348', '81792')
or ca_state in ('CA','WA','GA')
or cs_sales_price > 500)
and cs_sold_date_sk = d_date_sk
and d_qoy = 2 and d_year = 1998
group by ca_zip
order by ca_zip
limit 100;
-- end query 1 in stream 0 using template query15.tpl
-- start query 1 in stream 0 using template query16.tpl and seed 171719422
select
count(distinct cs_order_number) as `order count`
,sum(cs_ext_ship_cost) as `total shipping cost`
,sum(cs_net_profit) as `total net profit`
from
catalog_sales cs1
,date_dim
,customer_address
,call_center
where
d_date between '1999-4-01' and
(cast('1999-4-01' as date) + 60 days)
and cs1.cs_ship_date_sk = d_date_sk
and cs1.cs_ship_addr_sk = ca_address_sk
and ca_state = 'IL'
and cs1.cs_call_center_sk = cc_call_center_sk
and cc_county in ('Richland County','Bronx County','Maverick County','Mesa County',
'Raleigh County'
)
and exists (select *
from catalog_sales cs2
where cs1.cs_order_number = cs2.cs_order_number
and cs1.cs_warehouse_sk <> cs2.cs_warehouse_sk)
and not exists(select *
from catalog_returns cr1
where cs1.cs_order_number = cr1.cr_order_number)
order by count(distinct cs_order_number)
limit 100;
-- end query 1 in stream 0 using template query16.tpl
-- start query 1 in stream 0 using template query17.tpl and seed 1819994127
select i_item_id
,i_item_desc
,s_state
,count(ss_quantity) as store_sales_quantitycount
,avg(ss_quantity) as store_sales_quantityave
,stddev_samp(ss_quantity) as store_sales_quantitystdev
,stddev_samp(ss_quantity)/avg(ss_quantity) as store_sales_quantitycov
,count(sr_return_quantity) as store_returns_quantitycount
,avg(sr_return_quantity) as store_returns_quantityave
,stddev_samp(sr_return_quantity) as store_returns_quantitystdev
,stddev_samp(sr_return_quantity)/avg(sr_return_quantity) as store_returns_quantitycov
,count(cs_quantity) as catalog_sales_quantitycount ,avg(cs_quantity) as catalog_sales_quantityave
,stddev_samp(cs_quantity) as catalog_sales_quantitystdev
,stddev_samp(cs_quantity)/avg(cs_quantity) as catalog_sales_quantitycov
from store_sales
,store_returns
,catalog_sales
,date_dim d1
,date_dim d2
,date_dim d3
,store
,item
where d1.d_quarter_name = '2000Q1'
and d1.d_date_sk = ss_sold_date_sk
and i_item_sk = ss_item_sk
and s_store_sk = ss_store_sk
and ss_customer_sk = sr_customer_sk
and ss_item_sk = sr_item_sk
and ss_ticket_number = sr_ticket_number
and sr_returned_date_sk = d2.d_date_sk
and d2.d_quarter_name in ('2000Q1','2000Q2','2000Q3')
and sr_customer_sk = cs_bill_customer_sk
and sr_item_sk = cs_item_sk
and cs_sold_date_sk = d3.d_date_sk
and d3.d_quarter_name in ('2000Q1','2000Q2','2000Q3')
group by i_item_id
,i_item_desc
,s_state
order by i_item_id
,i_item_desc
,s_state
limit 100;
-- end query 1 in stream 0 using template query17.tpl
-- start query 1 in stream 0 using template query18.tpl and seed 1978355063
select i_item_id,
ca_country,
ca_state,
ca_county,
avg( cast(cs_quantity as decimal(12,2))) agg1,
avg( cast(cs_list_price as decimal(12,2))) agg2,
avg( cast(cs_coupon_amt as decimal(12,2))) agg3,
avg( cast(cs_sales_price as decimal(12,2))) agg4,
avg( cast(cs_net_profit as decimal(12,2))) agg5,
avg( cast(c_birth_year as decimal(12,2))) agg6,
avg( cast(cd1.cd_dep_count as decimal(12,2))) agg7
from catalog_sales, customer_demographics cd1,
customer_demographics cd2, customer, customer_address, date_dim, item
where cs_sold_date_sk = d_date_sk and
cs_item_sk = i_item_sk and
cs_bill_cdemo_sk = cd1.cd_demo_sk and
cs_bill_customer_sk = c_customer_sk and
cd1.cd_gender = 'M' and
cd1.cd_education_status = 'Unknown' and
c_current_cdemo_sk = cd2.cd_demo_sk and
c_current_addr_sk = ca_address_sk and
c_birth_month in (5,1,4,7,8,9) and
d_year = 2002 and
ca_state in ('AR','TX','NC'
,'GA','MS','WV','AL')
group by rollup (i_item_id, ca_country, ca_state, ca_county)
order by ca_country,
ca_state,
ca_county,
i_item_id
limit 100;
-- end query 1 in stream 0 using template query18.tpl
-- start query 1 in stream 0 using template query19.tpl and seed 1930872976
select i_brand_id brand_id, i_brand brand, i_manufact_id, i_manufact,
sum(ss_ext_sales_price) ext_price
from date_dim, store_sales, item,customer,customer_address,store
where d_date_sk = ss_sold_date_sk
and ss_item_sk = i_item_sk
and i_manager_id=16
and d_moy=12
and d_year=1998
and ss_customer_sk = c_customer_sk
and c_current_addr_sk = ca_address_sk
and substr(ca_zip,1,5) <> substr(s_zip,1,5)
and ss_store_sk = s_store_sk
group by i_brand
,i_brand_id
,i_manufact_id
,i_manufact
order by ext_price desc
,i_brand
,i_brand_id
,i_manufact_id
,i_manufact
limit 100 ;
-- end query 1 in stream 0 using template query19.tpl
-- start query 1 in stream 0 using template query1.tpl and seed 2031708268
with customer_total_return as
(select sr_customer_sk as ctr_customer_sk
,sr_store_sk as ctr_store_sk
,sum(SR_FEE) as ctr_total_return
from store_returns
,date_dim
where sr_returned_date_sk = d_date_sk
and d_year =2000
group by sr_customer_sk
,sr_store_sk)
select c_customer_id
from customer_total_return ctr1
,store
,customer
where ctr1.ctr_total_return > (select avg(ctr_total_return)*1.2
from customer_total_return ctr2
where ctr1.ctr_store_sk = ctr2.ctr_store_sk)
and s_store_sk = ctr1.ctr_store_sk
and s_state = 'NM'
and ctr1.ctr_customer_sk = c_customer_sk
order by c_customer_id
limit 100;
-- end query 1 in stream 0 using template query1.tpl
-- start query 1 in stream 0 using template query20.tpl and seed 345591136
select i_item_id
,i_item_desc
,i_category
,i_class
,i_current_price
,sum(cs_ext_sales_price) as itemrevenue
,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over
(partition by i_class) as revenueratio
from catalog_sales
,item
,date_dim
where cs_item_sk = i_item_sk
and i_category in ('Shoes', 'Electronics', 'Children')
and cs_sold_date_sk = d_date_sk
and d_date between cast('2001-03-14' as date)
and (cast('2001-03-14' as date) + 30 days)
group by i_item_id
,i_item_desc
,i_category
,i_class
,i_current_price
order by i_category
,i_class
,i_item_id
,i_item_desc
,revenueratio
limit 100;
-- end query 1 in stream 0 using template query20.tpl
-- start query 1 in stream 0 using template query21.tpl and seed 1819994127
select *
from(select w_warehouse_name
,i_item_id
,sum(case when (cast(d_date as date) < cast ('1999-03-20' as date))
then inv_quantity_on_hand
else 0 end) as inv_before
,sum(case when (cast(d_date as date) >= cast ('1999-03-20' as date))
then inv_quantity_on_hand
else 0 end) as inv_after
from inventory
,warehouse
,item
,date_dim
where i_current_price between 0.99 and 1.49
and i_item_sk = inv_item_sk
and inv_warehouse_sk = w_warehouse_sk
and inv_date_sk = d_date_sk
and d_date between (cast ('1999-03-20' as date) - 30 days)
and (cast ('1999-03-20' as date) + 30 days)
group by w_warehouse_name, i_item_id) x
where (case when inv_before > 0
then inv_after / inv_before
else null
end) between 2.0/3.0 and 3.0/2.0
order by w_warehouse_name
,i_item_id
limit 100;
-- end query 1 in stream 0 using template query21.tpl
-- start query 1 in stream 0 using template query22.tpl and seed 1819994127
select i_product_name
,i_brand
,i_class
,i_category
,avg(inv_quantity_on_hand) qoh
from inventory
,date_dim
,item
where inv_date_sk=d_date_sk
and inv_item_sk=i_item_sk
and d_month_seq between 1186 and 1186 + 11
group by rollup(i_product_name
,i_brand
,i_class
,i_category)
order by qoh, i_product_name, i_brand, i_class, i_category
limit 100;
-- end query 1 in stream 0 using template query22.tpl
-- start query 1 in stream 0 using template query23.tpl and seed 2031708268
with frequent_ss_items as
(select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
from store_sales
,date_dim
,item
where ss_sold_date_sk = d_date_sk
and ss_item_sk = i_item_sk
and d_year in (2000,2000+1,2000+2,2000+3)
group by substr(i_item_desc,1,30),i_item_sk,d_date
having count(*) >4),
max_store_sales as
(select max(csales) tpcds_cmax
from (select c_customer_sk,sum(ss_quantity*ss_sales_price) csales
from store_sales
,customer
,date_dim
where ss_customer_sk = c_customer_sk
and ss_sold_date_sk = d_date_sk
and d_year in (2000,2000+1,2000+2,2000+3)
group by c_customer_sk) x),
best_ss_customer as
(select c_customer_sk,sum(ss_quantity*ss_sales_price) ssales
from store_sales
,customer
where ss_customer_sk = c_customer_sk
group by c_customer_sk
having sum(ss_quantity*ss_sales_price) > (95/100.0) * (select
*
from
max_store_sales))
select sum(sales)
from (select cs_quantity*cs_list_price sales
from catalog_sales
,date_dim
where d_year = 2000
and d_moy = 3
and cs_sold_date_sk = d_date_sk
and cs_item_sk in (select item_sk from frequent_ss_items)
and cs_bill_customer_sk in (select c_customer_sk from best_ss_customer)
union all
select ws_quantity*ws_list_price sales
from web_sales
,date_dim
where d_year = 2000
and d_moy = 3
and ws_sold_date_sk = d_date_sk
and ws_item_sk in (select item_sk from frequent_ss_items)
and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer)) y
limit 100;
with frequent_ss_items as
(select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
from store_sales
,date_dim
,item
where ss_sold_date_sk = d_date_sk
and ss_item_sk = i_item_sk
and d_year in (2000,2000 + 1,2000 + 2,2000 + 3)
group by substr(i_item_desc,1,30),i_item_sk,d_date
having count(*) >4),
max_store_sales as
(select max(csales) tpcds_cmax
from (select c_customer_sk,sum(ss_quantity*ss_sales_price) csales
from store_sales
,customer
,date_dim
where ss_customer_sk = c_customer_sk
and ss_sold_date_sk = d_date_sk
and d_year in (2000,2000+1,2000+2,2000+3)
group by c_customer_sk) x),
best_ss_customer as
(select c_customer_sk,sum(ss_quantity*ss_sales_price) ssales
from store_sales
,customer
where ss_customer_sk = c_customer_sk
group by c_customer_sk
having sum(ss_quantity*ss_sales_price) > (95/100.0) * (select
*
from max_store_sales))
select c_last_name,c_first_name,sales
from (select c_last_name,c_first_name,sum(cs_quantity*cs_list_price) sales
from catalog_sales
,customer
,date_dim
where d_year = 2000
and d_moy = 3
and cs_sold_date_sk = d_date_sk
and cs_item_sk in (select item_sk from frequent_ss_items)
and cs_bill_customer_sk in (select c_customer_sk from best_ss_customer)
and cs_bill_customer_sk = c_customer_sk
group by c_last_name,c_first_name
union all
select c_last_name,c_first_name,sum(ws_quantity*ws_list_price) sales
from web_sales
,customer
,date_dim
where d_year = 2000
and d_moy = 3
and ws_sold_date_sk = d_date_sk
and ws_item_sk in (select item_sk from frequent_ss_items)
and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer)
and ws_bill_customer_sk = c_customer_sk
group by c_last_name,c_first_name
order by c_last_name,c_first_name,sales) y
limit 100;
-- end query 1 in stream 0 using template query23.tpl
-- start query 1 in stream 0 using template query24.tpl and seed 1220860970
with ssales as
(select c_last_name
,c_first_name
,s_store_name
,ca_state
,s_state
,i_color
,i_current_price
,i_manager_id
,i_units
,i_size
,sum(ss_sales_price) netpaid
from store_sales
,store_returns
,store
,item
,customer
,customer_address
where ss_ticket_number = sr_ticket_number
and ss_item_sk = sr_item_sk
and ss_customer_sk = c_customer_sk
and ss_item_sk = i_item_sk
and ss_store_sk = s_store_sk
and c_current_addr_sk = ca_address_sk
and c_birth_country <> upper(ca_country)
and s_zip = ca_zip
and s_market_id=10
group by c_last_name
,c_first_name
,s_store_name
,ca_state
,s_state
,i_color
,i_current_price
,i_manager_id
,i_units
,i_size)
select c_last_name
,c_first_name
,s_store_name
,sum(netpaid) paid
from ssales
where i_color = 'snow'
group by c_last_name
,c_first_name
,s_store_name
having sum(netpaid) > (select 0.05*avg(netpaid)
from ssales)
order by c_last_name
,c_first_name
,s_store_name
;
with ssales as
(select c_last_name
,c_first_name
,s_store_name
,ca_state
,s_state
,i_color
,i_current_price
,i_manager_id
,i_units
,i_size
,sum(ss_sales_price) netpaid
from store_sales
,store_returns
,store
,item
,customer
,customer_address
where ss_ticket_number = sr_ticket_number
and ss_item_sk = sr_item_sk
and ss_customer_sk = c_customer_sk
and ss_item_sk = i_item_sk
and ss_store_sk = s_store_sk
and c_current_addr_sk = ca_address_sk
and c_birth_country <> upper(ca_country)
and s_zip = ca_zip
and s_market_id = 10
group by c_last_name
,c_first_name
,s_store_name
,ca_state
,s_state
,i_color
,i_current_price
,i_manager_id
,i_units
,i_size)
select c_last_name
,c_first_name
,s_store_name
,sum(netpaid) paid
from ssales
where i_color = 'chiffon'
group by c_last_name
,c_first_name
,s_store_name
having sum(netpaid) > (select 0.05*avg(netpaid)
from ssales)
order by c_last_name
,c_first_name
,s_store_name
;
-- end query 1 in stream 0 using template query24.tpl
-- start query 1 in stream 0 using template query25.tpl and seed 1819994127
select
i_item_id
,i_item_desc
,s_store_id
,s_store_name
,sum(ss_net_profit) as store_sales_profit
,sum(sr_net_loss) as store_returns_loss
,sum(cs_net_profit) as catalog_sales_profit
from
store_sales
,store_returns
,catalog_sales
,date_dim d1
,date_dim d2
,date_dim d3
,store
,item
where
d1.d_moy = 4
and d1.d_year = 2000
and d1.d_date_sk = ss_sold_date_sk
and i_item_sk = ss_item_sk
and s_store_sk = ss_store_sk
and ss_customer_sk = sr_customer_sk
and ss_item_sk = sr_item_sk
and ss_ticket_number = sr_ticket_number
and sr_returned_date_sk = d2.d_date_sk
and d2.d_moy between 4 and 10
and d2.d_year = 2000
and sr_customer_sk = cs_bill_customer_sk
and sr_item_sk = cs_item_sk
and cs_sold_date_sk = d3.d_date_sk
and d3.d_moy between 4 and 10
and d3.d_year = 2000
group by
i_item_id
,i_item_desc
,s_store_id
,s_store_name
order by
i_item_id
,i_item_desc
,s_store_id
,s_store_name
limit 100;
-- end query 1 in stream 0 using template query25.tpl
-- start query 1 in stream 0 using template query26.tpl and seed 1930872976
select i_item_id,
avg(cs_quantity) agg1,
avg(cs_list_price) agg2,
avg(cs_coupon_amt) agg3,
avg(cs_sales_price) agg4
from catalog_sales, customer_demographics, date_dim, item, promotion
where cs_sold_date_sk = d_date_sk and
cs_item_sk = i_item_sk and
cs_bill_cdemo_sk = cd_demo_sk and
cs_promo_sk = p_promo_sk and
cd_gender = 'F' and
cd_marital_status = 'S' and
cd_education_status = 'College' and
(p_channel_email = 'N' or p_channel_event = 'N') and
d_year = 1998
group by i_item_id
order by i_item_id
limit 100;
-- end query 1 in stream 0 using template query26.tpl
-- start query 1 in stream 0 using template query27.tpl and seed 2017787633
select i_item_id,
s_state, grouping(s_state) g_state,
avg(ss_quantity) agg1,
avg(ss_list_price) agg2,
avg(ss_coupon_amt) agg3,
avg(ss_sales_price) agg4
from store_sales, customer_demographics, date_dim, store, item
where ss_sold_date_sk = d_date_sk and
ss_item_sk = i_item_sk and
ss_store_sk = s_store_sk and
ss_cdemo_sk = cd_demo_sk and
cd_gender = 'F' and
cd_marital_status = 'U' and
cd_education_status = '2 yr Degree' and
d_year = 2000 and
s_state in ('AL','IN', 'SC', 'NY', 'OH', 'FL')
group by rollup (i_item_id, s_state)
order by i_item_id
,s_state
limit 100;
-- end query 1 in stream 0 using template query27.tpl
-- start query 1 in stream 0 using template query28.tpl and seed 444293455
select *
from (select avg(ss_list_price) B1_LP
,count(ss_list_price) B1_CNT
,count(distinct ss_list_price) B1_CNTD
from store_sales
where ss_quantity between 0 and 5
and (ss_list_price between 73 and 73+10
or ss_coupon_amt between 7826 and 7826+1000
or ss_wholesale_cost between 70 and 70+20)) B1,
(select avg(ss_list_price) B2_LP
,count(ss_list_price) B2_CNT
,count(distinct ss_list_price) B2_CNTD
from store_sales
where ss_quantity between 6 and 10
and (ss_list_price between 152 and 152+10
or ss_coupon_amt between 2196 and 2196+1000
or ss_wholesale_cost between 56 and 56+20)) B2,
(select avg(ss_list_price) B3_LP
,count(ss_list_price) B3_CNT
,count(distinct ss_list_price) B3_CNTD
from store_sales
where ss_quantity between 11 and 15
and (ss_list_price between 53 and 53+10
or ss_coupon_amt between 3430 and 3430+1000
or ss_wholesale_cost between 13 and 13+20)) B3,
(select avg(ss_list_price) B4_LP
,count(ss_list_price) B4_CNT
,count(distinct ss_list_price) B4_CNTD
from store_sales
where ss_quantity between 16 and 20
and (ss_list_price between 182 and 182+10
or ss_coupon_amt between 3262 and 3262+1000
or ss_wholesale_cost between 20 and 20+20)) B4,
(select avg(ss_list_price) B5_LP
,count(ss_list_price) B5_CNT
,count(distinct ss_list_price) B5_CNTD
from store_sales
where ss_quantity between 21 and 25
and (ss_list_price between 85 and 85+10
or ss_coupon_amt between 3310 and 3310+1000
or ss_wholesale_cost between 37 and 37+20)) B5,
(select avg(ss_list_price) B6_LP
,count(ss_list_price) B6_CNT
,count(distinct ss_list_price) B6_CNTD
from store_sales
where ss_quantity between 26 and 30
and (ss_list_price between 180 and 180+10
or ss_coupon_amt between 12592 and 12592+1000
or ss_wholesale_cost between 22 and 22+20)) B6
limit 100;
-- end query 1 in stream 0 using template query28.tpl
-- start query 1 in stream 0 using template query29.tpl and seed 2031708268
select
i_item_id
,i_item_desc
,s_store_id
,s_store_name
,stddev_samp(ss_quantity) as store_sales_quantity
,stddev_samp(sr_return_quantity) as store_returns_quantity
,stddev_samp(cs_quantity) as catalog_sales_quantity
from
store_sales
,store_returns
,catalog_sales
,date_dim d1
,date_dim d2
,date_dim d3
,store
,item
where
d1.d_moy = 4
and d1.d_year = 1998
and d1.d_date_sk = ss_sold_date_sk
and i_item_sk = ss_item_sk
and s_store_sk = ss_store_sk
and ss_customer_sk = sr_customer_sk
and ss_item_sk = sr_item_sk
and ss_ticket_number = sr_ticket_number
and sr_returned_date_sk = d2.d_date_sk
and d2.d_moy between 4 and 4 + 3
and d2.d_year = 1998
and sr_customer_sk = cs_bill_customer_sk
and sr_item_sk = cs_item_sk
and cs_sold_date_sk = d3.d_date_sk
and d3.d_year in (1998,1998+1,1998+2)
group by
i_item_id
,i_item_desc
,s_store_id
,s_store_name
order by
i_item_id
,i_item_desc
,s_store_id
,s_store_name
limit 100;
-- end query 1 in stream 0 using template query29.tpl
-- start query 1 in stream 0 using template query2.tpl and seed 1819994127
with wscs as
(select sold_date_sk
,sales_price
from (select ws_sold_date_sk sold_date_sk
,ws_ext_sales_price sales_price
from web_sales) x
union all
(select cs_sold_date_sk sold_date_sk
,cs_ext_sales_price sales_price
from catalog_sales)),
wswscs as
(select d_week_seq,
sum(case when (d_day_name='Sunday') then sales_price else null end) sun_sales,
sum(case when (d_day_name='Monday') then sales_price else null end) mon_sales,
sum(case when (d_day_name='Tuesday') then sales_price else null end) tue_sales,
sum(case when (d_day_name='Wednesday') then sales_price else null end) wed_sales,
sum(case when (d_day_name='Thursday') then sales_price else null end) thu_sales,
sum(case when (d_day_name='Friday') then sales_price else null end) fri_sales,
sum(case when (d_day_name='Saturday') then sales_price else null end) sat_sales
from wscs
,date_dim
where d_date_sk = sold_date_sk
group by d_week_seq)
select d_week_seq1
,round(sun_sales1/sun_sales2,2)
,round(mon_sales1/mon_sales2,2)
,round(tue_sales1/tue_sales2,2)
,round(wed_sales1/wed_sales2,2)
,round(thu_sales1/thu_sales2,2)
,round(fri_sales1/fri_sales2,2)
,round(sat_sales1/sat_sales2,2)
from
(select wswscs.d_week_seq d_week_seq1
,sun_sales sun_sales1
,mon_sales mon_sales1
,tue_sales tue_sales1
,wed_sales wed_sales1
,thu_sales thu_sales1
,fri_sales fri_sales1
,sat_sales sat_sales1
from wswscs,date_dim
where date_dim.d_week_seq = wswscs.d_week_seq and
d_year = 1998) y,
(select wswscs.d_week_seq d_week_seq2
,sun_sales sun_sales2
,mon_sales mon_sales2
,tue_sales tue_sales2
,wed_sales wed_sales2
,thu_sales thu_sales2
,fri_sales fri_sales2
,sat_sales sat_sales2
from wswscs
,date_dim
where date_dim.d_week_seq = wswscs.d_week_seq and
d_year = 1998+1) z
where d_week_seq1=d_week_seq2-53
order by d_week_seq1;
-- end query 1 in stream 0 using template query2.tpl
-- start query 1 in stream 0 using template query30.tpl and seed 1819994127
with customer_total_return as
(select wr_returning_customer_sk as ctr_customer_sk
,ca_state as ctr_state,
sum(wr_return_amt) as ctr_total_return
from web_returns
,date_dim
,customer_address
where wr_returned_date_sk = d_date_sk
and d_year =2000
and wr_returning_addr_sk = ca_address_sk
group by wr_returning_customer_sk
,ca_state)
select c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag
,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address
,c_last_review_date_sk,ctr_total_return
from customer_total_return ctr1
,customer_address
,customer
where ctr1.ctr_total_return > (select avg(ctr_total_return)*1.2
from customer_total_return ctr2
where ctr1.ctr_state = ctr2.ctr_state)
and ca_address_sk = c_current_addr_sk
and ca_state = 'GA'
and ctr1.ctr_customer_sk = c_customer_sk
order by c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag
,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address
,c_last_review_date_sk,ctr_total_return
limit 100;
-- end query 1 in stream 0 using template query30.tpl
-- start query 1 in stream 0 using template query31.tpl and seed 1819994127
with ss as
(select ca_county,d_qoy, d_year,sum(ss_ext_sales_price) as store_sales
from store_sales,date_dim,customer_address
where ss_sold_date_sk = d_date_sk
and ss_addr_sk=ca_address_sk
group by ca_county,d_qoy, d_year),
ws as
(select ca_county,d_qoy, d_year,sum(ws_ext_sales_price) as web_sales
from web_sales,date_dim,customer_address
where ws_sold_date_sk = d_date_sk
and ws_bill_addr_sk=ca_address_sk
group by ca_county,d_qoy, d_year)
select
ss1.ca_county
,ss1.d_year
,ws2.web_sales/ws1.web_sales web_q1_q2_increase
,ss2.store_sales/ss1.store_sales store_q1_q2_increase
,ws3.web_sales/ws2.web_sales web_q2_q3_increase
,ss3.store_sales/ss2.store_sales store_q2_q3_increase
from
ss ss1
,ss ss2
,ss ss3
,ws ws1
,ws ws2
,ws ws3
where
ss1.d_qoy = 1
and ss1.d_year = 1999
and ss1.ca_county = ss2.ca_county
and ss2.d_qoy = 2
and ss2.d_year = 1999
and ss2.ca_county = ss3.ca_county
and ss3.d_qoy = 3
and ss3.d_year = 1999
and ss1.ca_county = ws1.ca_county
and ws1.d_qoy = 1
and ws1.d_year = 1999
and ws1.ca_county = ws2.ca_county
and ws2.d_qoy = 2
and ws2.d_year = 1999
and ws1.ca_county = ws3.ca_county
and ws3.d_qoy = 3
and ws3.d_year =1999
and case when ws1.web_sales > 0 then ws2.web_sales/ws1.web_sales else null end
> case when ss1.store_sales > 0 then ss2.store_sales/ss1.store_sales else null end
and case when ws2.web_sales > 0 then ws3.web_sales/ws2.web_sales else null end
> case when ss2.store_sales > 0 then ss3.store_sales/ss2.store_sales else null end
order by ss1.d_year;
-- end query 1 in stream 0 using template query31.tpl
-- start query 1 in stream 0 using template query32.tpl and seed 2031708268
select sum(cs_ext_discount_amt) as `excess discount amount`
from
catalog_sales
,item
,date_dim
where
i_manufact_id = 66
and i_item_sk = cs_item_sk
and d_date between '2002-03-29' and
(cast('2002-03-29' as date) + 90 days)
and d_date_sk = cs_sold_date_sk
and cs_ext_discount_amt
> (
select
1.3 * avg(cs_ext_discount_amt)
from
catalog_sales
,date_dim
where
cs_item_sk = i_item_sk
and d_date between '2002-03-29' and
(cast('2002-03-29' as date) + 90 days)
and d_date_sk = cs_sold_date_sk
)
limit 100;
-- end query 1 in stream 0 using template query32.tpl
-- start query 1 in stream 0 using template query33.tpl and seed 1930872976
with ss as (
select
i_manufact_id,sum(ss_ext_sales_price) total_sales
from
store_sales,
date_dim,
customer_address,
item
where
i_manufact_id in (select
i_manufact_id
from
item
where i_category in ('Home'))
and ss_item_sk = i_item_sk
and ss_sold_date_sk = d_date_sk
and d_year = 1998
and d_moy = 5
and ss_addr_sk = ca_address_sk
and ca_gmt_offset = -6
group by i_manufact_id),
cs as (
select
i_manufact_id,sum(cs_ext_sales_price) total_sales
from
catalog_sales,
date_dim,
customer_address,
item
where
i_manufact_id in (select
i_manufact_id
from
item
where i_category in ('Home'))
and cs_item_sk = i_item_sk
and cs_sold_date_sk = d_date_sk
and d_year = 1998
and d_moy = 5
and cs_bill_addr_sk = ca_address_sk
and ca_gmt_offset = -6
group by i_manufact_id),
ws as (
select
i_manufact_id,sum(ws_ext_sales_price) total_sales
from
web_sales,
date_dim,
customer_address,
item
where
i_manufact_id in (select
i_manufact_id
from
item
where i_category in ('Home'))
and ws_item_sk = i_item_sk
and ws_sold_date_sk = d_date_sk
and d_year = 1998
and d_moy = 5
and ws_bill_addr_sk = ca_address_sk
and ca_gmt_offset = -6
group by i_manufact_id)
select i_manufact_id ,sum(total_sales) total_sales
from (select * from ss
union all
select * from cs
union all
select * from ws) tmp1
group by i_manufact_id
order by total_sales
limit 100;
-- end query 1 in stream 0 using template query33.tpl
-- start query 1 in stream 0 using template query34.tpl and seed 1971067816
select c_last_name
,c_first_name
,c_salutation
,c_preferred_cust_flag
,ss_ticket_number
,cnt from
(select ss_ticket_number
,ss_customer_sk
,count(*) cnt
from store_sales,date_dim,store,household_demographics
where store_sales.ss_sold_date_sk = date_dim.d_date_sk
and store_sales.ss_store_sk = store.s_store_sk
and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
and (date_dim.d_dom between 1 and 3 or date_dim.d_dom between 25 and 28)
and (household_demographics.hd_buy_potential = '>10000' or
household_demographics.hd_buy_potential = 'Unknown')
and household_demographics.hd_vehicle_count > 0
and (case when household_demographics.hd_vehicle_count > 0
then household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count
else null
end) > 1.2
and date_dim.d_year in (2000,2000+1,2000+2)
and store.s_county in ('Salem County','Terrell County','Arthur County','Oglethorpe County',
'Lunenburg County','Perry County','Halifax County','Sumner County')
group by ss_ticket_number,ss_customer_sk) dn,customer
where ss_customer_sk = c_customer_sk
and cnt between 15 and 20
order by c_last_name,c_first_name,c_salutation,c_preferred_cust_flag desc, ss_ticket_number;
-- end query 1 in stream 0 using template query34.tpl
-- start query 1 in stream 0 using template query35.tpl and seed 1930872976
select
ca_state,
cd_gender,
cd_marital_status,
cd_dep_count,
count(*) cnt1,
avg(cd_dep_count),
min(cd_dep_count),
stddev_samp(cd_dep_count),
cd_dep_employed_count,
count(*) cnt2,
avg(cd_dep_employed_count),
min(cd_dep_employed_count),
stddev_samp(cd_dep_employed_count),
cd_dep_college_count,
count(*) cnt3,
avg(cd_dep_college_count),
min(cd_dep_college_count),
stddev_samp(cd_dep_college_count)
from
customer c,customer_address ca,customer_demographics
where
c.c_current_addr_sk = ca.ca_address_sk and
cd_demo_sk = c.c_current_cdemo_sk and
exists (select *
from store_sales,date_dim
where c.c_customer_sk = ss_customer_sk and
ss_sold_date_sk = d_date_sk and
d_year = 2001 and
d_qoy < 4) and
(exists (select *
from web_sales,date_dim
where c.c_customer_sk = ws_bill_customer_sk and
ws_sold_date_sk = d_date_sk and
d_year = 2001 and
d_qoy < 4) or
exists (select *
from catalog_sales,date_dim
where c.c_customer_sk = cs_ship_customer_sk and
cs_sold_date_sk = d_date_sk and
d_year = 2001 and
d_qoy < 4))
group by ca_state,
cd_gender,
cd_marital_status,
cd_dep_count,
cd_dep_employed_count,
cd_dep_college_count
order by ca_state,
cd_gender,
cd_marital_status,
cd_dep_count,
cd_dep_employed_count,
cd_dep_college_count
limit 100;
-- end query 1 in stream 0 using template query35.tpl
-- start query 1 in stream 0 using template query36.tpl and seed 1544728811
select
sum(ss_net_profit)/sum(ss_ext_sales_price) as gross_margin
,i_category
,i_class
,grouping(i_category)+grouping(i_class) as lochierarchy
,rank() over (
partition by grouping(i_category)+grouping(i_class),
case when grouping(i_class) = 0 then i_category end
order by sum(ss_net_profit)/sum(ss_ext_sales_price) asc) as rank_within_parent
from
store_sales
,date_dim d1
,item
,store
where
d1.d_year = 1999
and d1.d_date_sk = ss_sold_date_sk
and i_item_sk = ss_item_sk
and s_store_sk = ss_store_sk
and s_state in ('IN','AL','MI','MN',
'TN','LA','FL','NM')
group by rollup(i_category,i_class)
order by
lochierarchy desc
,case when lochierarchy = 0 then i_category end
,rank_within_parent
limit 100;
-- end query 1 in stream 0 using template query36.tpl
-- start query 1 in stream 0 using template query37.tpl and seed 301843662
select i_item_id
,i_item_desc
,i_current_price
from item, inventory, date_dim, catalog_sales
where i_current_price between 39 and 39 + 30
and inv_item_sk = i_item_sk
and d_date_sk=inv_date_sk
and d_date between cast('2001-01-16' as date) and (cast('2001-01-16' as date) + 60 days)
and i_manufact_id in (765,886,889,728)
and inv_quantity_on_hand between 100 and 500
and cs_item_sk = i_item_sk
group by i_item_id,i_item_desc,i_current_price
order by i_item_id
limit 100;
-- end query 1 in stream 0 using template query37.tpl
-- start query 1 in stream 0 using template query38.tpl and seed 1819994127
select count(*) from (
select distinct c_last_name, c_first_name, d_date
from store_sales, date_dim, customer
where store_sales.ss_sold_date_sk = date_dim.d_date_sk
and store_sales.ss_customer_sk = customer.c_customer_sk
and d_month_seq between 1186 and 1186 + 11
intersect
select distinct c_last_name, c_first_name, d_date
from catalog_sales, date_dim, customer
where catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
and catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
and d_month_seq between 1186 and 1186 + 11
intersect
select distinct c_last_name, c_first_name, d_date
from web_sales, date_dim, customer
where web_sales.ws_sold_date_sk = date_dim.d_date_sk
and web_sales.ws_bill_customer_sk = customer.c_customer_sk
and d_month_seq between 1186 and 1186 + 11
) hot_cust
limit 100;
-- end query 1 in stream 0 using template query38.tpl
-- start query 1 in stream 0 using template query39.tpl and seed 1327317894
with inv as
(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
,stdev,mean, case mean when 0 then null else stdev/mean end cov
from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
from inventory
,item
,warehouse
,date_dim
where inv_item_sk = i_item_sk
and inv_warehouse_sk = w_warehouse_sk
and inv_date_sk = d_date_sk
and d_year =2000
group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
where case mean when 0 then 0 else stdev/mean end > 1)
select inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean, inv1.cov
,inv2.w_warehouse_sk,inv2.i_item_sk,inv2.d_moy,inv2.mean, inv2.cov
from inv inv1,inv inv2
where inv1.i_item_sk = inv2.i_item_sk
and inv1.w_warehouse_sk = inv2.w_warehouse_sk
and inv1.d_moy=2
and inv2.d_moy=2+1
order by inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean,inv1.cov
,inv2.d_moy,inv2.mean, inv2.cov
;
with inv as
(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
,stdev,mean, case mean when 0 then null else stdev/mean end cov
from(select w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy
,stddev_samp(inv_quantity_on_hand) stdev,avg(inv_quantity_on_hand) mean
from inventory
,item
,warehouse
,date_dim
where inv_item_sk = i_item_sk
and inv_warehouse_sk = w_warehouse_sk
and inv_date_sk = d_date_sk
and d_year =2000
group by w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy) foo
where case mean when 0 then 0 else stdev/mean end > 1)
select inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean, inv1.cov
,inv2.w_warehouse_sk,inv2.i_item_sk,inv2.d_moy,inv2.mean, inv2.cov
from inv inv1,inv inv2
where inv1.i_item_sk = inv2.i_item_sk
and inv1.w_warehouse_sk = inv2.w_warehouse_sk
and inv1.d_moy=2
and inv2.d_moy=2+1
and inv1.cov > 1.5
order by inv1.w_warehouse_sk,inv1.i_item_sk,inv1.d_moy,inv1.mean,inv1.cov
,inv2.d_moy,inv2.mean, inv2.cov
;
-- end query 1 in stream 0 using template query39.tpl
-- start query 1 in stream 0 using template query3.tpl and seed 2031708268
select dt.d_year
,item.i_brand_id brand_id
,item.i_brand brand
,sum(ss_sales_price) sum_agg
from date_dim dt
,store_sales
,item
where dt.d_date_sk = store_sales.ss_sold_date_sk
and store_sales.ss_item_sk = item.i_item_sk
and item.i_manufact_id = 816
and dt.d_moy=11
group by dt.d_year
,item.i_brand
,item.i_brand_id
order by dt.d_year
,sum_agg desc
,brand_id
limit 100;
-- end query 1 in stream 0 using template query3.tpl
-- start query 1 in stream 0 using template query40.tpl and seed 1819994127
select
w_state
,i_item_id
,sum(case when (cast(d_date as date) < cast ('2000-03-18' as date))
then cs_sales_price - coalesce(cr_refunded_cash,0) else 0 end) as sales_before
,sum(case when (cast(d_date as date) >= cast ('2000-03-18' as date))
then cs_sales_price - coalesce(cr_refunded_cash,0) else 0 end) as sales_after
from
catalog_sales left outer join catalog_returns on
(cs_order_number = cr_order_number
and cs_item_sk = cr_item_sk)
,warehouse
,item
,date_dim
where
i_current_price between 0.99 and 1.49
and i_item_sk = cs_item_sk
and cs_warehouse_sk = w_warehouse_sk
and cs_sold_date_sk = d_date_sk
and d_date between (cast ('2000-03-18' as date) - 30 days)
and (cast ('2000-03-18' as date) + 30 days)
group by
w_state,i_item_id
order by w_state,i_item_id
limit 100;
-- end query 1 in stream 0 using template query40.tpl
-- start query 1 in stream 0 using template query41.tpl and seed 1581015815
select distinct(i_product_name)
from item i1
where i_manufact_id between 970 and 970+40
and (select count(*) as item_cnt
from item
where (i_manufact = i1.i_manufact and
((i_category = 'Women' and
(i_color = 'frosted' or i_color = 'rose') and
(i_units = 'Lb' or i_units = 'Gross') and
(i_size = 'medium' or i_size = 'large')
) or
(i_category = 'Women' and
(i_color = 'chocolate' or i_color = 'black') and
(i_units = 'Box' or i_units = 'Dram') and
(i_size = 'economy' or i_size = 'petite')
) or
(i_category = 'Men' and
(i_color = 'slate' or i_color = 'magenta') and
(i_units = 'Carton' or i_units = 'Bundle') and
(i_size = 'N/A' or i_size = 'small')
) or
(i_category = 'Men' and
(i_color = 'cornflower' or i_color = 'firebrick') and
(i_units = 'Pound' or i_units = 'Oz') and
(i_size = 'medium' or i_size = 'large')
))) or
(i_manufact = i1.i_manufact and
((i_category = 'Women' and
(i_color = 'almond' or i_color = 'steel') and
(i_units = 'Tsp' or i_units = 'Case') and
(i_size = 'medium' or i_size = 'large')
) or
(i_category = 'Women' and
(i_color = 'purple' or i_color = 'aquamarine') and
(i_units = 'Bunch' or i_units = 'Gram') and
(i_size = 'economy' or i_size = 'petite')
) or
(i_category = 'Men' and
(i_color = 'lavender' or i_color = 'papaya') and
(i_units = 'Pallet' or i_units = 'Cup') and
(i_size = 'N/A' or i_size = 'small')
) or
(i_category = 'Men' and
(i_color = 'maroon' or i_color = 'cyan') and
(i_units = 'Each' or i_units = 'N/A') and
(i_size = 'medium' or i_size = 'large')
)))) > 0
order by i_product_name
limit 100;
-- end query 1 in stream 0 using template query41.tpl
-- start query 1 in stream 0 using template query42.tpl and seed 1819994127
select dt.d_year
,item.i_category_id
,item.i_category
,sum(ss_ext_sales_price)
from date_dim dt
,store_sales
,item
where dt.d_date_sk = store_sales.ss_sold_date_sk
and store_sales.ss_item_sk = item.i_item_sk
and item.i_manager_id = 1
and dt.d_moy=12
and dt.d_year=1998
group by dt.d_year
,item.i_category_id
,item.i_category
order by sum(ss_ext_sales_price) desc,dt.d_year
,item.i_category_id
,item.i_category
limit 100 ;
-- end query 1 in stream 0 using template query42.tpl
-- start query 1 in stream 0 using template query43.tpl and seed 1819994127
select s_store_name, s_store_id,
sum(case when (d_day_name='Sunday') then ss_sales_price else null end) sun_sales,
sum(case when (d_day_name='Monday') then ss_sales_price else null end) mon_sales,
sum(case when (d_day_name='Tuesday') then ss_sales_price else null end) tue_sales,
sum(case when (d_day_name='Wednesday') then ss_sales_price else null end) wed_sales,
sum(case when (d_day_name='Thursday') then ss_sales_price else null end) thu_sales,
sum(case when (d_day_name='Friday') then ss_sales_price else null end) fri_sales,
sum(case when (d_day_name='Saturday') then ss_sales_price else null end) sat_sales
from date_dim, store_sales, store
where d_date_sk = ss_sold_date_sk and
s_store_sk = ss_store_sk and
s_gmt_offset = -6 and
d_year = 2001
group by s_store_name, s_store_id
order by s_store_name, s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales
limit 100;
-- end query 1 in stream 0 using template query43.tpl
-- start query 1 in stream 0 using template query44.tpl and seed 1819994127
select asceding.rnk, i1.i_product_name best_performing, i2.i_product_name worst_performing
from(select *
from (select item_sk,rank() over (order by rank_col asc) rnk
from (select ss_item_sk item_sk,avg(ss_net_profit) rank_col
from store_sales ss1
where ss_store_sk = 366
group by ss_item_sk
having avg(ss_net_profit) > 0.9*(select avg(ss_net_profit) rank_col
from store_sales
where ss_store_sk = 366
and ss_cdemo_sk is null
group by ss_store_sk))V1)V11
where rnk < 11) asceding,
(select *
from (select item_sk,rank() over (order by rank_col desc) rnk
from (select ss_item_sk item_sk,avg(ss_net_profit) rank_col
from store_sales ss1
where ss_store_sk = 366
group by ss_item_sk
having avg(ss_net_profit) > 0.9*(select avg(ss_net_profit) rank_col
from store_sales
where ss_store_sk = 366
and ss_cdemo_sk is null
group by ss_store_sk))V2)V21
where rnk < 11) descending,
item i1,
item i2
where asceding.rnk = descending.rnk
and i1.i_item_sk=asceding.item_sk
and i2.i_item_sk=descending.item_sk
order by asceding.rnk
limit 100;
-- end query 1 in stream 0 using template query44.tpl
-- start query 1 in stream 0 using template query45.tpl and seed 2031708268
select ca_zip, ca_county, sum(ws_sales_price)
from web_sales, customer, customer_address, date_dim, item
where ws_bill_customer_sk = c_customer_sk
and c_current_addr_sk = ca_address_sk
and ws_item_sk = i_item_sk
and ( substr(ca_zip,1,5) in ('85669', '86197','88274','83405','86475', '85392', '85460', '80348', '81792')
or
i_item_id in (select i_item_id
from item
where i_item_sk in (2, 3, 5, 7, 11, 13, 17, 19, 23, 29)
)
)
and ws_sold_date_sk = d_date_sk
and d_qoy = 1 and d_year = 1998
group by ca_zip, ca_county
order by ca_zip, ca_county
limit 100;
-- end query 1 in stream 0 using template query45.tpl
-- start query 1 in stream 0 using template query46.tpl and seed 803547492
select c_last_name
,c_first_name
,ca_city
,bought_city
,ss_ticket_number
,amt,profit
from
(select ss_ticket_number
,ss_customer_sk
,ca_city bought_city
,sum(ss_coupon_amt) amt
,sum(ss_net_profit) profit
from store_sales,date_dim,store,household_demographics,customer_address
where store_sales.ss_sold_date_sk = date_dim.d_date_sk
and store_sales.ss_store_sk = store.s_store_sk
and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
and store_sales.ss_addr_sk = customer_address.ca_address_sk
and (household_demographics.hd_dep_count = 0 or
household_demographics.hd_vehicle_count= 1)
and date_dim.d_dow in (6,0)
and date_dim.d_year in (2000,2000+1,2000+2)
and store.s_city in ('Five Forks','Oakland','Fairview','Winchester','Farmington')
group by ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city) dn,customer,customer_address current_addr
where ss_customer_sk = c_customer_sk
and customer.c_current_addr_sk = current_addr.ca_address_sk
and current_addr.ca_city <> bought_city
order by c_last_name
,c_first_name
,ca_city
,bought_city
,ss_ticket_number
limit 100;
-- end query 1 in stream 0 using template query46.tpl
-- start query 1 in stream 0 using template query47.tpl and seed 2031708268
with v1 as(
select i_category, i_brand,
s_store_name, s_company_name,
d_year, d_moy,
sum(ss_sales_price) sum_sales,
avg(sum(ss_sales_price)) over
(partition by i_category, i_brand,
s_store_name, s_company_name, d_year)
avg_monthly_sales,
rank() over
(partition by i_category, i_brand,
s_store_name, s_company_name
order by d_year, d_moy) rn
from item, store_sales, date_dim, store
where ss_item_sk = i_item_sk and
ss_sold_date_sk = d_date_sk and
ss_store_sk = s_store_sk and
(
d_year = 1999 or
( d_year = 1999-1 and d_moy =12) or
( d_year = 1999+1 and d_moy =1)
)
group by i_category, i_brand,
s_store_name, s_company_name,
d_year, d_moy),
v2 as(
select v1.s_store_name
,v1.d_year, v1.d_moy
,v1.avg_monthly_sales
,v1.sum_sales, v1_lag.sum_sales psum, v1_lead.sum_sales nsum
from v1, v1 v1_lag, v1 v1_lead
where v1.i_category = v1_lag.i_category and
v1.i_category = v1_lead.i_category and
v1.i_brand = v1_lag.i_brand and
v1.i_brand = v1_lead.i_brand and
v1.s_store_name = v1_lag.s_store_name and
v1.s_store_name = v1_lead.s_store_name and
v1.s_company_name = v1_lag.s_company_name and
v1.s_company_name = v1_lead.s_company_name and
v1.rn = v1_lag.rn + 1 and
v1.rn = v1_lead.rn - 1)
select *
from v2
where d_year = 1999 and
avg_monthly_sales > 0 and
case when avg_monthly_sales > 0 then abs(sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
order by sum_sales - avg_monthly_sales, sum_sales
limit 100;
-- end query 1 in stream 0 using template query47.tpl
-- start query 1 in stream 0 using template query48.tpl and seed 622697896
select sum (ss_quantity)
from store_sales, store, customer_demographics, customer_address, date_dim
where s_store_sk = ss_store_sk
and ss_sold_date_sk = d_date_sk and d_year = 1998
and
(
(
cd_demo_sk = ss_cdemo_sk
and
cd_marital_status = 'M'
and
cd_education_status = 'Unknown'
and
ss_sales_price between 100.00 and 150.00
)
or
(
cd_demo_sk = ss_cdemo_sk
and
cd_marital_status = 'W'
and
cd_education_status = 'College'
and
ss_sales_price between 50.00 and 100.00
)
or
(
cd_demo_sk = ss_cdemo_sk
and
cd_marital_status = 'D'
and
cd_education_status = 'Primary'
and
ss_sales_price between 150.00 and 200.00
)
)
and
(
(
ss_addr_sk = ca_address_sk
and
ca_country = 'United States'
and
ca_state in ('MI', 'GA', 'NH')
and ss_net_profit between 0 and 2000
)
or
(ss_addr_sk = ca_address_sk
and
ca_country = 'United States'
and
ca_state in ('TX', 'KY', 'SD')
and ss_net_profit between 150 and 3000
)
or
(ss_addr_sk = ca_address_sk
and
ca_country = 'United States'
and
ca_state in ('NY', 'OH', 'FL')
and ss_net_profit between 50 and 25000
)
)
;
-- end query 1 in stream 0 using template query48.tpl
-- start query 1 in stream 0 using template query49.tpl and seed 1819994127
select channel, item, return_ratio, return_rank, currency_rank from
(select
'web' as channel
,web.item as item
,web.return_ratio as return_ratio
,web.return_rank as return_rank
,web.currency_rank as currency_rank
from (
select
item
,return_ratio
,currency_ratio
,rank() over (order by return_ratio) as return_rank
,rank() over (order by currency_ratio) as currency_rank
from
( select ws.ws_item_sk as item
,(cast(sum(coalesce(wr.wr_return_quantity,0)) as decimal(15,4))/
cast(sum(coalesce(ws.ws_quantity,0)) as decimal(15,4) )) as return_ratio
,(cast(sum(coalesce(wr.wr_return_amt,0)) as decimal(15,4))/
cast(sum(coalesce(ws.ws_net_paid,0)) as decimal(15,4) )) as currency_ratio
from
web_sales ws left outer join web_returns wr
on (ws.ws_order_number = wr.wr_order_number and
ws.ws_item_sk = wr.wr_item_sk)
,date_dim
where
wr.wr_return_amt > 10000
and ws.ws_net_profit > 1
and ws.ws_net_paid > 0
and ws.ws_quantity > 0
and ws_sold_date_sk = d_date_sk
and d_year = 2000
and d_moy = 12
group by ws.ws_item_sk
) in_web
) web
where
(
web.return_rank <= 10
or
web.currency_rank <= 10
)
union
select
'catalog' as channel
,catalog.item as item
,catalog.return_ratio as return_ratio
,catalog.return_rank as return_rank
,catalog.currency_rank as currency_rank
from (
select
item
,return_ratio
,currency_ratio
,rank() over (order by return_ratio) as return_rank
,rank() over (order by currency_ratio) as currency_rank
from
( select
cs.cs_item_sk as item
,(cast(sum(coalesce(cr.cr_return_quantity,0)) as decimal(15,4))/
cast(sum(coalesce(cs.cs_quantity,0)) as decimal(15,4) )) as return_ratio
,(cast(sum(coalesce(cr.cr_return_amount,0)) as decimal(15,4))/
cast(sum(coalesce(cs.cs_net_paid,0)) as decimal(15,4) )) as currency_ratio
from
catalog_sales cs left outer join catalog_returns cr
on (cs.cs_order_number = cr.cr_order_number and
cs.cs_item_sk = cr.cr_item_sk)
,date_dim
where
cr.cr_return_amount > 10000
and cs.cs_net_profit > 1
and cs.cs_net_paid > 0
and cs.cs_quantity > 0
and cs_sold_date_sk = d_date_sk
and d_year = 2000
and d_moy = 12
group by cs.cs_item_sk
) in_cat
) catalog
where
(
catalog.return_rank <= 10
or
catalog.currency_rank <=10
)
union
select
'store' as channel
,store.item as item
,store.return_ratio as return_ratio
,store.return_rank as return_rank
,store.currency_rank as currency_rank
from (
select
item
,return_ratio
,currency_ratio
,rank() over (order by return_ratio) as return_rank
,rank() over (order by currency_ratio) as currency_rank
from
( select sts.ss_item_sk as item
,(cast(sum(coalesce(sr.sr_return_quantity,0)) as decimal(15,4))/cast(sum(coalesce(sts.ss_quantity,0)) as decimal(15,4) )) as return_ratio
,(cast(sum(coalesce(sr.sr_return_amt,0)) as decimal(15,4))/cast(sum(coalesce(sts.ss_net_paid,0)) as decimal(15,4) )) as currency_ratio
from
store_sales sts left outer join store_returns sr
on (sts.ss_ticket_number = sr.sr_ticket_number and sts.ss_item_sk = sr.sr_item_sk)
,date_dim
where
sr.sr_return_amt > 10000
and sts.ss_net_profit > 1
and sts.ss_net_paid > 0
and sts.ss_quantity > 0
and ss_sold_date_sk = d_date_sk
and d_year = 2000
and d_moy = 12
group by sts.ss_item_sk
) in_store
) store
where (
store.return_rank <= 10
or
store.currency_rank <= 10
)
) y
order by 1,4,5,2
limit 100;
-- end query 1 in stream 0 using template query49.tpl
-- start query 1 in stream 0 using template query4.tpl and seed 1819994127
with year_total as (
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,c_preferred_cust_flag customer_preferred_cust_flag
,c_birth_country customer_birth_country
,c_login customer_login
,c_email_address customer_email_address
,d_year dyear
,sum(((ss_ext_list_price-ss_ext_wholesale_cost-ss_ext_discount_amt)+ss_ext_sales_price)/2) year_total
,'s' sale_type
from customer
,store_sales
,date_dim
where c_customer_sk = ss_customer_sk
and ss_sold_date_sk = d_date_sk
group by c_customer_id
,c_first_name
,c_last_name
,c_preferred_cust_flag
,c_birth_country
,c_login
,c_email_address
,d_year
union all
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,c_preferred_cust_flag customer_preferred_cust_flag
,c_birth_country customer_birth_country
,c_login customer_login
,c_email_address customer_email_address
,d_year dyear
,sum((((cs_ext_list_price-cs_ext_wholesale_cost-cs_ext_discount_amt)+cs_ext_sales_price)/2) ) year_total
,'c' sale_type
from customer
,catalog_sales
,date_dim
where c_customer_sk = cs_bill_customer_sk
and cs_sold_date_sk = d_date_sk
group by c_customer_id
,c_first_name
,c_last_name
,c_preferred_cust_flag
,c_birth_country
,c_login
,c_email_address
,d_year
union all
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,c_preferred_cust_flag customer_preferred_cust_flag
,c_birth_country customer_birth_country
,c_login customer_login
,c_email_address customer_email_address
,d_year dyear
,sum((((ws_ext_list_price-ws_ext_wholesale_cost-ws_ext_discount_amt)+ws_ext_sales_price)/2) ) year_total
,'w' sale_type
from customer
,web_sales
,date_dim
where c_customer_sk = ws_bill_customer_sk
and ws_sold_date_sk = d_date_sk
group by c_customer_id
,c_first_name
,c_last_name
,c_preferred_cust_flag
,c_birth_country
,c_login
,c_email_address
,d_year
)
select
t_s_secyear.customer_id
,t_s_secyear.customer_first_name
,t_s_secyear.customer_last_name
,t_s_secyear.customer_birth_country
from year_total t_s_firstyear
,year_total t_s_secyear
,year_total t_c_firstyear
,year_total t_c_secyear
,year_total t_w_firstyear
,year_total t_w_secyear
where t_s_secyear.customer_id = t_s_firstyear.customer_id
and t_s_firstyear.customer_id = t_c_secyear.customer_id
and t_s_firstyear.customer_id = t_c_firstyear.customer_id
and t_s_firstyear.customer_id = t_w_firstyear.customer_id
and t_s_firstyear.customer_id = t_w_secyear.customer_id
and t_s_firstyear.sale_type = 's'
and t_c_firstyear.sale_type = 'c'
and t_w_firstyear.sale_type = 'w'
and t_s_secyear.sale_type = 's'
and t_c_secyear.sale_type = 'c'
and t_w_secyear.sale_type = 'w'
and t_s_firstyear.dyear = 1999
and t_s_secyear.dyear = 1999+1
and t_c_firstyear.dyear = 1999
and t_c_secyear.dyear = 1999+1
and t_w_firstyear.dyear = 1999
and t_w_secyear.dyear = 1999+1
and t_s_firstyear.year_total > 0
and t_c_firstyear.year_total > 0
and t_w_firstyear.year_total > 0
and case when t_c_firstyear.year_total > 0 then t_c_secyear.year_total / t_c_firstyear.year_total else null end
> case when t_s_firstyear.year_total > 0 then t_s_secyear.year_total / t_s_firstyear.year_total else null end
and case when t_c_firstyear.year_total > 0 then t_c_secyear.year_total / t_c_firstyear.year_total else null end
> case when t_w_firstyear.year_total > 0 then t_w_secyear.year_total / t_w_firstyear.year_total else null end
order by t_s_secyear.customer_id
,t_s_secyear.customer_first_name
,t_s_secyear.customer_last_name
,t_s_secyear.customer_birth_country
limit 100;
-- end query 1 in stream 0 using template query4.tpl
-- start query 1 in stream 0 using template query50.tpl and seed 1819994127
select
s_store_name
,s_company_id
,s_street_number
,s_street_name
,s_street_type
,s_suite_number
,s_city
,s_county
,s_state
,s_zip
,sum(case when (sr_returned_date_sk - ss_sold_date_sk <= 30 ) then 1 else 0 end) as `30 days`
,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 30) and
(sr_returned_date_sk - ss_sold_date_sk <= 60) then 1 else 0 end ) as `31-60 days`
,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 60) and
(sr_returned_date_sk - ss_sold_date_sk <= 90) then 1 else 0 end) as `61-90 days`
,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 90) and
(sr_returned_date_sk - ss_sold_date_sk <= 120) then 1 else 0 end) as `91-120 days`
,sum(case when (sr_returned_date_sk - ss_sold_date_sk > 120) then 1 else 0 end) as `>120 days`
from
store_sales
,store_returns
,store
,date_dim d1
,date_dim d2
where
d2.d_year = 1998
and d2.d_moy = 9
and ss_ticket_number = sr_ticket_number
and ss_item_sk = sr_item_sk
and ss_sold_date_sk = d1.d_date_sk
and sr_returned_date_sk = d2.d_date_sk
and ss_customer_sk = sr_customer_sk
and ss_store_sk = s_store_sk
group by
s_store_name
,s_company_id
,s_street_number
,s_street_name
,s_street_type
,s_suite_number
,s_city
,s_county
,s_state
,s_zip
order by s_store_name
,s_company_id
,s_street_number
,s_street_name
,s_street_type
,s_suite_number
,s_city
,s_county
,s_state
,s_zip
limit 100;
-- end query 1 in stream 0 using template query50.tpl
-- start query 1 in stream 0 using template query51.tpl and seed 1819994127
WITH web_v1 as (
select
ws_item_sk item_sk, d_date,
sum(sum(ws_sales_price))
over (partition by ws_item_sk order by d_date rows between unbounded preceding and current row) cume_sales
from web_sales
,date_dim
where ws_sold_date_sk=d_date_sk
and d_month_seq between 1214 and 1214+11
and ws_item_sk is not NULL
group by ws_item_sk, d_date),
store_v1 as (
select
ss_item_sk item_sk, d_date,
sum(sum(ss_sales_price))
over (partition by ss_item_sk order by d_date rows between unbounded preceding and current row) cume_sales
from store_sales
,date_dim
where ss_sold_date_sk=d_date_sk
and d_month_seq between 1214 and 1214+11
and ss_item_sk is not NULL
group by ss_item_sk, d_date)
select *
from (select item_sk
,d_date
,web_sales
,store_sales
,max(web_sales)
over (partition by item_sk order by d_date rows between unbounded preceding and current row) web_cumulative
,max(store_sales)
over (partition by item_sk order by d_date rows between unbounded preceding and current row) store_cumulative
from (select case when web.item_sk is not null then web.item_sk else store.item_sk end item_sk
,case when web.d_date is not null then web.d_date else store.d_date end d_date
,web.cume_sales web_sales
,store.cume_sales store_sales
from web_v1 web full outer join store_v1 store on (web.item_sk = store.item_sk
and web.d_date = store.d_date)
)x )y
where web_cumulative > store_cumulative
order by item_sk
,d_date
limit 100;
-- end query 1 in stream 0 using template query51.tpl
-- start query 1 in stream 0 using template query52.tpl and seed 1819994127
select dt.d_year
,item.i_brand_id brand_id
,item.i_brand brand
,sum(ss_ext_sales_price) ext_price
from date_dim dt
,store_sales
,item
where dt.d_date_sk = store_sales.ss_sold_date_sk
and store_sales.ss_item_sk = item.i_item_sk
and item.i_manager_id = 1
and dt.d_moy=12
and dt.d_year=2000
group by dt.d_year
,item.i_brand
,item.i_brand_id
order by dt.d_year
,ext_price desc
,brand_id
limit 100 ;
-- end query 1 in stream 0 using template query52.tpl
-- start query 1 in stream 0 using template query53.tpl and seed 1819994127
select * from
(select i_manufact_id,
sum(ss_sales_price) sum_sales,
avg(sum(ss_sales_price)) over (partition by i_manufact_id) avg_quarterly_sales
from item, store_sales, date_dim, store
where ss_item_sk = i_item_sk and
ss_sold_date_sk = d_date_sk and
ss_store_sk = s_store_sk and
d_month_seq in (1212,1212+1,1212+2,1212+3,1212+4,1212+5,1212+6,1212+7,1212+8,1212+9,1212+10,1212+11) and
((i_category in ('Books','Children','Electronics') and
i_class in ('personal','portable','reference','self-help') and
i_brand in ('scholaramalgamalg #14','scholaramalgamalg #7',
'exportiunivamalg #9','scholaramalgamalg #9'))
or(i_category in ('Women','Music','Men') and
i_class in ('accessories','classical','fragrances','pants') and
i_brand in ('amalgimporto #1','edu packscholar #1','exportiimporto #1',
'importoamalg #1')))
group by i_manufact_id, d_qoy ) tmp1
where case when avg_quarterly_sales > 0
then abs (sum_sales - avg_quarterly_sales)/ avg_quarterly_sales
else null end > 0.1
order by avg_quarterly_sales,
sum_sales,
i_manufact_id
limit 100;
-- end query 1 in stream 0 using template query53.tpl
-- start query 1 in stream 0 using template query54.tpl and seed 1930872976
with my_customers as (
select distinct c_customer_sk
, c_current_addr_sk
from
( select cs_sold_date_sk sold_date_sk,
cs_bill_customer_sk customer_sk,
cs_item_sk item_sk
from catalog_sales
union all
select ws_sold_date_sk sold_date_sk,
ws_bill_customer_sk customer_sk,
ws_item_sk item_sk
from web_sales
) cs_or_ws_sales,
item,
date_dim,
customer
where sold_date_sk = d_date_sk
and item_sk = i_item_sk
and i_category = 'Books'
and i_class = 'business'
and c_customer_sk = cs_or_ws_sales.customer_sk
and d_moy = 2
and d_year = 2000
)
, my_revenue as (
select c_customer_sk,
sum(ss_ext_sales_price) as revenue
from my_customers,
store_sales,
customer_address,
store,
date_dim
where c_current_addr_sk = ca_address_sk
and ca_county = s_county
and ca_state = s_state
and ss_sold_date_sk = d_date_sk
and c_customer_sk = ss_customer_sk
and d_month_seq between (select distinct d_month_seq+1
from date_dim where d_year = 2000 and d_moy = 2)
and (select distinct d_month_seq+3
from date_dim where d_year = 2000 and d_moy = 2)
group by c_customer_sk
)
, segments as
(select cast((revenue/50) as int) as segment
from my_revenue
)
select segment, count(*) as num_customers, segment*50 as segment_base
from segments
group by segment
order by segment, num_customers
limit 100;
-- end query 1 in stream 0 using template query54.tpl
-- start query 1 in stream 0 using template query55.tpl and seed 2031708268
select i_brand_id brand_id, i_brand brand,
sum(ss_ext_sales_price) ext_price
from date_dim, store_sales, item
where d_date_sk = ss_sold_date_sk
and ss_item_sk = i_item_sk
and i_manager_id=13
and d_moy=11
and d_year=1999
group by i_brand, i_brand_id
order by ext_price desc, i_brand_id
limit 100 ;
-- end query 1 in stream 0 using template query55.tpl
-- start query 1 in stream 0 using template query56.tpl and seed 1951559352
with ss as (
select i_item_id,sum(ss_ext_sales_price) total_sales
from
store_sales,
date_dim,
customer_address,
item
where i_item_id in (select
i_item_id
from item
where i_color in ('chiffon','smoke','lace'))
and ss_item_sk = i_item_sk
and ss_sold_date_sk = d_date_sk
and d_year = 2001
and d_moy = 5
and ss_addr_sk = ca_address_sk
and ca_gmt_offset = -6
group by i_item_id),
cs as (
select i_item_id,sum(cs_ext_sales_price) total_sales
from
catalog_sales,
date_dim,
customer_address,
item
where
i_item_id in (select
i_item_id
from item
where i_color in ('chiffon','smoke','lace'))
and cs_item_sk = i_item_sk
and cs_sold_date_sk = d_date_sk
and d_year = 2001
and d_moy = 5
and cs_bill_addr_sk = ca_address_sk
and ca_gmt_offset = -6
group by i_item_id),
ws as (
select i_item_id,sum(ws_ext_sales_price) total_sales
from
web_sales,
date_dim,
customer_address,
item
where
i_item_id in (select
i_item_id
from item
where i_color in ('chiffon','smoke','lace'))
and ws_item_sk = i_item_sk
and ws_sold_date_sk = d_date_sk
and d_year = 2001
and d_moy = 5
and ws_bill_addr_sk = ca_address_sk
and ca_gmt_offset = -6
group by i_item_id)
select i_item_id ,sum(total_sales) total_sales
from (select * from ss
union all
select * from cs
union all
select * from ws) tmp1
group by i_item_id
order by total_sales,
i_item_id
limit 100;
-- end query 1 in stream 0 using template query56.tpl
-- start query 1 in stream 0 using template query57.tpl and seed 2031708268
with v1 as(
select i_category, i_brand,
cc_name,
d_year, d_moy,
sum(cs_sales_price) sum_sales,
avg(sum(cs_sales_price)) over
(partition by i_category, i_brand,
cc_name, d_year)
avg_monthly_sales,
rank() over
(partition by i_category, i_brand,
cc_name
order by d_year, d_moy) rn
from item, catalog_sales, date_dim, call_center
where cs_item_sk = i_item_sk and
cs_sold_date_sk = d_date_sk and
cc_call_center_sk= cs_call_center_sk and
(
d_year = 1999 or
( d_year = 1999-1 and d_moy =12) or
( d_year = 1999+1 and d_moy =1)
)
group by i_category, i_brand,
cc_name , d_year, d_moy),
v2 as(
select v1.i_category, v1.i_brand
,v1.d_year, v1.d_moy
,v1.avg_monthly_sales
,v1.sum_sales, v1_lag.sum_sales psum, v1_lead.sum_sales nsum
from v1, v1 v1_lag, v1 v1_lead
where v1.i_category = v1_lag.i_category and
v1.i_category = v1_lead.i_category and
v1.i_brand = v1_lag.i_brand and
v1.i_brand = v1_lead.i_brand and
v1. cc_name = v1_lag. cc_name and
v1. cc_name = v1_lead. cc_name and
v1.rn = v1_lag.rn + 1 and
v1.rn = v1_lead.rn - 1)
select *
from v2
where d_year = 1999 and
avg_monthly_sales > 0 and
case when avg_monthly_sales > 0 then abs(sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
order by sum_sales - avg_monthly_sales, avg_monthly_sales
limit 100;
-- end query 1 in stream 0 using template query57.tpl
-- start query 1 in stream 0 using template query58.tpl and seed 1819994127
with ss_items as
(select i_item_id item_id
,sum(ss_ext_sales_price) ss_item_rev
from store_sales
,item
,date_dim
where ss_item_sk = i_item_sk
and d_date in (select d_date
from date_dim
where d_week_seq = (select d_week_seq
from date_dim
where d_date = '1998-02-21'))
and ss_sold_date_sk = d_date_sk
group by i_item_id),
cs_items as
(select i_item_id item_id
,sum(cs_ext_sales_price) cs_item_rev
from catalog_sales
,item
,date_dim
where cs_item_sk = i_item_sk
and d_date in (select d_date
from date_dim
where d_week_seq = (select d_week_seq
from date_dim
where d_date = '1998-02-21'))
and cs_sold_date_sk = d_date_sk
group by i_item_id),
ws_items as
(select i_item_id item_id
,sum(ws_ext_sales_price) ws_item_rev
from web_sales
,item
,date_dim
where ws_item_sk = i_item_sk
and d_date in (select d_date
from date_dim
where d_week_seq =(select d_week_seq
from date_dim
where d_date = '1998-02-21'))
and ws_sold_date_sk = d_date_sk
group by i_item_id)
select ss_items.item_id
,ss_item_rev
,ss_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 ss_dev
,cs_item_rev
,cs_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 cs_dev
,ws_item_rev
,ws_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 ws_dev
,(ss_item_rev+cs_item_rev+ws_item_rev)/3 average
from ss_items,cs_items,ws_items
where ss_items.item_id=cs_items.item_id
and ss_items.item_id=ws_items.item_id
and ss_item_rev between 0.9 * cs_item_rev and 1.1 * cs_item_rev
and ss_item_rev between 0.9 * ws_item_rev and 1.1 * ws_item_rev
and cs_item_rev between 0.9 * ss_item_rev and 1.1 * ss_item_rev
and cs_item_rev between 0.9 * ws_item_rev and 1.1 * ws_item_rev
and ws_item_rev between 0.9 * ss_item_rev and 1.1 * ss_item_rev
and ws_item_rev between 0.9 * cs_item_rev and 1.1 * cs_item_rev
order by item_id
,ss_item_rev
limit 100;
-- end query 1 in stream 0 using template query58.tpl
-- start query 1 in stream 0 using template query59.tpl and seed 1819994127
with wss as
(select d_week_seq,
ss_store_sk,
sum(case when (d_day_name='Sunday') then ss_sales_price else null end) sun_sales,
sum(case when (d_day_name='Monday') then ss_sales_price else null end) mon_sales,
sum(case when (d_day_name='Tuesday') then ss_sales_price else null end) tue_sales,
sum(case when (d_day_name='Wednesday') then ss_sales_price else null end) wed_sales,
sum(case when (d_day_name='Thursday') then ss_sales_price else null end) thu_sales,
sum(case when (d_day_name='Friday') then ss_sales_price else null end) fri_sales,
sum(case when (d_day_name='Saturday') then ss_sales_price else null end) sat_sales
from store_sales,date_dim
where d_date_sk = ss_sold_date_sk
group by d_week_seq,ss_store_sk
)
select s_store_name1,s_store_id1,d_week_seq1
,sun_sales1/sun_sales2,mon_sales1/mon_sales2
,tue_sales1/tue_sales2,wed_sales1/wed_sales2,thu_sales1/thu_sales2
,fri_sales1/fri_sales2,sat_sales1/sat_sales2
from
(select s_store_name s_store_name1,wss.d_week_seq d_week_seq1
,s_store_id s_store_id1,sun_sales sun_sales1
,mon_sales mon_sales1,tue_sales tue_sales1
,wed_sales wed_sales1,thu_sales thu_sales1
,fri_sales fri_sales1,sat_sales sat_sales1
from wss,store,date_dim d
where d.d_week_seq = wss.d_week_seq and
ss_store_sk = s_store_sk and
d_month_seq between 1205 and 1205 + 11) y,
(select s_store_name s_store_name2,wss.d_week_seq d_week_seq2
,s_store_id s_store_id2,sun_sales sun_sales2
,mon_sales mon_sales2,tue_sales tue_sales2
,wed_sales wed_sales2,thu_sales thu_sales2
,fri_sales fri_sales2,sat_sales sat_sales2
from wss,store,date_dim d
where d.d_week_seq = wss.d_week_seq and
ss_store_sk = s_store_sk and
d_month_seq between 1205+ 12 and 1205 + 23) x
where s_store_id1=s_store_id2
and d_week_seq1=d_week_seq2-52
order by s_store_name1,s_store_id1,d_week_seq1
limit 100;
-- end query 1 in stream 0 using template query59.tpl
-- start query 1 in stream 0 using template query5.tpl and seed 1819994127
with ssr as
(select s_store_id,
sum(sales_price) as sales,
sum(profit) as profit,
sum(return_amt) as returns,
sum(net_loss) as profit_loss
from
( select ss_store_sk as store_sk,
ss_sold_date_sk as date_sk,
ss_ext_sales_price as sales_price,
ss_net_profit as profit,
cast(0 as decimal(7,2)) as return_amt,
cast(0 as decimal(7,2)) as net_loss
from store_sales
union all
select sr_store_sk as store_sk,
sr_returned_date_sk as date_sk,
cast(0 as decimal(7,2)) as sales_price,
cast(0 as decimal(7,2)) as profit,
sr_return_amt as return_amt,
sr_net_loss as net_loss
from store_returns
) salesreturns,
date_dim,
store
where date_sk = d_date_sk
and d_date between cast('2000-08-19' as date)
and (cast('2000-08-19' as date) + 14 days)
and store_sk = s_store_sk
group by s_store_id)
,
csr as
(select cp_catalog_page_id,
sum(sales_price) as sales,
sum(profit) as profit,
sum(return_amt) as returns,
sum(net_loss) as profit_loss
from
( select cs_catalog_page_sk as page_sk,
cs_sold_date_sk as date_sk,
cs_ext_sales_price as sales_price,
cs_net_profit as profit,
cast(0 as decimal(7,2)) as return_amt,
cast(0 as decimal(7,2)) as net_loss
from catalog_sales
union all
select cr_catalog_page_sk as page_sk,
cr_returned_date_sk as date_sk,
cast(0 as decimal(7,2)) as sales_price,
cast(0 as decimal(7,2)) as profit,
cr_return_amount as return_amt,
cr_net_loss as net_loss
from catalog_returns
) salesreturns,
date_dim,
catalog_page
where date_sk = d_date_sk
and d_date between cast('2000-08-19' as date)
and (cast('2000-08-19' as date) + 14 days)
and page_sk = cp_catalog_page_sk
group by cp_catalog_page_id)
,
wsr as
(select web_site_id,
sum(sales_price) as sales,
sum(profit) as profit,
sum(return_amt) as returns,
sum(net_loss) as profit_loss
from
( select ws_web_site_sk as wsr_web_site_sk,
ws_sold_date_sk as date_sk,
ws_ext_sales_price as sales_price,
ws_net_profit as profit,
cast(0 as decimal(7,2)) as return_amt,
cast(0 as decimal(7,2)) as net_loss
from web_sales
union all
select ws_web_site_sk as wsr_web_site_sk,
wr_returned_date_sk as date_sk,
cast(0 as decimal(7,2)) as sales_price,
cast(0 as decimal(7,2)) as profit,
wr_return_amt as return_amt,
wr_net_loss as net_loss
from web_returns left outer join web_sales on
( wr_item_sk = ws_item_sk
and wr_order_number = ws_order_number)
) salesreturns,
date_dim,
web_site
where date_sk = d_date_sk
and d_date between cast('2000-08-19' as date)
and (cast('2000-08-19' as date) + 14 days)
and wsr_web_site_sk = web_site_sk
group by web_site_id)
select channel
, id
, sum(sales) as sales
, sum(returns) as returns
, sum(profit) as profit
from
(select 'store channel' as channel
, 'store' || s_store_id as id
, sales
, returns
, (profit - profit_loss) as profit
from ssr
union all
select 'catalog channel' as channel
, 'catalog_page' || cp_catalog_page_id as id
, sales
, returns
, (profit - profit_loss) as profit
from csr
union all
select 'web channel' as channel
, 'web_site' || web_site_id as id
, sales
, returns
, (profit - profit_loss) as profit
from wsr
) x
group by rollup (channel, id)
order by channel
,id
limit 100;
-- end query 1 in stream 0 using template query5.tpl
-- start query 1 in stream 0 using template query60.tpl and seed 1930872976
with ss as (
select
i_item_id,sum(ss_ext_sales_price) total_sales
from
store_sales,
date_dim,
customer_address,
item
where
i_item_id in (select
i_item_id
from
item
where i_category in ('Children'))
and ss_item_sk = i_item_sk
and ss_sold_date_sk = d_date_sk
and d_year = 1998
and d_moy = 10
and ss_addr_sk = ca_address_sk
and ca_gmt_offset = -5
group by i_item_id),
cs as (
select
i_item_id,sum(cs_ext_sales_price) total_sales
from
catalog_sales,
date_dim,
customer_address,
item
where
i_item_id in (select
i_item_id
from
item
where i_category in ('Children'))
and cs_item_sk = i_item_sk
and cs_sold_date_sk = d_date_sk
and d_year = 1998
and d_moy = 10
and cs_bill_addr_sk = ca_address_sk
and ca_gmt_offset = -5
group by i_item_id),
ws as (
select
i_item_id,sum(ws_ext_sales_price) total_sales
from
web_sales,
date_dim,
customer_address,
item
where
i_item_id in (select
i_item_id
from
item
where i_category in ('Children'))
and ws_item_sk = i_item_sk
and ws_sold_date_sk = d_date_sk
and d_year = 1998
and d_moy = 10
and ws_bill_addr_sk = ca_address_sk
and ca_gmt_offset = -5
group by i_item_id)
select
i_item_id
,sum(total_sales) total_sales
from (select * from ss
union all
select * from cs
union all
select * from ws) tmp1
group by i_item_id
order by i_item_id
,total_sales
limit 100;
-- end query 1 in stream 0 using template query60.tpl
-- start query 1 in stream 0 using template query61.tpl and seed 1930872976
select promotions,total,cast(promotions as decimal(15,4))/cast(total as decimal(15,4))*100
from
(select sum(ss_ext_sales_price) promotions
from store_sales
,store
,promotion
,date_dim
,customer
,customer_address
,item
where ss_sold_date_sk = d_date_sk
and ss_store_sk = s_store_sk
and ss_promo_sk = p_promo_sk
and ss_customer_sk= c_customer_sk
and ca_address_sk = c_current_addr_sk
and ss_item_sk = i_item_sk
and ca_gmt_offset = -6
and i_category = 'Sports'
and (p_channel_dmail = 'Y' or p_channel_email = 'Y' or p_channel_tv = 'Y')
and s_gmt_offset = -6
and d_year = 2001
and d_moy = 12) promotional_sales,
(select sum(ss_ext_sales_price) total
from store_sales
,store
,date_dim
,customer
,customer_address
,item
where ss_sold_date_sk = d_date_sk
and ss_store_sk = s_store_sk
and ss_customer_sk= c_customer_sk
and ca_address_sk = c_current_addr_sk
and ss_item_sk = i_item_sk
and ca_gmt_offset = -6
and i_category = 'Sports'
and s_gmt_offset = -6
and d_year = 2001
and d_moy = 12) all_sales
order by promotions, total
limit 100;
-- end query 1 in stream 0 using template query61.tpl
-- start query 1 in stream 0 using template query62.tpl and seed 1819994127
select
substr(w_warehouse_name,1,20)
,sm_type
,web_name
,sum(case when (ws_ship_date_sk - ws_sold_date_sk <= 30 ) then 1 else 0 end) as `30 days`
,sum(case when (ws_ship_date_sk - ws_sold_date_sk > 30) and
(ws_ship_date_sk - ws_sold_date_sk <= 60) then 1 else 0 end ) as `31-60 days`
,sum(case when (ws_ship_date_sk - ws_sold_date_sk > 60) and
(ws_ship_date_sk - ws_sold_date_sk <= 90) then 1 else 0 end) as `61-90 days`
,sum(case when (ws_ship_date_sk - ws_sold_date_sk > 90) and
(ws_ship_date_sk - ws_sold_date_sk <= 120) then 1 else 0 end) as `91-120 days`
,sum(case when (ws_ship_date_sk - ws_sold_date_sk > 120) then 1 else 0 end) as `>120 days`
from
web_sales
,warehouse
,ship_mode
,web_site
,date_dim
where
d_month_seq between 1215 and 1215 + 11
and ws_ship_date_sk = d_date_sk
and ws_warehouse_sk = w_warehouse_sk
and ws_ship_mode_sk = sm_ship_mode_sk
and ws_web_site_sk = web_site_sk
group by
substr(w_warehouse_name,1,20)
,sm_type
,web_name
order by substr(w_warehouse_name,1,20)
,sm_type
,web_name
limit 100;
-- end query 1 in stream 0 using template query62.tpl
-- start query 1 in stream 0 using template query63.tpl and seed 1819994127
select *
from (select i_manager_id
,sum(ss_sales_price) sum_sales
,avg(sum(ss_sales_price)) over (partition by i_manager_id) avg_monthly_sales
from item
,store_sales
,date_dim
,store
where ss_item_sk = i_item_sk
and ss_sold_date_sk = d_date_sk
and ss_store_sk = s_store_sk
and d_month_seq in (1211,1211+1,1211+2,1211+3,1211+4,1211+5,1211+6,1211+7,1211+8,1211+9,1211+10,1211+11)
and (( i_category in ('Books','Children','Electronics')
and i_class in ('personal','portable','reference','self-help')
and i_brand in ('scholaramalgamalg #14','scholaramalgamalg #7',
'exportiunivamalg #9','scholaramalgamalg #9'))
or( i_category in ('Women','Music','Men')
and i_class in ('accessories','classical','fragrances','pants')
and i_brand in ('amalgimporto #1','edu packscholar #1','exportiimporto #1',
'importoamalg #1')))
group by i_manager_id, d_moy) tmp1
where case when avg_monthly_sales > 0 then abs (sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
order by i_manager_id
,avg_monthly_sales
,sum_sales
limit 100;
-- end query 1 in stream 0 using template query63.tpl
-- start query 1 in stream 0 using template query64.tpl and seed 1220860970
with cs_ui as
(select cs_item_sk
,sum(cs_ext_list_price) as sale,sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit) as refund
from catalog_sales
,catalog_returns
where cs_item_sk = cr_item_sk
and cs_order_number = cr_order_number
group by cs_item_sk
having sum(cs_ext_list_price)>2*sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit)),
cross_sales as
(select i_product_name product_name
,i_item_sk item_sk
,s_store_name store_name
,s_zip store_zip
,ad1.ca_street_number b_street_number
,ad1.ca_street_name b_street_name
,ad1.ca_city b_city
,ad1.ca_zip b_zip
,ad2.ca_street_number c_street_number
,ad2.ca_street_name c_street_name
,ad2.ca_city c_city
,ad2.ca_zip c_zip
,d1.d_year as syear
,d2.d_year as fsyear
,d3.d_year s2year
,count(*) cnt
,sum(ss_wholesale_cost) s1
,sum(ss_list_price) s2
,sum(ss_coupon_amt) s3
FROM store_sales
,store_returns
,cs_ui
,date_dim d1
,date_dim d2
,date_dim d3
,store
,customer
,customer_demographics cd1
,customer_demographics cd2
,promotion
,household_demographics hd1
,household_demographics hd2
,customer_address ad1
,customer_address ad2
,income_band ib1
,income_band ib2
,item
WHERE ss_store_sk = s_store_sk AND
ss_sold_date_sk = d1.d_date_sk AND
ss_customer_sk = c_customer_sk AND
ss_cdemo_sk= cd1.cd_demo_sk AND
ss_hdemo_sk = hd1.hd_demo_sk AND
ss_addr_sk = ad1.ca_address_sk and
ss_item_sk = i_item_sk and
ss_item_sk = sr_item_sk and
ss_ticket_number = sr_ticket_number and
ss_item_sk = cs_ui.cs_item_sk and
c_current_cdemo_sk = cd2.cd_demo_sk AND
c_current_hdemo_sk = hd2.hd_demo_sk AND
c_current_addr_sk = ad2.ca_address_sk and
c_first_sales_date_sk = d2.d_date_sk and
c_first_shipto_date_sk = d3.d_date_sk and
ss_promo_sk = p_promo_sk and
hd1.hd_income_band_sk = ib1.ib_income_band_sk and
hd2.hd_income_band_sk = ib2.ib_income_band_sk and
cd1.cd_marital_status <> cd2.cd_marital_status and
i_color in ('azure','gainsboro','misty','blush','hot','lemon') and
i_current_price between 80 and 80 + 10 and
i_current_price between 80 + 1 and 80 + 15
group by i_product_name
,i_item_sk
,s_store_name
,s_zip
,ad1.ca_street_number
,ad1.ca_street_name
,ad1.ca_city
,ad1.ca_zip
,ad2.ca_street_number
,ad2.ca_street_name
,ad2.ca_city
,ad2.ca_zip
,d1.d_year
,d2.d_year
,d3.d_year
)
select cs1.product_name
,cs1.store_name
,cs1.store_zip
,cs1.b_street_number
,cs1.b_street_name
,cs1.b_city
,cs1.b_zip
,cs1.c_street_number
,cs1.c_street_name
,cs1.c_city
,cs1.c_zip
,cs1.syear
,cs1.cnt
,cs1.s1 as s11
,cs1.s2 as s21
,cs1.s3 as s31
,cs2.s1 as s12
,cs2.s2 as s22
,cs2.s3 as s32
,cs2.syear
,cs2.cnt
from cross_sales cs1,cross_sales cs2
where cs1.item_sk=cs2.item_sk and
cs1.syear = 1999 and
cs2.syear = 1999 + 1 and
cs2.cnt <= cs1.cnt and
cs1.store_name = cs2.store_name and
cs1.store_zip = cs2.store_zip
order by cs1.product_name
,cs1.store_name
,cs2.cnt
,cs1.s1
,cs2.s1;
-- end query 1 in stream 0 using template query64.tpl
-- start query 1 in stream 0 using template query65.tpl and seed 1819994127
select
s_store_name,
i_item_desc,
sc.revenue,
i_current_price,
i_wholesale_cost,
i_brand
from store, item,
(select ss_store_sk, avg(revenue) as ave
from
(select ss_store_sk, ss_item_sk,
sum(ss_sales_price) as revenue
from store_sales, date_dim
where ss_sold_date_sk = d_date_sk and d_month_seq between 1186 and 1186+11
group by ss_store_sk, ss_item_sk) sa
group by ss_store_sk) sb,
(select ss_store_sk, ss_item_sk, sum(ss_sales_price) as revenue
from store_sales, date_dim
where ss_sold_date_sk = d_date_sk and d_month_seq between 1186 and 1186+11
group by ss_store_sk, ss_item_sk) sc
where sb.ss_store_sk = sc.ss_store_sk and
sc.revenue <= 0.1 * sb.ave and
s_store_sk = sc.ss_store_sk and
i_item_sk = sc.ss_item_sk
order by s_store_name, i_item_desc
limit 100;
-- end query 1 in stream 0 using template query65.tpl
-- start query 1 in stream 0 using template query66.tpl and seed 2042478054
select
w_warehouse_name
,w_warehouse_sq_ft
,w_city
,w_county
,w_state
,w_country
,ship_carriers
,year
,sum(jan_sales) as jan_sales
,sum(feb_sales) as feb_sales
,sum(mar_sales) as mar_sales
,sum(apr_sales) as apr_sales
,sum(may_sales) as may_sales
,sum(jun_sales) as jun_sales
,sum(jul_sales) as jul_sales
,sum(aug_sales) as aug_sales
,sum(sep_sales) as sep_sales
,sum(oct_sales) as oct_sales
,sum(nov_sales) as nov_sales
,sum(dec_sales) as dec_sales
,sum(jan_sales/w_warehouse_sq_ft) as jan_sales_per_sq_foot
,sum(feb_sales/w_warehouse_sq_ft) as feb_sales_per_sq_foot
,sum(mar_sales/w_warehouse_sq_ft) as mar_sales_per_sq_foot
,sum(apr_sales/w_warehouse_sq_ft) as apr_sales_per_sq_foot
,sum(may_sales/w_warehouse_sq_ft) as may_sales_per_sq_foot
,sum(jun_sales/w_warehouse_sq_ft) as jun_sales_per_sq_foot
,sum(jul_sales/w_warehouse_sq_ft) as jul_sales_per_sq_foot
,sum(aug_sales/w_warehouse_sq_ft) as aug_sales_per_sq_foot
,sum(sep_sales/w_warehouse_sq_ft) as sep_sales_per_sq_foot
,sum(oct_sales/w_warehouse_sq_ft) as oct_sales_per_sq_foot
,sum(nov_sales/w_warehouse_sq_ft) as nov_sales_per_sq_foot
,sum(dec_sales/w_warehouse_sq_ft) as dec_sales_per_sq_foot
,sum(jan_net) as jan_net
,sum(feb_net) as feb_net
,sum(mar_net) as mar_net
,sum(apr_net) as apr_net
,sum(may_net) as may_net
,sum(jun_net) as jun_net
,sum(jul_net) as jul_net
,sum(aug_net) as aug_net
,sum(sep_net) as sep_net
,sum(oct_net) as oct_net
,sum(nov_net) as nov_net
,sum(dec_net) as dec_net
from (
select
w_warehouse_name
,w_warehouse_sq_ft
,w_city
,w_county
,w_state
,w_country
,'MSC' || ',' || 'GERMA' as ship_carriers
,d_year as year
,sum(case when d_moy = 1
then ws_sales_price* ws_quantity else 0 end) as jan_sales
,sum(case when d_moy = 2
then ws_sales_price* ws_quantity else 0 end) as feb_sales
,sum(case when d_moy = 3
then ws_sales_price* ws_quantity else 0 end) as mar_sales
,sum(case when d_moy = 4
then ws_sales_price* ws_quantity else 0 end) as apr_sales
,sum(case when d_moy = 5
then ws_sales_price* ws_quantity else 0 end) as may_sales
,sum(case when d_moy = 6
then ws_sales_price* ws_quantity else 0 end) as jun_sales
,sum(case when d_moy = 7
then ws_sales_price* ws_quantity else 0 end) as jul_sales
,sum(case when d_moy = 8
then ws_sales_price* ws_quantity else 0 end) as aug_sales
,sum(case when d_moy = 9
then ws_sales_price* ws_quantity else 0 end) as sep_sales
,sum(case when d_moy = 10
then ws_sales_price* ws_quantity else 0 end) as oct_sales
,sum(case when d_moy = 11
then ws_sales_price* ws_quantity else 0 end) as nov_sales
,sum(case when d_moy = 12
then ws_sales_price* ws_quantity else 0 end) as dec_sales
,sum(case when d_moy = 1
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as jan_net
,sum(case when d_moy = 2
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as feb_net
,sum(case when d_moy = 3
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as mar_net
,sum(case when d_moy = 4
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as apr_net
,sum(case when d_moy = 5
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as may_net
,sum(case when d_moy = 6
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as jun_net
,sum(case when d_moy = 7
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as jul_net
,sum(case when d_moy = 8
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as aug_net
,sum(case when d_moy = 9
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as sep_net
,sum(case when d_moy = 10
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as oct_net
,sum(case when d_moy = 11
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as nov_net
,sum(case when d_moy = 12
then ws_net_paid_inc_ship_tax * ws_quantity else 0 end) as dec_net
from
web_sales
,warehouse
,date_dim
,time_dim
,ship_mode
where
ws_warehouse_sk = w_warehouse_sk
and ws_sold_date_sk = d_date_sk
and ws_sold_time_sk = t_time_sk
and ws_ship_mode_sk = sm_ship_mode_sk
and d_year = 2001
and t_time between 9453 and 9453+28800
and sm_carrier in ('MSC','GERMA')
group by
w_warehouse_name
,w_warehouse_sq_ft
,w_city
,w_county
,w_state
,w_country
,d_year
union all
select
w_warehouse_name
,w_warehouse_sq_ft
,w_city
,w_county
,w_state
,w_country
,'MSC' || ',' || 'GERMA' as ship_carriers
,d_year as year
,sum(case when d_moy = 1
then cs_ext_list_price* cs_quantity else 0 end) as jan_sales
,sum(case when d_moy = 2
then cs_ext_list_price* cs_quantity else 0 end) as feb_sales
,sum(case when d_moy = 3
then cs_ext_list_price* cs_quantity else 0 end) as mar_sales
,sum(case when d_moy = 4
then cs_ext_list_price* cs_quantity else 0 end) as apr_sales
,sum(case when d_moy = 5
then cs_ext_list_price* cs_quantity else 0 end) as may_sales
,sum(case when d_moy = 6
then cs_ext_list_price* cs_quantity else 0 end) as jun_sales
,sum(case when d_moy = 7
then cs_ext_list_price* cs_quantity else 0 end) as jul_sales
,sum(case when d_moy = 8
then cs_ext_list_price* cs_quantity else 0 end) as aug_sales
,sum(case when d_moy = 9
then cs_ext_list_price* cs_quantity else 0 end) as sep_sales
,sum(case when d_moy = 10
then cs_ext_list_price* cs_quantity else 0 end) as oct_sales
,sum(case when d_moy = 11
then cs_ext_list_price* cs_quantity else 0 end) as nov_sales
,sum(case when d_moy = 12
then cs_ext_list_price* cs_quantity else 0 end) as dec_sales
,sum(case when d_moy = 1
then cs_net_paid_inc_ship * cs_quantity else 0 end) as jan_net
,sum(case when d_moy = 2
then cs_net_paid_inc_ship * cs_quantity else 0 end) as feb_net
,sum(case when d_moy = 3
then cs_net_paid_inc_ship * cs_quantity else 0 end) as mar_net
,sum(case when d_moy = 4
then cs_net_paid_inc_ship * cs_quantity else 0 end) as apr_net
,sum(case when d_moy = 5
then cs_net_paid_inc_ship * cs_quantity else 0 end) as may_net
,sum(case when d_moy = 6
then cs_net_paid_inc_ship * cs_quantity else 0 end) as jun_net
,sum(case when d_moy = 7
then cs_net_paid_inc_ship * cs_quantity else 0 end) as jul_net
,sum(case when d_moy = 8
then cs_net_paid_inc_ship * cs_quantity else 0 end) as aug_net
,sum(case when d_moy = 9
then cs_net_paid_inc_ship * cs_quantity else 0 end) as sep_net
,sum(case when d_moy = 10
then cs_net_paid_inc_ship * cs_quantity else 0 end) as oct_net
,sum(case when d_moy = 11
then cs_net_paid_inc_ship * cs_quantity else 0 end) as nov_net
,sum(case when d_moy = 12
then cs_net_paid_inc_ship * cs_quantity else 0 end) as dec_net
from
catalog_sales
,warehouse
,date_dim
,time_dim
,ship_mode
where
cs_warehouse_sk = w_warehouse_sk
and cs_sold_date_sk = d_date_sk
and cs_sold_time_sk = t_time_sk
and cs_ship_mode_sk = sm_ship_mode_sk
and d_year = 2001
and t_time between 9453 AND 9453+28800
and sm_carrier in ('MSC','GERMA')
group by
w_warehouse_name
,w_warehouse_sq_ft
,w_city
,w_county
,w_state
,w_country
,d_year
) x
group by
w_warehouse_name
,w_warehouse_sq_ft
,w_city
,w_county
,w_state
,w_country
,ship_carriers
,year
order by w_warehouse_name
limit 100;
-- end query 1 in stream 0 using template query66.tpl
-- start query 1 in stream 0 using template query67.tpl and seed 1819994127
select *
from (select i_category
,i_class
,i_brand
,i_product_name
,d_year
,d_qoy
,d_moy
,s_store_id
,sumsales
,rank() over (partition by i_category order by sumsales desc) rk
from (select i_category
,i_class
,i_brand
,i_product_name
,d_year
,d_qoy
,d_moy
,s_store_id
,sum(coalesce(ss_sales_price*ss_quantity,0)) sumsales
from store_sales
,date_dim
,store
,item
where ss_sold_date_sk=d_date_sk
and ss_item_sk=i_item_sk
and ss_store_sk = s_store_sk
and d_month_seq between 1185 and 1185+11
group by rollup(i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy,s_store_id))dw1) dw2
where rk <= 100
order by i_category
,i_class
,i_brand
,i_product_name
,d_year
,d_qoy
,d_moy
,s_store_id
,sumsales
,rk
limit 100;
-- end query 1 in stream 0 using template query67.tpl
-- start query 1 in stream 0 using template query68.tpl and seed 803547492
select c_last_name
,c_first_name
,ca_city
,bought_city
,ss_ticket_number
,extended_price
,extended_tax
,list_price
from (select ss_ticket_number
,ss_customer_sk
,ca_city bought_city
,sum(ss_ext_sales_price) extended_price
,sum(ss_ext_list_price) list_price
,sum(ss_ext_tax) extended_tax
from store_sales
,date_dim
,store
,household_demographics
,customer_address
where store_sales.ss_sold_date_sk = date_dim.d_date_sk
and store_sales.ss_store_sk = store.s_store_sk
and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
and store_sales.ss_addr_sk = customer_address.ca_address_sk
and date_dim.d_dom between 1 and 2
and (household_demographics.hd_dep_count = 4 or
household_demographics.hd_vehicle_count= 0)
and date_dim.d_year in (1999,1999+1,1999+2)
and store.s_city in ('Pleasant Hill','Bethel')
group by ss_ticket_number
,ss_customer_sk
,ss_addr_sk,ca_city) dn
,customer
,customer_address current_addr
where ss_customer_sk = c_customer_sk
and customer.c_current_addr_sk = current_addr.ca_address_sk
and current_addr.ca_city <> bought_city
order by c_last_name
,ss_ticket_number
limit 100;
-- end query 1 in stream 0 using template query68.tpl
-- start query 1 in stream 0 using template query69.tpl and seed 797269820
select
cd_gender,
cd_marital_status,
cd_education_status,
count(*) cnt1,
cd_purchase_estimate,
count(*) cnt2,
cd_credit_rating,
count(*) cnt3
from
customer c,customer_address ca,customer_demographics
where
c.c_current_addr_sk = ca.ca_address_sk and
ca_state in ('MO','MN','AZ') and
cd_demo_sk = c.c_current_cdemo_sk and
exists (select *
from store_sales,date_dim
where c.c_customer_sk = ss_customer_sk and
ss_sold_date_sk = d_date_sk and
d_year = 2003 and
d_moy between 2 and 2+2) and
(not exists (select *
from web_sales,date_dim
where c.c_customer_sk = ws_bill_customer_sk and
ws_sold_date_sk = d_date_sk and
d_year = 2003 and
d_moy between 2 and 2+2) and
not exists (select *
from catalog_sales,date_dim
where c.c_customer_sk = cs_ship_customer_sk and
cs_sold_date_sk = d_date_sk and
d_year = 2003 and
d_moy between 2 and 2+2))
group by cd_gender,
cd_marital_status,
cd_education_status,
cd_purchase_estimate,
cd_credit_rating
order by cd_gender,
cd_marital_status,
cd_education_status,
cd_purchase_estimate,
cd_credit_rating
limit 100;
-- end query 1 in stream 0 using template query69.tpl
-- start query 1 in stream 0 using template query6.tpl and seed 1819994127
select a.ca_state state, count(*) cnt
from customer_address a
,customer c
,store_sales s
,date_dim d
,item i
where a.ca_address_sk = c.c_current_addr_sk
and c.c_customer_sk = s.ss_customer_sk
and s.ss_sold_date_sk = d.d_date_sk
and s.ss_item_sk = i.i_item_sk
and d.d_month_seq =
(select distinct (d_month_seq)
from date_dim
where d_year = 2002
and d_moy = 3 )
and i.i_current_price > 1.2 *
(select avg(j.i_current_price)
from item j
where j.i_category = i.i_category)
group by a.ca_state
having count(*) >= 10
order by cnt, a.ca_state
limit 100;
-- end query 1 in stream 0 using template query6.tpl
-- start query 1 in stream 0 using template query70.tpl and seed 1819994127
select
sum(ss_net_profit) as total_sum
,s_state
,s_county
,grouping(s_state)+grouping(s_county) as lochierarchy
,rank() over (
partition by grouping(s_state)+grouping(s_county),
case when grouping(s_county) = 0 then s_state end
order by sum(ss_net_profit) desc) as rank_within_parent
from
store_sales
,date_dim d1
,store
where
d1.d_month_seq between 1218 and 1218+11
and d1.d_date_sk = ss_sold_date_sk
and s_store_sk = ss_store_sk
and s_state in
( select s_state
from (select s_state as s_state,
rank() over ( partition by s_state order by sum(ss_net_profit) desc) as ranking
from store_sales, store, date_dim
where d_month_seq between 1218 and 1218+11
and d_date_sk = ss_sold_date_sk
and s_store_sk = ss_store_sk
group by s_state
) tmp1
where ranking <= 5
)
group by rollup(s_state,s_county)
order by
lochierarchy desc
,case when lochierarchy = 0 then s_state end
,rank_within_parent
limit 100;
-- end query 1 in stream 0 using template query70.tpl
-- start query 1 in stream 0 using template query71.tpl and seed 2031708268
select i_brand_id brand_id, i_brand brand,t_hour,t_minute,
sum(ext_price) ext_price
from item, (select ws_ext_sales_price as ext_price,
ws_sold_date_sk as sold_date_sk,
ws_item_sk as sold_item_sk,
ws_sold_time_sk as time_sk
from web_sales,date_dim
where d_date_sk = ws_sold_date_sk
and d_moy=12
and d_year=2000
union all
select cs_ext_sales_price as ext_price,
cs_sold_date_sk as sold_date_sk,
cs_item_sk as sold_item_sk,
cs_sold_time_sk as time_sk
from catalog_sales,date_dim
where d_date_sk = cs_sold_date_sk
and d_moy=12
and d_year=2000
union all
select ss_ext_sales_price as ext_price,
ss_sold_date_sk as sold_date_sk,
ss_item_sk as sold_item_sk,
ss_sold_time_sk as time_sk
from store_sales,date_dim
where d_date_sk = ss_sold_date_sk
and d_moy=12
and d_year=2000
) tmp,time_dim
where
sold_item_sk = i_item_sk
and i_manager_id=1
and time_sk = t_time_sk
and (t_meal_time = 'breakfast' or t_meal_time = 'dinner')
group by i_brand, i_brand_id,t_hour,t_minute
order by ext_price desc, i_brand_id
;
-- end query 1 in stream 0 using template query71.tpl
-- start query 1 in stream 0 using template query72.tpl and seed 2031708268
select i_item_desc
,w_warehouse_name
,d1.d_week_seq
,sum(case when p_promo_sk is null then 1 else 0 end) no_promo
,sum(case when p_promo_sk is not null then 1 else 0 end) promo
,count(*) total_cnt
from catalog_sales
join inventory on (cs_item_sk = inv_item_sk)
join warehouse on (w_warehouse_sk=inv_warehouse_sk)
join item on (i_item_sk = cs_item_sk)
join customer_demographics on (cs_bill_cdemo_sk = cd_demo_sk)
join household_demographics on (cs_bill_hdemo_sk = hd_demo_sk)
join date_dim d1 on (cs_sold_date_sk = d1.d_date_sk)
join date_dim d2 on (inv_date_sk = d2.d_date_sk)
join date_dim d3 on (cs_ship_date_sk = d3.d_date_sk)
left outer join promotion on (cs_promo_sk=p_promo_sk)
left outer join catalog_returns on (cr_item_sk = cs_item_sk and cr_order_number = cs_order_number)
where d1.d_week_seq = d2.d_week_seq
and inv_quantity_on_hand < cs_quantity
and d3.d_date > d1.d_date + INTERVAL(5) DAY
and hd_buy_potential = '1001-5000'
and d1.d_year = 2000
and cd_marital_status = 'D'
group by i_item_desc,w_warehouse_name,d1.d_week_seq
order by total_cnt desc, i_item_desc, w_warehouse_name, d_week_seq
limit 100;
-- end query 1 in stream 0 using template query72.tpl
-- start query 1 in stream 0 using template query73.tpl and seed 1971067816
select c_last_name
,c_first_name
,c_salutation
,c_preferred_cust_flag
,ss_ticket_number
,cnt from
(select ss_ticket_number
,ss_customer_sk
,count(*) cnt
from store_sales,date_dim,store,household_demographics
where store_sales.ss_sold_date_sk = date_dim.d_date_sk
and store_sales.ss_store_sk = store.s_store_sk
and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
and date_dim.d_dom between 1 and 2
and (household_demographics.hd_buy_potential = '>10000' or
household_demographics.hd_buy_potential = '5001-10000')
and household_demographics.hd_vehicle_count > 0
and case when household_demographics.hd_vehicle_count > 0 then
household_demographics.hd_dep_count/ household_demographics.hd_vehicle_count else null end > 1
and date_dim.d_year in (2000,2000+1,2000+2)
and store.s_county in ('Lea County','Furnas County','Pennington County','Bronx County')
group by ss_ticket_number,ss_customer_sk) dj,customer
where ss_customer_sk = c_customer_sk
and cnt between 1 and 5
order by cnt desc, c_last_name asc;
-- end query 1 in stream 0 using template query73.tpl
-- start query 1 in stream 0 using template query74.tpl and seed 1556717815
with year_total as (
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,d_year as year
,sum(ss_net_paid) year_total
,'s' sale_type
from customer
,store_sales
,date_dim
where c_customer_sk = ss_customer_sk
and ss_sold_date_sk = d_date_sk
and d_year in (1998,1998+1)
group by c_customer_id
,c_first_name
,c_last_name
,d_year
union all
select c_customer_id customer_id
,c_first_name customer_first_name
,c_last_name customer_last_name
,d_year as year
,sum(ws_net_paid) year_total
,'w' sale_type
from customer
,web_sales
,date_dim
where c_customer_sk = ws_bill_customer_sk
and ws_sold_date_sk = d_date_sk
and d_year in (1998,1998+1)
group by c_customer_id
,c_first_name
,c_last_name
,d_year
)
select
t_s_secyear.customer_id, t_s_secyear.customer_first_name, t_s_secyear.customer_last_name
from year_total t_s_firstyear
,year_total t_s_secyear
,year_total t_w_firstyear
,year_total t_w_secyear
where t_s_secyear.customer_id = t_s_firstyear.customer_id
and t_s_firstyear.customer_id = t_w_secyear.customer_id
and t_s_firstyear.customer_id = t_w_firstyear.customer_id
and t_s_firstyear.sale_type = 's'
and t_w_firstyear.sale_type = 'w'
and t_s_secyear.sale_type = 's'
and t_w_secyear.sale_type = 'w'
and t_s_firstyear.year = 1998
and t_s_secyear.year = 1998+1
and t_w_firstyear.year = 1998
and t_w_secyear.year = 1998+1
and t_s_firstyear.year_total > 0
and t_w_firstyear.year_total > 0
and case when t_w_firstyear.year_total > 0 then t_w_secyear.year_total / t_w_firstyear.year_total else null end
> case when t_s_firstyear.year_total > 0 then t_s_secyear.year_total / t_s_firstyear.year_total else null end
order by 3,1,2
limit 100;
-- end query 1 in stream 0 using template query74.tpl
-- start query 1 in stream 0 using template query75.tpl and seed 1819994127
WITH all_sales AS (
SELECT d_year
,i_brand_id
,i_class_id
,i_category_id
,i_manufact_id
,SUM(sales_cnt) AS sales_cnt
,SUM(sales_amt) AS sales_amt
FROM (SELECT d_year
,i_brand_id
,i_class_id
,i_category_id
,i_manufact_id
,cs_quantity - COALESCE(cr_return_quantity,0) AS sales_cnt
,cs_ext_sales_price - COALESCE(cr_return_amount,0.0) AS sales_amt
FROM catalog_sales JOIN item ON i_item_sk=cs_item_sk
JOIN date_dim ON d_date_sk=cs_sold_date_sk
LEFT JOIN catalog_returns ON (cs_order_number=cr_order_number
AND cs_item_sk=cr_item_sk)
WHERE i_category='Sports'
UNION
SELECT d_year
,i_brand_id
,i_class_id
,i_category_id
,i_manufact_id
,ss_quantity - COALESCE(sr_return_quantity,0) AS sales_cnt
,ss_ext_sales_price - COALESCE(sr_return_amt,0.0) AS sales_amt
FROM store_sales JOIN item ON i_item_sk=ss_item_sk
JOIN date_dim ON d_date_sk=ss_sold_date_sk
LEFT JOIN store_returns ON (ss_ticket_number=sr_ticket_number
AND ss_item_sk=sr_item_sk)
WHERE i_category='Sports'
UNION
SELECT d_year
,i_brand_id
,i_class_id
,i_category_id
,i_manufact_id
,ws_quantity - COALESCE(wr_return_quantity,0) AS sales_cnt
,ws_ext_sales_price - COALESCE(wr_return_amt,0.0) AS sales_amt
FROM web_sales JOIN item ON i_item_sk=ws_item_sk
JOIN date_dim ON d_date_sk=ws_sold_date_sk
LEFT JOIN web_returns ON (ws_order_number=wr_order_number
AND ws_item_sk=wr_item_sk)
WHERE i_category='Sports') sales_detail
GROUP BY d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id)
SELECT prev_yr.d_year AS prev_year
,curr_yr.d_year AS year
,curr_yr.i_brand_id
,curr_yr.i_class_id
,curr_yr.i_category_id
,curr_yr.i_manufact_id
,prev_yr.sales_cnt AS prev_yr_cnt
,curr_yr.sales_cnt AS curr_yr_cnt
,curr_yr.sales_cnt-prev_yr.sales_cnt AS sales_cnt_diff
,curr_yr.sales_amt-prev_yr.sales_amt AS sales_amt_diff
FROM all_sales curr_yr, all_sales prev_yr
WHERE curr_yr.i_brand_id=prev_yr.i_brand_id
AND curr_yr.i_class_id=prev_yr.i_class_id
AND curr_yr.i_category_id=prev_yr.i_category_id
AND curr_yr.i_manufact_id=prev_yr.i_manufact_id
AND curr_yr.d_year=2001
AND prev_yr.d_year=2001-1
AND CAST(curr_yr.sales_cnt AS DECIMAL(17,2))/CAST(prev_yr.sales_cnt AS DECIMAL(17,2))<0.9
ORDER BY sales_cnt_diff,sales_amt_diff
limit 100;
-- end query 1 in stream 0 using template query75.tpl
-- start query 1 in stream 0 using template query76.tpl and seed 2031708268
select channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM (
SELECT 'store' as channel, 'ss_customer_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales_price
FROM store_sales, item, date_dim
WHERE ss_customer_sk IS NULL
AND ss_sold_date_sk=d_date_sk
AND ss_item_sk=i_item_sk
UNION ALL
SELECT 'web' as channel, 'ws_ship_addr_sk' col_name, d_year, d_qoy, i_category, ws_ext_sales_price ext_sales_price
FROM web_sales, item, date_dim
WHERE ws_ship_addr_sk IS NULL
AND ws_sold_date_sk=d_date_sk
AND ws_item_sk=i_item_sk
UNION ALL
SELECT 'catalog' as channel, 'cs_ship_mode_sk' col_name, d_year, d_qoy, i_category, cs_ext_sales_price ext_sales_price
FROM catalog_sales, item, date_dim
WHERE cs_ship_mode_sk IS NULL
AND cs_sold_date_sk=d_date_sk
AND cs_item_sk=i_item_sk) foo
GROUP BY channel, col_name, d_year, d_qoy, i_category
ORDER BY channel, col_name, d_year, d_qoy, i_category
limit 100;
-- end query 1 in stream 0 using template query76.tpl
-- start query 1 in stream 0 using template query77.tpl and seed 1819994127
with ss as
(select s_store_sk,
sum(ss_ext_sales_price) as sales,
sum(ss_net_profit) as profit
from store_sales,
date_dim,
store
where ss_sold_date_sk = d_date_sk
and d_date between cast('2000-08-16' as date)
and (cast('2000-08-16' as date) + 30 days)
and ss_store_sk = s_store_sk
group by s_store_sk)
,
sr as
(select s_store_sk,
sum(sr_return_amt) as returns,
sum(sr_net_loss) as profit_loss
from store_returns,
date_dim,
store
where sr_returned_date_sk = d_date_sk
and d_date between cast('2000-08-16' as date)
and (cast('2000-08-16' as date) + 30 days)
and sr_store_sk = s_store_sk
group by s_store_sk),
cs as
(select cs_call_center_sk,
sum(cs_ext_sales_price) as sales,
sum(cs_net_profit) as profit
from catalog_sales,
date_dim
where cs_sold_date_sk = d_date_sk
and d_date between cast('2000-08-16' as date)
and (cast('2000-08-16' as date) + 30 days)
group by cs_call_center_sk
),
cr as
(select cr_call_center_sk,
sum(cr_return_amount) as returns,
sum(cr_net_loss) as profit_loss
from catalog_returns,
date_dim
where cr_returned_date_sk = d_date_sk
and d_date between cast('2000-08-16' as date)
and (cast('2000-08-16' as date) + 30 days)
group by cr_call_center_sk
),
ws as
( select wp_web_page_sk,
sum(ws_ext_sales_price) as sales,
sum(ws_net_profit) as profit
from web_sales,
date_dim,
web_page
where ws_sold_date_sk = d_date_sk
and d_date between cast('2000-08-16' as date)
and (cast('2000-08-16' as date) + 30 days)
and ws_web_page_sk = wp_web_page_sk
group by wp_web_page_sk),
wr as
(select wp_web_page_sk,
sum(wr_return_amt) as returns,
sum(wr_net_loss) as profit_loss
from web_returns,
date_dim,
web_page
where wr_returned_date_sk = d_date_sk
and d_date between cast('2000-08-16' as date)
and (cast('2000-08-16' as date) + 30 days)
and wr_web_page_sk = wp_web_page_sk
group by wp_web_page_sk)
select channel
, id
, sum(sales) as sales
, sum(returns) as returns
, sum(profit) as profit
from
(select 'store channel' as channel
, ss.s_store_sk as id
, sales
, coalesce(returns, 0) as returns
, (profit - coalesce(profit_loss,0)) as profit
from ss left join sr
on ss.s_store_sk = sr.s_store_sk
union all
select 'catalog channel' as channel
, cs_call_center_sk as id
, sales
, returns
, (profit - profit_loss) as profit
from cs
, cr
union all
select 'web channel' as channel
, ws.wp_web_page_sk as id
, sales
, coalesce(returns, 0) returns
, (profit - coalesce(profit_loss,0)) as profit
from ws left join wr
on ws.wp_web_page_sk = wr.wp_web_page_sk
) x
group by rollup (channel, id)
order by channel
,id
limit 100;
-- end query 1 in stream 0 using template query77.tpl
-- start query 1 in stream 0 using template query78.tpl and seed 1819994127
with ws as
(select d_year AS ws_sold_year, ws_item_sk,
ws_bill_customer_sk ws_customer_sk,
sum(ws_quantity) ws_qty,
sum(ws_wholesale_cost) ws_wc,
sum(ws_sales_price) ws_sp
from web_sales
left join web_returns on wr_order_number=ws_order_number and ws_item_sk=wr_item_sk
join date_dim on ws_sold_date_sk = d_date_sk
where wr_order_number is null
group by d_year, ws_item_sk, ws_bill_customer_sk
),
cs as
(select d_year AS cs_sold_year, cs_item_sk,
cs_bill_customer_sk cs_customer_sk,
sum(cs_quantity) cs_qty,
sum(cs_wholesale_cost) cs_wc,
sum(cs_sales_price) cs_sp
from catalog_sales
left join catalog_returns on cr_order_number=cs_order_number and cs_item_sk=cr_item_sk
join date_dim on cs_sold_date_sk = d_date_sk
where cr_order_number is null
group by d_year, cs_item_sk, cs_bill_customer_sk
),
ss as
(select d_year AS ss_sold_year, ss_item_sk,
ss_customer_sk,
sum(ss_quantity) ss_qty,
sum(ss_wholesale_cost) ss_wc,
sum(ss_sales_price) ss_sp
from store_sales
left join store_returns on sr_ticket_number=ss_ticket_number and ss_item_sk=sr_item_sk
join date_dim on ss_sold_date_sk = d_date_sk
where sr_ticket_number is null
group by d_year, ss_item_sk, ss_customer_sk
)
select
ss_customer_sk,
round(ss_qty/(coalesce(ws_qty,0)+coalesce(cs_qty,0)),2) ratio,
ss_qty store_qty, ss_wc store_wholesale_cost, ss_sp store_sales_price,
coalesce(ws_qty,0)+coalesce(cs_qty,0) other_chan_qty,
coalesce(ws_wc,0)+coalesce(cs_wc,0) other_chan_wholesale_cost,
coalesce(ws_sp,0)+coalesce(cs_sp,0) other_chan_sales_price
from ss
left join ws on (ws_sold_year=ss_sold_year and ws_item_sk=ss_item_sk and ws_customer_sk=ss_customer_sk)
left join cs on (cs_sold_year=ss_sold_year and cs_item_sk=ss_item_sk and cs_customer_sk=ss_customer_sk)
where (coalesce(ws_qty,0)>0 or coalesce(cs_qty, 0)>0) and ss_sold_year=2001
order by
ss_customer_sk,
ss_qty desc, ss_wc desc, ss_sp desc,
other_chan_qty,
other_chan_wholesale_cost,
other_chan_sales_price,
ratio
limit 100;
-- end query 1 in stream 0 using template query78.tpl
-- start query 1 in stream 0 using template query79.tpl and seed 2031708268
select
c_last_name,c_first_name,substr(s_city,1,30),ss_ticket_number,amt,profit
from
(select ss_ticket_number
,ss_customer_sk
,store.s_city
,sum(ss_coupon_amt) amt
,sum(ss_net_profit) profit
from store_sales,date_dim,store,household_demographics
where store_sales.ss_sold_date_sk = date_dim.d_date_sk
and store_sales.ss_store_sk = store.s_store_sk
and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
and (household_demographics.hd_dep_count = 0 or household_demographics.hd_vehicle_count > 3)
and date_dim.d_dow = 1
and date_dim.d_year in (1998,1998+1,1998+2)
and store.s_number_employees between 200 and 295
group by ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city) ms,customer
where ss_customer_sk = c_customer_sk
order by c_last_name,c_first_name,substr(s_city,1,30), profit
limit 100;
-- end query 1 in stream 0 using template query79.tpl
-- start query 1 in stream 0 using template query7.tpl and seed 1930872976
select i_item_id,
avg(ss_quantity) agg1,
avg(ss_list_price) agg2,
avg(ss_coupon_amt) agg3,
avg(ss_sales_price) agg4
from store_sales, customer_demographics, date_dim, item, promotion
where ss_sold_date_sk = d_date_sk and
ss_item_sk = i_item_sk and
ss_cdemo_sk = cd_demo_sk and
ss_promo_sk = p_promo_sk and
cd_gender = 'F' and
cd_marital_status = 'W' and
cd_education_status = 'College' and
(p_channel_email = 'N' or p_channel_event = 'N') and
d_year = 2001
group by i_item_id
order by i_item_id
limit 100;
-- end query 1 in stream 0 using template query7.tpl
-- start query 1 in stream 0 using template query80.tpl and seed 1819994127
with ssr as
(select s_store_id as store_id,
sum(ss_ext_sales_price) as sales,
sum(coalesce(sr_return_amt, 0)) as returns,
sum(ss_net_profit - coalesce(sr_net_loss, 0)) as profit
from store_sales left outer join store_returns on
(ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number),
date_dim,
store,
item,
promotion
where ss_sold_date_sk = d_date_sk
and d_date between cast('2002-08-06' as date)
and (cast('2002-08-06' as date) + 30 days)
and ss_store_sk = s_store_sk
and ss_item_sk = i_item_sk
and i_current_price > 50
and ss_promo_sk = p_promo_sk
and p_channel_tv = 'N'
group by s_store_id)
,
csr as
(select cp_catalog_page_id as catalog_page_id,
sum(cs_ext_sales_price) as sales,
sum(coalesce(cr_return_amount, 0)) as returns,
sum(cs_net_profit - coalesce(cr_net_loss, 0)) as profit
from catalog_sales left outer join catalog_returns on
(cs_item_sk = cr_item_sk and cs_order_number = cr_order_number),
date_dim,
catalog_page,
item,
promotion
where cs_sold_date_sk = d_date_sk
and d_date between cast('2002-08-06' as date)
and (cast('2002-08-06' as date) + 30 days)
and cs_catalog_page_sk = cp_catalog_page_sk
and cs_item_sk = i_item_sk
and i_current_price > 50
and cs_promo_sk = p_promo_sk
and p_channel_tv = 'N'
group by cp_catalog_page_id)
,
wsr as
(select web_site_id,
sum(ws_ext_sales_price) as sales,
sum(coalesce(wr_return_amt, 0)) as returns,
sum(ws_net_profit - coalesce(wr_net_loss, 0)) as profit
from web_sales left outer join web_returns on
(ws_item_sk = wr_item_sk and ws_order_number = wr_order_number),
date_dim,
web_site,
item,
promotion
where ws_sold_date_sk = d_date_sk
and d_date between cast('2002-08-06' as date)
and (cast('2002-08-06' as date) + 30 days)
and ws_web_site_sk = web_site_sk
and ws_item_sk = i_item_sk
and i_current_price > 50
and ws_promo_sk = p_promo_sk
and p_channel_tv = 'N'
group by web_site_id)
select channel
, id
, sum(sales) as sales
, sum(returns) as returns
, sum(profit) as profit
from
(select 'store channel' as channel
, 'store' || store_id as id
, sales
, returns
, profit
from ssr
union all
select 'catalog channel' as channel
, 'catalog_page' || catalog_page_id as id
, sales
, returns
, profit
from csr
union all
select 'web channel' as channel
, 'web_site' || web_site_id as id
, sales
, returns
, profit
from wsr
) x
group by rollup (channel, id)
order by channel
,id
limit 100;
-- end query 1 in stream 0 using template query80.tpl
-- start query 1 in stream 0 using template query81.tpl and seed 1819994127
with customer_total_return as
(select cr_returning_customer_sk as ctr_customer_sk
,ca_state as ctr_state,
sum(cr_return_amt_inc_tax) as ctr_total_return
from catalog_returns
,date_dim
,customer_address
where cr_returned_date_sk = d_date_sk
and d_year =1998
and cr_returning_addr_sk = ca_address_sk
group by cr_returning_customer_sk
,ca_state )
select c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name
,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset
,ca_location_type,ctr_total_return
from customer_total_return ctr1
,customer_address
,customer
where ctr1.ctr_total_return > (select avg(ctr_total_return)*1.2
from customer_total_return ctr2
where ctr1.ctr_state = ctr2.ctr_state)
and ca_address_sk = c_current_addr_sk
and ca_state = 'TX'
and ctr1.ctr_customer_sk = c_customer_sk
order by c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name
,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset
,ca_location_type,ctr_total_return
limit 100;
-- end query 1 in stream 0 using template query81.tpl
-- start query 1 in stream 0 using template query82.tpl and seed 55585014
select i_item_id
,i_item_desc
,i_current_price
from item, inventory, date_dim, store_sales
where i_current_price between 49 and 49+30
and inv_item_sk = i_item_sk
and d_date_sk=inv_date_sk
and d_date between cast('2001-01-28' as date) and (cast('2001-01-28' as date) + 60 days)
and i_manufact_id in (80,675,292,17)
and inv_quantity_on_hand between 100 and 500
and ss_item_sk = i_item_sk
group by i_item_id,i_item_desc,i_current_price
order by i_item_id
limit 100;
-- end query 1 in stream 0 using template query82.tpl
-- start query 1 in stream 0 using template query83.tpl and seed 1930872976
with sr_items as
(select i_item_id item_id,
sum(sr_return_quantity) sr_item_qty
from store_returns,
item,
date_dim
where sr_item_sk = i_item_sk
and d_date in
(select d_date
from date_dim
where d_week_seq in
(select d_week_seq
from date_dim
where d_date in ('2000-06-17','2000-08-22','2000-11-17')))
and sr_returned_date_sk = d_date_sk
group by i_item_id),
cr_items as
(select i_item_id item_id,
sum(cr_return_quantity) cr_item_qty
from catalog_returns,
item,
date_dim
where cr_item_sk = i_item_sk
and d_date in
(select d_date
from date_dim
where d_week_seq in
(select d_week_seq
from date_dim
where d_date in ('2000-06-17','2000-08-22','2000-11-17')))
and cr_returned_date_sk = d_date_sk
group by i_item_id),
wr_items as
(select i_item_id item_id,
sum(wr_return_quantity) wr_item_qty
from web_returns,
item,
date_dim
where wr_item_sk = i_item_sk
and d_date in
(select d_date
from date_dim
where d_week_seq in
(select d_week_seq
from date_dim
where d_date in ('2000-06-17','2000-08-22','2000-11-17')))
and wr_returned_date_sk = d_date_sk
group by i_item_id)
select sr_items.item_id
,sr_item_qty
,sr_item_qty/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 sr_dev
,cr_item_qty
,cr_item_qty/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 cr_dev
,wr_item_qty
,wr_item_qty/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 * 100 wr_dev
,(sr_item_qty+cr_item_qty+wr_item_qty)/3.0 average
from sr_items
,cr_items
,wr_items
where sr_items.item_id=cr_items.item_id
and sr_items.item_id=wr_items.item_id
order by sr_items.item_id
,sr_item_qty
limit 100;
-- end query 1 in stream 0 using template query83.tpl
-- start query 1 in stream 0 using template query84.tpl and seed 1819994127
select c_customer_id as customer_id
, coalesce(c_last_name,'') || ', ' || coalesce(c_first_name,'') as customername
from customer
,customer_address
,customer_demographics
,household_demographics
,income_band
,store_returns
where ca_city = 'Hopewell'
and c_current_addr_sk = ca_address_sk
and ib_lower_bound >= 37855
and ib_upper_bound <= 37855 + 50000
and ib_income_band_sk = hd_income_band_sk
and cd_demo_sk = c_current_cdemo_sk
and hd_demo_sk = c_current_hdemo_sk
and sr_cdemo_sk = cd_demo_sk
order by c_customer_id
limit 100;
-- end query 1 in stream 0 using template query84.tpl
-- start query 1 in stream 0 using template query85.tpl and seed 622697896
select substr(r_reason_desc,1,20)
,avg(ws_quantity)
,avg(wr_refunded_cash)
,avg(wr_fee)
from web_sales, web_returns, web_page, customer_demographics cd1,
customer_demographics cd2, customer_address, date_dim, reason
where ws_web_page_sk = wp_web_page_sk
and ws_item_sk = wr_item_sk
and ws_order_number = wr_order_number
and ws_sold_date_sk = d_date_sk and d_year = 2001
and cd1.cd_demo_sk = wr_refunded_cdemo_sk
and cd2.cd_demo_sk = wr_returning_cdemo_sk
and ca_address_sk = wr_refunded_addr_sk
and r_reason_sk = wr_reason_sk
and
(
(
cd1.cd_marital_status = 'M'
and
cd1.cd_marital_status = cd2.cd_marital_status
and
cd1.cd_education_status = '4 yr Degree'
and
cd1.cd_education_status = cd2.cd_education_status
and
ws_sales_price between 100.00 and 150.00
)
or
(
cd1.cd_marital_status = 'S'
and
cd1.cd_marital_status = cd2.cd_marital_status
and
cd1.cd_education_status = 'College'
and
cd1.cd_education_status = cd2.cd_education_status
and
ws_sales_price between 50.00 and 100.00
)
or
(
cd1.cd_marital_status = 'D'
and
cd1.cd_marital_status = cd2.cd_marital_status
and
cd1.cd_education_status = 'Secondary'
and
cd1.cd_education_status = cd2.cd_education_status
and
ws_sales_price between 150.00 and 200.00
)
)
and
(
(
ca_country = 'United States'
and
ca_state in ('TX', 'VA', 'CA')
and ws_net_profit between 100 and 200
)
or
(
ca_country = 'United States'
and
ca_state in ('AR', 'NE', 'MO')
and ws_net_profit between 150 and 300
)
or
(
ca_country = 'United States'
and
ca_state in ('IA', 'MS', 'WA')
and ws_net_profit between 50 and 250
)
)
group by r_reason_desc
order by substr(r_reason_desc,1,20)
,avg(ws_quantity)
,avg(wr_refunded_cash)
,avg(wr_fee)
limit 100;
-- end query 1 in stream 0 using template query85.tpl
-- start query 1 in stream 0 using template query86.tpl and seed 1819994127
select
sum(ws_net_paid) as total_sum
,i_category
,i_class
,grouping(i_category)+grouping(i_class) as lochierarchy
,rank() over (
partition by grouping(i_category)+grouping(i_class),
case when grouping(i_class) = 0 then i_category end
order by sum(ws_net_paid) desc) as rank_within_parent
from
web_sales
,date_dim d1
,item
where
d1.d_month_seq between 1215 and 1215+11
and d1.d_date_sk = ws_sold_date_sk
and i_item_sk = ws_item_sk
group by rollup(i_category,i_class)
order by
lochierarchy desc,
case when lochierarchy = 0 then i_category end,
rank_within_parent
limit 100;
-- end query 1 in stream 0 using template query86.tpl
-- start query 1 in stream 0 using template query87.tpl and seed 1819994127
select count(*)
from ((select distinct c_last_name, c_first_name, d_date
from store_sales, date_dim, customer
where store_sales.ss_sold_date_sk = date_dim.d_date_sk
and store_sales.ss_customer_sk = customer.c_customer_sk
and d_month_seq between 1221 and 1221+11)
except
(select distinct c_last_name, c_first_name, d_date
from catalog_sales, date_dim, customer
where catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
and catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
and d_month_seq between 1221 and 1221+11)
except
(select distinct c_last_name, c_first_name, d_date
from web_sales, date_dim, customer
where web_sales.ws_sold_date_sk = date_dim.d_date_sk
and web_sales.ws_bill_customer_sk = customer.c_customer_sk
and d_month_seq between 1221 and 1221+11)
) cool_cust
;
-- end query 1 in stream 0 using template query87.tpl
-- start query 1 in stream 0 using template query88.tpl and seed 318176889
select *
from
(select count(*) h8_30_to_9
from store_sales, household_demographics , time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 8
and time_dim.t_minute >= 30
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s1,
(select count(*) h9_to_9_30
from store_sales, household_demographics , time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 9
and time_dim.t_minute < 30
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s2,
(select count(*) h9_30_to_10
from store_sales, household_demographics , time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 9
and time_dim.t_minute >= 30
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s3,
(select count(*) h10_to_10_30
from store_sales, household_demographics , time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 10
and time_dim.t_minute < 30
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s4,
(select count(*) h10_30_to_11
from store_sales, household_demographics , time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 10
and time_dim.t_minute >= 30
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s5,
(select count(*) h11_to_11_30
from store_sales, household_demographics , time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 11
and time_dim.t_minute < 30
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s6,
(select count(*) h11_30_to_12
from store_sales, household_demographics , time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 11
and time_dim.t_minute >= 30
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s7,
(select count(*) h12_to_12_30
from store_sales, household_demographics , time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 12
and time_dim.t_minute < 30
and ((household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2) or
(household_demographics.hd_dep_count = 4 and household_demographics.hd_vehicle_count<=4+2) or
(household_demographics.hd_dep_count = 3 and household_demographics.hd_vehicle_count<=3+2))
and store.s_store_name = 'ese') s8
;
-- end query 1 in stream 0 using template query88.tpl
-- start query 1 in stream 0 using template query89.tpl and seed 1719819282
select *
from(
select i_category, i_class, i_brand,
s_store_name, s_company_name,
d_moy,
sum(ss_sales_price) sum_sales,
avg(sum(ss_sales_price)) over
(partition by i_category, i_brand, s_store_name, s_company_name)
avg_monthly_sales
from item, store_sales, date_dim, store
where ss_item_sk = i_item_sk and
ss_sold_date_sk = d_date_sk and
ss_store_sk = s_store_sk and
d_year in (2000) and
((i_category in ('Home','Music','Books') and
i_class in ('glassware','classical','fiction')
)
or (i_category in ('Jewelry','Sports','Women') and
i_class in ('semi-precious','baseball','dresses')
))
group by i_category, i_class, i_brand,
s_store_name, s_company_name, d_moy) tmp1
where case when (avg_monthly_sales <> 0) then (abs(sum_sales - avg_monthly_sales) / avg_monthly_sales) else null end > 0.1
order by sum_sales - avg_monthly_sales, s_store_name
limit 100;
-- end query 1 in stream 0 using template query89.tpl
-- start query 1 in stream 0 using template query8.tpl and seed 1766988859
select s_store_name
,sum(ss_net_profit)
from store_sales
,date_dim
,store,
(select ca_zip
from (
SELECT substr(ca_zip,1,5) ca_zip
FROM customer_address
WHERE substr(ca_zip,1,5) IN (
'47602','16704','35863','28577','83910','36201',
'58412','48162','28055','41419','80332',
'38607','77817','24891','16226','18410',
'21231','59345','13918','51089','20317',
'17167','54585','67881','78366','47770',
'18360','51717','73108','14440','21800',
'89338','45859','65501','34948','25973',
'73219','25333','17291','10374','18829',
'60736','82620','41351','52094','19326',
'25214','54207','40936','21814','79077',
'25178','75742','77454','30621','89193',
'27369','41232','48567','83041','71948',
'37119','68341','14073','16891','62878',
'49130','19833','24286','27700','40979',
'50412','81504','94835','84844','71954',
'39503','57649','18434','24987','12350',
'86379','27413','44529','98569','16515',
'27287','24255','21094','16005','56436',
'91110','68293','56455','54558','10298',
'83647','32754','27052','51766','19444',
'13869','45645','94791','57631','20712',
'37788','41807','46507','21727','71836',
'81070','50632','88086','63991','20244',
'31655','51782','29818','63792','68605',
'94898','36430','57025','20601','82080',
'33869','22728','35834','29086','92645',
'98584','98072','11652','78093','57553',
'43830','71144','53565','18700','90209',
'71256','38353','54364','28571','96560',
'57839','56355','50679','45266','84680',
'34306','34972','48530','30106','15371',
'92380','84247','92292','68852','13338',
'34594','82602','70073','98069','85066',
'47289','11686','98862','26217','47529',
'63294','51793','35926','24227','14196',
'24594','32489','99060','49472','43432',
'49211','14312','88137','47369','56877',
'20534','81755','15794','12318','21060',
'73134','41255','63073','81003','73873',
'66057','51184','51195','45676','92696',
'70450','90669','98338','25264','38919',
'59226','58581','60298','17895','19489',
'52301','80846','95464','68770','51634',
'19988','18367','18421','11618','67975',
'25494','41352','95430','15734','62585',
'97173','33773','10425','75675','53535',
'17879','41967','12197','67998','79658',
'59130','72592','14851','43933','68101',
'50636','25717','71286','24660','58058',
'72991','95042','15543','33122','69280',
'11912','59386','27642','65177','17672',
'33467','64592','36335','54010','18767',
'63193','42361','49254','33113','33159',
'36479','59080','11855','81963','31016',
'49140','29392','41836','32958','53163',
'13844','73146','23952','65148','93498',
'14530','46131','58454','13376','13378',
'83986','12320','17193','59852','46081',
'98533','52389','13086','68843','31013',
'13261','60560','13443','45533','83583',
'11489','58218','19753','22911','25115',
'86709','27156','32669','13123','51933',
'39214','41331','66943','14155','69998',
'49101','70070','35076','14242','73021',
'59494','15782','29752','37914','74686',
'83086','34473','15751','81084','49230',
'91894','60624','17819','28810','63180',
'56224','39459','55233','75752','43639',
'55349','86057','62361','50788','31830',
'58062','18218','85761','60083','45484',
'21204','90229','70041','41162','35390',
'16364','39500','68908','26689','52868',
'81335','40146','11340','61527','61794',
'71997','30415','59004','29450','58117',
'69952','33562','83833','27385','61860',
'96435','48333','23065','32961','84919',
'61997','99132','22815','56600','68730',
'48017','95694','32919','88217','27116',
'28239','58032','18884','16791','21343',
'97462','18569','75660','15475')
intersect
select ca_zip
from (SELECT substr(ca_zip,1,5) ca_zip,count(*) cnt
FROM customer_address, customer
WHERE ca_address_sk = c_current_addr_sk and
c_preferred_cust_flag='Y'
group by ca_zip
having count(*) > 10)A1)A2) V1
where ss_store_sk = s_store_sk
and ss_sold_date_sk = d_date_sk
and d_qoy = 2 and d_year = 1998
and (substr(s_zip,1,2) = substr(V1.ca_zip,1,2))
group by s_store_name
order by s_store_name
limit 100;
-- end query 1 in stream 0 using template query8.tpl
-- start query 1 in stream 0 using template query90.tpl and seed 2031708268
select cast(amc as decimal(15,4))/cast(pmc as decimal(15,4)) am_pm_ratio
from ( select count(*) amc
from web_sales, household_demographics , time_dim, web_page
where ws_sold_time_sk = time_dim.t_time_sk
and ws_ship_hdemo_sk = household_demographics.hd_demo_sk
and ws_web_page_sk = web_page.wp_web_page_sk
and time_dim.t_hour between 9 and 9+1
and household_demographics.hd_dep_count = 3
and web_page.wp_char_count between 5000 and 5200) at,
( select count(*) pmc
from web_sales, household_demographics , time_dim, web_page
where ws_sold_time_sk = time_dim.t_time_sk
and ws_ship_hdemo_sk = household_demographics.hd_demo_sk
and ws_web_page_sk = web_page.wp_web_page_sk
and time_dim.t_hour between 16 and 16+1
and household_demographics.hd_dep_count = 3
and web_page.wp_char_count between 5000 and 5200) pt
order by am_pm_ratio
limit 100;
-- end query 1 in stream 0 using template query90.tpl
-- start query 1 in stream 0 using template query91.tpl and seed 1930872976
select
cc_call_center_id Call_Center,
cc_name Call_Center_Name,
cc_manager Manager,
sum(cr_net_loss) Returns_Loss
from
call_center,
catalog_returns,
date_dim,
customer,
customer_address,
customer_demographics,
household_demographics
where
cr_call_center_sk = cc_call_center_sk
and cr_returned_date_sk = d_date_sk
and cr_returning_customer_sk= c_customer_sk
and cd_demo_sk = c_current_cdemo_sk
and hd_demo_sk = c_current_hdemo_sk
and ca_address_sk = c_current_addr_sk
and d_year = 2000
and d_moy = 12
and ( (cd_marital_status = 'M' and cd_education_status = 'Unknown')
or(cd_marital_status = 'W' and cd_education_status = 'Advanced Degree'))
and hd_buy_potential like 'Unknown%'
and ca_gmt_offset = -7
group by cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status
order by sum(cr_net_loss) desc;
-- end query 1 in stream 0 using template query91.tpl
-- start query 1 in stream 0 using template query92.tpl and seed 2031708268
select
sum(ws_ext_discount_amt) as `Excess Discount Amount`
from
web_sales
,item
,date_dim
where
i_manufact_id = 356
and i_item_sk = ws_item_sk
and d_date between '2001-03-12' and
(cast('2001-03-12' as date) + 90 days)
and d_date_sk = ws_sold_date_sk
and ws_ext_discount_amt
> (
SELECT
1.3 * avg(ws_ext_discount_amt)
FROM
web_sales
,date_dim
WHERE
ws_item_sk = i_item_sk
and d_date between '2001-03-12' and
(cast('2001-03-12' as date) + 90 days)
and d_date_sk = ws_sold_date_sk
)
order by sum(ws_ext_discount_amt)
limit 100;
-- end query 1 in stream 0 using template query92.tpl
-- start query 1 in stream 0 using template query93.tpl and seed 1200409435
select ss_customer_sk
,sum(act_sales) sumsales
from (select ss_item_sk
,ss_ticket_number
,ss_customer_sk
,case when sr_return_quantity is not null then (ss_quantity-sr_return_quantity)*ss_sales_price
else (ss_quantity*ss_sales_price) end act_sales
from store_sales left outer join store_returns on (sr_item_sk = ss_item_sk
and sr_ticket_number = ss_ticket_number)
,reason
where sr_reason_sk = r_reason_sk
and r_reason_desc = 'reason 66') t
group by ss_customer_sk
order by sumsales, ss_customer_sk
limit 100;
-- end query 1 in stream 0 using template query93.tpl
-- start query 1 in stream 0 using template query94.tpl and seed 2031708268
select
count(distinct ws_order_number) as `order count`
,sum(ws_ext_ship_cost) as `total shipping cost`
,sum(ws_net_profit) as `total net profit`
from
web_sales ws1
,date_dim
,customer_address
,web_site
where
d_date between '1999-4-01' and
(cast('1999-4-01' as date) + 60 days)
and ws1.ws_ship_date_sk = d_date_sk
and ws1.ws_ship_addr_sk = ca_address_sk
and ca_state = 'NE'
and ws1.ws_web_site_sk = web_site_sk
and web_company_name = 'pri'
and exists (select *
from web_sales ws2
where ws1.ws_order_number = ws2.ws_order_number
and ws1.ws_warehouse_sk <> ws2.ws_warehouse_sk)
and not exists(select *
from web_returns wr1
where ws1.ws_order_number = wr1.wr_order_number)
order by count(distinct ws_order_number)
limit 100;
-- end query 1 in stream 0 using template query94.tpl
-- start query 1 in stream 0 using template query95.tpl and seed 2031708268
with ws_wh as
(select ws1.ws_order_number,ws1.ws_warehouse_sk wh1,ws2.ws_warehouse_sk wh2
from web_sales ws1,web_sales ws2
where ws1.ws_order_number = ws2.ws_order_number
and ws1.ws_warehouse_sk <> ws2.ws_warehouse_sk)
select
count(distinct ws_order_number) as `order count`
,sum(ws_ext_ship_cost) as `total shipping cost`
,sum(ws_net_profit) as `total net profit`
from
web_sales ws1
,date_dim
,customer_address
,web_site
where
d_date between '2002-4-01' and
(cast('2002-4-01' as date) + 60 days)
and ws1.ws_ship_date_sk = d_date_sk
and ws1.ws_ship_addr_sk = ca_address_sk
and ca_state = 'AL'
and ws1.ws_web_site_sk = web_site_sk
and web_company_name = 'pri'
and ws1.ws_order_number in (select ws_order_number
from ws_wh)
and ws1.ws_order_number in (select wr_order_number
from web_returns,ws_wh
where wr_order_number = ws_wh.ws_order_number)
order by count(distinct ws_order_number)
limit 100;
-- end query 1 in stream 0 using template query95.tpl
-- start query 1 in stream 0 using template query96.tpl and seed 1819994127
select count(*)
from store_sales
,household_demographics
,time_dim, store
where ss_sold_time_sk = time_dim.t_time_sk
and ss_hdemo_sk = household_demographics.hd_demo_sk
and ss_store_sk = s_store_sk
and time_dim.t_hour = 16
and time_dim.t_minute >= 30
and household_demographics.hd_dep_count = 6
and store.s_store_name = 'ese'
order by count(*)
limit 100;
-- end query 1 in stream 0 using template query96.tpl
-- start query 1 in stream 0 using template query97.tpl and seed 1819994127
with ssci as (
select ss_customer_sk customer_sk
,ss_item_sk item_sk
from store_sales,date_dim
where ss_sold_date_sk = d_date_sk
and d_month_seq between 1190 and 1190 + 11
group by ss_customer_sk
,ss_item_sk),
csci as(
select cs_bill_customer_sk customer_sk
,cs_item_sk item_sk
from catalog_sales,date_dim
where cs_sold_date_sk = d_date_sk
and d_month_seq between 1190 and 1190 + 11
group by cs_bill_customer_sk
,cs_item_sk)
select sum(case when ssci.customer_sk is not null and csci.customer_sk is null then 1 else 0 end) store_only
,sum(case when ssci.customer_sk is null and csci.customer_sk is not null then 1 else 0 end) catalog_only
,sum(case when ssci.customer_sk is not null and csci.customer_sk is not null then 1 else 0 end) store_and_catalog
from ssci full outer join csci on (ssci.customer_sk=csci.customer_sk
and ssci.item_sk = csci.item_sk)
limit 100;
-- end query 1 in stream 0 using template query97.tpl
-- start query 1 in stream 0 using template query98.tpl and seed 345591136
select i_item_id
,i_item_desc
,i_category
,i_class
,i_current_price
,sum(ss_ext_sales_price) as itemrevenue
,sum(ss_ext_sales_price)*100/sum(sum(ss_ext_sales_price)) over
(partition by i_class) as revenueratio
from
store_sales
,item
,date_dim
where
ss_item_sk = i_item_sk
and i_category in ('Home', 'Sports', 'Men')
and ss_sold_date_sk = d_date_sk
and d_date between cast('2002-01-05' as date)
and (cast('2002-01-05' as date) + 30 days)
group by
i_item_id
,i_item_desc
,i_category
,i_class
,i_current_price
order by
i_category
,i_class
,i_item_id
,i_item_desc
,revenueratio;
-- end query 1 in stream 0 using template query98.tpl
-- start query 1 in stream 0 using template query99.tpl and seed 1819994127
select
substr(w_warehouse_name,1,20)
,sm_type
,cc_name
,sum(case when (cs_ship_date_sk - cs_sold_date_sk <= 30 ) then 1 else 0 end) as `30 days`
,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 30) and
(cs_ship_date_sk - cs_sold_date_sk <= 60) then 1 else 0 end ) as `31-60 days`
,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 60) and
(cs_ship_date_sk - cs_sold_date_sk <= 90) then 1 else 0 end) as `61-90 days`
,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 90) and
(cs_ship_date_sk - cs_sold_date_sk <= 120) then 1 else 0 end) as `91-120 days`
,sum(case when (cs_ship_date_sk - cs_sold_date_sk > 120) then 1 else 0 end) as `>120 days`
from
catalog_sales
,warehouse
,ship_mode
,call_center
,date_dim
where
d_month_seq between 1178 and 1178 + 11
and cs_ship_date_sk = d_date_sk
and cs_warehouse_sk = w_warehouse_sk
and cs_ship_mode_sk = sm_ship_mode_sk
and cs_call_center_sk = cc_call_center_sk
group by
substr(w_warehouse_name,1,20)
,sm_type
,cc_name
order by substr(w_warehouse_name,1,20)
,sm_type
,cc_name
limit 100;
-- end query 1 in stream 0 using template query99.tpl
-- start query 1 in stream 0 using template query9.tpl and seed 1490436826
select case when (select count(*)
from store_sales
where ss_quantity between 1 and 20) > 98972190
then (select avg(ss_ext_discount_amt)
from store_sales
where ss_quantity between 1 and 20)
else (select avg(ss_net_profit)
from store_sales
where ss_quantity between 1 and 20) end bucket1 ,
case when (select count(*)
from store_sales
where ss_quantity between 21 and 40) > 160856845
then (select avg(ss_ext_discount_amt)
from store_sales
where ss_quantity between 21 and 40)
else (select avg(ss_net_profit)
from store_sales
where ss_quantity between 21 and 40) end bucket2,
case when (select count(*)
from store_sales
where ss_quantity between 41 and 60) > 12733327
then (select avg(ss_ext_discount_amt)
from store_sales
where ss_quantity between 41 and 60)
else (select avg(ss_net_profit)
from store_sales
where ss_quantity between 41 and 60) end bucket3,
case when (select count(*)
from store_sales
where ss_quantity between 61 and 80) > 96251173
then (select avg(ss_ext_discount_amt)
from store_sales
where ss_quantity between 61 and 80)
else (select avg(ss_net_profit)
from store_sales
where ss_quantity between 61 and 80) end bucket4,
case when (select count(*)
from store_sales
where ss_quantity between 81 and 100) > 80049606
then (select avg(ss_ext_discount_amt)
from store_sales
where ss_quantity between 81 and 100)
else (select avg(ss_net_profit)
from store_sales
where ss_quantity between 81 and 100) end bucket5
from reason
where r_reason_sk = 1
;
-- end query 1 in stream 0 using template query9.tpl | the_stack |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for tp_admin
-- ----------------------------
DROP TABLE IF EXISTS `tp_admin`;
CREATE TABLE `tp_admin` (
`id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
`username` char(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户名',
`password` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密码',
`email` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户邮箱',
`realname` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '姓名',
`phone` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户手机',
`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '头像',
`reg_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '注册IP',
`login_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间',
`login_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '最后登录IP',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '用户状态 0 禁用,1正常',
`group_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '权限组',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`delete_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员用户表';
-- ----------------------------
-- Records of tp_admin
-- ----------------------------
INSERT INTO `tp_admin` VALUES ('1', 'admini', 'd93a5def7511da3d0f2d171d9c344e91', '123@163.com', '123', '15237156573', 'https://hardphp.oss-cn-beijing.aliyuncs.com\\images/20200115\\1ed50a8ff67bedbe1d4794705868a234.jpg', '127.0.0.1', '1585404867', '39.149.12.184', '1585404867', '1', '1', '1540975213', '0');
INSERT INTO `tp_admin` VALUES ('2', 'admina', '00b091d5bbbcbea4a371242e61d644a3', '123@163.com', '王五一', '15237156573', 'https://hardphp.oss-cn-beijing.aliyuncs.com/vedios/20191220/044a612bd5f0874e669e0755f51ca93e.jpg', '127.0.0.1', '1540975213', '123.149.208.76', '1579146396', '1', '1', '1540975213', '0');
INSERT INTO `tp_admin` VALUES ('60', 'test', '', '', '', '', 'https://hardphp.oss-cn-beijing.aliyuncs.com/vedios/20191220/044a612bd5f0874e669e0755f51ca93e.jpg', '127.0.0.1', '1540975213', '0', '1579104327', '1', '2', '1540975213', '1579104327');
INSERT INTO `tp_admin` VALUES ('5831189944471553', '123123', '794484e50babce6d890d24bdbcd3a63b', '123@123.com', '1231', '15237156573', 'https://hardphp.oss-cn-beijing.aliyuncs.com\\images/20200115\\1ed50a8ff67bedbe1d4794705868a234.jpg', '127.0.0.1', '0', '', '1579104339', '1', '2', '1579103200', '1579104339');
INSERT INTO `tp_admin` VALUES ('6014628748464129', '3ewr23', '42fa3e555eecf2754a3da41c5e86af35', '', '', '', 'https://hardphp.oss-cn-beijing.aliyuncs.com\\images/20200115\\1ed50a8ff67bedbe1d4794705868a234.jpg', '127.0.0.1', '0', '', '1579149556', '1', '2', '1579146935', '0');
INSERT INTO `tp_admin` VALUES ('6026749121007617', '2324dfsdf', '80713128888be539a72c80820ea92649', '', 'sdf', '', 'https://hardphp.oss-cn-beijing.aliyuncs.com\\images/20200115\\1ed50a8ff67bedbe1d4794705868a234.jpg', '127.0.0.1', '0', '', '1582174917', '0', '2', '1579149824', '1582174917');
-- ----------------------------
-- Table structure for tp_app
-- ----------------------------
DROP TABLE IF EXISTS `tp_app`;
CREATE TABLE `tp_app` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '用户ID',
`appid` char(18) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '应用id',
`app_salt` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '应用签名盐值',
`title` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '名称',
`description` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '备注',
`reg_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '注册IP',
`login_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间',
`login_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '最后登录IP',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '用户状态 0 禁用,1正常',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `appid` (`appid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='app应用表';
-- ----------------------------
-- Records of tp_app
-- ----------------------------
INSERT INTO `tp_app` VALUES ('1', 'ty9fd2848a039ab554', 'ec32286d0718118861afdbf6e401ee81', '管理员端', '', '127.0.0.1', '1521305444', '123.149.208.76', '1514962598', '1', '0');
-- ----------------------------
-- Table structure for tp_article
-- ----------------------------
DROP TABLE IF EXISTS `tp_article`;
CREATE TABLE `tp_article` (
`id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
`title` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '标题',
`content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'seo描述',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态 0 禁用,1正常',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`sorts` int(3) NOT NULL DEFAULT '100' COMMENT '排序',
`cate_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '分类id',
`column_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属栏目',
`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '图片',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章表';
-- ----------------------------
-- Records of tp_article
-- ----------------------------
INSERT INTO `tp_article` VALUES ('1', 'ty9fd2848a039ab554', '管理员端', '1582518981', '1', '1514962598', '100', '18716532003704833', '7264324116680705', 'https://hardphp.oss-cn-beijing.aliyuncs.com\\images/20200221\\c2a62a8dbba7ae828c5837291e170a4c.jpg');
-- ----------------------------
-- Table structure for tp_article_categery
-- ----------------------------
DROP TABLE IF EXISTS `tp_article_categery`;
CREATE TABLE `tp_article_categery` (
`id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
`name` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '栏目名称',
`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '描述',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态 0 禁用,1正常',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`sorts` int(3) NOT NULL DEFAULT '100' COMMENT '排序',
`column_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属栏目',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章分类表';
-- ----------------------------
-- Records of tp_article_categery
-- ----------------------------
INSERT INTO `tp_article_categery` VALUES ('18716532003704833', '未全额委屈', '', '1582175304', '1', '1582175304', '100', '7264576798330881');
-- ----------------------------
-- Table structure for tp_article_column
-- ----------------------------
DROP TABLE IF EXISTS `tp_article_column`;
CREATE TABLE `tp_article_column` (
`id` bigint(20) unsigned NOT NULL COMMENT '用户ID',
`name` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '栏目名称',
`seo_title` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'seo关键词',
`seo_dec` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'seo描述',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态 0 禁用,1正常',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`sorts` int(3) NOT NULL DEFAULT '100' COMMENT '排序',
`pid` bigint(20) NOT NULL DEFAULT '0' COMMENT '父id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文章栏目表';
-- ----------------------------
-- Records of tp_article_column
-- ----------------------------
INSERT INTO `tp_article_column` VALUES ('1', '编程语言', 'ec32286d0718118861afdbf6e401ee81', '管理员端', '1579444850', '1', '1514962598', '100', '0');
INSERT INTO `tp_article_column` VALUES ('7264107703177217', '数据库', '1', '1', '1579445065', '1', '1579444834', '100', '0');
INSERT INTO `tp_article_column` VALUES ('7264249676173313', '开发框架', '', '', '1579444868', '1', '1579444868', '100', '0');
INSERT INTO `tp_article_column` VALUES ('7264324116680705', '开发工具', '', '', '1579444885', '1', '1579444885', '100', '0');
INSERT INTO `tp_article_column` VALUES ('7264576798330881', '应用实例', '', '', '1579444946', '1', '1579444946', '100', '0');
INSERT INTO `tp_article_column` VALUES ('7264664253763585', 'php', '', '', '1579445040', '1', '1579444966', '100', '1');
INSERT INTO `tp_article_column` VALUES ('7264796114292737', 'golang', '', '', '1579444998', '1', '1579444998', '100', '1');
INSERT INTO `tp_article_column` VALUES ('7264844751441921', 'python', '', '', '1579445009', '1', '1579445009', '100', '1');
-- ----------------------------
-- Table structure for tp_auth_group
-- ----------------------------
DROP TABLE IF EXISTS `tp_auth_group`;
CREATE TABLE `tp_auth_group` (
`id` bigint(20) unsigned NOT NULL,
`title` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '用户组中文名称',
`status` tinyint(1) DEFAULT '1' COMMENT '为1正常,为0禁用',
`rules` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '用户组拥有的规则id, 多个规则","隔开',
`update_time` int(10) unsigned DEFAULT '0' COMMENT '更新时间',
`create_time` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户组表';
-- ----------------------------
-- Records of tp_auth_group
-- ----------------------------
INSERT INTO `tp_auth_group` VALUES ('1', '超级管理员', '1', '7246645603471361,7247512280895489,7247267136409601,7247034964905985,43,44,39,40,1,38,7,2', '1579440951', '1544881719');
INSERT INTO `tp_auth_group` VALUES ('2', '普通管理员', '1', '1,2', '1542787522', '1542787522');
INSERT INTO `tp_auth_group` VALUES ('6119919951417345', 'teste', '1', '43,44', '1579172038', '1579172038');
-- ----------------------------
-- Table structure for tp_auth_rule
-- ----------------------------
DROP TABLE IF EXISTS `tp_auth_rule`;
CREATE TABLE `tp_auth_rule` (
`id` bigint(20) unsigned NOT NULL,
`name` char(80) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则唯一标识',
`title` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '规则中文名称',
`type` tinyint(1) DEFAULT '1' COMMENT '为1正常,为0禁用',
`status` tinyint(1) DEFAULT '1' COMMENT '1 正常,0=禁用',
`condition` char(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '规则表达式,为空表示存在就验证',
`pid` bigint(20) DEFAULT '0' COMMENT '上级菜单',
`sorts` mediumint(8) DEFAULT '0' COMMENT '升序',
`icon` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
`update_time` int(10) unsigned DEFAULT '0' COMMENT '更新时间',
`path` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '路经',
`component` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '' COMMENT '组件',
`hidden` tinyint(1) DEFAULT '0' COMMENT '左侧菜单 0==显示,1隐藏',
`no_cache` tinyint(1) DEFAULT '0' COMMENT '1=不缓存,0=缓存',
`always_show` tinyint(1) DEFAULT '0' COMMENT '1= 总显示,0=否 依据子菜单个数',
`redirect` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT '',
`create_time` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `name` (`name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='规则表';
-- ----------------------------
-- Records of tp_auth_rule
-- ----------------------------
INSERT INTO `tp_auth_rule` VALUES ('1', 'manage', '权限管理', '1', '1', '', '0', '0', 'component', '1542602916', '/manage', 'layout', '0', '0', '1', '', '0');
INSERT INTO `tp_auth_rule` VALUES ('2', 'manage/admin', '管理员列表', '1', '1', '', '1', '0', 'user', '1541666364', 'admin', 'manage/admin', '0', '0', '0', '', '0');
INSERT INTO `tp_auth_rule` VALUES ('7', 'manage/rules', '权限列表', '1', '1', '', '1', '0', 'lock', '1542353476', 'rules', 'manage/rules', '0', '0', '0', '', '0');
INSERT INTO `tp_auth_rule` VALUES ('38', 'manage/roles', '角色列表', '1', '1', '', '1', '0', 'list', '1542602805', 'roles', 'manage/roles', '0', '0', '0', '', '0');
INSERT INTO `tp_auth_rule` VALUES ('39', 'log', '日志管理', '1', '1', '', '0', '0', 'component', '1579436605', '/log', 'layout', '0', '0', '1', '', '0');
INSERT INTO `tp_auth_rule` VALUES ('40', 'log/log', '登陆日志', '1', '1', '', '39', '0', 'list', '1579435976', 'log', 'log/log', '0', '0', '0', '', '0');
INSERT INTO `tp_auth_rule` VALUES ('43', 'icon', '图标管理', '1', '1', '', '0', '0', 'component', '1579436588', '/icon', 'layout', '0', '0', '0', '', '0');
INSERT INTO `tp_auth_rule` VALUES ('44', 'icon/index', '图标列表', '1', '1', '', '43', '0', 'list', '0', 'index', 'icons/index', '0', '0', '0', '', '0');
INSERT INTO `tp_auth_rule` VALUES ('7246645603471361', 'article', '文章管理', '1', '1', '', '0', '0', 'component', '1579440670', '/article', 'layout', '0', '0', '1', '', '1579440670');
INSERT INTO `tp_auth_rule` VALUES ('7247034964905985', 'article/categery', '分类列表', '1', '1', '', '7246645603471361', '0', 'list', '1579440763', 'categery', 'article/categery', '0', '0', '0', '', '1579440763');
INSERT INTO `tp_auth_rule` VALUES ('7247267136409601', 'article/column', '栏目列表', '1', '1', '', '7246645603471361', '0', 'list', '1579440819', 'column', 'article/column', '0', '0', '0', '', '1579440819');
INSERT INTO `tp_auth_rule` VALUES ('7247512280895489', 'article/blog', '文章列表', '1', '1', '', '7246645603471361', '0', 'list', '1579440877', 'blog', 'article/blog', '0', '0', '0', '', '1579440877');
-- ----------------------------
-- Table structure for tp_failed_jobs
-- ----------------------------
DROP TABLE IF EXISTS `tp_failed_jobs`;
CREATE TABLE `tp_failed_jobs` (
`id` bigint(20) NOT NULL,
`type` tinyint(1) DEFAULT '1' COMMENT '1=小程序,2=短信',
`data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '数据',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='队列失败任务记录';
-- ----------------------------
-- Records of tp_failed_jobs
-- ----------------------------
-- ----------------------------
-- Table structure for tp_image_hash
-- ----------------------------
DROP TABLE IF EXISTS `tp_image_hash`;
CREATE TABLE `tp_image_hash` (
`id` bigint(20) unsigned NOT NULL,
`image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '图片',
`hash` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '图片hash',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- ----------------------------
-- Records of tp_image_hash
-- ----------------------------
INSERT INTO `tp_image_hash` VALUES ('5819117802229761', 'https://hardphp.oss-cn-beijing.aliyuncs.com\\images/20200115\\1ed50a8ff67bedbe1d4794705868a234.jpg', 'd3ab533b8b10e4f3daeee85dde4179df68cfcc4d', '1579100321', '1579100321');
INSERT INTO `tp_image_hash` VALUES ('19177852159266817', 'https://hardphp.oss-cn-beijing.aliyuncs.com\\images/20200221\\c2a62a8dbba7ae828c5837291e170a4c.jpg', 'b3857f39fb233da316eae01bbbedc67561519cdb', '1582285292', '1582285292');
-- ----------------------------
-- Table structure for tp_login_log
-- ----------------------------
DROP TABLE IF EXISTS `tp_login_log`;
CREATE TABLE `tp_login_log` (
`id` bigint(20) unsigned NOT NULL COMMENT 'ID',
`uid` bigint(20) unsigned NOT NULL COMMENT '用户ID',
`username` char(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户名',
`login_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '最后登录IP',
`login_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '时间',
`roles` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '角色',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `uid` (`uid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='管理员登录';
-- ----------------------------
-- Records of tp_login_log
-- ----------------------------
INSERT INTO `tp_login_log` VALUES ('502', '1', 'admin', '115.60.16.49', '1569570610', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('503', '1', 'admin', '115.60.16.49', '1569570926', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('504', '1', 'admin', '115.60.16.49', '1569571106', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('505', '1', 'admin', '115.60.16.49', '1569571198', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('506', '1', 'admin', '115.60.16.49', '1569572567', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('507', '1', 'admin', '115.60.16.49', '1569572862', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('508', '1', 'admin', '115.60.16.49', '1569577336', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('509', '1', 'admin', '115.60.16.49', '1569577374', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('510', '1', 'admin', '115.60.16.49', '1569579992', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('511', '1', 'admin', '115.60.16.49', '1569580000', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('512', '1', 'admin', '115.60.16.49', '1569580041', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('513', '1', 'admin', '115.60.16.49', '1569580343', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('514', '1', 'admin', '115.60.16.49', '1569580809', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('515', '1', 'admin', '115.60.16.49', '1569580949', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('516', '1', 'admin', '115.60.16.49', '1569581081', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('517', '1', 'admin', '115.60.16.49', '1569581087', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('518', '1', 'admin', '115.60.16.49', '1569581136', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('519', '1', 'admin', '115.60.16.49', '1569581209', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('520', '1', 'admin', '115.60.16.49', '1569581628', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('521', '1', 'admin', '115.60.16.49', '1569581657', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('522', '1', 'admin', '115.60.16.49', '1569581699', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('523', '1', 'admin', '115.60.16.49', '1569581722', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('524', '1', 'admin', '115.60.16.49', '1569583325', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('525', '1', 'admin', '115.60.19.188', '1569634122', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('526', '1', 'admin', '115.60.19.188', '1569639797', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('527', '1', 'admin', '115.60.19.188', '1569639873', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('528', '1', 'admin', '115.60.19.188', '1569640203', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('529', '1', 'admin', '115.60.19.188', '1569640213', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('530', '1', 'admin', '115.60.19.188', '1569642217', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('531', '1', 'admin', '39.149.247.160', '1574342514', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('532', '1', 'admin', '39.149.247.160', '1574468895', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('533', '1', 'admin', '223.88.30.142', '1574846370', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('534', '1', 'admin', '223.88.30.142', '1574848961', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('535', '1', 'admin', '223.88.30.142', '1574849547', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('536', '1', 'admin', '223.88.30.142', '1574849754', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('537', '1', 'admin', '223.88.30.142', '1574850555', '超级管理员', '0', '0');
INSERT INTO `tp_login_log` VALUES ('538', '1', 'admin', '223.88.30.142', '1574850985', '超级管理员', '0', '0');
-- ----------------------------
-- Table structure for tp_notice_send_log
-- ----------------------------
DROP TABLE IF EXISTS `tp_notice_send_log`;
CREATE TABLE `tp_notice_send_log` (
`id` bigint(20) NOT NULL,
`type` tinyint(1) DEFAULT '1' COMMENT '1=小程序,2=公众号,3=短信',
`data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '数据',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
`result` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT '结果',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='通知消息发送记录';
-- ----------------------------
-- Records of tp_notice_send_log
-- ----------------------------
-- ----------------------------
-- Table structure for tp_sms
-- ----------------------------
DROP TABLE IF EXISTS `tp_sms`;
CREATE TABLE `tp_sms` (
`id` bigint(20) unsigned NOT NULL,
`phone` char(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '手机号',
`code` varchar(10) NOT NULL COMMENT '验证码',
`ip` varchar(50) NOT NULL COMMENT 'ip地址',
`deadline` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '过期时间',
`type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=注册,2=登录,3=找回密码',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0 未使用,1已使用',
`update_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
`create_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `phone` (`phone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机验证码';
-- ----------------------------
-- Records of tp_sms
-- ----------------------------
-- ----------------------------
-- Table structure for tp_user
-- ----------------------------
DROP TABLE IF EXISTS `tp_user`;
CREATE TABLE `tp_user` (
`id` bigint(20) NOT NULL COMMENT 'ID',
`openid` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '微信身份标识',
`password` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '32位小写MD5密码',
`phone` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
`username` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户名',
`is_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否启用',
`nickname` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '用户昵称',
`img` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '头像URL',
`sex` tinyint(1) NOT NULL DEFAULT '0' COMMENT '性别标志:0,其他;1,男;2,女',
`balance` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '账户余额',
`birth` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '生日',
`descript` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '账户总金额',
`create_time` int(10) NOT NULL DEFAULT '0' COMMENT '注册时间',
`reg_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '注册IP',
`login_ip` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT 'IP',
`login_time` int(10) NOT NULL DEFAULT '0' COMMENT '登录时间',
`update_time` int(10) NOT NULL DEFAULT '0' COMMENT '时间',
`delete_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
PRIMARY KEY (`id`),
KEY `phone` (`phone`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主系统用户表。';
-- ----------------------------
-- Records of tp_user
-- ----------------------------
INSERT INTO `tp_user` VALUES ('1', '', '', '15237156573', '12312333', '1', 'xiegaolei', '/uploads/images/20180512/6c7cf3ee6e3e83c031e260c5fa0844fb.jpg', '0', '20210.00', '1989-10-10', '我要给你一个拥抱 给你一双温热手掌', '525225.00', '1515057952', '123.149.214.69', '', '0', '0', '0');
INSERT INTO `tp_user` VALUES ('10', '', '', '', '', '1', '', '', '0', '0.00', '', '', '0.00', '0', '', '', '0', '0', '0'); | the_stack |
-------------------- ad relation for bankstatement line -----------------------
-- 31.08.2015 17:41:57
-- URL zum Konzept
INSERT INTO AD_RelationType (AD_Client_ID,AD_Org_ID,AD_Reference_Source_ID,AD_Reference_Target_ID,AD_RelationType_ID,Created,CreatedBy,EntityType,IsActive,IsDirected,IsExplicit,Name,Updated,UpdatedBy) VALUES (0,0,540539,540538,540113,TO_TIMESTAMP('2015-08-31 17:41:56','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','N','BankStatement <-> C_AllocationLine',TO_TIMESTAMP('2015-08-31 17:41:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 31.08.2015 17:42:41
-- URL zum Konzept
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540549,TO_TIMESTAMP('2015-08-31 17:42:41','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','C_AllocationLine_for_C_BankStatement',TO_TIMESTAMP('2015-08-31 17:42:41','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 31.08.2015 17:42:41
-- URL zum Konzept
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540549 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 31.08.2015 18:16:42
-- URL zum Konzept
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,5494,12331,0,540549,390,TO_TIMESTAMP('2015-08-31 18:16:42','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N',TO_TIMESTAMP('2015-08-31 18:16:42','YYYY-MM-DD HH24:MI:SS'),100,'EXISTS (SELECT 1 FROM ESR_ImportLine esrl WHERE esrl.C_Payment_ID=C_Payment.C_Payment_ID and esrl.C_Payment_ID = @C_Payment_ID@)')
;
-- 31.08.2015 18:16:54
-- URL zum Konzept
UPDATE AD_Ref_Table SET WhereClause='
EXISTS (SELECT 1 FROM C_BankStatementLine_Ref bslr
left outer join C_BankStatementLine bsl on (bsl.C_BankStatementLine_ID=bslr.C_BankStatementLine_ID)
left outer join C_BankStatement bs on (bs.C_BankStatement_ID=bsl.C_BankStatement_ID) WHERE bslr.C_Payment_ID=@C_Payment_ID@ and bs.DocStatus IN (''''CO'''', ''''CL''''))',Updated=TO_TIMESTAMP('2015-08-31 18:16:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540549
;
-- 31.08.2015 18:17:07
-- URL zum Konzept
UPDATE AD_RelationType SET AD_Reference_Source_ID=540549,Updated=TO_TIMESTAMP('2015-08-31 18:17:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540113
;
-- 31.08.2015 18:17:57
-- URL zum Konzept
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540550,TO_TIMESTAMP('2015-08-31 18:17:57','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','C_BankStatement for C_AllocationLine',TO_TIMESTAMP('2015-08-31 18:17:57','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 31.08.2015 18:17:58
-- URL zum Konzept
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540550 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 31.08.2015 23:15:41
-- URL zum Konzept
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy) VALUES (0,541645,0,540550,392,TO_TIMESTAMP('2015-08-31 23:15:41','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N',TO_TIMESTAMP('2015-08-31 23:15:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 31.08.2015 23:17:24
-- URL zum Konzept
UPDATE AD_RelationType SET AD_Reference_Target_ID=NULL,Updated=TO_TIMESTAMP('2015-08-31 23:17:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540113
;
-- 31.08.2015 23:25:41
-- URL zum Konzept
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,53331,541113,TO_TIMESTAMP('2015-08-31 23:25:40','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','Zuordnung',TO_TIMESTAMP('2015-08-31 23:25:40','YYYY-MM-DD HH24:MI:SS'),100,'C_AllocationLine','Zuordnung')
;
-- 31.08.2015 23:25:41
-- URL zum Konzept
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541113 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 31.08.2015 23:26:25
-- URL zum Konzept
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,53331,541114,TO_TIMESTAMP('2015-08-31 23:26:25','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','Bankauszug',TO_TIMESTAMP('2015-08-31 23:26:25','YYYY-MM-DD HH24:MI:SS'),100,'C_BankStatement','Bankauszug')
;
-- 31.08.2015 23:26:25
-- URL zum Konzept
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541114 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 31.08.2015 23:27:11
-- URL zum Konzept
UPDATE AD_RelationType SET Role_Source='C_AllocationLine',Updated=TO_TIMESTAMP('2015-08-31 23:27:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540113
;
-- 31.08.2015 23:27:30
-- URL zum Konzept
UPDATE AD_RelationType SET AD_Reference_Target_ID=540550, Role_Target='C_BankStatement',Updated=TO_TIMESTAMP('2015-08-31 23:27:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540113
;
-- 31.08.2015 23:30:07
-- URL zum Konzept
UPDATE AD_Ref_Table SET WhereClause='
EXISTS (SELECT 1 FROM C_BankStatementLine_Ref bslr
left outer join C_BankStatementLine bsl on (bsl.C_BankStatementLine_ID=bslr.C_BankStatementLine_ID)
left outer join C_BankStatement bs on (bs.C_BankStatement_ID=bsl.C_BankStatement_ID) WHERE bslr.C_Payment_ID=@C_Payment_ID@ and bs.DocStatus IN (''CO'', ''CL''))',Updated=TO_TIMESTAMP('2015-08-31 23:30:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540549
;
-- 31.08.2015 23:32:43
-- URL zum Konzept
UPDATE AD_RelationType SET AD_Reference_Source_ID=540550, AD_Reference_Target_ID=540549,Updated=TO_TIMESTAMP('2015-08-31 23:32:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540113
;
-- 31.08.2015 23:36:22
-- URL zum Konzept
UPDATE AD_Ref_Table SET WhereClause='EXISTS (SELECT 1 FROM c_allocationline WHERE C_BankStatementLine.C_Payment_ID=@C_Payment_ID@ and C_BankStatementLine.C_Payment_ID = al.C_Payment_ID)',Updated=TO_TIMESTAMP('2015-08-31 23:36:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:38:25
-- URL zum Konzept
UPDATE AD_Ref_Table SET WhereClause='EXISTS (SELECT 1 FROM C_BankStatementLine bsl
left outer join C_BankStatement bs on (bs.C_BankStatement_ID=bsl.C_BankStatement_ID)
WHERE bsl.C_Payment_ID=@C_Payment_ID@ and bs.DocStatus IN (''CO'', ''CL'') and C_AllocationLine.C_Payment_ID = bsl.C_Payment_ID)',Updated=TO_TIMESTAMP('2015-08-31 23:38:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540549
;
-- 31.08.2015 23:39:07
-- URL zum Konzept
UPDATE AD_Ref_Table SET WhereClause='EXISTS (SELECT 1 FROM c_allocationline al WHERE C_BankStatementLine.C_Payment_ID=@C_Payment_ID@ and C_BankStatementLine.C_Payment_ID = al.C_Payment_ID)',Updated=TO_TIMESTAMP('2015-08-31 23:39:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:39:50
-- URL zum Konzept
UPDATE AD_Ref_Table SET AD_Key=4937, AD_Table_ID=393,Updated=TO_TIMESTAMP('2015-08-31 23:39:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:40:45
-- URL zum Konzept
UPDATE AD_RelationType SET Role_Source='C_BankStatement', Role_Target='C_AllocationLine',Updated=TO_TIMESTAMP('2015-08-31 23:40:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540113
;
-- 31.08.2015 23:41:28
-- URL zum Konzept
UPDATE AD_Reference SET Name='C_BankStatementLine for C_AllocationLine',Updated=TO_TIMESTAMP('2015-08-31 23:41:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:41:28
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:41:52
-- URL zum Konzept
UPDATE AD_Reference SET Name='C_AllocationLine_for_C_BankStatementLine',Updated=TO_TIMESTAMP('2015-08-31 23:41:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540549
;
-- 31.08.2015 23:41:52
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=540549
;
-- 31.08.2015 23:42:13
-- URL zum Konzept
UPDATE AD_Ref_Table SET WhereClause='EXISTS (SELECT 1 FROM C_BankStatementLine bsl
join C_BankStatement bs on (bs.C_BankStatement_ID=bsl.C_BankStatement_ID)
WHERE bsl.C_Payment_ID=@C_Payment_ID@ and bs.DocStatus IN (''CO'', ''CL'') and C_AllocationLine.C_Payment_ID = bsl.C_Payment_ID)',Updated=TO_TIMESTAMP('2015-08-31 23:42:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540549
;
-- 31.08.2015 23:42:45
-- URL zum Konzept
UPDATE AD_Ref_Table SET AD_Display=NULL,Updated=TO_TIMESTAMP('2015-08-31 23:42:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540549
;
-- 31.08.2015 23:43:10
-- URL zum Konzept
UPDATE AD_Ref_Table SET AD_Key=4926,Updated=TO_TIMESTAMP('2015-08-31 23:43:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:43:20
-- URL zum Konzept
UPDATE AD_Ref_Table SET AD_Display=4937,Updated=TO_TIMESTAMP('2015-08-31 23:43:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:43:28
-- URL zum Konzept
UPDATE AD_Ref_Table SET AD_Display=4884,Updated=TO_TIMESTAMP('2015-08-31 23:43:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540549
;
-------------------- ad relation for bankstatement line reference -----------------------
-- 31.08.2015 23:48:19
-- URL zum Konzept
INSERT INTO AD_RelationType (AD_Client_ID,AD_Org_ID,AD_Reference_Source_ID,AD_Reference_Target_ID,AD_RelationType_ID,Created,CreatedBy,EntityType,IsActive,IsDirected,IsExplicit,Name,Role_Source,Role_Target,Updated,UpdatedBy) VALUES (0,0,540550,540549,540114,TO_TIMESTAMP('2015-08-31 23:48:19','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','N','BankStatementLineRef <-> C_AllocationLine','C_BankStatement','C_AllocationLine',TO_TIMESTAMP('2015-08-31 23:48:19','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 31.08.2015 23:48:27
-- URL zum Konzept
UPDATE AD_RelationType SET Name='BankStatementLine <-> C_AllocationLine',Updated=TO_TIMESTAMP('2015-08-31 23:48:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540113
;
-- 31.08.2015 23:48:50
-- URL zum Konzept
UPDATE AD_Reference SET Name='C_BankStatementLineRef for C_AllocationLine',Updated=TO_TIMESTAMP('2015-08-31 23:48:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:48:50
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:48:57
-- URL zum Konzept
UPDATE AD_Reference SET Name='C_BankStatementLine for C_AllocationLine',Updated=TO_TIMESTAMP('2015-08-31 23:48:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:48:57
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=540550
;
-- 31.08.2015 23:49:08
-- URL zum Konzept
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540551,TO_TIMESTAMP('2015-08-31 23:49:07','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','C_BankStatementLineRef for C_AllocationLine',TO_TIMESTAMP('2015-08-31 23:49:07','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 31.08.2015 23:49:08
-- URL zum Konzept
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540551 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 31.08.2015 23:50:01
-- URL zum Konzept
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,54388,54395,0,540551,53065,TO_TIMESTAMP('2015-08-31 23:50:01','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N',TO_TIMESTAMP('2015-08-31 23:50:01','YYYY-MM-DD HH24:MI:SS'),100,'EXISTS (SELECT 1 FROM c_allocationline al WHERE C_BankStatementLine_Ref.C_Payment_ID=@C_Payment_ID@ and C_BankStatementLine_Ref.C_Payment_ID = al.C_Payment_ID)')
;
-- 31.08.2015 23:50:12
-- URL zum Konzept
UPDATE AD_RelationType SET AD_Reference_Source_ID=540551,Updated=TO_TIMESTAMP('2015-08-31 23:50:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540114
;
-- 31.08.2015 23:50:31
-- URL zum Konzept
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,540552,TO_TIMESTAMP('2015-08-31 23:50:31','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N','C_AllocationLine_for_C_BankStatementLine_Ref',TO_TIMESTAMP('2015-08-31 23:50:31','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- 31.08.2015 23:50:31
-- URL zum Konzept
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=540552 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 31.08.2015 23:53:24
-- URL zum Konzept
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,WhereClause) VALUES (0,4884,12331,0,540552,390,TO_TIMESTAMP('2015-08-31 23:53:24','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','N',TO_TIMESTAMP('2015-08-31 23:53:24','YYYY-MM-DD HH24:MI:SS'),100,'EXISTS (SELECT 1 FROM C_BankStatementLine_Ref bslr
join C_BankStatementLine bsl on (bslC_BankStatementLine_ID=bslr.C_BankStatementLine_ID)
join C_BankStatement bs on (bs.C_BankStatement_ID=bsl.C_BankStatement_ID)
WHERE bslr.C_Payment_ID=@C_Payment_ID@ and bs.DocStatus IN (''CO'', ''CL'') and C_AllocationLine.C_Payment_ID = bslr.C_Payment_ID)')
;
-- 31.08.2015 23:53:37
-- URL zum Konzept
UPDATE AD_RelationType SET AD_Reference_Target_ID=540552,Updated=TO_TIMESTAMP('2015-08-31 23:53:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_RelationType_ID=540114
;
-- 31.08.2015 23:58:00
-- URL zum Konzept
UPDATE AD_Ref_Table SET WhereClause='EXISTS (SELECT 1 FROM C_BankStatementLine_Ref bslr
join C_BankStatementLine bsl on (bsl.C_BankStatementLine_ID=bslr.C_BankStatementLine_ID)
join C_BankStatement bs on (bs.C_BankStatement_ID=bsl.C_BankStatement_ID)
WHERE bslr.C_Payment_ID=@C_Payment_ID@ and bs.DocStatus IN (''CO'', ''CL'') and C_AllocationLine.C_Payment_ID = bslr.C_Payment_ID)',Updated=TO_TIMESTAMP('2015-08-31 23:58:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=540552
; | the_stack |
-- ----------------------------
-- Table structure for Admin
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Admin]') AND type IN ('U'))
DROP TABLE [dbo].[Admin]
GO
CREATE TABLE [dbo].[Admin] (
[Id] int IDENTITY(1,1) NOT NULL,
[UserName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[PassWord] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Salt] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[RealName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Tel] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Email] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[UserLevel] int DEFAULT ((0)) NOT NULL,
[RoleId] int DEFAULT ((0)) NOT NULL,
[GroupId] int DEFAULT ((0)) NOT NULL,
[LastLoginTime] datetime NULL,
[LastLoginIP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[ThisLoginTime] datetime NULL,
[ThisLoginIP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[IsLock] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Admin] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'密码',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'PassWord'
GO
EXEC sp_addextendedproperty
'MS_Description', N'盐值',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'Salt'
GO
EXEC sp_addextendedproperty
'MS_Description', N'姓名',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'RealName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'电话',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'Tel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮件',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'Email'
GO
EXEC sp_addextendedproperty
'MS_Description', N'级别',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'UserLevel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理组',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'RoleId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户组',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'GroupId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后登录时间',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'LastLoginTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'上次登录IP',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'LastLoginIP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'本次登录时间',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'ThisLoginTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'本次登录IP',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'ThisLoginIP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否是锁定',
'SCHEMA', N'dbo',
'TABLE', N'Admin',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理员',
'SCHEMA', N'dbo',
'TABLE', N'Admin'
GO
-- ----------------------------
-- Records of Admin
-- ----------------------------
SET IDENTITY_INSERT [dbo].[Admin] ON
GO
INSERT INTO [dbo].[Admin] ([Id], [UserName], [PassWord], [Salt], [RealName], [Tel], [Email], [UserLevel], [RoleId], [GroupId], [LastLoginTime], [LastLoginIP], [ThisLoginTime], [ThisLoginIP], [IsLock]) VALUES (N'1', N'admin', N'6671BCF861E8B2FA78BA7786EBC6D14C', N'n9FYh5Pztsba', N'admin', N'', N'', N'100', N'1', N'0', N'2020-04-26 16:35:43.000', N'127.0.0.1', N'2020-04-26 16:35:43.000', N'127.0.0.1', N'0')
GO
SET IDENTITY_INSERT [dbo].[Admin] OFF
GO
-- ----------------------------
-- Table structure for AdminLog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AdminLog]') AND type IN ('U'))
DROP TABLE [dbo].[AdminLog]
GO
CREATE TABLE [dbo].[AdminLog] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[GUID] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[UserName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[PassWord] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[LoginTime] datetime NULL,
[LoginIP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[IsLoginOK] int DEFAULT ((0)) NOT NULL,
[Actions] ntext COLLATE Chinese_PRC_CI_AS NULL,
[LastUpdateTime] datetime NULL
)
GO
ALTER TABLE [dbo].[AdminLog] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'唯一ID',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'GUID'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'密码',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'PassWord'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录时间',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'LoginTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录IP',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'LoginIP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否登录成功',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'IsLoginOK'
GO
EXEC sp_addextendedproperty
'MS_Description', N'记录',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'Actions'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录时间',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog',
'COLUMN', N'LastUpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理日志表',
'SCHEMA', N'dbo',
'TABLE', N'AdminLog'
GO
-- ----------------------------
-- Records of AdminLog
-- ----------------------------
SET IDENTITY_INSERT [dbo].[AdminLog] ON
GO
INSERT INTO [dbo].[AdminLog] ([Id], [UId], [GUID], [UserName], [PassWord], [LoginTime], [LoginIP], [IsLoginOK], [Actions], [LastUpdateTime]) VALUES (N'1', N'0', N'd0f2f8ef-ee33-496e-9599-47cfbb395a56', N'admin', N'******', N'2020-04-26 16:35:43.000', N'127.0.0.1', N'1', NULL, N'2020-04-26 16:35:43.000')
GO
SET IDENTITY_INSERT [dbo].[AdminLog] OFF
GO
-- ----------------------------
-- Table structure for AdminMenu
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AdminMenu]') AND type IN ('U'))
DROP TABLE [dbo].[AdminMenu]
GO
CREATE TABLE [dbo].[AdminMenu] (
[Id] int IDENTITY(1,1) NOT NULL,
[MenuKey] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[MenuName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PermissionKey] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Link] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[PId] int DEFAULT ((0)) NOT NULL,
[Level] int DEFAULT ((0)) NOT NULL,
[Location] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[Rank] int DEFAULT ((0)) NOT NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ClassName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[AdminMenu] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'标识key',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'MenuKey'
GO
EXEC sp_addextendedproperty
'MS_Description', N'页面名称',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'MenuName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'页面名称',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'PermissionKey'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'页面连接地址',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'Link'
GO
EXEC sp_addextendedproperty
'MS_Description', N'上级ID',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'PId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'级别',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'Level'
GO
EXEC sp_addextendedproperty
'MS_Description', N'路径',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'样式名称',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu',
'COLUMN', N'ClassName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'后台菜单',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenu'
GO
-- ----------------------------
-- Records of AdminMenu
-- ----------------------------
SET IDENTITY_INSERT [dbo].[AdminMenu] ON
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'1', N'home', N'主页', N'', N'', N'Index/Main', N'0', N'0', N'0,', N'0', N'0', N'', N'fa-home')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'2', N'system', N'系统设置', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'1', N'', N'fa-gears')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'3', N'baseconfig', N'基本配置', N'', N'', N'System/BaseConfig', N'2', N'1', N'0,2,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'4', N'smptconfig', N'SMTP设置', N'', N'', N'System/SmtpConfig', N'2', N'1', N'0,2,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'5', N'attachconfig', N'附件设置', N'', N'', N'System/AttachConfig', N'2', N'1', N'0,2,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'6', N'articlesys', N'文章系统', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'2', N'', N'fa-book')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'7', N'articlecategory', N'文章栏目管理', N'', N'', N'Article/ArticleCategoryList', N'6', N'1', N'0,6,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'8', N'article', N'文章管理', N'', N'', N'Article/ArticleList', N'6', N'1', N'0,6,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'9', N'productsys', N'商品系统', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'3', N'', N'fa-balance-scale')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'10', N'productcategory', N'商品分类管理', N'', N'', N'Product/CategoryList', N'9', N'1', N'0,9,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'11', N'product', N'商品管理', N'', N'', N'Product/ProductList', N'9', N'1', N'0,9,', N'0', N'1', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'12', N'ordersys', N'订单系统', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'4', N'', N'fa-shopping-bag')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'13', N'order', N'商品订单管理', N'', N'', N'Order/OrderList', N'12', N'1', N'0,12,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'14', N'payonline', N'支付记录', N'', N'', N'Order/PayOnlineList', N'12', N'1', N'0,12,', N'0', N'1', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'15', N'user', N'用户系统', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'5', N'', N'fa-user')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'16', N'memberrole', N'用户组管理', N'', N'', N'Member/MemberRole', N'15', N'1', N'0,15,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'17', N'members', N'用户管理', N'', N'', N'Member/Members', N'15', N'1', N'0,15,', N'0', N'1', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'18', N'permissionsys', N'后台权限', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'6', N'', N'fa-users')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'19', N'adminrole', N'管理组管理', N'', N'', N'Member/AdminRole', N'18', N'1', N'0,18,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'20', N'admins', N'管理员管理', N'', N'', N'Member/Admins', N'18', N'1', N'0,18,', N'0', N'1', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'21', N'eventkey', N'事件权限管理', N'', N'', N'Permission/EventKey', N'18', N'1', N'0,18,', N'0', N'3', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'22', N'adminmenu', N'后台栏目管理', N'', N'', N'Permission/AdminMenuList', N'18', N'1', N'0,18,', N'0', N'4', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'23', N'editme', N' 修改密码', N'', N'', N'Member/EditMe', N'18', N'1', N'0,18,', N'0', N'5', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'24', N'guestbooksys', N'留言系统', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'7', N'', N'fa-rss-square')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'25', N'guestbookkinds', N'留言分类管理', N'', N'', N'Guestbook/GuestbookCategorys', N'24', N'1', N'0,24,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'26', N'guestbook', N'留言管理', N'', N'', N'Guestbook/GuestbookList', N'24', N'1', N'0,24,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'27', N'other', N'其他', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'99', N'', N'fa-square-o')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'28', N'adskinds', N'广告分类管理', N'', N'', N'Other/AdsCategoryList', N'27', N'1', N'0,27,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'29', N'ads', N'广告管理', N'', N'', N'Other/AdsList', N'27', N'1', N'0,27,', N'0', N'1', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'30', N'linkkinds', N'友情连接分类管理', N'', N'', N'Other/LinkCategoryList', N'27', N'1', N'0,27,', N'0', N'2', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'31', N'link', N'友情连接管理', N'', N'', N'Other/LinkList', N'27', N'1', N'0,27,', N'0', N'3', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'32', N'weixinsys', N'微信公众号管理', N'', N'', N'#', N'0', N'0', N'0,', N'0', N'8', N'', N'fa-file-word-o')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'33', N'wxautoreply', N'关注自动回复', N'', N'', N'Weixin/SubscribeReply', N'32', N'1', N'0,32,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'34', N'wxmenu', N'自定义菜单管理', N'', N'', N'Weixin/Menu', N'32', N'1', N'0,32,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'35', N'wxkeywordreply', N'关键字回复', N'', N'', N'Weixin/ReplyRule', N'32', N'1', N'0,32,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'36', N'clickreplyrule', N'点击事件自动回复', N'', N'', N'Weixin/ClickReplyRule', N'32', N'1', N'0,32,', N'0', N'0', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'37', N'robots', N'Robots文档设置', N'', N'', N'System/Robots', N'2', N'1', N'0,2,', N'0', N'3', N'', N'')
GO
INSERT INTO [dbo].[AdminMenu] ([Id], [MenuKey], [MenuName], [PermissionKey], [Description], [Link], [PId], [Level], [Location], [IsHide], [Rank], [Icon], [ClassName]) VALUES (N'38', N'admincplog', N'后台管理日志', N'', N'', N'Member/AdminCPLogList', N'18', N'1', N'0,18,', N'0', N'10', N'', N'')
GO
SET IDENTITY_INSERT [dbo].[AdminMenu] OFF
GO
-- ----------------------------
-- Table structure for AdminMenuEvent
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AdminMenuEvent]') AND type IN ('U'))
DROP TABLE [dbo].[AdminMenuEvent]
GO
CREATE TABLE [dbo].[AdminMenuEvent] (
[Id] int IDENTITY(1,1) NOT NULL,
[MenuId] int DEFAULT ((0)) NOT NULL,
[MenuKey] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[EventId] int DEFAULT ((0)) NOT NULL,
[EventKey] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[EventName] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[AdminMenuEvent] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenuEvent',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'菜单ID',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenuEvent',
'COLUMN', N'MenuId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'菜单key',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenuEvent',
'COLUMN', N'MenuKey'
GO
EXEC sp_addextendedproperty
'MS_Description', N'事件ID',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenuEvent',
'COLUMN', N'EventId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'事件key',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenuEvent',
'COLUMN', N'EventKey'
GO
EXEC sp_addextendedproperty
'MS_Description', N'事件名称',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenuEvent',
'COLUMN', N'EventName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'后台菜单对应的事件权限',
'SCHEMA', N'dbo',
'TABLE', N'AdminMenuEvent'
GO
-- ----------------------------
-- Records of AdminMenuEvent
-- ----------------------------
SET IDENTITY_INSERT [dbo].[AdminMenuEvent] ON
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'1', N'1', N'home', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'2', N'3', N'baseconfig', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'3', N'3', N'baseconfig', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'4', N'4', N'smptconfig', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'5', N'4', N'smptconfig', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'6', N'5', N'attachconfig', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'7', N'5', N'attachconfig', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'8', N'7', N'articlecategory', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'9', N'7', N'articlecategory', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'10', N'7', N'articlecategory', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'11', N'7', N'articlecategory', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'12', N'7', N'articlecategory', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'13', N'7', N'articlecategory', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'14', N'8', N'article', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'15', N'8', N'article', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'16', N'8', N'article', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'17', N'8', N'article', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'18', N'8', N'article', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'19', N'8', N'article', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'20', N'8', N'article', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'21', N'8', N'article', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'22', N'8', N'article', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'23', N'8', N'article', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'24', N'8', N'article', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'25', N'10', N'productcategory', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'26', N'10', N'productcategory', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'27', N'10', N'productcategory', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'28', N'10', N'productcategory', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'29', N'10', N'productcategory', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'30', N'10', N'productcategory', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'31', N'11', N'product', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'32', N'11', N'product', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'33', N'11', N'product', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'34', N'11', N'product', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'35', N'11', N'product', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'36', N'11', N'product', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'37', N'11', N'product', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'38', N'11', N'product', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'39', N'11', N'product', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'40', N'11', N'product', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'41', N'11', N'product', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'42', N'13', N'order', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'43', N'13', N'order', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'44', N'13', N'order', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'45', N'13', N'order', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'46', N'13', N'order', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'47', N'13', N'order', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'48', N'13', N'order', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'49', N'13', N'order', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'50', N'13', N'order', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'51', N'13', N'order', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'52', N'13', N'order', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'53', N'14', N'payonline', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'54', N'14', N'payonline', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'55', N'14', N'payonline', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'56', N'14', N'payonline', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'57', N'14', N'payonline', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'58', N'14', N'payonline', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'59', N'14', N'payonline', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'60', N'14', N'payonline', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'61', N'14', N'payonline', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'62', N'14', N'payonline', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'63', N'16', N'memberrole', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'64', N'16', N'memberrole', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'65', N'16', N'memberrole', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'66', N'16', N'memberrole', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'67', N'16', N'memberrole', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'68', N'16', N'memberrole', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'69', N'17', N'members', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'70', N'17', N'members', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'71', N'17', N'members', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'72', N'17', N'members', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'73', N'17', N'members', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'74', N'17', N'members', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'75', N'17', N'members', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'76', N'17', N'members', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'77', N'17', N'members', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'78', N'17', N'members', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'79', N'17', N'members', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'80', N'19', N'adminrole', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'81', N'19', N'adminrole', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'82', N'19', N'adminrole', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'83', N'19', N'adminrole', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'84', N'19', N'adminrole', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'85', N'19', N'adminrole', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'86', N'19', N'adminrole', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'87', N'20', N'admins', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'88', N'20', N'admins', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'89', N'20', N'admins', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'90', N'20', N'admins', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'91', N'20', N'admins', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'92', N'20', N'admins', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'93', N'20', N'admins', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'94', N'20', N'admins', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'95', N'20', N'admins', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'96', N'20', N'admins', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'97', N'20', N'admins', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'98', N'21', N'eventkey', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'99', N'21', N'eventkey', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'100', N'21', N'eventkey', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'101', N'21', N'eventkey', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'102', N'21', N'eventkey', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'103', N'21', N'eventkey', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'104', N'21', N'eventkey', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'105', N'22', N'adminmenu', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'106', N'22', N'adminmenu', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'107', N'22', N'adminmenu', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'108', N'22', N'adminmenu', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'109', N'22', N'adminmenu', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'110', N'22', N'adminmenu', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'111', N'22', N'adminmenu', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'112', N'22', N'adminmenu', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'113', N'22', N'adminmenu', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'114', N'22', N'adminmenu', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'115', N'22', N'adminmenu', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'116', N'23', N'editme', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'117', N'23', N'editme', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'118', N'25', N'guestbookkinds', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'119', N'25', N'guestbookkinds', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'120', N'25', N'guestbookkinds', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'121', N'25', N'guestbookkinds', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'122', N'25', N'guestbookkinds', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'123', N'25', N'guestbookkinds', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'124', N'25', N'guestbookkinds', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'125', N'25', N'guestbookkinds', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'126', N'26', N'guestbook', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'127', N'26', N'guestbook', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'128', N'26', N'guestbook', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'129', N'26', N'guestbook', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'130', N'26', N'guestbook', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'131', N'26', N'guestbook', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'132', N'26', N'guestbook', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'133', N'26', N'guestbook', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'134', N'26', N'guestbook', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'135', N'26', N'guestbook', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'136', N'28', N'adskinds', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'137', N'28', N'adskinds', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'138', N'28', N'adskinds', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'139', N'28', N'adskinds', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'140', N'28', N'adskinds', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'141', N'29', N'ads', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'142', N'29', N'ads', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'143', N'29', N'ads', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'144', N'29', N'ads', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'145', N'29', N'ads', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'146', N'30', N'linkkinds', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'147', N'30', N'linkkinds', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'148', N'30', N'linkkinds', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'149', N'30', N'linkkinds', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'150', N'30', N'linkkinds', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'151', N'31', N'link', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'152', N'31', N'link', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'153', N'31', N'link', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'154', N'31', N'link', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'155', N'31', N'link', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'156', N'31', N'link', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'157', N'31', N'link', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'158', N'31', N'link', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'159', N'31', N'link', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'160', N'31', N'link', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'161', N'31', N'link', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'162', N'33', N'wxautoreply', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'163', N'33', N'wxautoreply', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'164', N'34', N'wxmenu', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'165', N'34', N'wxmenu', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'166', N'35', N'wxkeywordreply', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'167', N'35', N'wxkeywordreply', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'168', N'35', N'wxkeywordreply', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'169', N'35', N'wxkeywordreply', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'170', N'35', N'wxkeywordreply', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'171', N'35', N'wxkeywordreply', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'172', N'35', N'wxkeywordreply', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'173', N'35', N'wxkeywordreply', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'174', N'35', N'wxkeywordreply', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'175', N'35', N'wxkeywordreply', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'176', N'35', N'wxkeywordreply', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'177', N'36', N'clickreplyrule', N'1', N'add', N'添加')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'178', N'36', N'clickreplyrule', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'179', N'36', N'clickreplyrule', N'3', N'del', N'删除')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'180', N'36', N'clickreplyrule', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'181', N'36', N'clickreplyrule', N'5', N'viewlist', N'查看列表')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'182', N'36', N'clickreplyrule', N'6', N'import', N'导入')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'183', N'36', N'clickreplyrule', N'7', N'export', N'导出')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'184', N'36', N'clickreplyrule', N'8', N'filter', N'搜索')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'185', N'36', N'clickreplyrule', N'9', N'batch', N'批量操作')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'186', N'36', N'clickreplyrule', N'10', N'recycle', N'回收站')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'187', N'36', N'clickreplyrule', N'11', N'confirm', N'确认')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'188', N'37', N'robots', N'2', N'edit', N'修改')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'189', N'37', N'robots', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'190', N'38', N'admincplog', N'4', N'view', N'查看')
GO
INSERT INTO [dbo].[AdminMenuEvent] ([Id], [MenuId], [MenuKey], [EventId], [EventKey], [EventName]) VALUES (N'191', N'38', N'admincplog', N'5', N'viewlist', N'查看列表')
GO
SET IDENTITY_INSERT [dbo].[AdminMenuEvent] OFF
GO
-- ----------------------------
-- Table structure for AdminRoles
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AdminRoles]') AND type IN ('U'))
DROP TABLE [dbo].[AdminRoles]
GO
CREATE TABLE [dbo].[AdminRoles] (
[Id] int IDENTITY(1,1) NOT NULL,
[RoleType] int DEFAULT ((0)) NOT NULL,
[RoleName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RoleDescription] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsSuperAdmin] int DEFAULT ((0)) NOT NULL,
[Stars] int DEFAULT ((0)) NOT NULL,
[NotAllowDel] int DEFAULT ((0)) NOT NULL,
[Rank] int DEFAULT ((0)) NOT NULL,
[Color] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Menus] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Powers] ntext COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[AdminRoles] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'角色类型',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'RoleType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'角色名称',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'RoleName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'角色简单介绍',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'RoleDescription'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否是超级管理员',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'IsSuperAdmin'
GO
EXEC sp_addextendedproperty
'MS_Description', N'星级',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'Stars'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'NotAllowDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'Color'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理菜单',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'Menus'
GO
EXEC sp_addextendedproperty
'MS_Description', N'权限',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles',
'COLUMN', N'Powers'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理角色',
'SCHEMA', N'dbo',
'TABLE', N'AdminRoles'
GO
-- ----------------------------
-- Records of AdminRoles
-- ----------------------------
SET IDENTITY_INSERT [dbo].[AdminRoles] ON
GO
INSERT INTO [dbo].[AdminRoles] ([Id], [RoleType], [RoleName], [RoleDescription], [IsSuperAdmin], [Stars], [NotAllowDel], [Rank], [Color], [Menus], [Powers]) VALUES (N'1', N'0', N'超级管理员', N'系统超级管理员', N'1', N'5', N'1', N'0', N'', N'', N'')
GO
SET IDENTITY_INSERT [dbo].[AdminRoles] OFF
GO
-- ----------------------------
-- Table structure for Ads
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Ads]') AND type IN ('U'))
DROP TABLE [dbo].[Ads]
GO
CREATE TABLE [dbo].[Ads] (
[Id] int IDENTITY(1,1) NOT NULL,
[Title] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Content] ntext COLLATE Chinese_PRC_CI_AS NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[TId] int DEFAULT ((0)) NOT NULL,
[StartTime] datetime NULL,
[EndTime] datetime NULL,
[IsDisabled] bit DEFAULT ((0)) NOT NULL,
[Sequence] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Ads] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告标题',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告详情JSON',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'Content'
GO
EXEC sp_addextendedproperty
'MS_Description', N'分类ID',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告代码类型:0代码、1文字广告、2图片广告、3Flash广告、4幻灯片广告、5漂浮广告、6对联浮动图片广告',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'TId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'起始时间',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'StartTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'EndTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否禁用广告',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'IsDisabled'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序,默认999',
'SCHEMA', N'dbo',
'TABLE', N'Ads',
'COLUMN', N'Sequence'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告详情',
'SCHEMA', N'dbo',
'TABLE', N'Ads'
GO
-- ----------------------------
-- Table structure for AdsKind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[AdsKind]') AND type IN ('U'))
DROP TABLE [dbo].[AdsKind]
GO
CREATE TABLE [dbo].[AdsKind] (
[Id] int IDENTITY(1,1) NOT NULL,
[KindName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KindInfo] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Rank] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[AdsKind] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'AdsKind',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告类别名称',
'SCHEMA', N'dbo',
'TABLE', N'AdsKind',
'COLUMN', N'KindName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'简单说明',
'SCHEMA', N'dbo',
'TABLE', N'AdsKind',
'COLUMN', N'KindInfo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'AdsKind',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告类别',
'SCHEMA', N'dbo',
'TABLE', N'AdsKind'
GO
-- ----------------------------
-- Table structure for Area
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Area]') AND type IN ('U'))
DROP TABLE [dbo].[Area]
GO
CREATE TABLE [dbo].[Area] (
[Id] int NOT NULL,
[Name] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ParentId] int DEFAULT ((0)) NOT NULL,
[Level] int DEFAULT ((0)) NOT NULL,
[Code] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PinYin] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[PY] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TelCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[ZipCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Latitude] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Longitude] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[Area] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'地区名称',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'Name'
GO
EXEC sp_addextendedproperty
'MS_Description', N'上级ID',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'ParentId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'级别',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'Level'
GO
EXEC sp_addextendedproperty
'MS_Description', N'区域代码',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'Code'
GO
EXEC sp_addextendedproperty
'MS_Description', N'拼音',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'PinYin'
GO
EXEC sp_addextendedproperty
'MS_Description', N'简写拼音',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'PY'
GO
EXEC sp_addextendedproperty
'MS_Description', N'区号',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'TelCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮政编码',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'ZipCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'纬度',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'Latitude'
GO
EXEC sp_addextendedproperty
'MS_Description', N'经度',
'SCHEMA', N'dbo',
'TABLE', N'Area',
'COLUMN', N'Longitude'
GO
EXEC sp_addextendedproperty
'MS_Description', N'地区',
'SCHEMA', N'dbo',
'TABLE', N'Area'
GO
-- ----------------------------
-- Table structure for Article
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Article]') AND type IN ('U'))
DROP TABLE [dbo].[Article]
GO
CREATE TABLE [dbo].[Article] (
[Id] int IDENTITY(1,1) NOT NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[SubTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Content] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LinkURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TitleColor] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsRecommend] int DEFAULT ((0)) NOT NULL,
[IsNew] int DEFAULT ((0)) NOT NULL,
[IsBest] int DEFAULT ((0)) NOT NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[IsLock] int DEFAULT ((0)) NOT NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IsTop] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[IsMember] int DEFAULT ((0)) NOT NULL,
[Hits] int DEFAULT ((0)) NOT NULL,
[Sequence] int DEFAULT ((0)) NOT NULL,
[CommentCount] int DEFAULT ((0)) NOT NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ClassName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BannerImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AdsId] int DEFAULT ((0)) NOT NULL,
[Tags] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Origin] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[OriginURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ItemImg] ntext COLLATE Chinese_PRC_CI_AS NULL,
[AuthorId] int DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL,
[UpdateTime] datetime NULL,
[Location] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[FilePath] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[Article] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目ID',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'标题',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'副标题',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'SubTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'内容',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Content'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'跳转链接',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'LinkURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称颜色',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'TitleColor'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模板',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'TemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否推荐',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsRecommend'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否最新',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsNew'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否推荐',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsBest'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否锁定,不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除,已经删除到回收站',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否置顶',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsTop'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否允许评论',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否会员栏目',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'IsMember'
GO
EXEC sp_addextendedproperty
'MS_Description', N'点击数量',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Hits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Sequence'
GO
EXEC sp_addextendedproperty
'MS_Description', N'评论数量',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'CommentCount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'样式名称',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'ClassName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'banner图片',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'BannerImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告ID',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'AdsId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'TAG',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Tags'
GO
EXEC sp_addextendedproperty
'MS_Description', N'来源',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Origin'
GO
EXEC sp_addextendedproperty
'MS_Description', N'来源地址',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'OriginURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'更多图片',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'ItemImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'AuthorId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'时间',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'UpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'路径',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty
'MS_Description', N'存放目录',
'SCHEMA', N'dbo',
'TABLE', N'Article',
'COLUMN', N'FilePath'
GO
EXEC sp_addextendedproperty
'MS_Description', N'文章',
'SCHEMA', N'dbo',
'TABLE', N'Article'
GO
-- ----------------------------
-- Table structure for ArticleCategory
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ArticleCategory]') AND type IN ('U'))
DROP TABLE [dbo].[ArticleCategory]
GO
CREATE TABLE [dbo].[ArticleCategory] (
[Id] int IDENTITY(1,1) NOT NULL,
[KindName] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[SubTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LinkURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TitleColor] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[DetailTemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindDomain] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsList] int DEFAULT ((0)) NOT NULL,
[PageSize] int DEFAULT ((0)) NOT NULL,
[PId] int DEFAULT ((0)) NOT NULL,
[Level] int DEFAULT ((0)) NOT NULL,
[Location] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[IsLock] int DEFAULT ((0)) NOT NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[IsMember] int DEFAULT ((0)) NOT NULL,
[IsShowSubDetail] int DEFAULT ((0)) NOT NULL,
[CatalogId] int DEFAULT ((0)) NOT NULL,
[Counts] int DEFAULT ((0)) NOT NULL,
[Rank] int DEFAULT ((0)) NOT NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ClassName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BannerImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindInfo] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AdsId] int DEFAULT ((0)) NOT NULL,
[FilePath] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[ArticleCategory] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目名称',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'KindName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目副标题',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'SubTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目标题,填写则在浏览器替换此标题',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'KindTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'跳转链接',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'LinkURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称颜色',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'TitleColor'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模板',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'TemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详情模板',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'DetailTemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别域名(保留)',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'KindDomain'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为列表页面',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'IsList'
GO
EXEC sp_addextendedproperty
'MS_Description', N'每页显示数量',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'PageSize'
GO
EXEC sp_addextendedproperty
'MS_Description', N'上级ID',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'PId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'级别',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Level'
GO
EXEC sp_addextendedproperty
'MS_Description', N'路径',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否锁定,不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除,已经删除到回收站',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否允许评论',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否会员栏目',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'IsMember'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否显示下级栏目内容',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'IsShowSubDetail'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模型ID',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'CatalogId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详情数量,缓存',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Counts'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'样式名称',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'ClassName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'banner图片',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'BannerImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目详细介绍',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'KindInfo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告ID',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'AdsId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'目录路径',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory',
'COLUMN', N'FilePath'
GO
EXEC sp_addextendedproperty
'MS_Description', N'文章栏目',
'SCHEMA', N'dbo',
'TABLE', N'ArticleCategory'
GO
-- ----------------------------
-- Table structure for BalanceChangeLog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[BalanceChangeLog]') AND type IN ('U'))
DROP TABLE [dbo].[BalanceChangeLog]
GO
CREATE TABLE [dbo].[BalanceChangeLog] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[AdminId] int DEFAULT ((0)) NOT NULL,
[UserName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[IP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Actions] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Reward] money DEFAULT ((0)) NOT NULL,
[BeforChange] money DEFAULT ((0)) NOT NULL,
[AfterChange] money DEFAULT ((0)) NOT NULL,
[LogDetails] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TypeId] int DEFAULT ((0)) NOT NULL,
[OrderId] int DEFAULT ((0)) NOT NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[BalanceChangeLog] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'AdminId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'时间',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录IP',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'IP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'记录',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'Actions'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总积分',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'Reward'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总积分',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'BeforChange'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总积分',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'AfterChange'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详细记录',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'LogDetails'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类型 0 充值 1 购买 2 赠送 3 退款 4 分销提成',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'TypeId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单ID',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'OrderId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户余额变化记录',
'SCHEMA', N'dbo',
'TABLE', N'BalanceChangeLog'
GO
-- ----------------------------
-- Table structure for Category
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Category]') AND type IN ('U'))
DROP TABLE [dbo].[Category]
GO
CREATE TABLE [dbo].[Category] (
[Id] int IDENTITY(1,1) NOT NULL,
[KindName] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[SubTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LinkURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TitleColor] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[DetailTemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindDomain] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsList] int DEFAULT ((0)) NOT NULL,
[PageSize] int DEFAULT ((0)) NOT NULL,
[PId] int DEFAULT ((0)) NOT NULL,
[Level] int DEFAULT ((0)) NOT NULL,
[Location] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[IsLock] int DEFAULT ((0)) NOT NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[IsMember] int DEFAULT ((0)) NOT NULL,
[IsShowSubDetail] int DEFAULT ((0)) NOT NULL,
[CatalogId] int DEFAULT ((0)) NOT NULL,
[Counts] int DEFAULT ((0)) NOT NULL,
[Rank] int DEFAULT ((0)) NOT NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ClassName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BannerImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindInfo] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AdsId] int DEFAULT ((0)) NOT NULL,
[FilePath] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsIndexShow] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Category] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目名称',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'KindName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目副标题',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'SubTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目标题,填写则在浏览器替换此标题',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'KindTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'跳转链接',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'LinkURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称颜色',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'TitleColor'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模板',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'TemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详情模板',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'DetailTemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别域名(保留)',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'KindDomain'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为列表页面',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'IsList'
GO
EXEC sp_addextendedproperty
'MS_Description', N'每页显示数量',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'PageSize'
GO
EXEC sp_addextendedproperty
'MS_Description', N'上级ID',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'PId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'级别',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Level'
GO
EXEC sp_addextendedproperty
'MS_Description', N'路径',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否锁定,不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除,已经删除到回收站',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否允许评论',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否会员栏目',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'IsMember'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否显示下级栏目内容',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'IsShowSubDetail'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模型ID',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'CatalogId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详情数量,缓存',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Counts'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'样式名称',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'ClassName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'banner图片',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'BannerImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目详细介绍',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'KindInfo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告ID',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'AdsId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'目录路径',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'FilePath'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否首页显示',
'SCHEMA', N'dbo',
'TABLE', N'Category',
'COLUMN', N'IsIndexShow'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品栏目',
'SCHEMA', N'dbo',
'TABLE', N'Category'
GO
-- ----------------------------
-- Table structure for Config
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Config]') AND type IN ('U'))
DROP TABLE [dbo].[Config]
GO
CREATE TABLE [dbo].[Config] (
[Id] int IDENTITY(1,1) NOT NULL,
[SiteName] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[SiteUrl] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[SiteLogo] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Icp] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[SiteEmail] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[SiteTel] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Copyright] ntext COLLATE Chinese_PRC_CI_AS NULL,
[IsCloseSite] bit DEFAULT ((0)) NOT NULL,
[CloseReason] ntext COLLATE Chinese_PRC_CI_AS NULL,
[CountScript] ntext COLLATE Chinese_PRC_CI_AS NULL,
[WeiboQRCode] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[WinxinQRCode] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IndexTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsRewrite] int DEFAULT ((0)) NOT NULL,
[SearchMinTime] int DEFAULT ((0)) NOT NULL,
[OnlineQQ] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[OnlineSkype] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[OnlineWangWang] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[SkinName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OfficialName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OfficialDecsription] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[OfficialOriginalId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[WexinAccount] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Token] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[AppId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[AppSecret] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[FllowTipPageURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[OfficialType] int DEFAULT ((0)) NOT NULL,
[EncodingAESKey] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[DEType] int DEFAULT ((0)) NOT NULL,
[OfficialQRCode] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[OfficialImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LastUpdateTime] datetime NULL,
[LastCacheTime] datetime NULL,
[MCHId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[MCHKey] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[DefaultFare] money DEFAULT ((0)) NOT NULL,
[MaxFreeFare] money DEFAULT ((0)) NOT NULL,
[WXAppId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[WXAppSecret] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsResetData] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Config] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'站点名称',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'SiteName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'站点URL',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'SiteUrl'
GO
EXEC sp_addextendedproperty
'MS_Description', N'站点LOGO',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'SiteLogo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'ICP备案',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'Icp'
GO
EXEC sp_addextendedproperty
'MS_Description', N'联系我们Email',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'SiteEmail'
GO
EXEC sp_addextendedproperty
'MS_Description', N'网站电话',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'SiteTel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'版权所有',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'Copyright'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否关闭网站',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'IsCloseSite'
GO
EXEC sp_addextendedproperty
'MS_Description', N'关闭原因',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'CloseReason'
GO
EXEC sp_addextendedproperty
'MS_Description', N'统计代码',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'CountScript'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微博二维码',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'WeiboQRCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信二维码',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'WinxinQRCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'关键字',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'首页标题',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'IndexTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否URL地址重写',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'IsRewrite'
GO
EXEC sp_addextendedproperty
'MS_Description', N'搜索最小时间间距 秒',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'SearchMinTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'在线QQ',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OnlineQQ'
GO
EXEC sp_addextendedproperty
'MS_Description', N'在线Skype',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OnlineSkype'
GO
EXEC sp_addextendedproperty
'MS_Description', N'在线阿里旺旺',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OnlineWangWang'
GO
EXEC sp_addextendedproperty
'MS_Description', N'站点URL',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'SkinName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公众号名称',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OfficialName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公众号介绍',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OfficialDecsription'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公众号原始ID',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OfficialOriginalId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信名称',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'WexinAccount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'Token',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'Token'
GO
EXEC sp_addextendedproperty
'MS_Description', N'AppId',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'AppId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'AppSecret',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'AppSecret'
GO
EXEC sp_addextendedproperty
'MS_Description', N'引导关注素材地址',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'FllowTipPageURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公众号类型:0普通订阅号 1普通服务号 2认证订阅号 3认证服务号 4企业号 5认证企业号',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OfficialType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'EncodingAESKey',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'EncodingAESKey'
GO
EXEC sp_addextendedproperty
'MS_Description', N'解密方式0,明文',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'DEType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公众号二维码地址',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OfficialQRCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公众号头像',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'OfficialImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'LastUpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后缓存时间',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'LastCacheTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信商家MCHId',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'MCHId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信商家key',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'MCHKey'
GO
EXEC sp_addextendedproperty
'MS_Description', N'默认运费',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'DefaultFare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最大免运费金额',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'MaxFreeFare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信小程序AppId',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'WXAppId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信小程序AppSecret',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'WXAppSecret'
GO
EXEC sp_addextendedproperty
'MS_Description', N'小程序首页是否显示清除数据按钮',
'SCHEMA', N'dbo',
'TABLE', N'Config',
'COLUMN', N'IsResetData'
GO
EXEC sp_addextendedproperty
'MS_Description', N'系统配置',
'SCHEMA', N'dbo',
'TABLE', N'Config'
GO
-- ----------------------------
-- Records of Config
-- ----------------------------
SET IDENTITY_INSERT [dbo].[Config] ON
GO
INSERT INTO [dbo].[Config] ([Id], [SiteName], [SiteUrl], [SiteLogo], [Icp], [SiteEmail], [SiteTel], [Copyright], [IsCloseSite], [CloseReason], [CountScript], [WeiboQRCode], [WinxinQRCode], [Keyword], [Description], [IndexTitle], [IsRewrite], [SearchMinTime], [OnlineQQ], [OnlineSkype], [OnlineWangWang], [SkinName], [OfficialName], [OfficialDecsription], [OfficialOriginalId], [WexinAccount], [Token], [AppId], [AppSecret], [FllowTipPageURL], [OfficialType], [EncodingAESKey], [DEType], [OfficialQRCode], [OfficialImg], [LastUpdateTime], [LastCacheTime], [MCHId], [MCHKey], [DefaultFare], [MaxFreeFare], [WXAppId], [WXAppSecret], [IsResetData]) VALUES (N'1', N'COMCMS', N'http://www.comcms.com', N'', N'', N'', N'', NULL, N'0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'0', N'0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, N'0', NULL, N'0', NULL, NULL, N'2020-04-26 16:12:27.000', N'2020-04-26 16:12:27.000', NULL, NULL, N'.0000', N'.0000', NULL, NULL, N'0')
GO
SET IDENTITY_INSERT [dbo].[Config] OFF
GO
-- ----------------------------
-- Table structure for Coupon
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Coupon]') AND type IN ('U'))
DROP TABLE [dbo].[Coupon]
GO
CREATE TABLE [dbo].[Coupon] (
[Id] int IDENTITY(1,1) NOT NULL,
[ItemNO] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[CouponType] int DEFAULT ((0)) NOT NULL,
[DiscuountRates] money DEFAULT ((0)) NOT NULL,
[IsLimit] int DEFAULT ((0)) NOT NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[NeedPrice] money DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL,
[StartTime] datetime NULL,
[EndTime] datetime NULL,
[TotalCount] int DEFAULT ((0)) NOT NULL,
[TotalUseCount] int DEFAULT ((0)) NOT NULL,
[SpreadUId] int DEFAULT ((0)) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[MyType] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Coupon] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'券号',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'ItemNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别,0默认没限制',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券类型,0 现金用券,1打折券',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'CouponType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'打折率,只有是打折券才有用',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'DiscuountRates'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否有类别限制,0 无限制;1 是类别限制,2是商品限制',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'IsLimit'
GO
EXEC sp_addextendedproperty
'MS_Description', N'面额',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'需要消费面额',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'NeedPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'StartTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'EndTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最大领取数量',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'TotalCount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'已使用次数',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'TotalUseCount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'推广员ID,可选',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'SpreadUId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户Id',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'可使用类型',
'SCHEMA', N'dbo',
'TABLE', N'Coupon',
'COLUMN', N'MyType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券',
'SCHEMA', N'dbo',
'TABLE', N'Coupon'
GO
-- ----------------------------
-- Table structure for CouponKind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[CouponKind]') AND type IN ('U'))
DROP TABLE [dbo].[CouponKind]
GO
CREATE TABLE [dbo].[CouponKind] (
[Id] int IDENTITY(1,1) NOT NULL,
[IsLimit] int DEFAULT ((0)) NOT NULL,
[KindName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[CouponType] int DEFAULT ((0)) NOT NULL,
[KIds] ntext COLLATE Chinese_PRC_CI_AS NULL,
[PIds] ntext COLLATE Chinese_PRC_CI_AS NULL,
[KindNote] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[MyType] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[CouponKind] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否有类别限制,0 无限制;1 是类别限制,2是商品限制',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'IsLimit'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'KindName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券类型,0 现金用券,1打折券',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'CouponType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别按逗号分开',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'KIds'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品ID,按逗号分开',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'PIds'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别说明',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'KindNote'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'可使用类型',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind',
'COLUMN', N'MyType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券分类',
'SCHEMA', N'dbo',
'TABLE', N'CouponKind'
GO
-- ----------------------------
-- Table structure for CouponUseLog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[CouponUseLog]') AND type IN ('U'))
DROP TABLE [dbo].[CouponUseLog]
GO
CREATE TABLE [dbo].[CouponUseLog] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[CouponId] int DEFAULT ((0)) NOT NULL,
[ItemNO] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OrderId] int DEFAULT ((0)) NOT NULL,
[UserName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Title] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[IP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Actions] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[CouponUseLog] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券ID',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'CouponId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券编号',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'ItemNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单编号',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'OrderId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单名称',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'时间',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录IP',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'IP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'记录详情',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog',
'COLUMN', N'Actions'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券使用记录',
'SCHEMA', N'dbo',
'TABLE', N'CouponUseLog'
GO
-- ----------------------------
-- Table structure for Favortie
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Favortie]') AND type IN ('U'))
DROP TABLE [dbo].[Favortie]
GO
CREATE TABLE [dbo].[Favortie] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[TId] int DEFAULT ((0)) NOT NULL,
[RId] int DEFAULT ((0)) NOT NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[UpdateTime] datetime NULL
)
GO
ALTER TABLE [dbo].[Favortie] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Favortie',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'Favortie',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'Tpye ID,类别类型:0文章,1相册(图片),2视频,3下载,4商品',
'SCHEMA', N'dbo',
'TABLE', N'Favortie',
'COLUMN', N'TId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'目标ID',
'SCHEMA', N'dbo',
'TABLE', N'Favortie',
'COLUMN', N'RId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'价格,如果是商品',
'SCHEMA', N'dbo',
'TABLE', N'Favortie',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'Favortie',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'加入购物车时间',
'SCHEMA', N'dbo',
'TABLE', N'Favortie',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后更新时间',
'SCHEMA', N'dbo',
'TABLE', N'Favortie',
'COLUMN', N'UpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'收藏夹',
'SCHEMA', N'dbo',
'TABLE', N'Favortie'
GO
-- ----------------------------
-- Table structure for Food
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Food]') AND type IN ('U'))
DROP TABLE [dbo].[Food]
GO
CREATE TABLE [dbo].[Food] (
[Id] int IDENTITY(1,1) NOT NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[BId] int DEFAULT ((0)) NOT NULL,
[ShopId] int DEFAULT ((0)) NOT NULL,
[CId] int DEFAULT ((0)) NOT NULL,
[SupportId] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ItemNO] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[SubTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Unit] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Spec] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Color] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Weight] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[MarketPrice] money DEFAULT ((0)) NOT NULL,
[SpecialPrice] money DEFAULT ((0)) NOT NULL,
[Fare] money DEFAULT ((0)) NOT NULL,
[Discount] money DEFAULT ((0)) NOT NULL,
[Material] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Front] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Credits] int DEFAULT ((0)) NOT NULL,
[Stock] int DEFAULT ((0)) NOT NULL,
[WarnStock] int DEFAULT ((0)) NOT NULL,
[IsSubProduct] int DEFAULT ((0)) NOT NULL,
[PPId] int DEFAULT ((0)) NOT NULL,
[Content] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Parameters] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LinkURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TitleColor] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsRecommend] int DEFAULT ((0)) NOT NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[IsLock] int DEFAULT ((0)) NOT NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IsTop] int DEFAULT ((0)) NOT NULL,
[IsBest] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[IsMember] int DEFAULT ((0)) NOT NULL,
[IsNew] int DEFAULT ((0)) NOT NULL,
[IsSpecial] int DEFAULT ((0)) NOT NULL,
[IsPromote] int DEFAULT ((0)) NOT NULL,
[IsHotSales] int DEFAULT ((0)) NOT NULL,
[IsBreakup] int DEFAULT ((0)) NOT NULL,
[IsShelves] int DEFAULT ((0)) NOT NULL,
[IsVerify] int DEFAULT ((0)) NOT NULL,
[Hits] int DEFAULT ((0)) NOT NULL,
[IsGift] int DEFAULT ((0)) NOT NULL,
[IsPart] int DEFAULT ((0)) NOT NULL,
[Sequence] int DEFAULT ((0)) NOT NULL,
[CommentCount] int DEFAULT ((0)) NOT NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ClassName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BannerImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AdsId] int DEFAULT ((0)) NOT NULL,
[Tags] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ItemImg] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Service] ntext COLLATE Chinese_PRC_CI_AS NULL,
[AuthorId] int DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL,
[UpdateTime] datetime NULL,
[Location] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[FilePath] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[Food] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目ID',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'品牌ID',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'BId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'店铺ID',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'ShopId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色ID',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'CId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'供货商ID',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'SupportId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'标题',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'ItemNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'副标题',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'SubTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品单位',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Unit'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品规格尺寸',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Spec'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Color'
GO
EXEC sp_addextendedproperty
'MS_Description', N'重量',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Weight'
GO
EXEC sp_addextendedproperty
'MS_Description', N'价格',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'市场价格',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'MarketPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'特价,如有特价,以特价为准',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'SpecialPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'运费',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Fare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'折扣',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Discount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'材料',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Material'
GO
EXEC sp_addextendedproperty
'MS_Description', N'封面',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Front'
GO
EXEC sp_addextendedproperty
'MS_Description', N'积分',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Credits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'库存',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Stock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'警告库存',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'WarnStock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为子商品',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsSubProduct'
GO
EXEC sp_addextendedproperty
'MS_Description', N'父商品ID。如果为子商品,则需要填写父商品ID。实现多颜色功能',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'PPId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'内容',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Content'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品参数',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Parameters'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'跳转链接',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'LinkURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称颜色',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'TitleColor'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模板',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'TemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否推荐',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsRecommend'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否锁定,不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除,已经删除到回收站',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否置顶',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsTop'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否精华',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsBest'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否允许评论',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否会员栏目',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsMember'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否新品',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsNew'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否特价',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsSpecial'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否促销',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsPromote'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否热销',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsHotSales'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否缺货',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsBreakup'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否下架',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsShelves'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否审核,1为已经审核前台显示',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsVerify'
GO
EXEC sp_addextendedproperty
'MS_Description', N'点击数量',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Hits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为礼品商品',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsGift'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为配件',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'IsPart'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Sequence'
GO
EXEC sp_addextendedproperty
'MS_Description', N'评论数量',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'CommentCount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'样式名称',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'ClassName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'banner图片',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'BannerImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告ID',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'AdsId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'TAG',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Tags'
GO
EXEC sp_addextendedproperty
'MS_Description', N'更多图片',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'ItemImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'售后服务',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Service'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'AuthorId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'时间',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'UpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'路径',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty
'MS_Description', N'存放目录',
'SCHEMA', N'dbo',
'TABLE', N'Food',
'COLUMN', N'FilePath'
GO
EXEC sp_addextendedproperty
'MS_Description', N'快餐',
'SCHEMA', N'dbo',
'TABLE', N'Food'
GO
-- ----------------------------
-- Table structure for Guestbook
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Guestbook]') AND type IN ('U'))
DROP TABLE [dbo].[Guestbook]
GO
CREATE TABLE [dbo].[Guestbook] (
[Id] int IDENTITY(1,1) NOT NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Content] ntext COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[IsVerify] int DEFAULT ((0)) NOT NULL,
[IsRead] int DEFAULT ((0)) NOT NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Nickname] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Email] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Tel] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[QQ] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Skype] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[HomePage] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Address] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Company] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ReplyTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ReplyContent] ntext COLLATE Chinese_PRC_CI_AS NULL,
[ReplyAddTime] datetime NULL,
[ReplyIP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[ReplyAdminId] int DEFAULT ((0)) NOT NULL,
[ReplyNickName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[Guestbook] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'分类ID',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'留言标题',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详细介绍',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Content'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否审核通过',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'IsVerify'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否阅读',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'IsRead'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除,已经删除到回收站',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户IP',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'IP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'昵称',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Nickname'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮箱',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Email'
GO
EXEC sp_addextendedproperty
'MS_Description', N'电话',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Tel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'QQ',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'QQ'
GO
EXEC sp_addextendedproperty
'MS_Description', N'Skype',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Skype'
GO
EXEC sp_addextendedproperty
'MS_Description', N'主页',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'HomePage'
GO
EXEC sp_addextendedproperty
'MS_Description', N'地址',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Address'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公司',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'Company'
GO
EXEC sp_addextendedproperty
'MS_Description', N'回复标题',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'ReplyTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'回复的详情',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'ReplyContent'
GO
EXEC sp_addextendedproperty
'MS_Description', N'回复时间',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'ReplyAddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户回复IP',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'ReplyIP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户的管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'ReplyAdminId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'回复者昵称',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook',
'COLUMN', N'ReplyNickName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'留言详情',
'SCHEMA', N'dbo',
'TABLE', N'Guestbook'
GO
-- ----------------------------
-- Table structure for GuestbookCategory
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[GuestbookCategory]') AND type IN ('U'))
DROP TABLE [dbo].[GuestbookCategory]
GO
CREATE TABLE [dbo].[GuestbookCategory] (
[Id] int IDENTITY(1,1) NOT NULL,
[KindName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KindInfo] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Rank] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[GuestbookCategory] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'GuestbookCategory',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称',
'SCHEMA', N'dbo',
'TABLE', N'GuestbookCategory',
'COLUMN', N'KindName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'简单说明',
'SCHEMA', N'dbo',
'TABLE', N'GuestbookCategory',
'COLUMN', N'KindInfo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'分类图片',
'SCHEMA', N'dbo',
'TABLE', N'GuestbookCategory',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'GuestbookCategory',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'留言分类',
'SCHEMA', N'dbo',
'TABLE', N'GuestbookCategory'
GO
-- ----------------------------
-- Table structure for HotelRoom
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[HotelRoom]') AND type IN ('U'))
DROP TABLE [dbo].[HotelRoom]
GO
CREATE TABLE [dbo].[HotelRoom] (
[Id] int IDENTITY(1,1) NOT NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[BId] int DEFAULT ((0)) NOT NULL,
[ShopId] int DEFAULT ((0)) NOT NULL,
[CId] int DEFAULT ((0)) NOT NULL,
[SupportId] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ItemNO] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[SubTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Unit] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Spec] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Color] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Weight] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[MarketPrice] money DEFAULT ((0)) NOT NULL,
[SpecialPrice] money DEFAULT ((0)) NOT NULL,
[Fare] money DEFAULT ((0)) NOT NULL,
[Discount] money DEFAULT ((0)) NOT NULL,
[Material] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Front] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Credits] int DEFAULT ((0)) NOT NULL,
[Stock] int DEFAULT ((0)) NOT NULL,
[WarnStock] int DEFAULT ((0)) NOT NULL,
[IsSubProduct] int DEFAULT ((0)) NOT NULL,
[PPId] int DEFAULT ((0)) NOT NULL,
[Content] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Parameters] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LinkURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TitleColor] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsRecommend] int DEFAULT ((0)) NOT NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[IsLock] int DEFAULT ((0)) NOT NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IsTop] int DEFAULT ((0)) NOT NULL,
[IsBest] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[IsMember] int DEFAULT ((0)) NOT NULL,
[IsNew] int DEFAULT ((0)) NOT NULL,
[IsSpecial] int DEFAULT ((0)) NOT NULL,
[IsPromote] int DEFAULT ((0)) NOT NULL,
[IsHotSales] int DEFAULT ((0)) NOT NULL,
[IsBreakup] int DEFAULT ((0)) NOT NULL,
[IsShelves] int DEFAULT ((0)) NOT NULL,
[IsVerify] int DEFAULT ((0)) NOT NULL,
[Hits] int DEFAULT ((0)) NOT NULL,
[IsGift] int DEFAULT ((0)) NOT NULL,
[IsPart] int DEFAULT ((0)) NOT NULL,
[Sequence] int DEFAULT ((0)) NOT NULL,
[CommentCount] int DEFAULT ((0)) NOT NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ClassName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BannerImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AdsId] int DEFAULT ((0)) NOT NULL,
[Tags] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ItemImg] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Service] ntext COLLATE Chinese_PRC_CI_AS NULL,
[AuthorId] int DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL,
[UpdateTime] datetime NULL,
[Location] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[FilePath] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[PriceList] ntext COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[HotelRoom] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目ID',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'品牌ID',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'BId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'店铺ID',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'ShopId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色ID',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'CId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'供货商ID',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'SupportId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'标题',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'ItemNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'副标题',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'SubTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品单位',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Unit'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品规格尺寸',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Spec'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Color'
GO
EXEC sp_addextendedproperty
'MS_Description', N'重量',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Weight'
GO
EXEC sp_addextendedproperty
'MS_Description', N'价格',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'市场价格',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'MarketPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'特价,如有特价,以特价为准',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'SpecialPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'运费',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Fare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'折扣',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Discount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'材料',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Material'
GO
EXEC sp_addextendedproperty
'MS_Description', N'封面',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Front'
GO
EXEC sp_addextendedproperty
'MS_Description', N'积分',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Credits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'库存',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Stock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'警告库存',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'WarnStock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为子商品',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsSubProduct'
GO
EXEC sp_addextendedproperty
'MS_Description', N'父商品ID。如果为子商品,则需要填写父商品ID。实现多颜色功能',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'PPId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'内容',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Content'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品参数',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Parameters'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'跳转链接',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'LinkURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称颜色',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'TitleColor'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模板',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'TemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否推荐',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsRecommend'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否锁定,不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除,已经删除到回收站',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否置顶',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsTop'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否精华',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsBest'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否允许评论',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否会员栏目',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsMember'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否新品',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsNew'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否特价',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsSpecial'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否促销',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsPromote'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否热销',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsHotSales'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否缺货',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsBreakup'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否下架',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsShelves'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否审核,1为已经审核前台显示',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsVerify'
GO
EXEC sp_addextendedproperty
'MS_Description', N'点击数量',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Hits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为礼品商品',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsGift'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为配件',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'IsPart'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Sequence'
GO
EXEC sp_addextendedproperty
'MS_Description', N'评论数量',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'CommentCount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'样式名称',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'ClassName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'banner图片',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'BannerImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告ID',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'AdsId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'TAG',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Tags'
GO
EXEC sp_addextendedproperty
'MS_Description', N'更多图片',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'ItemImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'售后服务',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Service'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'AuthorId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'时间',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'UpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'路径',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty
'MS_Description', N'存放目录',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'FilePath'
GO
EXEC sp_addextendedproperty
'MS_Description', N'日期价格',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom',
'COLUMN', N'PriceList'
GO
EXEC sp_addextendedproperty
'MS_Description', N'酒店房间',
'SCHEMA', N'dbo',
'TABLE', N'HotelRoom'
GO
-- ----------------------------
-- Table structure for Link
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Link]') AND type IN ('U'))
DROP TABLE [dbo].[Link]
GO
CREATE TABLE [dbo].[Link] (
[Id] int IDENTITY(1,1) NOT NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LinkURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Info] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Logo] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsHide] bit DEFAULT ((0)) NOT NULL,
[Sequence] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Link] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Link',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'分类ID',
'SCHEMA', N'dbo',
'TABLE', N'Link',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'站点标题',
'SCHEMA', N'dbo',
'TABLE', N'Link',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'站点连接',
'SCHEMA', N'dbo',
'TABLE', N'Link',
'COLUMN', N'LinkURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'Link',
'COLUMN', N'Info'
GO
EXEC sp_addextendedproperty
'MS_Description', N'站点LOGO',
'SCHEMA', N'dbo',
'TABLE', N'Link',
'COLUMN', N'Logo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏友情链接',
'SCHEMA', N'dbo',
'TABLE', N'Link',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序,默认999',
'SCHEMA', N'dbo',
'TABLE', N'Link',
'COLUMN', N'Sequence'
GO
EXEC sp_addextendedproperty
'MS_Description', N'友情连接详情',
'SCHEMA', N'dbo',
'TABLE', N'Link'
GO
-- ----------------------------
-- Table structure for LinkKind
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[LinkKind]') AND type IN ('U'))
DROP TABLE [dbo].[LinkKind]
GO
CREATE TABLE [dbo].[LinkKind] (
[Id] int IDENTITY(1,1) NOT NULL,
[KindName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[KindInfo] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Rank] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[LinkKind] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'LinkKind',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称',
'SCHEMA', N'dbo',
'TABLE', N'LinkKind',
'COLUMN', N'KindName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'简单说明',
'SCHEMA', N'dbo',
'TABLE', N'LinkKind',
'COLUMN', N'KindInfo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'分类图片',
'SCHEMA', N'dbo',
'TABLE', N'LinkKind',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'LinkKind',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'友情链接分类',
'SCHEMA', N'dbo',
'TABLE', N'LinkKind'
GO
-- ----------------------------
-- Table structure for Member
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Member]') AND type IN ('U'))
DROP TABLE [dbo].[Member]
GO
CREATE TABLE [dbo].[Member] (
[Id] int IDENTITY(1,1) NOT NULL,
[UserName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[PassWord] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Salt] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[RealName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Tel] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Email] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[RoleId] int DEFAULT ((0)) NOT NULL,
[LastLoginTime] datetime NULL,
[LastLoginIP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[ThisLoginTime] datetime NULL,
[ThisLoginIP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[IsLock] int DEFAULT ((0)) NOT NULL,
[Nickname] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[UserImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Sex] int DEFAULT ((0)) NOT NULL,
[Birthday] datetime NULL,
[Phone] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Fax] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Qq] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Weixin] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Alipay] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Skype] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Homepage] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Company] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Idno] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Country] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Province] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[City] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[District] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Address] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Postcode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[RegIP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[RegTime] datetime NULL,
[LoginCount] int DEFAULT ((0)) NOT NULL,
[RndNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RePassWordTime] datetime NULL,
[Question] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Answer] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Balance] money DEFAULT ((0)) NOT NULL,
[GiftBalance] money DEFAULT ((0)) NOT NULL,
[Rebate] money DEFAULT ((0)) NOT NULL,
[Bank] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BankCardNO] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BankBranch] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BankRealname] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[YearsPerformance] money DEFAULT ((0)) NOT NULL,
[ExtCredits1] money DEFAULT ((0)) NOT NULL,
[ExtCredits2] money DEFAULT ((0)) NOT NULL,
[ExtCredits3] money DEFAULT ((0)) NOT NULL,
[ExtCredits4] money DEFAULT ((0)) NOT NULL,
[ExtCredits5] money DEFAULT ((0)) NOT NULL,
[TotalCredits] money DEFAULT ((0)) NOT NULL,
[Parent] int DEFAULT ((0)) NOT NULL,
[Grandfather] int DEFAULT ((0)) NOT NULL,
[IsSellers] int DEFAULT ((0)) NOT NULL,
[IsVerifySellers] int DEFAULT ((0)) NOT NULL,
[WeixinOpenId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[WeixinAppOpenId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[QQOpenId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[WeiboOpenId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[TenUnionId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[AliAppOpenId] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsAdmin] int DEFAULT ((0)) NOT NULL,
[RegType] int DEFAULT ((0)) NOT NULL,
[TotalOrders] int DEFAULT ((0)) NOT NULL,
[TotalPayPrice] money DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Member] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'密码',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'PassWord'
GO
EXEC sp_addextendedproperty
'MS_Description', N'盐值',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Salt'
GO
EXEC sp_addextendedproperty
'MS_Description', N'姓名',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'RealName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'手机',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Tel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮件',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Email'
GO
EXEC sp_addextendedproperty
'MS_Description', N'会员组,代理级别',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'RoleId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后登录时间',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'LastLoginTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'上次登录IP',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'LastLoginIP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'本次登录时间',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'ThisLoginTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'本次登录IP',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'ThisLoginIP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否是锁定',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'昵称',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Nickname'
GO
EXEC sp_addextendedproperty
'MS_Description', N'头像',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'UserImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'性别 0 保密 1 男 2女',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Sex'
GO
EXEC sp_addextendedproperty
'MS_Description', N'生日',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Birthday'
GO
EXEC sp_addextendedproperty
'MS_Description', N'电话',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Phone'
GO
EXEC sp_addextendedproperty
'MS_Description', N'传真',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Fax'
GO
EXEC sp_addextendedproperty
'MS_Description', N'QQ',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Qq'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Weixin'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付宝',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Alipay'
GO
EXEC sp_addextendedproperty
'MS_Description', N'skype',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Skype'
GO
EXEC sp_addextendedproperty
'MS_Description', N'主页',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Homepage'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公司',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Company'
GO
EXEC sp_addextendedproperty
'MS_Description', N'身份证',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Idno'
GO
EXEC sp_addextendedproperty
'MS_Description', N'国家',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Country'
GO
EXEC sp_addextendedproperty
'MS_Description', N'省',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Province'
GO
EXEC sp_addextendedproperty
'MS_Description', N'市',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'City'
GO
EXEC sp_addextendedproperty
'MS_Description', N'区',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'District'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详细地址',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Address'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮政编码',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Postcode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'注册IP',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'RegIP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'注册时间',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'RegTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录次数',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'LoginCount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'随机字符',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'RndNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'找回密码时间',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'RePassWordTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'保密问题',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Question'
GO
EXEC sp_addextendedproperty
'MS_Description', N'保密答案',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Answer'
GO
EXEC sp_addextendedproperty
'MS_Description', N'可用余额',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Balance'
GO
EXEC sp_addextendedproperty
'MS_Description', N'赠送余额',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'GiftBalance'
GO
EXEC sp_addextendedproperty
'MS_Description', N'返利,分销提成',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Rebate'
GO
EXEC sp_addextendedproperty
'MS_Description', N'银行',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Bank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'银行卡号',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'BankCardNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支行名称',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'BankBranch'
GO
EXEC sp_addextendedproperty
'MS_Description', N'银行卡姓名',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'BankRealname'
GO
EXEC sp_addextendedproperty
'MS_Description', N'年业务量',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'YearsPerformance'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备用积分1',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'ExtCredits1'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备用积分2',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'ExtCredits2'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备用积分3',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'ExtCredits3'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备用积分4',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'ExtCredits4'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备用积分5',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'ExtCredits5'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总积分',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'TotalCredits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'父级用户ID',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Parent'
GO
EXEC sp_addextendedproperty
'MS_Description', N'爷级用户ID',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'Grandfather'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否是分销商',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'IsSellers'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否已经认证的分销商,缴纳费用',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'IsVerifySellers'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信公众号OpenId',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'WeixinOpenId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信OpenId',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'WeixinAppOpenId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'QQ OpenId',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'QQOpenId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微博OpenId',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'WeiboOpenId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'腾讯UnionId',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'TenUnionId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付宝小程序OpenId',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'AliAppOpenId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否是管理员',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'IsAdmin'
GO
EXEC sp_addextendedproperty
'MS_Description', N'注册类型',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'RegType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总订单',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'TotalOrders'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总支付金额',
'SCHEMA', N'dbo',
'TABLE', N'Member',
'COLUMN', N'TotalPayPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户',
'SCHEMA', N'dbo',
'TABLE', N'Member'
GO
-- ----------------------------
-- Table structure for MemberAddress
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[MemberAddress]') AND type IN ('U'))
DROP TABLE [dbo].[MemberAddress]
GO
CREATE TABLE [dbo].[MemberAddress] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[RealName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Tel] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Email] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsDefault] bit DEFAULT ((0)) NOT NULL,
[Phone] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Company] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Country] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Province] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[City] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[District] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Address] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Postcode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[UpdateTime] datetime NULL,
[Rank] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[MemberAddress] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'姓名',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'RealName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'手机',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Tel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮件',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Email'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否是默认',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'IsDefault'
GO
EXEC sp_addextendedproperty
'MS_Description', N'电话',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Phone'
GO
EXEC sp_addextendedproperty
'MS_Description', N'公司',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Company'
GO
EXEC sp_addextendedproperty
'MS_Description', N'国家',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Country'
GO
EXEC sp_addextendedproperty
'MS_Description', N'省',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Province'
GO
EXEC sp_addextendedproperty
'MS_Description', N'市',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'City'
GO
EXEC sp_addextendedproperty
'MS_Description', N'区',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'District'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详细地址',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Address'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮政编码',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Postcode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'更新时间',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'UpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户地址',
'SCHEMA', N'dbo',
'TABLE', N'MemberAddress'
GO
-- ----------------------------
-- Table structure for MemberCoupon
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[MemberCoupon]') AND type IN ('U'))
DROP TABLE [dbo].[MemberCoupon]
GO
CREATE TABLE [dbo].[MemberCoupon] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[ItemNO] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[CouponId] int DEFAULT ((0)) NOT NULL,
[CouponType] int DEFAULT ((0)) NOT NULL,
[DiscuountRates] money DEFAULT ((0)) NOT NULL,
[IsLimit] int DEFAULT ((0)) NOT NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[NeedPrice] money DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL,
[StartTime] datetime NULL,
[EndTime] datetime NULL,
[IsUse] int DEFAULT ((0)) NOT NULL,
[UseTime] datetime NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OrderId] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[MemberCoupon] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'券号',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'ItemNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券ID',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'CouponId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'优惠券类型,0 现金用券,1打折券',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'CouponType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'打折率,只有是打折券才有用',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'DiscuountRates'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否有类别限制,0 无限制;1 是类别限制,2是商品限制',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'IsLimit'
GO
EXEC sp_addextendedproperty
'MS_Description', N'面额',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'需要消费面额',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'NeedPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'StartTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'EndTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否使用',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'IsUse'
GO
EXEC sp_addextendedproperty
'MS_Description', N'使用时间',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'UseTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号(使用后)',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单编号(使用后)',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon',
'COLUMN', N'OrderId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户优惠券',
'SCHEMA', N'dbo',
'TABLE', N'MemberCoupon'
GO
-- ----------------------------
-- Table structure for MemberLog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[MemberLog]') AND type IN ('U'))
DROP TABLE [dbo].[MemberLog]
GO
CREATE TABLE [dbo].[MemberLog] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[GUID] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[UserName] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[PassWord] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[LoginTime] datetime NULL,
[LoginIP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[IsLoginOK] int DEFAULT ((0)) NOT NULL,
[Actions] ntext COLLATE Chinese_PRC_CI_AS NULL,
[LastUpdateTime] datetime NULL
)
GO
ALTER TABLE [dbo].[MemberLog] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'唯一ID',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'GUID'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'密码',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'PassWord'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录时间',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'LoginTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录IP',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'LoginIP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否登录成功',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'IsLoginOK'
GO
EXEC sp_addextendedproperty
'MS_Description', N'记录',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'Actions'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录时间',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog',
'COLUMN', N'LastUpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户日志表',
'SCHEMA', N'dbo',
'TABLE', N'MemberLog'
GO
-- ----------------------------
-- Table structure for MemberRoles
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[MemberRoles]') AND type IN ('U'))
DROP TABLE [dbo].[MemberRoles]
GO
CREATE TABLE [dbo].[MemberRoles] (
[Id] int IDENTITY(1,1) NOT NULL,
[RoleName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[RoleDescription] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Stars] int DEFAULT ((0)) NOT NULL,
[NotAllowDel] int DEFAULT ((0)) NOT NULL,
[Rank] int DEFAULT ((0)) NOT NULL,
[Color] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[CashBack] money DEFAULT ((0)) NOT NULL,
[ParentCashBack] money DEFAULT ((0)) NOT NULL,
[GrandfatherCashBack] money DEFAULT ((0)) NOT NULL,
[IsDefault] int DEFAULT ((0)) NOT NULL,
[IsHalved] int DEFAULT ((0)) NOT NULL,
[HalvedParentCashBack] money DEFAULT ((0)) NOT NULL,
[HalvedGrandfatherCashBack] money DEFAULT ((0)) NOT NULL,
[YearsPerformance] money DEFAULT ((0)) NOT NULL,
[IsSellers] int DEFAULT ((0)) NOT NULL,
[JoinPrice] money DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[MemberRoles] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'角色名称',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'RoleName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'角色简单介绍',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'RoleDescription'
GO
EXEC sp_addextendedproperty
'MS_Description', N'星级',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'Stars'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'NotAllowDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'Color'
GO
EXEC sp_addextendedproperty
'MS_Description', N'返现百分比',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'CashBack'
GO
EXEC sp_addextendedproperty
'MS_Description', N'父级返现百分比',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'ParentCashBack'
GO
EXEC sp_addextendedproperty
'MS_Description', N'爷级返现百分比',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'GrandfatherCashBack'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否是默认角色',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'IsDefault'
GO
EXEC sp_addextendedproperty
'MS_Description', N'超过级别是否减半',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'IsHalved'
GO
EXEC sp_addextendedproperty
'MS_Description', N'超过级别父级返现百分比',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'HalvedParentCashBack'
GO
EXEC sp_addextendedproperty
'MS_Description', N'超过级别爷级返现百分比',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'HalvedGrandfatherCashBack'
GO
EXEC sp_addextendedproperty
'MS_Description', N'年业务量',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'YearsPerformance'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否是分销商',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'IsSellers'
GO
EXEC sp_addextendedproperty
'MS_Description', N'加入分销商价格',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles',
'COLUMN', N'JoinPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户角色',
'SCHEMA', N'dbo',
'TABLE', N'MemberRoles'
GO
-- ----------------------------
-- Table structure for OnlinePayOrder
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[OnlinePayOrder]') AND type IN ('U'))
DROP TABLE [dbo].[OnlinePayOrder]
GO
CREATE TABLE [dbo].[OnlinePayOrder] (
[Id] int IDENTITY(1,1) NOT NULL,
[PayOrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OrderId] int DEFAULT ((0)) NOT NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PayId] int DEFAULT ((0)) NOT NULL,
[PayType] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PayTypeNotes] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Actions] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[UserName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TotalQty] int DEFAULT ((0)) NOT NULL,
[TotalPrice] money DEFAULT ((0)) NOT NULL,
[PaymentStatus] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PaymentNotes] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsOK] int DEFAULT ((0)) NOT NULL,
[Ip] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[ReceiveTime] datetime NULL,
[TypeId] int DEFAULT ((0)) NOT NULL,
[MyType] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OutTradeNo] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[OnlinePayOrder] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'在线支付订单号,唯一',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'PayOrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单ID',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'OrderId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付方式ID',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'PayId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'付款方式',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'PayType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付备注',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'PayTypeNotes'
GO
EXEC sp_addextendedproperty
'MS_Description', N'日志记录',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'Actions'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总数量',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'TotalQty'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总价格',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'TotalPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付状态:未支付、已支付、已退款',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'PaymentStatus'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付备注',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'PaymentNotes'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否完成',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'IsOK'
GO
EXEC sp_addextendedproperty
'MS_Description', N'下单IP',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'Ip'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'回传时间',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'ReceiveTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付的类型',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'TypeId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'系统类型',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'MyType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单标题',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付成功流水号',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder',
'COLUMN', N'OutTradeNo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'在线支付订单',
'SCHEMA', N'dbo',
'TABLE', N'OnlinePayOrder'
GO
-- ----------------------------
-- Table structure for Order
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Order]') AND type IN ('U'))
DROP TABLE [dbo].[Order]
GO
CREATE TABLE [dbo].[Order] (
[Id] int IDENTITY(1,1) NOT NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[UserName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ShopId] int DEFAULT ((0)) NOT NULL,
[Credit] int DEFAULT ((0)) NOT NULL,
[TotalQty] int DEFAULT ((0)) NOT NULL,
[TotalPrice] money DEFAULT ((0)) NOT NULL,
[Discount] money DEFAULT ((0)) NOT NULL,
[Fare] money DEFAULT ((0)) NOT NULL,
[TotalTax] money DEFAULT ((0)) NOT NULL,
[TotalPay] money DEFAULT ((0)) NOT NULL,
[BackCredits] int DEFAULT ((0)) NOT NULL,
[RealName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Country] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Province] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[City] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[District] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Address] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[PostCode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Tel] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Mobile] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Email] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Notes] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AdminNotes] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] ntext COLLATE Chinese_PRC_CI_AS NULL,
[DeliverId] int DEFAULT ((0)) NOT NULL,
[DeliverType] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DeliverNO] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DeliverNotes] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[PayId] int DEFAULT ((0)) NOT NULL,
[PayType] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PayTypeNotes] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[OrderStatus] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[PaymentStatus] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[DeliverStatus] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[Ip] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[IsInvoice] int DEFAULT ((0)) NOT NULL,
[InvoiceCompanyName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[InvoiceCompanyID] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[InvoiceType] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[InvoiceNote] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsRead] int DEFAULT ((0)) NOT NULL,
[IsEnd] int DEFAULT ((0)) NOT NULL,
[EndTime] datetime NULL,
[IsOk] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[Flag1] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Flag2] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Flag3] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Title] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[LastModTime] datetime NULL,
[OrderType] int DEFAULT ((0)) NOT NULL,
[MyType] int DEFAULT ((0)) NOT NULL,
[OutTradeNo] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[Order] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'下单用户名',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商户ID',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'ShopId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'积分',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Credit'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总数量',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'TotalQty'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总价格',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'TotalPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'折扣',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Discount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'运费',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Fare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'税',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'TotalTax'
GO
EXEC sp_addextendedproperty
'MS_Description', N'总支付价格',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'TotalPay'
GO
EXEC sp_addextendedproperty
'MS_Description', N'返现积分',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'BackCredits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'姓名',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'RealName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'国家',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Country'
GO
EXEC sp_addextendedproperty
'MS_Description', N'省份',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Province'
GO
EXEC sp_addextendedproperty
'MS_Description', N'城市',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'City'
GO
EXEC sp_addextendedproperty
'MS_Description', N'区',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'District'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详细地址',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Address'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮编',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'PostCode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'手机',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Tel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'手机',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Mobile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮箱',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Email'
GO
EXEC sp_addextendedproperty
'MS_Description', N'备注',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Notes'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理员备注',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'AdminNotes'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'配送方式ID',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'DeliverId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'配送方式名称',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'DeliverType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'运单号',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'DeliverNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'配送备注',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'DeliverNotes'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付方式ID',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'PayId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'付款方式',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'PayType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付备注',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'PayTypeNotes'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单状态:未确认、已确认、已完成、已取消',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'OrderStatus'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付状态:未支付、已支付、已退款',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'PaymentStatus'
GO
EXEC sp_addextendedproperty
'MS_Description', N'配送状态:未配送、配货中、已配送、已收到、退货中、已退货',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'DeliverStatus'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'下单IP',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Ip'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否需要发票',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'IsInvoice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'抬头',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'InvoiceCompanyName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'纳税人识别号',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'InvoiceCompanyID'
GO
EXEC sp_addextendedproperty
'MS_Description', N'发票内容',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'InvoiceType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'发票备注',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'InvoiceNote'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否未读',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'IsRead'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否结束',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'IsEnd'
GO
EXEC sp_addextendedproperty
'MS_Description', N'结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'EndTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单是否顺利完成',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'IsOk'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单已经评论',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'预留字段1',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Flag1'
GO
EXEC sp_addextendedproperty
'MS_Description', N'预留字段2',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Flag2'
GO
EXEC sp_addextendedproperty
'MS_Description', N'预留字段3',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Flag3'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单名称',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后操作时间',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'LastModTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单类型,0为商品订单',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'OrderType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'系统类型',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'MyType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'支付成功流水号',
'SCHEMA', N'dbo',
'TABLE', N'Order',
'COLUMN', N'OutTradeNo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单',
'SCHEMA', N'dbo',
'TABLE', N'Order'
GO
-- ----------------------------
-- Table structure for OrderDetail
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[OrderDetail]') AND type IN ('U'))
DROP TABLE [dbo].[OrderDetail]
GO
CREATE TABLE [dbo].[OrderDetail] (
[Id] int IDENTITY(1,1) NOT NULL,
[OrderId] int DEFAULT ((0)) NOT NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ShopId] int DEFAULT ((0)) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[PId] int DEFAULT ((0)) NOT NULL,
[TypeId] int DEFAULT ((0)) NOT NULL,
[PriceId] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Attr] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Color] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Spec] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ItemNO] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Qty] int DEFAULT ((0)) NOT NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[MarketPrice] money DEFAULT ((0)) NOT NULL,
[SpecialPrice] money DEFAULT ((0)) NOT NULL,
[Discount] money DEFAULT ((0)) NOT NULL,
[Tax] money DEFAULT ((0)) NOT NULL,
[Credit] int DEFAULT ((0)) NOT NULL,
[BackCredits] int DEFAULT ((0)) NOT NULL,
[IsOK] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL,
[CheckInDate] datetime NULL,
[LeaveDate] datetime NULL,
[MyType] int DEFAULT ((0)) NOT NULL,
[IsPay] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[OrderDetail] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单ID',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'OrderId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商户ID',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'ShopId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品ID',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'PId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类型ID',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'TypeId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'价格ID',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'PriceId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品名称',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品名称',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品属性',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Attr'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品颜色',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Color'
GO
EXEC sp_addextendedproperty
'MS_Description', N'规格',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Spec'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'ItemNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'数量',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Qty'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品价格',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品市场价格',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'MarketPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品特价',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'SpecialPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品优惠',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Discount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品税',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Tax'
GO
EXEC sp_addextendedproperty
'MS_Description', N'积分',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'Credit'
GO
EXEC sp_addextendedproperty
'MS_Description', N'返现积分',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'BackCredits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否完成',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'IsOK'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否已经评论',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'入住日期',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'CheckInDate'
GO
EXEC sp_addextendedproperty
'MS_Description', N'离开日期',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'LeaveDate'
GO
EXEC sp_addextendedproperty
'MS_Description', N'系统类型',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'MyType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否已经支付',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail',
'COLUMN', N'IsPay'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单详情',
'SCHEMA', N'dbo',
'TABLE', N'OrderDetail'
GO
-- ----------------------------
-- Table structure for OrderLog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[OrderLog]') AND type IN ('U'))
DROP TABLE [dbo].[OrderLog]
GO
CREATE TABLE [dbo].[OrderLog] (
[Id] int IDENTITY(1,1) NOT NULL,
[OrderId] int DEFAULT ((0)) NOT NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Actions] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL
)
GO
ALTER TABLE [dbo].[OrderLog] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'OrderLog',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单ID',
'SCHEMA', N'dbo',
'TABLE', N'OrderLog',
'COLUMN', N'OrderId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'OrderLog',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'日志记录',
'SCHEMA', N'dbo',
'TABLE', N'OrderLog',
'COLUMN', N'Actions'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'OrderLog',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'OrderLog',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单日志',
'SCHEMA', N'dbo',
'TABLE', N'OrderLog'
GO
-- ----------------------------
-- Table structure for OtherConfig
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[OtherConfig]') AND type IN ('U'))
DROP TABLE [dbo].[OtherConfig]
GO
CREATE TABLE [dbo].[OtherConfig] (
[Id] int IDENTITY(1,1) NOT NULL,
[ConfigName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[ConfigValue] ntext COLLATE Chinese_PRC_CI_AS NULL,
[LastUpdateTime] datetime NULL
)
GO
ALTER TABLE [dbo].[OtherConfig] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'OtherConfig',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'配置名称',
'SCHEMA', N'dbo',
'TABLE', N'OtherConfig',
'COLUMN', N'ConfigName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'配置值 JSON',
'SCHEMA', N'dbo',
'TABLE', N'OtherConfig',
'COLUMN', N'ConfigValue'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后更新时间',
'SCHEMA', N'dbo',
'TABLE', N'OtherConfig',
'COLUMN', N'LastUpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'其他配置',
'SCHEMA', N'dbo',
'TABLE', N'OtherConfig'
GO
-- ----------------------------
-- Table structure for Product
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Product]') AND type IN ('U'))
DROP TABLE [dbo].[Product]
GO
CREATE TABLE [dbo].[Product] (
[Id] int IDENTITY(1,1) NOT NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[BId] int DEFAULT ((0)) NOT NULL,
[ShopId] int DEFAULT ((0)) NOT NULL,
[CId] int DEFAULT ((0)) NOT NULL,
[SupportId] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ItemNO] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[SubTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Unit] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Spec] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Color] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Weight] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[MarketPrice] money DEFAULT ((0)) NOT NULL,
[SpecialPrice] money DEFAULT ((0)) NOT NULL,
[Fare] money DEFAULT ((0)) NOT NULL,
[Discount] money DEFAULT ((0)) NOT NULL,
[Material] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Front] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Credits] int DEFAULT ((0)) NOT NULL,
[Stock] int DEFAULT ((0)) NOT NULL,
[WarnStock] int DEFAULT ((0)) NOT NULL,
[IsSubProduct] int DEFAULT ((0)) NOT NULL,
[PPId] int DEFAULT ((0)) NOT NULL,
[Content] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Parameters] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LinkURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TitleColor] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsRecommend] int DEFAULT ((0)) NOT NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[IsLock] int DEFAULT ((0)) NOT NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IsTop] int DEFAULT ((0)) NOT NULL,
[IsBest] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[IsMember] int DEFAULT ((0)) NOT NULL,
[IsNew] int DEFAULT ((0)) NOT NULL,
[IsSpecial] int DEFAULT ((0)) NOT NULL,
[IsPromote] int DEFAULT ((0)) NOT NULL,
[IsHotSales] int DEFAULT ((0)) NOT NULL,
[IsBreakup] int DEFAULT ((0)) NOT NULL,
[IsShelves] int DEFAULT ((0)) NOT NULL,
[IsVerify] int DEFAULT ((0)) NOT NULL,
[Hits] int DEFAULT ((0)) NOT NULL,
[IsGift] int DEFAULT ((0)) NOT NULL,
[IsPart] int DEFAULT ((0)) NOT NULL,
[Sequence] int DEFAULT ((0)) NOT NULL,
[CommentCount] int DEFAULT ((0)) NOT NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ClassName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BannerImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AdsId] int DEFAULT ((0)) NOT NULL,
[Tags] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[ItemImg] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Service] ntext COLLATE Chinese_PRC_CI_AS NULL,
[AuthorId] int DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL,
[UpdateTime] datetime NULL,
[Location] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[FilePath] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[FileName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[WarningStock] int DEFAULT ((0)) NOT NULL,
[Sales] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Product] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目ID',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'品牌ID',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'BId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'店铺ID',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'ShopId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色ID',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'CId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'供货商ID',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'SupportId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'标题',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'ItemNO'
GO
EXEC sp_addextendedproperty
'MS_Description', N'副标题',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'SubTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品单位',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Unit'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品规格尺寸',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Spec'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Color'
GO
EXEC sp_addextendedproperty
'MS_Description', N'重量',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Weight'
GO
EXEC sp_addextendedproperty
'MS_Description', N'价格',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'市场价格',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'MarketPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'特价,如有特价,以特价为准',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'SpecialPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'运费',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Fare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'折扣',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Discount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'材料',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Material'
GO
EXEC sp_addextendedproperty
'MS_Description', N'封面',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Front'
GO
EXEC sp_addextendedproperty
'MS_Description', N'积分',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Credits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'库存',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Stock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'警告库存',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'WarnStock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为子商品',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsSubProduct'
GO
EXEC sp_addextendedproperty
'MS_Description', N'父商品ID。如果为子商品,则需要填写父商品ID。实现多颜色功能',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'PPId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'内容',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Content'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品参数',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Parameters'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'跳转链接',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'LinkURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称颜色',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'TitleColor'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模板',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'TemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否推荐',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsRecommend'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否锁定,不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除,已经删除到回收站',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否置顶',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsTop'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否精华',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsBest'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否允许评论',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否会员栏目',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsMember'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否新品',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsNew'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否特价',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsSpecial'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否促销',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsPromote'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否热销',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsHotSales'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否缺货',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsBreakup'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否下架',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsShelves'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否审核,1为已经审核前台显示',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsVerify'
GO
EXEC sp_addextendedproperty
'MS_Description', N'点击数量',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Hits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为礼品商品',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsGift'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为配件',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'IsPart'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Sequence'
GO
EXEC sp_addextendedproperty
'MS_Description', N'评论数量',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'CommentCount'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'样式名称',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'ClassName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'banner图片',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'BannerImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告ID',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'AdsId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'TAG',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Tags'
GO
EXEC sp_addextendedproperty
'MS_Description', N'更多图片',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'ItemImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'售后服务',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Service'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'AuthorId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'时间',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'UpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'路径',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty
'MS_Description', N'存放目录',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'FilePath'
GO
EXEC sp_addextendedproperty
'MS_Description', N'文件名称',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'FileName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'警告库存',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'WarningStock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'销售量',
'SCHEMA', N'dbo',
'TABLE', N'Product',
'COLUMN', N'Sales'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品',
'SCHEMA', N'dbo',
'TABLE', N'Product'
GO
-- ----------------------------
-- Table structure for ProductAttr
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ProductAttr]') AND type IN ('U'))
DROP TABLE [dbo].[ProductAttr]
GO
CREATE TABLE [dbo].[ProductAttr] (
[Id] int IDENTITY(1,1) NOT NULL,
[PId] int DEFAULT ((0)) NOT NULL,
[Title] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TitleColor] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[Color] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Size] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Spec] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[MarketPrice] money DEFAULT ((0)) NOT NULL,
[Stock] int DEFAULT ((0)) NOT NULL,
[Rank] int DEFAULT ((0)) NOT NULL,
[MoreImg] ntext COLLATE Chinese_PRC_CI_AS NULL,
[WarningStock] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[ProductAttr] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品ID',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'PId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'属性名称',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'属性名称颜色',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'TitleColor'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'颜色',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Color'
GO
EXEC sp_addextendedproperty
'MS_Description', N'尺码',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Size'
GO
EXEC sp_addextendedproperty
'MS_Description', N'规格',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Spec'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'价格',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'市场价格',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'MarketPrice'
GO
EXEC sp_addextendedproperty
'MS_Description', N'库存',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Stock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'更多图片',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'MoreImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'预警库存',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr',
'COLUMN', N'WarningStock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商品属性',
'SCHEMA', N'dbo',
'TABLE', N'ProductAttr'
GO
-- ----------------------------
-- Table structure for RebateChangeLog
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[RebateChangeLog]') AND type IN ('U'))
DROP TABLE [dbo].[RebateChangeLog]
GO
CREATE TABLE [dbo].[RebateChangeLog] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[AdminId] int DEFAULT ((0)) NOT NULL,
[UserName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[IP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Actions] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Reward] money DEFAULT ((0)) NOT NULL,
[BeforChange] money DEFAULT ((0)) NOT NULL,
[AfterChange] money DEFAULT ((0)) NOT NULL,
[LogDetails] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TypeId] int DEFAULT ((0)) NOT NULL,
[MyType] int DEFAULT ((0)) NOT NULL,
[OrderId] int DEFAULT ((0)) NOT NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[RebateChangeLog] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'AdminId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'时间',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录IP',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'IP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'记录',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'Actions'
GO
EXEC sp_addextendedproperty
'MS_Description', N'返现、扣除金额',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'Reward'
GO
EXEC sp_addextendedproperty
'MS_Description', N'变化前',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'BeforChange'
GO
EXEC sp_addextendedproperty
'MS_Description', N'变化后',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'AfterChange'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详细记录',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'LogDetails'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类型 0 充值 1 购买 2 赠送 3 退款 4 分销提成',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'TypeId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'消费类型,见MyType',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'MyType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单ID',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'OrderId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户返现余额变化记录',
'SCHEMA', N'dbo',
'TABLE', N'RebateChangeLog'
GO
-- ----------------------------
-- Table structure for ShipFeeStrategy
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ShipFeeStrategy]') AND type IN ('U'))
DROP TABLE [dbo].[ShipFeeStrategy]
GO
CREATE TABLE [dbo].[ShipFeeStrategy] (
[Id] int IDENTITY(1,1) NOT NULL,
[Title] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[DefaultFare] money DEFAULT ((0)) NOT NULL,
[MaxFreeFare] money DEFAULT ((0)) NOT NULL,
[MinWeight] money DEFAULT ((0)) NOT NULL,
[AppendWeight] money DEFAULT ((0)) NOT NULL,
[AppendFee] money DEFAULT ((0)) NOT NULL,
[AddTime] datetime NULL,
[UpdateTime] datetime NULL,
[AreaType] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[ShipFeeStrategy] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'策略名称',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'策略说明',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'默认运费',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'DefaultFare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最大免运费金额',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'MaxFreeFare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最小重量',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'MinWeight'
GO
EXEC sp_addextendedproperty
'MS_Description', N'续重重量',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'AppendWeight'
GO
EXEC sp_addextendedproperty
'MS_Description', N'续重金额',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'AppendFee'
GO
EXEC sp_addextendedproperty
'MS_Description', N'加入时间',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后更新时间',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'UpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'策略地区类型。1省份策略;2城市策略',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy',
'COLUMN', N'AreaType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'运费策略',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategy'
GO
-- ----------------------------
-- Table structure for ShipFeeStrategyArea
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ShipFeeStrategyArea]') AND type IN ('U'))
DROP TABLE [dbo].[ShipFeeStrategyArea]
GO
CREATE TABLE [dbo].[ShipFeeStrategyArea] (
[Id] int IDENTITY(1,1) NOT NULL,
[AreaId] int DEFAULT ((0)) NOT NULL,
[ShipFeeStrategyId] int DEFAULT ((0)) NOT NULL,
[Province] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[City] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Level] int DEFAULT ((0)) NOT NULL,
[Code] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[ShipFeeStrategyArea] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategyArea',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'地区Id',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategyArea',
'COLUMN', N'AreaId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'运费策略Id',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategyArea',
'COLUMN', N'ShipFeeStrategyId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'省份',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategyArea',
'COLUMN', N'Province'
GO
EXEC sp_addextendedproperty
'MS_Description', N'城市',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategyArea',
'COLUMN', N'City'
GO
EXEC sp_addextendedproperty
'MS_Description', N'级别',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategyArea',
'COLUMN', N'Level'
GO
EXEC sp_addextendedproperty
'MS_Description', N'区域代码',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategyArea',
'COLUMN', N'Code'
GO
EXEC sp_addextendedproperty
'MS_Description', N'运费区域策略详情',
'SCHEMA', N'dbo',
'TABLE', N'ShipFeeStrategyArea'
GO
-- ----------------------------
-- Table structure for Shop
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[Shop]') AND type IN ('U'))
DROP TABLE [dbo].[Shop]
GO
CREATE TABLE [dbo].[Shop] (
[Id] int IDENTITY(1,1) NOT NULL,
[ShopName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[KId] int DEFAULT ((0)) NOT NULL,
[AId] int DEFAULT ((0)) NOT NULL,
[Sequence] int DEFAULT ((0)) NOT NULL,
[Latitude] money DEFAULT ((0)) NOT NULL,
[Longitude] money DEFAULT ((0)) NOT NULL,
[Country] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Province] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[City] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[District] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Address] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Postcode] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[IsDisabled] int DEFAULT ((0)) NOT NULL,
[Content] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[BannerImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Balance] money DEFAULT ((0)) NOT NULL,
[IsTop] int DEFAULT ((0)) NOT NULL,
[IsVip] int DEFAULT ((0)) NOT NULL,
[IsRecommend] int DEFAULT ((0)) NOT NULL,
[Likes] int DEFAULT ((0)) NOT NULL,
[AvgScore] money DEFAULT ((0)) NOT NULL,
[ServiceScore] money DEFAULT ((0)) NOT NULL,
[SpeedScore] money DEFAULT ((0)) NOT NULL,
[EnvironmentScore] money DEFAULT ((0)) NOT NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[MorePics] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Email] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[Tel] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Phone] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[QQ] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Skype] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[HomePage] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Weixin] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[IsShip] int DEFAULT ((0)) NOT NULL,
[OpenTime] datetime NULL,
[CloseTime] datetime NULL,
[ShippingStartTime] datetime NULL,
[ShippingEndTime] datetime NULL,
[AddTime] datetime NULL,
[Hits] int DEFAULT ((0)) NOT NULL,
[MyType] int DEFAULT ((0)) NOT NULL,
[DefaultFare] money DEFAULT ((0)) NOT NULL,
[MaxFreeFare] money DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[Shop] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'店铺名称',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'ShopName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商家分类ID',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'KId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'地区ID',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'AId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Sequence'
GO
EXEC sp_addextendedproperty
'MS_Description', N'纬度',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Latitude'
GO
EXEC sp_addextendedproperty
'MS_Description', N'经度',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Longitude'
GO
EXEC sp_addextendedproperty
'MS_Description', N'国家',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Country'
GO
EXEC sp_addextendedproperty
'MS_Description', N'省',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Province'
GO
EXEC sp_addextendedproperty
'MS_Description', N'市',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'City'
GO
EXEC sp_addextendedproperty
'MS_Description', N'区',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'District'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详细地址',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Address'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮政编码',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Postcode'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否禁用',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'IsDisabled'
GO
EXEC sp_addextendedproperty
'MS_Description', N'店铺介绍',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Content'
GO
EXEC sp_addextendedproperty
'MS_Description', N'关键字',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'banner图片',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'BannerImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'余额',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Balance'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否置顶',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'IsTop'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否vip',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'IsVip'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否推荐',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'IsRecommend'
GO
EXEC sp_addextendedproperty
'MS_Description', N'点赞数',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Likes'
GO
EXEC sp_addextendedproperty
'MS_Description', N'平均分数',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'AvgScore'
GO
EXEC sp_addextendedproperty
'MS_Description', N'服务分数',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'ServiceScore'
GO
EXEC sp_addextendedproperty
'MS_Description', N'速度分数',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'SpeedScore'
GO
EXEC sp_addextendedproperty
'MS_Description', N'环境分数',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'EnvironmentScore'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'店铺所有图片',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'MorePics'
GO
EXEC sp_addextendedproperty
'MS_Description', N'邮箱',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Email'
GO
EXEC sp_addextendedproperty
'MS_Description', N'电话',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Tel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'固定电话',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Phone'
GO
EXEC sp_addextendedproperty
'MS_Description', N'QQ',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'QQ'
GO
EXEC sp_addextendedproperty
'MS_Description', N'Skype',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Skype'
GO
EXEC sp_addextendedproperty
'MS_Description', N'主页',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'HomePage'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Weixin'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否配送',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'IsShip'
GO
EXEC sp_addextendedproperty
'MS_Description', N'开店时间',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'OpenTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'关店时间',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'CloseTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'配送开始时间',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'ShippingStartTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'配送结束时间',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'ShippingEndTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'点击量',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'Hits'
GO
EXEC sp_addextendedproperty
'MS_Description', N'店铺类型',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'MyType'
GO
EXEC sp_addextendedproperty
'MS_Description', N'默认运费',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'DefaultFare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最大免运费金额',
'SCHEMA', N'dbo',
'TABLE', N'Shop',
'COLUMN', N'MaxFreeFare'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商家',
'SCHEMA', N'dbo',
'TABLE', N'Shop'
GO
-- ----------------------------
-- Table structure for ShopCategory
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ShopCategory]') AND type IN ('U'))
DROP TABLE [dbo].[ShopCategory]
GO
CREATE TABLE [dbo].[ShopCategory] (
[Id] int IDENTITY(1,1) NOT NULL,
[KindName] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[SubTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindTitle] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Keyword] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Description] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[LinkURL] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[TitleColor] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[TemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[DetailTemplateFile] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindDomain] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[IsList] int DEFAULT ((0)) NOT NULL,
[PageSize] int DEFAULT ((0)) NOT NULL,
[PId] int DEFAULT ((0)) NOT NULL,
[Level] int DEFAULT ((0)) NOT NULL,
[Location] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[IsHide] int DEFAULT ((0)) NOT NULL,
[IsLock] int DEFAULT ((0)) NOT NULL,
[IsDel] int DEFAULT ((0)) NOT NULL,
[IsComment] int DEFAULT ((0)) NOT NULL,
[IsMember] int DEFAULT ((0)) NOT NULL,
[IsShowSubDetail] int DEFAULT ((0)) NOT NULL,
[CatalogId] int DEFAULT ((0)) NOT NULL,
[Counts] int DEFAULT ((0)) NOT NULL,
[Rank] int DEFAULT ((0)) NOT NULL,
[Icon] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[ClassName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[BannerImg] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[KindInfo] ntext COLLATE Chinese_PRC_CI_AS NULL,
[Pic] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[AdsId] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[ShopCategory] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目名称',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'KindName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目副标题',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'SubTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目标题,填写则在浏览器替换此标题',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'KindTitle'
GO
EXEC sp_addextendedproperty
'MS_Description', N'描述',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Keyword'
GO
EXEC sp_addextendedproperty
'MS_Description', N'介绍',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Description'
GO
EXEC sp_addextendedproperty
'MS_Description', N'跳转链接',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'LinkURL'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别名称颜色',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'TitleColor'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模板',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'TemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详情模板',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'DetailTemplateFile'
GO
EXEC sp_addextendedproperty
'MS_Description', N'类别域名(保留)',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'KindDomain'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否为列表页面',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'IsList'
GO
EXEC sp_addextendedproperty
'MS_Description', N'每页显示数量',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'PageSize'
GO
EXEC sp_addextendedproperty
'MS_Description', N'上级ID',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'PId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'级别',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Level'
GO
EXEC sp_addextendedproperty
'MS_Description', N'路径',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Location'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否隐藏',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'IsHide'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否锁定,不允许删除',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'IsLock'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否删除,已经删除到回收站',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'IsDel'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否允许评论',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'IsComment'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否会员栏目',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'IsMember'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否显示下级栏目内容',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'IsShowSubDetail'
GO
EXEC sp_addextendedproperty
'MS_Description', N'模型ID',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'CatalogId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'详情数量,缓存',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Counts'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图标',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Icon'
GO
EXEC sp_addextendedproperty
'MS_Description', N'样式名称',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'ClassName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'banner图片',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'BannerImg'
GO
EXEC sp_addextendedproperty
'MS_Description', N'栏目详细介绍',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'KindInfo'
GO
EXEC sp_addextendedproperty
'MS_Description', N'图片',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'Pic'
GO
EXEC sp_addextendedproperty
'MS_Description', N'广告ID',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory',
'COLUMN', N'AdsId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'商家分类',
'SCHEMA', N'dbo',
'TABLE', N'ShopCategory'
GO
-- ----------------------------
-- Table structure for ShoppingCart
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[ShoppingCart]') AND type IN ('U'))
DROP TABLE [dbo].[ShoppingCart]
GO
CREATE TABLE [dbo].[ShoppingCart] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[GUID] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[Details] ntext COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[UpdateTime] datetime NULL
)
GO
ALTER TABLE [dbo].[ShoppingCart] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'ShoppingCart',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'ShoppingCart',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'唯一GUID,没登录用户使用',
'SCHEMA', N'dbo',
'TABLE', N'ShoppingCart',
'COLUMN', N'GUID'
GO
EXEC sp_addextendedproperty
'MS_Description', N'购物车内容,JOSN',
'SCHEMA', N'dbo',
'TABLE', N'ShoppingCart',
'COLUMN', N'Details'
GO
EXEC sp_addextendedproperty
'MS_Description', N'加入购物车时间',
'SCHEMA', N'dbo',
'TABLE', N'ShoppingCart',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'最后更新时间',
'SCHEMA', N'dbo',
'TABLE', N'ShoppingCart',
'COLUMN', N'UpdateTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'购物车',
'SCHEMA', N'dbo',
'TABLE', N'ShoppingCart'
GO
-- ----------------------------
-- Table structure for TargetEvent
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[TargetEvent]') AND type IN ('U'))
DROP TABLE [dbo].[TargetEvent]
GO
CREATE TABLE [dbo].[TargetEvent] (
[Id] int IDENTITY(1,1) NOT NULL,
[EventKey] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[EventName] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[IsDisable] int DEFAULT ((0)) NOT NULL,
[Rank] int DEFAULT ((0)) NOT NULL
)
GO
ALTER TABLE [dbo].[TargetEvent] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'TargetEvent',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'事件key',
'SCHEMA', N'dbo',
'TABLE', N'TargetEvent',
'COLUMN', N'EventKey'
GO
EXEC sp_addextendedproperty
'MS_Description', N'事件名称',
'SCHEMA', N'dbo',
'TABLE', N'TargetEvent',
'COLUMN', N'EventName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否禁用',
'SCHEMA', N'dbo',
'TABLE', N'TargetEvent',
'COLUMN', N'IsDisable'
GO
EXEC sp_addextendedproperty
'MS_Description', N'排序',
'SCHEMA', N'dbo',
'TABLE', N'TargetEvent',
'COLUMN', N'Rank'
GO
EXEC sp_addextendedproperty
'MS_Description', N'目标事件',
'SCHEMA', N'dbo',
'TABLE', N'TargetEvent'
GO
-- ----------------------------
-- Records of TargetEvent
-- ----------------------------
SET IDENTITY_INSERT [dbo].[TargetEvent] ON
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'1', N'add', N'添加', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'2', N'edit', N'修改', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'3', N'del', N'删除', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'4', N'view', N'查看', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'5', N'viewlist', N'查看列表', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'6', N'import', N'导入', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'7', N'export', N'导出', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'8', N'filter', N'搜索', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'9', N'batch', N'批量操作', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'10', N'recycle', N'回收站', N'0', N'0')
GO
INSERT INTO [dbo].[TargetEvent] ([Id], [EventKey], [EventName], [IsDisable], [Rank]) VALUES (N'11', N'confirm', N'确认', N'0', N'0')
GO
SET IDENTITY_INSERT [dbo].[TargetEvent] OFF
GO
-- ----------------------------
-- Table structure for WithdrawOrder
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[WithdrawOrder]') AND type IN ('U'))
DROP TABLE [dbo].[WithdrawOrder]
GO
CREATE TABLE [dbo].[WithdrawOrder] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[OrderNum] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[UserName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL,
[Title] nvarchar(100) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL,
[IP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Actions] nvarchar(250) COLLATE Chinese_PRC_CI_AS NULL,
[Price] money DEFAULT ((0)) NOT NULL,
[VerifyAdminId] int DEFAULT ((0)) NOT NULL,
[IsVerify] int DEFAULT ((0)) NOT NULL,
[VerifyTime] datetime NULL,
[FormId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL
)
GO
ALTER TABLE [dbo].[WithdrawOrder] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单号',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'OrderNum'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户名',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'UserName'
GO
EXEC sp_addextendedproperty
'MS_Description', N'订单名称',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'Title'
GO
EXEC sp_addextendedproperty
'MS_Description', N'时间',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录IP',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'IP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'记录详情',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'Actions'
GO
EXEC sp_addextendedproperty
'MS_Description', N'提现金额',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'Price'
GO
EXEC sp_addextendedproperty
'MS_Description', N'审核管理员ID',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'VerifyAdminId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'是否通过审核',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'IsVerify'
GO
EXEC sp_addextendedproperty
'MS_Description', N'审核时间',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'VerifyTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'小程序FormId',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder',
'COLUMN', N'FormId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户提现订单',
'SCHEMA', N'dbo',
'TABLE', N'WithdrawOrder'
GO
-- ----------------------------
-- Table structure for WXAppSession
-- ----------------------------
IF EXISTS (SELECT * FROM sys.all_objects WHERE object_id = OBJECT_ID(N'[dbo].[WXAppSession]') AND type IN ('U'))
DROP TABLE [dbo].[WXAppSession]
GO
CREATE TABLE [dbo].[WXAppSession] (
[Id] int IDENTITY(1,1) NOT NULL,
[UId] int DEFAULT ((0)) NOT NULL,
[IP] nvarchar(20) COLLATE Chinese_PRC_CI_AS NULL,
[Key] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[SessionKey] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[OpenId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL,
[AddTime] datetime NULL
)
GO
ALTER TABLE [dbo].[WXAppSession] SET (LOCK_ESCALATION = TABLE)
GO
EXEC sp_addextendedproperty
'MS_Description', N'编号',
'SCHEMA', N'dbo',
'TABLE', N'WXAppSession',
'COLUMN', N'Id'
GO
EXEC sp_addextendedproperty
'MS_Description', N'用户ID',
'SCHEMA', N'dbo',
'TABLE', N'WXAppSession',
'COLUMN', N'UId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'登录IP',
'SCHEMA', N'dbo',
'TABLE', N'WXAppSession',
'COLUMN', N'IP'
GO
EXEC sp_addextendedproperty
'MS_Description', N'系统生成Key',
'SCHEMA', N'dbo',
'TABLE', N'WXAppSession',
'COLUMN', N'Key'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信SessionKey',
'SCHEMA', N'dbo',
'TABLE', N'WXAppSession',
'COLUMN', N'SessionKey'
GO
EXEC sp_addextendedproperty
'MS_Description', N'微信小程序OpenId',
'SCHEMA', N'dbo',
'TABLE', N'WXAppSession',
'COLUMN', N'OpenId'
GO
EXEC sp_addextendedproperty
'MS_Description', N'添加时间',
'SCHEMA', N'dbo',
'TABLE', N'WXAppSession',
'COLUMN', N'AddTime'
GO
EXEC sp_addextendedproperty
'MS_Description', N'小程序Session',
'SCHEMA', N'dbo',
'TABLE', N'WXAppSession'
GO
-- ----------------------------
-- Primary Key structure for table Admin
-- ----------------------------
ALTER TABLE [dbo].[Admin] ADD CONSTRAINT [PK__Admin__3214EC070BE151E2] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table AdminLog
-- ----------------------------
ALTER TABLE [dbo].[AdminLog] ADD CONSTRAINT [PK__AdminLog__3214EC07B6C01400] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table AdminMenu
-- ----------------------------
ALTER TABLE [dbo].[AdminMenu] ADD CONSTRAINT [PK__AdminMen__3214EC0713FD6092] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table AdminMenuEvent
-- ----------------------------
ALTER TABLE [dbo].[AdminMenuEvent] ADD CONSTRAINT [PK__AdminMen__3214EC0766C1640F] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table AdminRoles
-- ----------------------------
ALTER TABLE [dbo].[AdminRoles] ADD CONSTRAINT [PK__AdminRol__3214EC07494ABBBC] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Ads
-- ----------------------------
ALTER TABLE [dbo].[Ads] ADD CONSTRAINT [PK__Ads__3214EC07F20950FC] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table AdsKind
-- ----------------------------
ALTER TABLE [dbo].[AdsKind] ADD CONSTRAINT [PK__AdsKind__3214EC07A3BEDD3C] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Indexes structure for table Area
-- ----------------------------
CREATE NONCLUSTERED INDEX [IX_Area_Name]
ON [dbo].[Area] (
[Name] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Area_ParentId]
ON [dbo].[Area] (
[ParentId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Area_Level]
ON [dbo].[Area] (
[Level] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Area_Code]
ON [dbo].[Area] (
[Code] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Area_PinYin]
ON [dbo].[Area] (
[PinYin] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Area_PY]
ON [dbo].[Area] (
[PY] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table Area
-- ----------------------------
ALTER TABLE [dbo].[Area] ADD CONSTRAINT [PK__Area__3214EC07641C70E0] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Article
-- ----------------------------
ALTER TABLE [dbo].[Article] ADD CONSTRAINT [PK__Article__3214EC0762B47DAB] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table ArticleCategory
-- ----------------------------
ALTER TABLE [dbo].[ArticleCategory] ADD CONSTRAINT [PK__ArticleC__3214EC07EEE28C9B] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table BalanceChangeLog
-- ----------------------------
ALTER TABLE [dbo].[BalanceChangeLog] ADD CONSTRAINT [PK__BalanceC__3214EC077D646F4C] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Category
-- ----------------------------
ALTER TABLE [dbo].[Category] ADD CONSTRAINT [PK__Category__3214EC074235E836] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Config
-- ----------------------------
ALTER TABLE [dbo].[Config] ADD CONSTRAINT [PK__Config__3214EC07D9ABFA2C] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Coupon
-- ----------------------------
ALTER TABLE [dbo].[Coupon] ADD CONSTRAINT [PK__Coupon__3214EC076FF20207] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table CouponKind
-- ----------------------------
ALTER TABLE [dbo].[CouponKind] ADD CONSTRAINT [PK__CouponKi__3214EC07E9F856CA] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table CouponUseLog
-- ----------------------------
ALTER TABLE [dbo].[CouponUseLog] ADD CONSTRAINT [PK__CouponUs__3214EC0774E2BA5F] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Indexes structure for table Favortie
-- ----------------------------
CREATE NONCLUSTERED INDEX [IX_Favortie_UId]
ON [dbo].[Favortie] (
[UId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Favortie_TId]
ON [dbo].[Favortie] (
[TId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Favortie_RId]
ON [dbo].[Favortie] (
[RId] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table Favortie
-- ----------------------------
ALTER TABLE [dbo].[Favortie] ADD CONSTRAINT [PK__Favortie__3214EC07FCC7A7E8] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Food
-- ----------------------------
ALTER TABLE [dbo].[Food] ADD CONSTRAINT [PK__Food__3214EC071E1B18CF] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Guestbook
-- ----------------------------
ALTER TABLE [dbo].[Guestbook] ADD CONSTRAINT [PK__Guestboo__3214EC07334AFBC4] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table GuestbookCategory
-- ----------------------------
ALTER TABLE [dbo].[GuestbookCategory] ADD CONSTRAINT [PK__Guestboo__3214EC078E45FE08] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table HotelRoom
-- ----------------------------
ALTER TABLE [dbo].[HotelRoom] ADD CONSTRAINT [PK__HotelRoo__3214EC071F0FCCEA] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Link
-- ----------------------------
ALTER TABLE [dbo].[Link] ADD CONSTRAINT [PK__Link__3214EC07ACB87964] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table LinkKind
-- ----------------------------
ALTER TABLE [dbo].[LinkKind] ADD CONSTRAINT [PK__LinkKind__3214EC07B20D8679] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Indexes structure for table Member
-- ----------------------------
CREATE NONCLUSTERED INDEX [IX_Member_Rebate]
ON [dbo].[Member] (
[Rebate] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_Balance]
ON [dbo].[Member] (
[Balance] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_WeixinOpenId]
ON [dbo].[Member] (
[WeixinOpenId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_WeixinAppOpenId]
ON [dbo].[Member] (
[WeixinAppOpenId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_Tel]
ON [dbo].[Member] (
[Tel] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_UserName]
ON [dbo].[Member] (
[UserName] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_RoleId]
ON [dbo].[Member] (
[RoleId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_AliAppOpenId]
ON [dbo].[Member] (
[AliAppOpenId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_TenUnionId]
ON [dbo].[Member] (
[TenUnionId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Member_RegType]
ON [dbo].[Member] (
[RegType] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table Member
-- ----------------------------
ALTER TABLE [dbo].[Member] ADD CONSTRAINT [PK__Member__3214EC0763DEC348] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table MemberAddress
-- ----------------------------
ALTER TABLE [dbo].[MemberAddress] ADD CONSTRAINT [PK__MemberAd__3214EC07FE64B32F] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table MemberCoupon
-- ----------------------------
ALTER TABLE [dbo].[MemberCoupon] ADD CONSTRAINT [PK__MemberCo__3214EC071891780F] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table MemberLog
-- ----------------------------
ALTER TABLE [dbo].[MemberLog] ADD CONSTRAINT [PK__MemberLo__3214EC07692F3D03] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table MemberRoles
-- ----------------------------
ALTER TABLE [dbo].[MemberRoles] ADD CONSTRAINT [PK__MemberRo__3214EC075C03E835] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table OnlinePayOrder
-- ----------------------------
ALTER TABLE [dbo].[OnlinePayOrder] ADD CONSTRAINT [PK__OnlinePa__3214EC078AFF6475] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Indexes structure for table Order
-- ----------------------------
CREATE NONCLUSTERED INDEX [IX_Order_OrderNum]
ON [dbo].[Order] (
[OrderNum] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Order_OrderStatus]
ON [dbo].[Order] (
[OrderStatus] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Order_PaymentStatus]
ON [dbo].[Order] (
[PaymentStatus] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Order_AddTime]
ON [dbo].[Order] (
[AddTime] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Order_OrderType]
ON [dbo].[Order] (
[OrderType] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_Order_UId]
ON [dbo].[Order] (
[UId] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table Order
-- ----------------------------
ALTER TABLE [dbo].[Order] ADD CONSTRAINT [PK__Order__3214EC07C496791F] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Indexes structure for table OrderDetail
-- ----------------------------
CREATE NONCLUSTERED INDEX [IX_OrderDetail_OrderNum]
ON [dbo].[OrderDetail] (
[OrderNum] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_OrderDetail_PId]
ON [dbo].[OrderDetail] (
[PId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_OrderDetail_OrderId]
ON [dbo].[OrderDetail] (
[OrderId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_OrderDetail_PriceId]
ON [dbo].[OrderDetail] (
[PriceId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_OrderDetail_UId]
ON [dbo].[OrderDetail] (
[UId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_OrderDetail_IsPay]
ON [dbo].[OrderDetail] (
[IsPay] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_OrderDetail_IsOK]
ON [dbo].[OrderDetail] (
[IsOK] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table OrderDetail
-- ----------------------------
ALTER TABLE [dbo].[OrderDetail] ADD CONSTRAINT [PK__OrderDet__3214EC073BAF54DF] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table OrderLog
-- ----------------------------
ALTER TABLE [dbo].[OrderLog] ADD CONSTRAINT [PK__OrderLog__3214EC07CA4BBF9F] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table OtherConfig
-- ----------------------------
ALTER TABLE [dbo].[OtherConfig] ADD CONSTRAINT [PK__OtherCon__3214EC07A62C0B84] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Product
-- ----------------------------
ALTER TABLE [dbo].[Product] ADD CONSTRAINT [PK__Product__3214EC0772DD3F76] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Indexes structure for table ProductAttr
-- ----------------------------
CREATE NONCLUSTERED INDEX [IX_ProductAttr_PId]
ON [dbo].[ProductAttr] (
[PId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_ProductAttr_Spec]
ON [dbo].[ProductAttr] (
[Spec] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_ProductAttr_Stock]
ON [dbo].[ProductAttr] (
[Stock] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_ProductAttr_Rank]
ON [dbo].[ProductAttr] (
[Rank] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table ProductAttr
-- ----------------------------
ALTER TABLE [dbo].[ProductAttr] ADD CONSTRAINT [PK__ProductA__3214EC0718092A75] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table RebateChangeLog
-- ----------------------------
ALTER TABLE [dbo].[RebateChangeLog] ADD CONSTRAINT [PK__RebateCh__3214EC0774BC006B] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table ShipFeeStrategy
-- ----------------------------
ALTER TABLE [dbo].[ShipFeeStrategy] ADD CONSTRAINT [PK__ShipFeeS__3214EC07304AEEC9] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Indexes structure for table ShipFeeStrategyArea
-- ----------------------------
CREATE NONCLUSTERED INDEX [IX_ShipFeeStrategyArea_AreaId]
ON [dbo].[ShipFeeStrategyArea] (
[AreaId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_ShipFeeStrategyArea_ShipFeeStrategyId]
ON [dbo].[ShipFeeStrategyArea] (
[ShipFeeStrategyId] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_ShipFeeStrategyArea_Province]
ON [dbo].[ShipFeeStrategyArea] (
[Province] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_ShipFeeStrategyArea_City]
ON [dbo].[ShipFeeStrategyArea] (
[City] ASC
)
GO
CREATE NONCLUSTERED INDEX [IX_ShipFeeStrategyArea_Level]
ON [dbo].[ShipFeeStrategyArea] (
[Level] ASC
)
GO
-- ----------------------------
-- Primary Key structure for table ShipFeeStrategyArea
-- ----------------------------
ALTER TABLE [dbo].[ShipFeeStrategyArea] ADD CONSTRAINT [PK__ShipFeeS__3214EC07FD126DD9] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table Shop
-- ----------------------------
ALTER TABLE [dbo].[Shop] ADD CONSTRAINT [PK__Shop__3214EC07F42E4224] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table ShopCategory
-- ----------------------------
ALTER TABLE [dbo].[ShopCategory] ADD CONSTRAINT [PK__ShopCate__3214EC07AC3F60E8] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table ShoppingCart
-- ----------------------------
ALTER TABLE [dbo].[ShoppingCart] ADD CONSTRAINT [PK__Shopping__3214EC07434C850A] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table TargetEvent
-- ----------------------------
ALTER TABLE [dbo].[TargetEvent] ADD CONSTRAINT [PK__TargetEv__3214EC07D34F0E89] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table WithdrawOrder
-- ----------------------------
ALTER TABLE [dbo].[WithdrawOrder] ADD CONSTRAINT [PK__Withdraw__3214EC07A9077AD3] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO
-- ----------------------------
-- Primary Key structure for table WXAppSession
-- ----------------------------
ALTER TABLE [dbo].[WXAppSession] ADD CONSTRAINT [PK__WXAppSes__3214EC0749B4AF48] PRIMARY KEY CLUSTERED ([Id])
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
ON [PRIMARY]
GO | the_stack |
-- Made the check_job_status() error clearer for when a job is added to job_check_config but has never run. Would say a job was missing, but wouldn't say which one.
-- check_job_status() will now report when sensitivity threshold is broken for jobs giving a level 2 (WARNING) status. Ex: A job with a sensitivity of zero will show up with a level 2 alert if it has shown up in job_log with just a single level 2 status.
/*
* Check Job status
*
* p_history is how far into job_log's past the check will go. Don't go further back than the longest job's interval that is contained
* in job_check_config to keep check efficient
* Return code 1 means a successful job run
* Return code 2 is for use with jobs that support a warning indicator. Not critical, but someone should look into it
* Return code 3 is for use with a critical job failure
*/
CREATE OR REPLACE FUNCTION check_job_status(p_history interval, OUT alert_code integer, OUT alert_text text)
LANGUAGE plpgsql
AS $$
DECLARE
v_alert_code_3 text;
v_count int = 1;
v_jobs RECORD;
v_job_errors RECORD;
v_longest_period interval;
v_trouble text[];
v_version int;
BEGIN
-- Leave this check here in case helper function isn't used and this is called directly with an interval argument
SELECT greatest(max(error_threshold), max(warn_threshold)) INTO v_longest_period FROM @extschema@.job_check_config;
IF v_longest_period IS NOT NULL THEN
IF p_history < v_longest_period THEN
RAISE EXCEPTION 'Input argument must be greater than or equal to the longest threshold in job_check_config table';
END IF;
END IF;
SELECT current_setting('server_version_num')::int INTO v_version;
alert_text := '(';
alert_code := 1;
-- Generic check for jobs without special monitoring. Should error on 3 failures
FOR v_job_errors IN SELECT l.job_name, l.alert_code FROM @extschema@.job_check_log l
WHERE l.job_name NOT IN (SELECT c.job_name FROM @extschema@.job_check_config c WHERE l.job_name <> c.job_name) GROUP BY l.job_name, l.alert_code HAVING count(*) > 2
LOOP
v_trouble[v_count] := v_job_errors.job_name;
v_count := v_count+1;
alert_code = greatest(alert_code, v_job_errors.alert_code);
END LOOP;
IF array_upper(v_trouble,1) > 0 THEN
alert_text := alert_text || 'Jobs w/ 3 consecutive problems: '||array_to_string(v_trouble,', ')||'; ';
END IF;
SELECT jt.alert_text INTO v_alert_code_3 FROM @extschema@.job_status_text jt WHERE jt.alert_code = 3;
-- Jobs with special monitoring (threshold different than 3 errors; must run within a timeframe; etc)
IF v_version >= 90200 THEN
FOR v_jobs IN
SELECT
job_name,
current_timestamp,
current_timestamp - end_time AS last_run_time,
CASE
WHEN (SELECT count(*) FROM @extschema@.job_check_log l WHERE job_name = job_check_config.job_name and l.alert_code = 3 ) > sensitivity THEN 'ERROR'
WHEN end_time < (current_timestamp - error_threshold) THEN 'ERROR'
WHEN (SELECT count(*) FROM @extschema@.job_check_log l WHERE job_name = job_check_config.job_name and l.alert_code = 2 ) > sensitivity THEN 'WARNING'
WHEN end_time < (current_timestamp - warn_threshold) THEN 'WARNING'
WHEN end_time IS NULL THEN 'ERROR'
ELSE 'OK'
END AS error_code,
CASE
WHEN status = v_alert_code_3 THEN 'CRITICAL'
WHEN status is null THEN 'MISSING'
WHEN (end_time < current_timestamp - error_threshold) OR (end_time < current_timestamp - warn_threshold) THEN
CASE
WHEN status = 'OK' THEN 'MISSING'
ELSE status
END
ELSE status
END AS job_status
FROM
@extschema@.job_check_config
LEFT JOIN (SELECT
job_name,
max(start_time) AS start_time,
max(end_time) AS end_time
FROM
@extschema@.job_log
WHERE
(end_time > now() - p_history OR end_time IS NULL)
GROUP BY
job_name
) last_job using (job_name)
LEFT JOIN (SELECT
job_name,
start_time,
coalesce(status,
(SELECT CASE WHEN (SELECT count(*) FROM pg_locks WHERE not granted and pid = m.pid) > 0 THEN 'BLOCKED' ELSE NULL END),
(SELECT CASE WHEN (SELECT count(*) FROM pg_stat_activity WHERE pid = m.pid) > 0 THEN 'RUNNING' ELSE NULL END),
'FOOBAR') AS status
FROM
@extschema@.job_log m
WHERE
start_time > now() - p_history
) lj_status using (job_name,start_time)
WHERE active
LOOP
IF v_jobs.error_code = 'ERROR' THEN
alert_code := 3;
alert_text := alert_text || v_jobs.job_name || ': ' || coalesce(v_jobs.job_status,'null??');
END IF;
IF v_jobs.error_code = 'WARNING' THEN
IF alert_code <> 3 THEN
alert_code := 2;
END IF;
alert_text := alert_text || v_jobs.job_name || ': ' || coalesce(v_jobs.job_status,'null??');
END IF;
IF v_jobs.job_status = 'BLOCKED' THEN
alert_text := alert_text || ' - Object lock is blocking job completion';
ELSIF v_jobs.job_status = 'MISSING' THEN
IF v_jobs.last_run_time IS NULL THEN
alert_text := alert_text || ' - Last run over ' || p_history || ' ago. Check job_log for more details';
ELSE
alert_text := alert_text || ' - Last run at ' || current_timestamp - v_jobs.last_run_time;
END IF;
END IF;
IF alert_code <> 1 AND v_jobs.job_status <> 'OK' THEN
alert_text := alert_text || '; ';
END IF;
END LOOP;
ELSE -- version less than 9.2 with old procpid column
FOR v_jobs IN
SELECT
job_name,
current_timestamp,
current_timestamp - end_time AS last_run_time,
CASE
WHEN (SELECT count(*) FROM @extschema@.job_check_log l WHERE job_name = job_check_config.job_name and l.alert_code = 3 ) > sensitivity THEN 'ERROR'
WHEN end_time < (current_timestamp - error_threshold) THEN 'ERROR'
WHEN (SELECT count(*) FROM @extschema@.job_check_log l WHERE job_name = job_check_config.job_name and l.alert_code = 2 ) > sensitivity THEN 'WARNING'
WHEN end_time < (current_timestamp - warn_threshold) THEN 'WARNING'
WHEN end_time IS NULL THEN 'ERROR'
ELSE 'OK'
END AS error_code,
CASE
WHEN status = v_alert_code_3 THEN 'CRITICAL'
WHEN status is null THEN 'MISSING'
WHEN (end_time < current_timestamp - error_threshold) OR (end_time < current_timestamp - warn_threshold) THEN
CASE
WHEN status = 'OK' THEN 'MISSING'
ELSE status
END
ELSE status
END AS job_status
FROM
@extschema@.job_check_config
LEFT JOIN (SELECT
job_name,
max(start_time) AS start_time,
max(end_time) AS end_time
FROM
@extschema@.job_log
WHERE
(end_time > now() - p_history OR end_time IS NULL)
GROUP BY
job_name
) last_job using (job_name)
LEFT JOIN (SELECT
job_name,
start_time,
coalesce(status,
(SELECT CASE WHEN (SELECT count(*) FROM pg_locks WHERE not granted and pid = m.pid) > 0 THEN 'BLOCKED' ELSE NULL END),
(SELECT CASE WHEN (SELECT count(*) FROM pg_stat_activity WHERE procpid = m.pid) > 0 THEN 'RUNNING' ELSE NULL END),
'FOOBAR') AS status
FROM
@extschema@.job_log m
WHERE
start_time > now() - p_history
) lj_status using (job_name,start_time)
WHERE active
LOOP
IF v_jobs.error_code = 'ERROR' THEN
alert_code := 3;
alert_text := alert_text || v_jobs.job_name || ': ' || coalesce(v_jobs.job_status,'null??');
END IF;
IF v_jobs.error_code = 'WARNING' THEN
IF alert_code <> 3 THEN
alert_code := 2;
END IF;
alert_text := alert_text || v_jobs.job_name || ': ' || coalesce(v_jobs.job_status,'null??');
END IF;
IF v_jobs.job_status = 'BLOCKED' THEN
alert_text := alert_text || ' - Object lock is blocking job completion';
ELSIF v_jobs.job_status = 'MISSING' THEN
IF v_jobs.last_run_time IS NULL THEN
alert_text := alert_text || ' - Last run over ' || p_history || ' ago. Check job_log for more details';
ELSE
alert_text := alert_text || ' - Last run at ' || current_timestamp - v_jobs.last_run_time;
END IF;
END IF;
IF alert_code <> 1 AND v_jobs.job_status <> 'OK' THEN
alert_text := alert_text || '; ';
END IF;
END LOOP;
END IF; -- end version check IF
IF alert_text = '(' THEN
alert_text := alert_text || 'All jobs run successfully';
END IF;
alert_text := alert_text || ')';
END
$$; | the_stack |
-- 2019-06-07T08:08:30.218
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,541791,541352,TO_TIMESTAMP('2019-06-07 08:08:29','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2019-06-07 08:08:29','YYYY-MM-DD HH24:MI:SS'),100,'main')
;
-- 2019-06-07T08:08:30.241
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_UI_Section_ID=541352 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2019-06-07T08:08:44.976
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,541730,541352,TO_TIMESTAMP('2019-06-07 08:08:44','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2019-06-07 08:08:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:08:53.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,541731,541352,TO_TIMESTAMP('2019-06-07 08:08:52','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2019-06-07 08:08:52','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:09:26.471
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,UIStyle,Updated,UpdatedBy) VALUES (0,0,541730,542602,TO_TIMESTAMP('2019-06-07 08:09:26','YYYY-MM-DD HH24:MI:SS'),100,'Y','default',10,'primary',TO_TIMESTAMP('2019-06-07 08:09:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:11:37.501
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580896,0,541791,542602,559601,'F',TO_TIMESTAMP('2019-06-07 08:11:37','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'IsDone',10,0,0,TO_TIMESTAMP('2019-06-07 08:11:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:16:16.002
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541731,542603,TO_TIMESTAMP('2019-06-07 08:16:15','YYYY-MM-DD HH24:MI:SS'),100,'Y','org',20,TO_TIMESTAMP('2019-06-07 08:16:15','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:16:57.055
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580884,0,541791,542603,559602,'F',TO_TIMESTAMP('2019-06-07 08:16:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Sektion',10,0,0,TO_TIMESTAMP('2019-06-07 08:16:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:17:06.926
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580882,0,541791,542603,559603,'F',TO_TIMESTAMP('2019-06-07 08:17:06','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Mandant',20,0,0,TO_TIMESTAMP('2019-06-07 08:17:06','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:19:11.292
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580885,0,541791,542602,559604,'F',TO_TIMESTAMP('2019-06-07 08:19:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'C_Invoice_ID',20,0,0,TO_TIMESTAMP('2019-06-07 08:19:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:20:53.971
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541730,542604,TO_TIMESTAMP('2019-06-07 08:20:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','rest',30,TO_TIMESTAMP('2019-06-07 08:20:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:21:30.814
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580890,0,541791,542604,559605,'F',TO_TIMESTAMP('2019-06-07 08:21:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Explanation',10,0,0,TO_TIMESTAMP('2019-06-07 08:21:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:22:15.993
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,541791,541353,TO_TIMESTAMP('2019-06-07 08:22:15','YYYY-MM-DD HH24:MI:SS'),100,'Y',20,TO_TIMESTAMP('2019-06-07 08:22:15','YYYY-MM-DD HH24:MI:SS'),100,'details')
;
-- 2019-06-07T08:22:15.996
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N') AND t.AD_UI_Section_ID=541353 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2019-06-07T08:22:29.966
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,541732,541353,TO_TIMESTAMP('2019-06-07 08:22:29','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2019-06-07 08:22:29','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:22:39.824
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541732,542605,TO_TIMESTAMP('2019-06-07 08:22:39','YYYY-MM-DD HH24:MI:SS'),100,'Y','rest',10,TO_TIMESTAMP('2019-06-07 08:22:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:22:53.870
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580890,0,541791,542605,559606,'F',TO_TIMESTAMP('2019-06-07 08:22:53','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Explanation',10,0,0,TO_TIMESTAMP('2019-06-07 08:22:53','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:25:33.640
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsMultiLine='Y', UIStyle='secondary',Updated=TO_TIMESTAMP('2019-06-07 08:25:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559606
;
-- 2019-06-07T08:25:45.449
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Section SET Value='rest',Updated=TO_TIMESTAMP('2019-06-07 08:25:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Section_ID=541353
;
-- 2019-06-07T08:26:01.939
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET MultiLine_LinesCount=5,Updated=TO_TIMESTAMP('2019-06-07 08:26:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559606
;
-- 2019-06-07T08:26:39.321
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsMultiLine='Y', MultiLine_LinesCount=5, UIStyle='secondary',Updated=TO_TIMESTAMP('2019-06-07 08:26:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559605
;
-- 2019-06-07T08:26:55.327
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580894,0,541791,542604,559607,'F',TO_TIMESTAMP('2019-06-07 08:26:55','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Reason',20,0,0,TO_TIMESTAMP('2019-06-07 08:26:55','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:27:10.289
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580894,0,541791,542605,559608,'F',TO_TIMESTAMP('2019-06-07 08:27:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Reason',20,0,0,TO_TIMESTAMP('2019-06-07 08:27:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:32:14.486
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsMultiLine='Y', MultiLine_LinesCount=3,Updated=TO_TIMESTAMP('2019-06-07 08:32:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559607
;
-- 2019-06-07T08:32:28.820
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsMultiLine='N',Updated=TO_TIMESTAMP('2019-06-07 08:32:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559607
;
-- 2019-06-07T08:32:46.039
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580888,0,541791,542604,559609,'F',TO_TIMESTAMP('2019-06-07 08:32:45','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Client',30,0,0,TO_TIMESTAMP('2019-06-07 08:32:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:33:13.136
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,Description,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580889,0,541791,542604,559610,'F',TO_TIMESTAMP('2019-06-07 08:33:12','YYYY-MM-DD HH24:MI:SS'),100,'','Y','N','N','Y','N','N','N',0,'Email',40,0,0,TO_TIMESTAMP('2019-06-07 08:33:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:33:37.729
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580891,0,541791,542604,559611,'F',TO_TIMESTAMP('2019-06-07 08:33:37','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'InvoiceNumber',50,0,0,TO_TIMESTAMP('2019-06-07 08:33:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:34:11.097
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580897,0,541791,542604,559612,'F',TO_TIMESTAMP('2019-06-07 08:34:10','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'InvoiceRecipient',60,0,0,TO_TIMESTAMP('2019-06-07 08:34:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:34:58.253
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580897,0,541791,542604,559613,'F',TO_TIMESTAMP('2019-06-07 08:34:58','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Invoice Recipient',70,0,0,TO_TIMESTAMP('2019-06-07 08:34:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:35:11.194
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580895,0,541791,542604,559614,'F',TO_TIMESTAMP('2019-06-07 08:35:11','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Phone',80,0,0,TO_TIMESTAMP('2019-06-07 08:35:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:35:25.688
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580893,0,541791,542604,559615,'F',TO_TIMESTAMP('2019-06-07 08:35:25','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Responsible Person',90,0,0,TO_TIMESTAMP('2019-06-07 08:35:25','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:35:38.844
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580892,0,541791,542604,559616,'F',TO_TIMESTAMP('2019-06-07 08:35:38','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Status',100,0,0,TO_TIMESTAMP('2019-06-07 08:35:38','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:36:41.655
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=559613
;
-- 2019-06-07T08:37:18.805
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580892,0,541791,542602,559617,'F',TO_TIMESTAMP('2019-06-07 08:37:18','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Status',30,0,0,TO_TIMESTAMP('2019-06-07 08:37:18','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:37:29.823
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=559616
;
-- 2019-06-07T08:52:09.882
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,0,541791,542604,559618,'F',TO_TIMESTAMP('2019-06-07 08:52:09','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Org',100,0,0,TO_TIMESTAMP('2019-06-07 08:52:09','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:53:31
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541731,542606,TO_TIMESTAMP('2019-06-07 08:53:30','YYYY-MM-DD HH24:MI:SS'),100,'Y','client;recipient; responsible',10,TO_TIMESTAMP('2019-06-07 08:53:30','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:54:24.668
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580888,0,541791,542606,559619,'F',TO_TIMESTAMP('2019-06-07 08:54:24','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Client',10,0,0,TO_TIMESTAMP('2019-06-07 08:54:24','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:54:44.799
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580897,0,541791,542606,559620,'F',TO_TIMESTAMP('2019-06-07 08:54:44','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Invoice Recipient',20,0,0,TO_TIMESTAMP('2019-06-07 08:54:44','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:55:29.450
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET SeqNo=30,Updated=TO_TIMESTAMP('2019-06-07 08:55:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=542603
;
-- 2019-06-07T08:55:34.479
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET Name='client;recipient',Updated=TO_TIMESTAMP('2019-06-07 08:55:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=542606
;
-- 2019-06-07T08:55:46.144
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,541731,542607,TO_TIMESTAMP('2019-06-07 08:55:45','YYYY-MM-DD HH24:MI:SS'),100,'Y','responsible',20,TO_TIMESTAMP('2019-06-07 08:55:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:56:03.917
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580893,0,541791,542607,559621,'F',TO_TIMESTAMP('2019-06-07 08:56:03','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Responsible Person',10,0,0,TO_TIMESTAMP('2019-06-07 08:56:03','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:56:13.884
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580895,0,541791,542607,559622,'F',TO_TIMESTAMP('2019-06-07 08:56:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Phone',20,0,0,TO_TIMESTAMP('2019-06-07 08:56:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:56:23.354
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,580889,0,541791,542607,559623,'F',TO_TIMESTAMP('2019-06-07 08:56:23','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',0,'Email',30,0,0,TO_TIMESTAMP('2019-06-07 08:56:23','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2019-06-07T08:57:05.457
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=559608
;
-- 2019-06-07T08:57:05.473
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=559606
;
-- 2019-06-07T08:57:05.486
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=542605
;
-- 2019-06-07T08:57:05.495
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Column WHERE AD_UI_Column_ID=541732
;
-- 2019-06-07T08:57:05.500
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Section_Trl WHERE AD_UI_Section_ID=541353
;
-- 2019-06-07T08:57:05.507
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Section WHERE AD_UI_Section_ID=541353
;
-- 2019-06-07T08:58:20.785
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsActive='N',Updated=TO_TIMESTAMP('2019-06-07 08:58:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559609
;
-- 2019-06-07T08:58:22.251
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsActive='N',Updated=TO_TIMESTAMP('2019-06-07 08:58:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559610
;
-- 2019-06-07T08:58:23.854
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsActive='N',Updated=TO_TIMESTAMP('2019-06-07 08:58:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559611
;
-- 2019-06-07T08:58:25.447
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsActive='N',Updated=TO_TIMESTAMP('2019-06-07 08:58:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559612
;
-- 2019-06-07T08:58:27.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsActive='N',Updated=TO_TIMESTAMP('2019-06-07 08:58:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559614
;
-- 2019-06-07T08:58:29.053
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsActive='N',Updated=TO_TIMESTAMP('2019-06-07 08:58:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=559615
;
-- 2019-06-07T08:58:41.856
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=559618
; | the_stack |
-- 2021-03-15T13:57:51.936Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET PrintName='Alberta-Artikeldaten',Updated=TO_TIMESTAMP('2021-03-15 14:57:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='de_CH'
;
-- 2021-03-15T13:57:51.957Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'de_CH')
;
-- 2021-03-15T13:58:06.259Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', PrintName='Alberta-Artikeldaten',Updated=TO_TIMESTAMP('2021-03-15 14:58:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='de_DE'
;
-- 2021-03-15T13:58:06.263Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'de_DE')
;
-- 2021-03-15T13:58:06.301Z
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(578816,'de_DE')
;
-- 2021-03-15T13:58:06.302Z
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Alberta-Artikeldaten', Name='M_Product_AlbertaArticle' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=578816)
;
-- 2021-03-15T13:58:23.525Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET PrintName='Alberta article data',Updated=TO_TIMESTAMP('2021-03-15 14:58:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='en_US'
;
-- 2021-03-15T13:58:23.529Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'en_US')
;
-- 2021-03-15T13:58:26.428Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-03-15 14:58:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='en_US'
;
-- 2021-03-15T13:58:26.429Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'en_US')
;
-- 2021-03-15T13:58:43.779Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET PrintName='Alberta-Artikeldaten',Updated=TO_TIMESTAMP('2021-03-15 14:58:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='nl_NL'
;
-- 2021-03-15T13:58:43.783Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'nl_NL')
;
-- 2021-03-15T14:04:52.899Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Alberta-Artikeldaten',Updated=TO_TIMESTAMP('2021-03-15 15:04:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='de_CH'
;
-- 2021-03-15T14:04:52.903Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'de_CH')
;
-- 2021-03-15T14:05:00.964Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Alberta-Artikeldaten',Updated=TO_TIMESTAMP('2021-03-15 15:05:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='de_DE'
;
-- 2021-03-15T14:05:00.968Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'de_DE')
;
-- 2021-03-15T14:05:00.994Z
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(578816,'de_DE')
;
-- 2021-03-15T14:05:00.996Z
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='M_Product_AlbertaArticle_ID', Name='Alberta-Artikeldaten', Description=NULL, Help=NULL WHERE AD_Element_ID=578816
;
-- 2021-03-15T14:05:00.999Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='M_Product_AlbertaArticle_ID', Name='Alberta-Artikeldaten', Description=NULL, Help=NULL, AD_Element_ID=578816 WHERE UPPER(ColumnName)='M_PRODUCT_ALBERTAARTICLE_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-03-15T14:05:01.001Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='M_Product_AlbertaArticle_ID', Name='Alberta-Artikeldaten', Description=NULL, Help=NULL WHERE AD_Element_ID=578816 AND IsCentrallyMaintained='Y'
;
-- 2021-03-15T14:05:01.002Z
-- URL zum Konzept
UPDATE AD_Field SET Name='Alberta-Artikeldaten', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=578816) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 578816)
;
-- 2021-03-15T14:05:01.028Z
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Alberta-Artikeldaten', Name='Alberta-Artikeldaten' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=578816)
;
-- 2021-03-15T14:05:01.029Z
-- URL zum Konzept
UPDATE AD_Tab SET Name='Alberta-Artikeldaten', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 578816
;
-- 2021-03-15T14:05:01.031Z
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Alberta-Artikeldaten', Description=NULL, Help=NULL WHERE AD_Element_ID = 578816
;
-- 2021-03-15T14:05:01.031Z
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Alberta-Artikeldaten', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 578816
;
-- 2021-03-15T14:05:09.094Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Alberta article data',Updated=TO_TIMESTAMP('2021-03-15 15:05:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='en_US'
;
-- 2021-03-15T14:05:09.096Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'en_US')
;
-- 2021-03-15T14:05:21.238Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Alberta-Artikeldaten',Updated=TO_TIMESTAMP('2021-03-15 15:05:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578816 AND AD_Language='nl_NL'
;
-- 2021-03-15T14:05:21.241Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578816,'nl_NL')
;
-- 2021-03-15T14:06:52.558Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Alberta-Therapien', PrintName='Alberta-Therapien',Updated=TO_TIMESTAMP('2021-03-15 15:06:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578829 AND AD_Language='nl_NL'
;
-- 2021-03-15T14:06:52.561Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578829,'nl_NL')
;
-- 2021-03-15T14:07:03.508Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Alberta-Therapien', PrintName='Alberta-Therapien',Updated=TO_TIMESTAMP('2021-03-15 15:07:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578829 AND AD_Language='de_DE'
;
-- 2021-03-15T14:07:03.511Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578829,'de_DE')
;
-- 2021-03-15T14:07:03.520Z
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(578829,'de_DE')
;
-- 2021-03-15T14:07:03.520Z
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='M_Product_AlbertaTherapy_ID', Name='Alberta-Therapien', Description=NULL, Help=NULL WHERE AD_Element_ID=578829
;
-- 2021-03-15T14:07:03.521Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='M_Product_AlbertaTherapy_ID', Name='Alberta-Therapien', Description=NULL, Help=NULL, AD_Element_ID=578829 WHERE UPPER(ColumnName)='M_PRODUCT_ALBERTATHERAPY_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-03-15T14:07:03.521Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='M_Product_AlbertaTherapy_ID', Name='Alberta-Therapien', Description=NULL, Help=NULL WHERE AD_Element_ID=578829 AND IsCentrallyMaintained='Y'
;
-- 2021-03-15T14:07:03.521Z
-- URL zum Konzept
UPDATE AD_Field SET Name='Alberta-Therapien', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=578829) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 578829)
;
-- 2021-03-15T14:07:03.531Z
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Alberta-Therapien', Name='Alberta-Therapien' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=578829)
;
-- 2021-03-15T14:07:03.532Z
-- URL zum Konzept
UPDATE AD_Tab SET Name='Alberta-Therapien', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 578829
;
-- 2021-03-15T14:07:03.533Z
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Alberta-Therapien', Description=NULL, Help=NULL WHERE AD_Element_ID = 578829
;
-- 2021-03-15T14:07:03.533Z
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Alberta-Therapien', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 578829
;
-- 2021-03-15T14:07:10.635Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Alberta-Therapien', PrintName='Alberta-Therapien',Updated=TO_TIMESTAMP('2021-03-15 15:07:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578829 AND AD_Language='de_CH'
;
-- 2021-03-15T14:07:10.638Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578829,'de_CH')
;
-- 2021-03-15T14:07:41.259Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Alberta therapies', PrintName='Alberta therapies',Updated=TO_TIMESTAMP('2021-03-15 15:07:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578829 AND AD_Language='en_US'
;
-- 2021-03-15T14:07:41.260Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578829,'en_US')
;
-- 2021-03-15T14:08:22.671Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Billable Alberta therapies', PrintName='Billable Alberta therapies',Updated=TO_TIMESTAMP('2021-03-15 15:08:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578831 AND AD_Language='en_US'
;
-- 2021-03-15T14:08:22.674Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578831,'en_US')
;
-- 2021-03-15T14:09:00.580Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Abrechenbare Alberta-Therapien', PrintName='Abrechenbare Alberta-Therapien',Updated=TO_TIMESTAMP('2021-03-15 15:09:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578831 AND AD_Language='nl_NL'
;
-- 2021-03-15T14:09:00.580Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578831,'nl_NL')
;
-- 2021-03-15T14:09:12.367Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Abrechenbare Alberta-Therapien', PrintName='Abrechenbare Alberta-Therapien',Updated=TO_TIMESTAMP('2021-03-15 15:09:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578831 AND AD_Language='de_DE'
;
-- 2021-03-15T14:09:12.368Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578831,'de_DE')
;
-- 2021-03-15T14:09:12.372Z
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(578831,'de_DE')
;
-- 2021-03-15T14:09:12.373Z
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='M_Product_AlbertaBillableTherapy_ID', Name='Abrechenbare Alberta-Therapien', Description=NULL, Help=NULL WHERE AD_Element_ID=578831
;
-- 2021-03-15T14:09:12.373Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='M_Product_AlbertaBillableTherapy_ID', Name='Abrechenbare Alberta-Therapien', Description=NULL, Help=NULL, AD_Element_ID=578831 WHERE UPPER(ColumnName)='M_PRODUCT_ALBERTABILLABLETHERAPY_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-03-15T14:09:12.374Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='M_Product_AlbertaBillableTherapy_ID', Name='Abrechenbare Alberta-Therapien', Description=NULL, Help=NULL WHERE AD_Element_ID=578831 AND IsCentrallyMaintained='Y'
;
-- 2021-03-15T14:09:12.374Z
-- URL zum Konzept
UPDATE AD_Field SET Name='Abrechenbare Alberta-Therapien', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=578831) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 578831)
;
-- 2021-03-15T14:09:12.384Z
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Abrechenbare Alberta-Therapien', Name='Abrechenbare Alberta-Therapien' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=578831)
;
-- 2021-03-15T14:09:12.384Z
-- URL zum Konzept
UPDATE AD_Tab SET Name='Abrechenbare Alberta-Therapien', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 578831
;
-- 2021-03-15T14:09:12.385Z
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Abrechenbare Alberta-Therapien', Description=NULL, Help=NULL WHERE AD_Element_ID = 578831
;
-- 2021-03-15T14:09:12.386Z
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Abrechenbare Alberta-Therapien', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 578831
;
-- 2021-03-15T14:09:23.127Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Abrechenbare Alberta-Therapien', PrintName='Abrechenbare Alberta-Therapien',Updated=TO_TIMESTAMP('2021-03-15 15:09:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578831 AND AD_Language='de_CH'
;
-- 2021-03-15T14:09:23.128Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578831,'de_CH')
;
-- 2021-03-15T14:11:34.615Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Abrechenbare Alberta-Therapien', PrintName='Abrechenbare Alberta-Therapien',Updated=TO_TIMESTAMP('2021-03-15 15:11:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578825 AND AD_Language='de_CH'
;
-- 2021-03-15T14:11:34.617Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578825,'de_CH')
;
-- 2021-03-15T14:12:24.152Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Alberta-Verpackungseinheiten', PrintName='Alberta-Verpackungseinheiten',Updated=TO_TIMESTAMP('2021-03-15 15:12:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578825 AND AD_Language='de_DE'
;
-- 2021-03-15T14:12:24.154Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578825,'de_DE')
;
-- 2021-03-15T14:12:24.163Z
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(578825,'de_DE')
;
-- 2021-03-15T14:12:24.164Z
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='M_Product_AlbertaPackagingUnit_ID', Name='Alberta-Verpackungseinheiten', Description=NULL, Help=NULL WHERE AD_Element_ID=578825
;
-- 2021-03-15T14:12:24.164Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='M_Product_AlbertaPackagingUnit_ID', Name='Alberta-Verpackungseinheiten', Description=NULL, Help=NULL, AD_Element_ID=578825 WHERE UPPER(ColumnName)='M_PRODUCT_ALBERTAPACKAGINGUNIT_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-03-15T14:12:24.165Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='M_Product_AlbertaPackagingUnit_ID', Name='Alberta-Verpackungseinheiten', Description=NULL, Help=NULL WHERE AD_Element_ID=578825 AND IsCentrallyMaintained='Y'
;
-- 2021-03-15T14:12:24.165Z
-- URL zum Konzept
UPDATE AD_Field SET Name='Alberta-Verpackungseinheiten', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=578825) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 578825)
;
-- 2021-03-15T14:12:24.175Z
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Alberta-Verpackungseinheiten', Name='Alberta-Verpackungseinheiten' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=578825)
;
-- 2021-03-15T14:12:24.175Z
-- URL zum Konzept
UPDATE AD_Tab SET Name='Alberta-Verpackungseinheiten', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 578825
;
-- 2021-03-15T14:12:24.176Z
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Alberta-Verpackungseinheiten', Description=NULL, Help=NULL WHERE AD_Element_ID = 578825
;
-- 2021-03-15T14:12:24.176Z
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Alberta-Verpackungseinheiten', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 578825
;
-- 2021-03-15T14:12:31.448Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Alberta-Verpackungseinheiten', PrintName='Alberta-Verpackungseinheiten',Updated=TO_TIMESTAMP('2021-03-15 15:12:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578825 AND AD_Language='de_CH'
;
-- 2021-03-15T14:12:31.448Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578825,'de_CH')
;
-- 2021-03-15T14:12:40.862Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Alberta-Verpackungseinheiten', PrintName='Alberta-Verpackungseinheiten',Updated=TO_TIMESTAMP('2021-03-15 15:12:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578825 AND AD_Language='nl_NL'
;
-- 2021-03-15T14:12:40.864Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578825,'nl_NL')
;
-- 2021-03-15T14:13:19.694Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Alberta packaging units', PrintName='Alberta packaging units',Updated=TO_TIMESTAMP('2021-03-15 15:13:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=578825 AND AD_Language='en_US'
;
-- 2021-03-15T14:13:19.697Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(578825,'en_US')
;
-- 2021-03-15T14:20:37.908Z
-- URL zum Konzept
UPDATE AD_UI_Element SET Name='Therapy1',Updated=TO_TIMESTAMP('2021-03-15 15:20:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=579773
;
-- 2021-03-15T14:21:20.600Z
-- URL zum Konzept
UPDATE AD_UI_Element SET Name='Therapy',Updated=TO_TIMESTAMP('2021-03-15 15:21:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=579773
;
-- 2021-03-15T14:36:56.505Z
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='Y', Name='Therapie',Updated=TO_TIMESTAMP('2021-03-15 15:36:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Reference_ID=541282
;
-- 2021-03-15T14:37:03.808Z
-- URL zum Konzept
UPDATE AD_Reference_Trl SET Name='Therapie',Updated=TO_TIMESTAMP('2021-03-15 15:37:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Reference_ID=541282
;
-- 2021-03-15T14:37:09.925Z
-- URL zum Konzept
UPDATE AD_Reference_Trl SET Name='Therapie',Updated=TO_TIMESTAMP('2021-03-15 15:37:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Reference_ID=541282
;
-- 2021-03-15T14:44:57.375Z
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-03-15 15:44:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Reference_ID=541282
;
-- 2021-03-15T14:52:22.136Z
-- URL zum Konzept
UPDATE AD_UI_Element SET Name='M_Product_AlbertaTherapy',Updated=TO_TIMESTAMP('2021-03-15 15:52:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=579773
;
-- 2021-03-15T14:52:53.319Z
-- URL zum Konzept
UPDATE AD_UI_Element SET Name='Therapy',Updated=TO_TIMESTAMP('2021-03-15 15:52:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=579773
; | the_stack |
-----------------------------------------------------------------------------
-- (c) Copyright IBM Corp. 2007 All rights reserved.
--
-- The following sample of source code ("Sample") is owned by International
-- Business Machines Corporation or one of its subsidiaries ("IBM") and is
-- copyrighted and licensed, not sold. You may use, copy, modify, and
-- distribute the Sample in any form without payment to IBM, for the purpose of
-- assisting you in the development of your applications.
--
-- The Sample code is provided to you on an "AS IS" basis, without warranty of
-- any kind. IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR
-- IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Some jurisdictions do
-- not allow for the exclusion or limitation of implied warranties, so the above
-- limitations or exclusions may not apply to you. IBM shall not be liable for
-- any damages you suffer as a result of using, copying, modifying or
-- distributing the Sample, even if IBM has been advised of the possibility of
-- such damages.
-----------------------------------------------------------------------------
--
-- SAMPLE FILE NAME: xmltrig.db2
--
-- PURPOSE: This sample shows how triggers are used to enforce automatic
-- validation while inserting/updating xml documents.
--
-- USAGE SCENARIO: When a customer places a purchase order request an entry
-- is made in the "customer" table by inserting customer
-- information and his history details. If the customer is
-- new, and is placing a request for the first time to this
-- supplier,then the history column in the "customer" table
-- wil be NULL. If he's an old customer, data in "customer"
-- table info and history columns are inserted.
--
-- PREREQUISITE:
-- On Unix: copy boots.xsd file from <install_path>/sqllib
-- /samples/xml/data directory to current directory.
-- On Windows: copy boots.xsd from <install_path>\sqllib\
-- samples\xml\data directory to current directory
--
-- EXECUTION: db2 -td@ -vf xmltrig.db2
--
-- INPUTS: NONE
--
-- OUTPUTS: The last trigger statement which uses XMLELEMENT on transition
-- variable will fail. All other trigger statements will succeed.
--
-- OUTPUT FILE: xmltrig.out (available in the online documentation)
--
-- SQL STATEMENTS USED:
-- CREATE TRIGGER
-- INSERT
-- DELETE
-- DROP
-- REGISTER XMLSCHEMA
-- COMPLETE XMLSCHEMA
--
-- SQL/XML FUNCTIONS USED:
-- XMLDOCUMENT
-- XMLPARSE
-- XMLVALIDATE
-- XMLELEMENT
--
--
-----------------------------------------------------------------------------
-- For more information about the command line processor (CLP) scripts,
-- see the README file.
--
-- For information on using SQL statements, see the SQL Reference.
--
-- For the latest information on programming, building, and running DB2
-- applications, visit the DB2 application development website:
-- http://www.software.ibm.com/data/db2/udb/ad
--
-----------------------------------------------------------------------------
-- SAMPLE DESCRIPTION
--
-----------------------------------------------------------------------------
-- 1. Register boots.xsd schema with http://posample1.org namespace.
--
-- 2. This sample consists of four different cases of create trigger
-- statements to show automatic validation of xml documents with
-- triggers.
--
-- Case1: This first trigger statement shows how to assign values to
-- non-xml transition variables, how to validate XML documents and
-- also to show that NULL values can be assigned to XML transition
-- variables in triggers.
--
-- Case2: Create a BEFORE INSERT trigger to validate info column in
-- "customer" table and insert a value for history column without
-- any validation
--
-- Case3: Create a BEFORE UPDATE trigger with ACCORDING TO clause used
-- with WHEN clause.This trigger statement shows that only when WHEN
-- condition is satisfied, the action part of the trigger will be
-- executed.WHEN conditions are used with BEFORE UPDATE triggers.
--
-- Case4: Create a BEFORE INSERT trigger with XMLELEMENT function being
-- used on a transition variable. This case results in a failure as only
-- XMLVALIDATE function is allowed on XML transition variables.
--
-- NOTE : In a typical in real-time scenario, DBAs will create triggers
-- and users will insert records using one or more insert/update statements
-- not just one insert statement as shown in this sample.
-----------------------------------------------------------------------------
-- SETUP
-----------------------------------------------------------------------------
-- Connect to sample database
CONNECT TO sample@
--
-- Register boots schema
REGISTER XMLSCHEMA http://posample1.org FROM boots.xsd AS boots@
COMPLETE XMLSCHEMA boots@
-----------------------------------------------------------------------------
--
-- Case1: This first trigger statement shows how to assign values to
-- non-xml transition variables, how to validate XML documents and
-- also to show that NULL values can be assigned to XML transition
-- variables in triggers.
--
-----------------------------------------------------------------------------
CREATE TRIGGER TR1 NO CASCADE BEFORE INSERT ON customer
REFERENCING NEW AS n
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC
set n.Cid = 5000;
set n.info = xmlvalidate (n.info ACCORDING TO XMLSCHEMA ID customer);
set n.history = NULL;
END@
-- Insert values into "customer" table
INSERT INTO customer VALUES (1008,
'<customerinfo Cid="1008"><name>
Larry Menard</name><addr country="Canada"><street>223 Koramangala
ring Road</street><city>Toronto</city><prov-state>Ontario
</prov-state><pcode-zip>M4C 5K8</pcode-zip></addr>
<phone type="work">905-555-9146</phone><phone type="home">
416-555-6121</phone><assistant><name>Goose Defender</name>
<phone type="home">416-555-1943</phone></assistant>
</customerinfo>', NULL)@
-- Display the inserted info from "customer" table
SELECT Cid, info FROM customer
WHERE Cid = 5000@
-- DROP trigger TR1
DROP TRIGGER TR1@
-----------------------------------------------------------------------------
--
-- Case2: Create a BEFORE INSERT trigger to validate info column in
-- "customer" table and insert a value for history column without
-- any validation
--
-----------------------------------------------------------------------------
CREATE TRIGGER TR1 NO CASCADE BEFORE INSERT ON customer
REFERENCING NEW AS n
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC
set n.Cid =5001;
set n.info = xmlvalidate(n.info ACCORDING TO XMLSCHEMA ID customer);
set n.history = '<customerinfo Cid="1009">
<name>madhavi</name></customerinfo>';
END@
-- INSERT row into "customer" table
INSERT INTO customer VALUES (1009,
' <customerinfo Cid="1009"><name>
Larry Menard</name><addr country="Canada"><street>
223 Koramangala ring Road</street><city>Toronto</city>
<prov-state>Ontario</prov-state><pcode-zip>M4C 5K8</pcode-zip>
</addr><phone type="work">905-555-9146</phone>
<phone type="home">416-555-6121</phone><assistant><name>
Madhavi Kaza</name><phone type="home">416-555-1943
</phone></assistant></customerinfo>', NULL)@
-- Display inserted info from "customer" table
SELECT Cid, info, history
FROM customer
WHERE Cid = 5001@
-----------------------------------------------------------------------------
--
-- Case3: Create a BEFORE UPDATE trigger with ACCORDING TO clause used
-- with WHEN clause.This trigger statement shows that only when WHEN
-- condition is satisfied, the action part of the trigger will be
-- executed.WHEN conditions are used with BEFORE UPDATE triggers.
--
-----------------------------------------------------------------------------
CREATE TRIGGER TR2 NO CASCADE BEFORE UPDATE ON customer
REFERENCING NEW AS n
FOR EACH ROW MODE DB2SQL
WHEN (n.info is not validated ACCORDING TO XMLSCHEMA ID CUSTOMER)
BEGIN ATOMIC
set n.Cid = 5002;
set n.info = xmlvalidate(n.info ACCORDING TO XMLSCHEMA ID customer);
set n.history = '<customerinfo Cid="1010">
<name>sum Lata</name></customerinfo>';
END@
-- UPDATE the 'info' column value in the "customer" table whose Cid is 5001
UPDATE CUSTOMER SET customer.info = XMLPARSE(document
'<customerinfo Cid="1012">
<name>Russel</name><addr country="India"><street>
Koramangala ring Road</street><city>Bangalore</city>
<prov-state>Karnataka</prov-state><pcode-zip>M4C 5K9
</pcode-zip></addr><phone type="work">995-545-9142</phone>
<phone type="home">476-552-6421</phone><assistant><name>
Madhavi Kaza</name><phone type="home">415-595-1243</phone>
</assistant></customerinfo>' preserve whitespace)
WHERE Cid=5001@
-- Display updated data from "customer" table
SELECT Cid, info, history
FROM customer
WHERE Cid = 5002@
-- DROP TRIGGERS TR1 and TR2
DROP TRIGGER TR1@
DROP TRIGGER TR2@
-----------------------------------------------------------------------------
--
-- Case4: Create a BEFORE INSERT trigger with XMLELEMENT function being
-- used on a transition variable. This case results in a failure as only
-- XMLVALIDATE function is allowed on transition variables.
--
-----------------------------------------------------------------------------
-- Create table "boots"
CREATE TABLE boots (Cid int, xmldoc1 XML, xmldoc2 XML)@
-- Trigger creation itself fails as XMLELEMENT is not allowed on
-- transition variable
CREATE TRIGGER TR1 NO CASCADE BEFORE INSERT ON boots
REFERENCING NEW as n
FOR EACH ROW MODE DB2SQL
BEGIN ATOMIC
set n.Cid=5004;
set n.xmldoc1 = XMLVALIDATE(xmldoc1 ACCORDING TO XMLSCHEMA URI
'http://posample1.org');
set n.xmldoc2 = XMLDOCUMENT(XMLELEMENT(name adidas, n.xmldoc2));
END@
-----------------------------------------------------------------------------
--
-- CLEANUP
--
-----------------------------------------------------------------------------
-- Delete all rows inserted from this sample
DELETE FROM CUSTOMER
WHERE Cid > 1005@
-- Drop table boots
DROP TABLE boots@
-- Drop schema
DROP XSROBJECT BOOTS@ | the_stack |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- 主机: localhost
-- 生成日期: 2019-03-09 11:23:26
-- 服务器版本: 5.7.18
-- PHP 版本: 7.1.23
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 */;
--
-- 数据库: `bytedesk`
--
-- --------------------------------------------------------
--
-- 表的结构 `answer`
--
CREATE TABLE `answer` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`answer` varchar(255) DEFAULT NULL,
`code` varchar(255) DEFAULT NULL,
`media_id` varchar(255) DEFAULT NULL,
`question` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`weixin_url` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`workgroup_id` bigint(20) DEFAULT NULL,
`is_related` bit(1) DEFAULT NULL,
`query_count` int(11) DEFAULT NULL,
`rate_helpful` int(11) DEFAULT NULL,
`rate_useless` int(11) DEFAULT NULL,
`aid` varchar(255) NOT NULL,
`is_welcome` tinyint(1) DEFAULT '0',
`is_recommend` tinyint(1) DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `answer_category`
--
CREATE TABLE `answer_category` (
`answer_id` bigint(20) NOT NULL,
`category_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `answer_query`
--
CREATE TABLE `answer_query` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`answer_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `answer_rate`
--
CREATE TABLE `answer_rate` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`answer_id` bigint(20) NOT NULL,
`message_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL,
`helpful` bit(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `answer_related`
--
CREATE TABLE `answer_related` (
`answer_id` bigint(20) NOT NULL,
`related_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `app`
--
CREATE TABLE `app` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`avatar` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`app_key` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`status` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`aid` varchar(255) NOT NULL,
`is_default` tinyint(1) DEFAULT '0',
`platform` varchar(255) DEFAULT NULL,
`tip` varchar(255) DEFAULT NULL,
`app_version` varchar(255) DEFAULT NULL,
`pem_password` varchar(255) DEFAULT NULL,
`pem_path` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `app`
--
INSERT INTO `app` (`id`, `created_at`, `updated_at`, `avatar`, `description`, `app_key`, `name`, `url`, `users_id`, `status`, `by_type`, `aid`, `is_default`, `platform`, `tip`, `app_version`, `pem_password`, `pem_path`) VALUES
(826123, '2018-12-30 20:04:00', '2018-12-30 20:04:00', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/chrome_default_avatar.png', '默认网站', NULL, '默认网站', 'www.bytedesk.com', 826122, 'debug', 'web', '201812302003591', 1, NULL, NULL, NULL, NULL, NULL),
(826780, '2019-01-01 15:24:47', '2019-01-01 15:24:47', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/chrome_default_avatar.png', 'ddddd', '201901011524462', '1234', 'dddd.com', 15, 'debug', 'web', '201901011524461', 0, NULL, NULL, NULL, NULL, NULL),
(826787, '2019-01-01 15:37:51', '2019-01-11 21:58:59', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/apple_default_avatar.png', '安卓版', '201901011537502', '萝卜丝', 'bytedesk.com', 15, 'release', 'app', '201901011537501', 0, 'android', '修复已知bug', '1.1', NULL, NULL),
(834087, '2019-01-09 22:41:40', '2019-01-09 22:41:40', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/chrome_default_avatar.png', '默认网站', NULL, '默认网站', 'www.bytedesk.com', 834086, 'debug', 'web', '201901092241393', 1, NULL, NULL, NULL, NULL, NULL),
(834468, '2019-01-11 21:26:27', '2019-01-11 21:57:57', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/apple_default_avatar.png', '苹果版', '201901112126262', '萝卜丝', 'bytedesk.com', 15, 'release', 'app', '201901112126261', 0, 'ios', '修复已知bug', '1.1', NULL, NULL),
(839321, '2019-01-24 03:12:27', '2019-01-24 03:12:27', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/chrome_default_avatar.png', '默认网站', NULL, '默认网站', 'www.bytedesk.com', 839320, 'debug', 'web', '201901241712253', 1, NULL, NULL, NULL, NULL, NULL),
(839335, '2019-01-24 03:23:50', '2019-01-24 03:23:50', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/chrome_default_avatar.png', '默认网站', NULL, '默认网站', 'www.bytedesk.com', 839334, 'debug', 'web', '201901241723501', 1, NULL, NULL, NULL, NULL, NULL),
(854808, '2019-03-04 18:20:19', '2019-03-04 18:20:19', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/chrome_default_avatar.png', '默认网站', NULL, '默认网站', 'www.bytedesk.com', 854807, 'debug', 'web', '201903050820183', 1, NULL, NULL, NULL, NULL, NULL);
-- --------------------------------------------------------
--
-- 表的结构 `article`
--
CREATE TABLE `article` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`content` longtext,
`rate_helpful` int(11) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`title` varchar(255) DEFAULT NULL,
`read_count` int(11) DEFAULT NULL,
`aid` varchar(255) NOT NULL,
`is_recommend` bit(1) DEFAULT NULL,
`rate_useless` int(11) DEFAULT NULL,
`summary` varchar(255) DEFAULT NULL,
`is_top` bit(1) DEFAULT NULL,
`is_published` bit(1) DEFAULT NULL,
`is_reship` bit(1) DEFAULT NULL,
`reship_url` varchar(255) DEFAULT NULL,
`is_markdown` tinyint(1) DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
--
-- 表的结构 `article_category`
--
CREATE TABLE `article_category` (
`article_id` bigint(20) NOT NULL,
`category_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `article_keyword`
--
CREATE TABLE `article_keyword` (
`article_id` bigint(20) NOT NULL,
`tag_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `article_rate`
--
CREATE TABLE `article_rate` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`helpful` bit(1) DEFAULT NULL,
`article_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `article_read`
--
CREATE TABLE `article_read` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`article_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `authority`
--
CREATE TABLE `authority` (
`id` bigint(20) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`value` varchar(255) DEFAULT NULL,
`descriptions` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `authority`
--
INSERT INTO `authority` (`id`, `name`, `value`, `descriptions`, `by_type`) VALUES
(1, '当前会话', 'thread', '人工客服-当前会话', 'workgroup'),
(2, '会话监控', 'monitor', '人工客服-监控组内所有会话', 'workgroup'),
(3, '质量检查', 'quality', '人工客服-Quality Assurance(QA) 质量检查', 'workgroup'),
(4, '客服管理', 'admin', '人工客服-客服账号CRUD增删改查', 'workgroup'),
(5, '我的首页', 'home', '我的首页', 'workgroup'),
(6, '绩效数据', 'statistic', '绩效数据', 'workgroup'),
(7, '人工客服', 'chat', '人工客服', 'workgroup'),
(8, '智能客服', 'robot', '智能客服', 'workgroup'),
(9, '帮助中心', 'support', '帮助中心', 'workgroup'),
(10, '所有设置', 'setting', '所有设置', 'platform'),
(11, '意见反馈', 'feedback', '意见反馈', 'workgroup'),
(12, '工单系统', 'workorder', '工单系统', 'workgroup'),
(13, '呼叫中心', 'callcenter', '呼叫中心', 'workgroup'),
(14, '客户管理', 'crm', '客户管理', 'workgroup'),
(15, '调查问卷', 'wenjuan', '调查问卷', 'workgroup'),
(16, '内部协同', 'internal', '内部协同', 'workgroup'),
(17, '当前访客', 'visitor', '人工客服-当前访客', 'workgroup'),
(18, '历史记录', 'history', '人工客服-历史记录', 'workgroup');
-- --------------------------------------------------------
--
-- 表的结构 `block`
--
CREATE TABLE `block` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`bid` varchar(255) CHARACTER SET utf8 NOT NULL,
`note` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`blocked_user_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) DEFAULT NULL,
`by_type` varchar(255) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `browse`
--
CREATE TABLE `browse` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`workgroup_id` bigint(20) NOT NULL,
`visitor_id` bigint(20) NOT NULL,
`session_id` varchar(255) DEFAULT NULL,
`referrer_id` bigint(20) DEFAULT NULL,
`url_id` bigint(20) DEFAULT NULL,
`bid` varchar(255) NOT NULL,
`actioned` varchar(255) DEFAULT NULL,
`actioned_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `browse_invite`
--
CREATE TABLE `browse_invite` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`is_accepted` tinyint(1) DEFAULT '0',
`actioned_at` datetime DEFAULT NULL,
`b_iid` varchar(255) NOT NULL,
`from_client` varchar(255) DEFAULT NULL,
`to_client` varchar(255) DEFAULT NULL,
`from_user_id` bigint(20) DEFAULT NULL,
`to_user_id` bigint(20) DEFAULT NULL,
`workgroup_id` bigint(20) NOT NULL,
`browse_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `category`
--
CREATE TABLE `category` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`category_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`cid` varchar(255) NOT NULL,
`by_type` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `comments`
--
CREATE TABLE `comments` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`cid` varchar(255) NOT NULL,
`content` varchar(255) DEFAULT NULL,
`article_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`post_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `company`
--
CREATE TABLE `company` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`avatar` varchar(255) DEFAULT NULL,
`cid` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `company_region`
--
CREATE TABLE `company_region` (
`company_id` bigint(20) NOT NULL,
`region_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `country`
--
CREATE TABLE `country` (
`id` bigint(20) NOT NULL,
`cid` varchar(255) NOT NULL,
`name` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `customer`
--
CREATE TABLE `customer` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`cid` varchar(255) NOT NULL,
`company` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`mobile` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `cuw`
--
CREATE TABLE `cuw` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`content` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`count` int(11) DEFAULT NULL,
`cid` varchar(255) NOT NULL,
`category_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `cuw`
--
INSERT INTO `cuw` (`id`, `created_at`, `updated_at`, `content`, `name`, `users_id`, `count`, `cid`, `category_id`) VALUES
(6, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '您好,有什么可以帮您的?', '您好,有什么可以帮您的?', 19, 0, '201809291650494', 213679),
(7, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '您想了解哪方面呢?', '您想了解哪方面呢?', 19, 0, '201809291650495', 213679),
(8, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '上午好,很高兴问你服务', '上午好,很高兴问你服务', 19, 0, '201809291650496', 213679),
(9, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '欢迎光临,有什么可以为您效劳?', '欢迎光临,有什么可以为您效劳?', 19, 0, '201809291650497', 213679),
(10, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '请问怎么称呼您?', '请问怎么称呼您?', 19, 0, '201809291650498', 213679),
(11, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '方便的话请您提供一下您的联系电话,我电话给您沟通一下,这样更加直观', '方便的话请您提供一下您的联系电话,我电话给您沟通一下,这样更加直观', 19, 0, '201809291650499', 188000),
(12, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '您常用的QQ是多少呢?我加您一下,方便我们及时联系', '您常用的QQ是多少呢?我加您一下,方便我们及时联系', 19, 0, '201809291650411', 188000),
(13, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '请提供一下您的邮箱,我马上准备发送您所需要的资料', '请提供一下您的邮箱,我马上准备发送您所需要的资料', 19, 0, '201809291650412', 188000),
(14, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '感谢光临,欢迎再来', '感谢光临,欢迎再来', 19, 0, '201809291650413', 213681),
(15, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '抱歉让您久等了', '抱歉让您久等了', 19, 0, '201809291650414', 213680),
(16, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '祝您一天都有快乐的心情噢', '祝您一天都有快乐的心情噢', 19, 0, '201809291650415', 188001),
(17, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '您先休息下,我正在努力查询中…o(∩_∩)o', '您先休息下,我正在努力查询中…o(∩_∩)o', 19, 0, '201809291650416', 213680),
(18, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '欢迎您常来!祝您好心情!', '欢迎您常来!祝您好心情!', 19, 0, '201809291650417', 213681),
(19, '2017-09-26 16:00:00', '2017-09-26 16:00:00', '您的满意一直是我们的目标,如果有任何疑问欢迎您随时联系', '您的满意一直是我们的目标,如果有任何疑问欢迎您随时联系', 19, 0, '201809291650418', 213681),
(214746, '2018-09-30 13:30:48', '2018-09-30 13:30:48', '常用语1内容', '常用语1', 15, 0, '201809301330471', 214592),
(214748, '2018-09-30 13:31:12', '2018-09-30 17:48:33', '常用语3内容', '常用语3', 15, 0, '201809301331111', 214603),
(214749, '2018-09-30 13:31:24', '2018-09-30 17:24:20', '常用语41内容', '常用语41', 15, 0, '201809301331231', 214604),
(214847, '2018-09-30 14:11:19', '2018-09-30 14:11:19', '公司常用语1内容', '公司常用语1', 15, 0, '201809301411181', 214840),
(214864, '2018-09-30 14:16:39', '2018-09-30 17:48:46', '公司常用语2123内容', '公司常用语2123', 15, 0, '201809301416381', 214862),
(214908, '2018-09-30 14:29:20', '2018-09-30 14:29:20', '常用语12内容 ', '常用语12', 15, 0, '201809301429191', 214592),
(214910, '2018-09-30 14:30:41', '2018-09-30 17:48:53', '公司常用语123内容', '公司常用语123', 15, 0, '201809301430401', 214862),
(215292, '2018-09-30 17:52:32', '2018-09-30 17:52:32', '公司常用语31内容', '公司常用语31', 15, 0, '201809301752311', 214863),
(794113, '2018-12-07 22:01:39', '2018-12-07 22:01:39', '常用1-查给你用哪个', '常用语1', 402942, 0, '201812072201371', 794100),
(794117, '2018-12-07 22:02:01', '2018-12-07 22:02:01', '常用12-查给你用哪个', '常用语12', 402942, 0, '201812072202001', 794100),
(794118, '2018-12-07 22:02:15', '2018-12-07 22:02:15', '常用21-查给你用哪个', '常用语21', 402942, 0, '201812072202141', 794114),
(794150, '2018-12-07 22:27:56', '2018-12-07 22:27:56', 'dsdsdsd', 'sdsd', 15, 0, '201812072227551', 214862),
(794151, '2018-12-07 22:28:15', '2018-12-07 22:28:15', 'ereer', '2345', 15, 0, '201812072228141', 794123),
(798082, '2018-12-16 23:55:59', '2018-12-16 23:55:59', 'FET', 'REN', 15, 0, '201812162355591', 798081),
(798080, '2018-12-16 23:55:38', '2018-12-16 23:55:38', 'TEST1', 'TEST1', 15, 0, '201812162355361', 798079);
-- --------------------------------------------------------
--
-- 表的结构 `department`
--
CREATE TABLE `department` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`avatar` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`did` varchar(255) NOT NULL,
`nickname` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`company_id` bigint(20) DEFAULT NULL,
`department_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `feedback`
--
CREATE TABLE `feedback` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`visitor_id` bigint(20) NOT NULL,
`content` varchar(255) DEFAULT NULL,
`fid` varchar(255) NOT NULL,
`category_id` bigint(20) DEFAULT NULL,
`image_url` varchar(255) DEFAULT NULL,
`is_replied` bit(1) DEFAULT NULL,
`reply_content` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `fingerprint`
--
CREATE TABLE `fingerprint` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`my_key` varchar(255) DEFAULT NULL,
`my_value` longtext,
`users_id` bigint(20) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`is_system` bit(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `func_info`
--
CREATE TABLE `func_info` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`func_scope_category_id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `groups`
--
CREATE TABLE `groups` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`max_count` int(11) DEFAULT NULL,
`nickname` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`gid` varchar(255) NOT NULL,
`avatar` varchar(255) DEFAULT NULL,
`announcement` varchar(255) DEFAULT NULL,
`is_dismissed` bit(1) DEFAULT NULL,
`num` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `groups_admin`
--
CREATE TABLE `groups_admin` (
`groups_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `groups_detail`
--
CREATE TABLE `groups_detail` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`groups_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `groups_member`
--
CREATE TABLE `groups_member` (
`groups_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `groups_muted`
--
CREATE TABLE `groups_muted` (
`groups_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `hibernate_sequence`
--
CREATE TABLE `hibernate_sequence` (
`next_val` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `hibernate_sequence`
--
INSERT INTO `hibernate_sequence` (`next_val`) VALUES
(855930),
(855930),
(855930);
-- --------------------------------------------------------
--
-- 表的结构 `invite`
--
CREATE TABLE `invite` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`is_accepted` tinyint(1) DEFAULT '0',
`actioned_at` datetime DEFAULT NULL,
`exit_at` datetime DEFAULT NULL,
`from_client` varchar(255) DEFAULT NULL,
`t_iid` varchar(255) NOT NULL,
`to_client` varchar(255) DEFAULT NULL,
`from_user_id` bigint(20) DEFAULT NULL,
`thread_id` bigint(20) DEFAULT NULL,
`to_user_id` bigint(20) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `ip`
--
CREATE TABLE `ip` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`area` varchar(255) DEFAULT NULL,
`area_id` varchar(255) DEFAULT NULL,
`city` varchar(255) DEFAULT NULL,
`city_id` varchar(255) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`country_id` varchar(255) DEFAULT NULL,
`county` varchar(255) DEFAULT NULL,
`county_id` varchar(255) DEFAULT NULL,
`ip` varchar(255) DEFAULT NULL,
`isp` varchar(255) DEFAULT NULL,
`isp_id` varchar(255) DEFAULT NULL,
`region` varchar(255) DEFAULT NULL,
`region_id` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `leave_message`
--
CREATE TABLE `leave_message` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`content` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`mobile` varchar(255) DEFAULT NULL,
`users_id` bigint(20) DEFAULT NULL,
`visitor_id` bigint(20) NOT NULL,
`lid` varchar(255) NOT NULL,
`is_replied` bit(1) DEFAULT NULL,
`reply` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`work_group_id` bigint(20) DEFAULT NULL,
`agent_id` bigint(20) DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`claimer_id` bigint(20) DEFAULT NULL,
`sub_domain` varchar(255) DEFAULT NULL,
`my_summary` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `message`
--
CREATE TABLE `message` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`queue_id` bigint(20) DEFAULT NULL,
`thread_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) DEFAULT NULL,
`mid` varchar(255) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`format` varchar(255) DEFAULT NULL,
`image_url` varchar(255) DEFAULT NULL,
`label` varchar(255) DEFAULT NULL,
`length` int(11) DEFAULT NULL,
`location_x` double DEFAULT NULL,
`location_y` double DEFAULT NULL,
`media_id` varchar(255) DEFAULT NULL,
`pic_url` varchar(255) DEFAULT NULL,
`is_played` bit(1) DEFAULT NULL,
`scale` double DEFAULT NULL,
`thumb_media_id` varchar(255) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`video_or_short_thumb_url` varchar(255) DEFAULT NULL,
`video_or_short_url` varchar(255) DEFAULT NULL,
`voice_url` varchar(255) DEFAULT NULL,
`wid` varchar(255) DEFAULT NULL,
`client` varchar(255) DEFAULT NULL,
`cid` varchar(255) DEFAULT NULL,
`gid` varchar(255) DEFAULT NULL,
`company_id` bigint(20) DEFAULT NULL,
`questionnaire_id` bigint(20) DEFAULT NULL,
`file_url` varchar(255) DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`session_type` varchar(255) DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`content` varchar(512) DEFAULT NULL,
`destroy_after_reading` bit(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `message_answer`
--
CREATE TABLE `message_answer` (
`message_id` bigint(20) NOT NULL,
`answer_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `message_deleted`
--
CREATE TABLE `message_deleted` (
`message_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `message_status`
--
CREATE TABLE `message_status` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`message_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `message_workgroup`
--
CREATE TABLE `message_workgroup` (
`message_id` bigint(20) NOT NULL,
`workgroup_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `mini_program_info`
--
CREATE TABLE `mini_program_info` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`visit_status` int(11) DEFAULT NULL,
`wid` varchar(255) NOT NULL,
`wechat_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `monitor`
--
CREATE TABLE `monitor` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `notice`
--
CREATE TABLE `notice` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`content` varchar(512) DEFAULT NULL,
`nid` varchar(255) NOT NULL,
`title` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`is_processed` bit(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `notice_reader`
--
CREATE TABLE `notice_reader` (
`notice_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `notice_users`
--
CREATE TABLE `notice_users` (
`notice_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
--
-- 转存表中的数据 `notice_users`
--
INSERT INTO `notice_users` (`notice_id`, `users_id`) VALUES
(852844, 169128),
(852931, 15),
(854595, 15),
(854599, 402938);
-- --------------------------------------------------------
--
-- 表的结构 `oauth_client_details`
--
CREATE TABLE `oauth_client_details` (
`client_id` varchar(128) NOT NULL,
`resource_ids` varchar(256) DEFAULT NULL,
`client_secret` varchar(256) DEFAULT NULL,
`scope` varchar(256) DEFAULT NULL,
`authorized_grant_types` varchar(256) DEFAULT NULL,
`web_server_redirect_uri` varchar(256) DEFAULT NULL,
`authorities` varchar(256) DEFAULT NULL,
`access_token_validity` int(11) DEFAULT NULL,
`refresh_token_validity` int(11) DEFAULT NULL,
`additional_information` longtext,
`autoapprove` varchar(256) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `oauth_client_details`
--
INSERT INTO `oauth_client_details` (`client_id`, `resource_ids`, `client_secret`, `scope`, `authorized_grant_types`, `web_server_redirect_uri`, `authorities`, `access_token_validity`, `refresh_token_validity`, `additional_information`, `autoapprove`) VALUES
('client', NULL, '$2a$10$55oBftBZ.p9XGTOEc3W9xOIwH.YwuqwAZToiePusx6T/uk4heElPO', 'all', 'password,authorization_code,refresh_token,implicit,client_credentials', NULL, NULL, 2592000, 2592000, NULL, NULL);
-- --------------------------------------------------------
--
-- 表的结构 `payment`
--
CREATE TABLE `payment` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`description` varchar(255) DEFAULT NULL,
`ended_at` datetime DEFAULT NULL,
`started_at` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `pay_feature`
--
CREATE TABLE `pay_feature` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`current_agent_count` int(11) DEFAULT '1',
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `post`
--
CREATE TABLE `post` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`content` longtext,
`pid` varchar(255) NOT NULL,
`read_count` int(11) DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`is_top` bit(1) DEFAULT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `post_category`
--
CREATE TABLE `post_category` (
`post_id` bigint(20) NOT NULL,
`category_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `post_keyword`
--
CREATE TABLE `post_keyword` (
`post_id` bigint(20) NOT NULL,
`tag_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `questionnaire`
--
CREATE TABLE `questionnaire` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`qid` varchar(255) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `questionnaire`
--
INSERT INTO `questionnaire` (`id`, `created_at`, `updated_at`, `name`, `qid`, `users_id`) VALUES
(1, '2018-10-06 00:00:00', '2018-10-06 00:00:00', '大学长业务咨询', '201810061551191', 15);
-- --------------------------------------------------------
--
-- 表的结构 `questionnaire_answer`
--
CREATE TABLE `questionnaire_answer` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`input_content` varchar(255) DEFAULT NULL,
`qid` varchar(255) NOT NULL,
`textarea_content` varchar(255) DEFAULT NULL,
`questionnaire_item_id` bigint(20) NOT NULL,
`questionnaire_item_item_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `questionnaire_answer_item`
--
CREATE TABLE `questionnaire_answer_item` (
`questionnaire_answer_id` bigint(20) NOT NULL,
`questionnaire_item_item_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `questionnaire_item`
--
CREATE TABLE `questionnaire_item` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`qid` varchar(255) NOT NULL,
`title` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`questionnaire_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `questionnaire_item`
--
INSERT INTO `questionnaire_item` (`id`, `created_at`, `updated_at`, `qid`, `title`, `by_type`, `questionnaire_id`, `users_id`) VALUES
(1, '2018-10-06 00:00:00', '2018-10-06 00:00:00', '201810061551192', '请选择您需要咨询的业务类型:', 'radio', 1, 15);
-- --------------------------------------------------------
--
-- 表的结构 `questionnaire_item_item`
--
CREATE TABLE `questionnaire_item_item` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`content` varchar(255) DEFAULT NULL,
`qid` varchar(255) NOT NULL,
`questionnaire_item_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `questionnaire_item_item`
--
INSERT INTO `questionnaire_item_item` (`id`, `created_at`, `updated_at`, `content`, `qid`, `questionnaire_item_id`, `users_id`) VALUES
(1, '2018-10-06 00:00:00', '2018-10-06 00:00:00', '留学', '201810061551181', 1, 15),
(2, '2018-10-06 00:00:00', '2018-10-06 00:00:00', '语培', '201810061551182', 1, 15),
(3, '2018-10-06 00:00:00', '2018-10-06 00:00:00', '移民', '201810061551183', 1, 15),
(4, '2018-10-06 00:00:00', '2018-10-06 00:00:00', '其他', '201810061551184', 1, 15);
-- --------------------------------------------------------
--
-- 表的结构 `queue`
--
CREATE TABLE `queue` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`agent_id` bigint(20) DEFAULT NULL,
`visitor_id` bigint(20) NOT NULL,
`workgroup_id` bigint(20) NOT NULL,
`agent_client` varchar(255) DEFAULT NULL,
`qid` varchar(255) NOT NULL,
`status` varchar(255) DEFAULT NULL,
`thread_id` bigint(20) DEFAULT NULL,
`actioned_at` datetime DEFAULT NULL,
`client` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `rate`
--
CREATE TABLE `rate` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`is_auto` bit(1) DEFAULT NULL,
`client` varchar(255) DEFAULT NULL,
`is_invite` bit(1) DEFAULT NULL,
`note` varchar(255) DEFAULT NULL,
`score` int(11) DEFAULT NULL,
`total` int(11) DEFAULT NULL,
`agent_id` bigint(20) NOT NULL,
`thread_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`visitor_id` bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `region`
--
CREATE TABLE `region` (
`id` bigint(20) NOT NULL,
`code` varchar(255) DEFAULT NULL,
`lat` varchar(255) DEFAULT NULL,
`lng` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`parent_id` bigint(20) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `region`
--
INSERT INTO `region` (`id`, `code`, `lat`, `lng`, `name`, `parent_id`, `by_type`) VALUES
(442202, '110000', '39.92998577808', '116.39564503788', '北京市', NULL, 'province'),
(442203, '120000', '39.14392990331', '117.21081309155', '天津市', NULL, 'province'),
(442204, '130000', '38.613839749251', '115.66143362422', '河北省', NULL, 'province'),
(442205, '140000', '37.866565990509', '112.51549586384', '山西省', NULL, 'province'),
(442206, '150000', '43.468238221949', '114.41586754817', '内蒙古自治区', NULL, 'province'),
(442207, '210000', '41.621600105958', '122.75359155772', '辽宁省', NULL, 'province'),
(442208, '220000', '43.678846185241', '126.26287593078', '吉林省', NULL, 'province'),
(442209, '230000', '47.356591643111', '128.04741371499', '黑龙江省', NULL, 'province'),
(442210, '310000', '31.249161710015', '121.48789948569', '上海市', NULL, 'province'),
(442211, '320000', '33.013797169954', '119.36848893836', '江苏省', NULL, 'province'),
(442212, '330000', '29.159494120761', '119.95720242066', '浙江省', NULL, 'province'),
(442213, '340000', '31.859252417079', '117.21600520757', '安徽省', NULL, 'province'),
(442214, '350000', '26.050118295661', '117.98494311991', '福建省', NULL, 'province'),
(442215, '360000', '27.757258443441', '115.6760823667', '江西省', NULL, 'province'),
(442216, '370000', '36.099289929728', '118.52766339288', '山东省', NULL, 'province'),
(442217, '410000', '34.157183767956', '113.48680405753', '河南省', NULL, 'province'),
(442218, '420000', '31.20931625014', '112.41056219213', '湖北省', NULL, 'province'),
(442219, '430000', '27.695864052356', '111.72066354648', '湖南省', NULL, 'province'),
(442220, '440000', '23.408003729025', '113.39481755876', '广东省', NULL, 'province'),
(442221, '450000', '23.552254688119', '108.92427442706', '广西壮族自治区', NULL, 'province'),
(442222, '460000', '19.180500801261', '109.73375548794', '海南省', NULL, 'province'),
(442223, '500000', '29.544606108886', '106.53063501341', '重庆市', NULL, 'province'),
(442224, '510000', '30.367480937958', '102.8991597236', '四川省', NULL, 'province'),
(442225, '520000', '26.902825927797', '106.7349961033', '贵州省', NULL, 'province'),
(442226, '530000', '24.864212795483', '101.59295163701', '云南省', NULL, 'province'),
(442227, '540000', '31.367315402715', '89.137981684031', '西藏自治区', NULL, 'province'),
(442228, '610000', '35.860026261323', '109.50378929073', '陕西省', NULL, 'province'),
(442229, '620000', '38.103267343752', '102.45762459934', '甘肃省', NULL, 'province'),
(442230, '630000', '35.499761004275', '96.202543672261', '青海省', NULL, 'province'),
(442231, '640000', '37.321323112295', '106.15548126505', '宁夏回族自治区', NULL, 'province'),
(442232, '650000', '42.127000957642', '85.614899338339', '新疆维吾尔自治区', NULL, 'province'),
(442233, '710000', '24.086956718805', '121.97387097872', '台湾省', NULL, 'province'),
(442234, '810000', '22.29358599328', '114.18612410257', '香港特别行政区', NULL, 'province'),
(442235, '820000', '22.204117988443', '113.55751910182', '澳门特别行政区', NULL, 'province'),
(442236, '110100', '39.92998577808', '116.39564503788', '市辖区', 442202, 'city'),
(442237, '120100', '39.14392990331', '117.21081309155', '市辖区', 442203, 'city'),
(442238, '130100', '38.048958314615', '114.52208184421', '石家庄市', 442204, 'city'),
(442239, '130200', '39.650530922537', '118.18345059773', '唐山市', 442204, 'city'),
(442240, '130300', '39.945461565898', '119.60436761612', '秦皇岛市', 442204, 'city'),
(442241, '130400', '36.609307928471', '114.48269393234', '邯郸市', 442204, 'city'),
(442242, '130500', '37.069531196912', '114.52048681294', '邢台市', 442204, 'city'),
(442243, '130600', '38.886564548027', '115.49481016908', '保定市', 442204, 'city'),
(442244, '130700', '40.811188491103', '114.89378153033', '张家口市', 442204, 'city'),
(442245, '130800', '40.992521052457', '117.93382245584', '承德市', 442204, 'city'),
(442246, '130900', '38.297615350326', '116.86380647644', '沧州市', 442204, 'city'),
(442247, '131000', '39.518610625085', '116.70360222264', '廊坊市', 442204, 'city'),
(442248, '131100', '37.746929045857', '115.68622865291', '衡水市', 442204, 'city'),
(442249, '139000', '38.613839749251', '115.66143362422', '省直辖县级行政区划', 442204, 'city'),
(442250, '140100', '37.890277053968', '112.55086358906', '太原市', 442205, 'city'),
(442251, '140200', '40.113744499705', '113.29050867308', '大同市', 442205, 'city'),
(442252, '140300', '37.869529493223', '113.56923760163', '阳泉市', 442205, 'city'),
(442253, '140400', '36.201664385743', '113.12029208573', '长治市', 442205, 'city'),
(442254, '140500', '35.499834467226', '112.86733275751', '晋城市', 442205, 'city'),
(442255, '140600', '39.337671966221', '112.47992772666', '朔州市', 442205, 'city'),
(442256, '140700', '37.693361526798', '112.73851439992', '晋中市', 442205, 'city'),
(442257, '140800', '35.038859479812', '111.00685365308', '运城市', 442205, 'city'),
(442258, '140900', '38.461030572959', '112.72793882881', '忻州市', 442205, 'city'),
(442259, '141000', '36.099745443585', '111.53878759641', '临汾市', 442205, 'city'),
(442260, '141100', '37.527316096963', '111.14315660235', '吕梁市', 442205, 'city'),
(442261, '150100', '40.828318873082', '111.66035052005', '呼和浩特市', 442206, 'city'),
(442262, '150200', '40.647119425709', '109.84623853249', '包头市', 442206, 'city'),
(442263, '150300', '39.683177006785', '106.83199909716', '乌海市', 442206, 'city'),
(442264, '150400', '42.297112320317', '118.93076119217', '赤峰市', 442206, 'city'),
(442265, '150500', '43.633756072996', '122.26036326322', '通辽市', 442206, 'city'),
(442266, '150600', '39.816489560602', '109.99370625145', '鄂尔多斯市', 442206, 'city'),
(442267, '150700', '49.201636054604', '119.760821794', '呼伦贝尔市', 442206, 'city'),
(442268, '150800', '40.769179902429', '107.42380671968', '巴彦淖尔市', 442206, 'city'),
(442269, '150900', '41.022362946751', '113.11284639068', '乌兰察布市', 442206, 'city'),
(442270, '152200', '46.083757065182', '122.04816651407', '兴安盟', 442206, 'city'),
(442271, '152500', '43.939704842324', '116.02733968896', '锡林郭勒盟', 442206, 'city'),
(442272, '152900', '38.843075264408', '105.69568287113', '阿拉善盟', 442206, 'city'),
(442273, '210100', '41.808644783516', '123.43279092161', '沈阳市', 442207, 'city'),
(442274, '210200', '38.948709938304', '121.59347778144', '大连市', 442207, 'city'),
(442275, '210300', '41.118743682153', '123.00776332888', '鞍山市', 442207, 'city'),
(442276, '210400', '41.877303829591', '123.92981976705', '抚顺市', 442207, 'city'),
(442277, '210500', '41.325837626649', '123.77806236979', '本溪市', 442207, 'city'),
(442278, '210600', '40.129022826638', '124.33854311477', '丹东市', 442207, 'city'),
(442279, '210700', '41.130878875917', '121.14774873824', '锦州市', 442207, 'city'),
(442280, '210800', '40.668651066474', '122.23339137079', '营口市', 442207, 'city'),
(442281, '210900', '42.01925010706', '121.66082212857', '阜新市', 442207, 'city'),
(442282, '211000', '41.273339265569', '123.17245120515', '辽阳市', 442207, 'city'),
(442283, '211100', '41.141248022956', '122.07322781023', '盘锦市', 442207, 'city'),
(442284, '211200', '42.299757012125', '123.85484961462', '铁岭市', 442207, 'city'),
(442285, '211300', '41.571827667857', '120.44616270274', '朝阳市', 442207, 'city'),
(442286, '211400', '40.743029881318', '120.86075764476', '葫芦岛市', 442207, 'city'),
(442287, '220100', '43.898337607098', '125.3136424272', '长春市', 442208, 'city'),
(442288, '220200', '43.871988334359', '126.56454398883', '吉林市', 442208, 'city'),
(442289, '220300', '43.175524701126', '124.39138207368', '四平市', 442208, 'city'),
(442290, '220400', '42.923302619054', '125.13368605218', '辽源市', 442208, 'city'),
(442291, '220500', '41.736397129868', '125.94265013851', '通化市', 442208, 'city'),
(442292, '220600', '41.945859397018', '126.43579767535', '白山市', 442208, 'city'),
(442293, '220700', '45.136048970084', '124.83299453234', '松原市', 442208, 'city'),
(442294, '220800', '45.621086275219', '122.8407766791', '白城市', 442208, 'city'),
(442295, '222400', '42.896413603744', '129.48590195816', '延边朝鲜族自治州', 442208, 'city'),
(442296, '230100', '45.773224633239', '126.65771685545', '哈尔滨市', 442209, 'city'),
(442297, '230200', '47.347699813366', '123.98728894217', '齐齐哈尔市', 442209, 'city'),
(442298, '230300', '45.321539886551', '130.94176727325', '鸡西市', 442209, 'city'),
(442299, '230400', '47.338665903727', '130.29247205063', '鹤岗市', 442209, 'city'),
(442300, '230500', '46.655102062482', '131.17140173958', '双鸭山市', 442209, 'city'),
(442301, '230600', '46.596709020008', '125.02183973021', '大庆市', 442209, 'city'),
(442302, '230700', '47.734685075079', '128.91076597792', '伊春市', 442209, 'city'),
(442303, '230800', '46.81377960474', '130.28473458595', '佳木斯市', 442209, 'city'),
(442304, '230900', '45.77500536864', '131.01904804712', '七台河市', 442209, 'city'),
(442305, '231000', '44.588521152783', '129.60803539564', '牡丹江市', 442209, 'city'),
(442306, '231100', '50.250690090738', '127.50083029524', '黑河市', 442209, 'city'),
(442307, '231200', '46.646063926997', '126.98909457163', '绥化市', 442209, 'city'),
(442308, '232700', '51.991788968014', '124.19610419017', '大兴安岭地区', 442209, 'city'),
(442309, '310100', '31.249161710015', '121.48789948569', '市辖区', 442210, 'city'),
(442310, '320100', '32.057235501806', '118.77807440803', '南京市', 442211, 'city'),
(442311, '320200', '31.570037451923', '120.30545590054', '无锡市', 442211, 'city'),
(442312, '320300', '34.271553431092', '117.18810662318', '徐州市', 442211, 'city'),
(442313, '320400', '31.771396744684', '119.98186101346', '常州市', 442211, 'city'),
(442314, '320500', '31.317987367952', '120.61990711549', '苏州市', 442211, 'city'),
(442315, '320600', '32.014664540823', '120.87380095093', '南通市', 442211, 'city'),
(442316, '320700', '34.60154896701', '119.17387221742', '连云港市', 442211, 'city'),
(442317, '320800', '33.606512739276', '119.03018636466', '淮安市', 442211, 'city'),
(442318, '320900', '33.379861877121', '120.14887181794', '盐城市', 442211, 'city'),
(442319, '321000', '32.408505254568', '119.42777755117', '扬州市', 442211, 'city'),
(442320, '321100', '32.204409443599', '119.45583540513', '镇江市', 442211, 'city'),
(442321, '321200', '32.47605327483', '119.91960601619', '泰州市', 442211, 'city'),
(442322, '321300', '33.952049733709', '118.29689337855', '宿迁市', 442211, 'city'),
(442323, '330100', '30.259244461536', '120.21937541572', '杭州市', 442212, 'city'),
(442324, '330200', '29.885258965918', '121.57900597259', '宁波市', 442212, 'city'),
(442325, '330300', '28.002837594041', '120.69063473371', '温州市', 442212, 'city'),
(442326, '330400', '30.773992239582', '120.76042769896', '嘉兴市', 442212, 'city'),
(442327, '330500', '30.877925155691', '120.13724316328', '湖州市', 442212, 'city'),
(442328, '330600', '30.002364580528', '120.59246738555', '绍兴市', 442212, 'city'),
(442329, '330700', '29.102899105391', '119.65257570368', '金华市', 442212, 'city'),
(442330, '330800', '28.956910447536', '118.87584165151', '衢州市', 442212, 'city'),
(442331, '330900', '30.036010302554', '122.16987209835', '舟山市', 442212, 'city'),
(442332, '331000', '28.668283285674', '121.44061293594', '台州市', 442212, 'city'),
(442333, '331100', '28.456299552144', '119.92957584319', '丽水市', 442212, 'city'),
(442334, '340100', '31.866942260687', '117.28269909168', '合肥市', 442213, 'city'),
(442335, '340200', '31.366019787543', '118.38410842323', '芜湖市', 442213, 'city'),
(442336, '340300', '32.929498906698', '117.35707986588', '蚌埠市', 442213, 'city'),
(442337, '340400', '32.642811823748', '117.01863886329', '淮南市', 442213, 'city'),
(442338, '340500', '31.68852815888', '118.51588184662', '马鞍山市', 442213, 'city'),
(442339, '340600', '33.960023305364', '116.79144742863', '淮北市', 442213, 'city'),
(442340, '340700', '30.940929694666', '117.81942872881', '铜陵市', 442213, 'city'),
(442341, '340800', '30.537897817381', '117.05873877211', '安庆市', 442213, 'city'),
(442342, '341000', '29.734434856163', '118.293569632', '黄山市', 442213, 'city'),
(442343, '341100', '32.317350595384', '118.32457035098', '滁州市', 442213, 'city'),
(442344, '341200', '32.90121133057', '115.82093225905', '阜阳市', 442213, 'city'),
(442345, '341300', '33.636772385781', '116.98869241183', '宿州市', 442213, 'city'),
(442346, '341500', '31.755558355198', '116.50525268298', '六安市', 442213, 'city'),
(442347, '341600', '33.871210565302', '115.78792824512', '亳州市', 442213, 'city'),
(442348, '341700', '30.660019248161', '117.49447677159', '池州市', 442213, 'city'),
(442349, '341800', '30.951642354296', '118.75209631098', '宣城市', 442213, 'city'),
(442350, '350100', '26.047125496573', '119.33022110713', '福州市', 442214, 'city'),
(442351, '350200', '24.489230612469', '118.10388604566', '厦门市', 442214, 'city'),
(442352, '350300', '25.448450136734', '119.07773096396', '莆田市', 442214, 'city'),
(442353, '350400', '26.270835279362', '117.64219393404', '三明市', 442214, 'city'),
(442354, '350500', '24.901652383991', '118.60036234323', '泉州市', 442214, 'city'),
(442355, '350600', '24.517064779808', '117.67620467895', '漳州市', 442214, 'city'),
(442356, '350700', '26.643626474198', '118.18188294866', '南平市', 442214, 'city'),
(442357, '350800', '25.078685433515', '117.01799673877', '龙岩市', 442214, 'city'),
(442358, '350900', '26.656527419159', '119.54208214972', '宁德市', 442214, 'city'),
(442359, '360100', '28.689578000141', '115.89352754584', '南昌市', 442215, 'city'),
(442360, '360200', '29.303562768448', '117.18652262527', '景德镇市', 442215, 'city'),
(442361, '360300', '27.639544222952', '113.85991703301', '萍乡市', 442215, 'city'),
(442362, '360400', '29.719639526122', '115.99984802155', '九江市', 442215, 'city'),
(442363, '360500', '27.822321558629', '114.94711741679', '新余市', 442215, 'city'),
(442364, '360600', '28.241309597182', '117.03545018601', '鹰潭市', 442215, 'city'),
(442365, '360700', '25.845295536347', '114.93590907928', '赣州市', 442215, 'city'),
(442366, '360800', '27.113847650157', '114.99203871092', '吉安市', 442215, 'city'),
(442367, '360900', '27.811129895843', '114.40003867156', '宜春市', 442215, 'city'),
(442368, '361000', '27.95454517027', '116.36091886693', '抚州市', 442215, 'city'),
(442369, '361100', '28.457622553937', '117.95546387715', '上饶市', 442215, 'city'),
(442370, '370100', '36.682784727161', '117.02496706629', '济南市', 442216, 'city'),
(442371, '370200', '36.105214901274', '120.38442818368', '青岛市', 442216, 'city'),
(442372, '370300', '36.804684854212', '118.05913427787', '淄博市', 442216, 'city'),
(442373, '370400', '34.807883078386', '117.2793053833', '枣庄市', 442216, 'city'),
(442374, '370500', '37.487121155276', '118.58392633307', '东营市', 442216, 'city'),
(442375, '370600', '37.53656156286', '121.30955503009', '烟台市', 442216, 'city'),
(442376, '370700', '36.716114873051', '119.14263382297', '潍坊市', 442216, 'city'),
(442377, '370800', '35.402121664331', '116.60079762482', '济宁市', 442216, 'city'),
(442378, '370900', '36.188077758948', '117.08941491714', '泰安市', 442216, 'city'),
(442379, '371000', '37.528787081251', '122.09395836581', '威海市', 442216, 'city'),
(442380, '371100', '35.420225193144', '119.50717994299', '日照市', 442216, 'city'),
(442381, '371200', '36.233654133647', '117.68466691247', '莱芜市', 442216, 'city'),
(442382, '371300', '35.072409074391', '118.34076823661', '临沂市', 442216, 'city'),
(442383, '371400', '37.460825926305', '116.32816136356', '德州市', 442216, 'city'),
(442384, '371500', '36.455828514728', '115.98686913929', '聊城市', 442216, 'city'),
(442385, '371600', '37.405313941826', '117.96829241453', '滨州市', 442216, 'city'),
(442386, '371700', '35.262440496075', '115.46335977453', '菏泽市', 442216, 'city'),
(442387, '410100', '34.75661006414', '113.64964384986', '郑州市', 442217, 'city'),
(442388, '410200', '34.801854175837', '114.35164211776', '开封市', 442217, 'city'),
(442389, '410300', '34.657367817651', '112.44752476895', '洛阳市', 442217, 'city'),
(442390, '410400', '33.745301456524', '113.30084897798', '平顶山市', 442217, 'city'),
(442391, '410500', '36.110266722181', '114.35180650767', '安阳市', 442217, 'city'),
(442392, '410600', '35.755425874224', '114.29776983802', '鹤壁市', 442217, 'city'),
(442393, '410700', '35.307257557661', '113.91269016082', '新乡市', 442217, 'city'),
(442394, '410800', '35.234607554986', '113.21183588499', '焦作市', 442217, 'city'),
(442395, '410900', '35.753297888208', '115.02662744067', '濮阳市', 442217, 'city'),
(442396, '411000', '34.026739588655', '113.83531245979', '许昌市', 442217, 'city'),
(442397, '411100', '33.576278688483', '114.04606140023', '漯河市', 442217, 'city'),
(442398, '411200', '34.78331994105', '111.18126209327', '三门峡市', 442217, 'city'),
(442399, '411300', '33.011419569116', '112.54284190051', '南阳市', 442217, 'city'),
(442400, '411400', '34.438588640246', '115.64188568785', '商丘市', 442217, 'city'),
(442401, '411500', '32.128582307512', '114.08549099347', '信阳市', 442217, 'city'),
(442402, '411600', '33.623740818141', '114.6541019423', '周口市', 442217, 'city'),
(442403, '411700', '32.983158154093', '114.04915354746', '驻马店市', 442217, 'city'),
(442404, '419000', '34.157183767956', '113.48680405753', '省直辖县级行政区划', 442217, 'city'),
(442405, '420100', '30.581084126921', '114.31620010268', '武汉市', 442218, 'city'),
(442406, '420200', '30.216127127714', '115.05068316392', '黄石市', 442218, 'city'),
(442407, '420300', '32.636994339468', '110.80122891676', '十堰市', 442218, 'city'),
(442408, '420500', '30.732757818026', '111.31098109196', '宜昌市', 442218, 'city'),
(442409, '420600', '31.939712558944', '111.94954852739', '襄阳市', 442218, 'city'),
(442410, '420700', '30.384439322752', '114.89559404136', '鄂州市', 442218, 'city'),
(442411, '420800', '31.042611202949', '112.21733029897', '荆门市', 442218, 'city'),
(442412, '420900', '30.927954784201', '113.93573439207', '孝感市', 442218, 'city'),
(442413, '421000', '30.332590522986', '112.24186580719', '荆州市', 442218, 'city'),
(442414, '421100', '30.446108937901', '114.90661804658', '黄冈市', 442218, 'city'),
(442415, '421200', '29.880656757728', '114.30006059206', '咸宁市', 442218, 'city'),
(442416, '421300', '31.717857608189', '113.37935836429', '随州市', 442218, 'city'),
(442417, '422800', '30.285888316556', '109.49192330375', '恩施土家族苗族自治州', 442218, 'city'),
(442418, '429000', '31.20931625014', '112.41056219213', '省直辖县级行政区划', 442218, 'city'),
(442419, '430100', '28.213478230853', '112.97935278765', '长沙市', 442219, 'city'),
(442420, '430200', '27.827432927663', '113.13169534107', '株洲市', 442219, 'city'),
(442421, '430300', '27.835095052979', '112.93555563303', '湘潭市', 442219, 'city'),
(442422, '430400', '26.898164415358', '112.58381881072', '衡阳市', 442219, 'city'),
(442423, '430500', '27.236811244922', '111.46152540355', '邵阳市', 442219, 'city'),
(442424, '430600', '29.378007075474', '113.14619551912', '岳阳市', 442219, 'city'),
(442425, '430700', '29.012148855181', '111.65371813684', '常德市', 442219, 'city'),
(442426, '430800', '29.12488935322', '110.48162015697', '张家界市', 442219, 'city'),
(442427, '430900', '28.588087779887', '112.36654664523', '益阳市', 442219, 'city'),
(442428, '431000', '25.782263975739', '113.0377044678', '郴州市', 442219, 'city'),
(442429, '431100', '26.435971646759', '111.61464768616', '永州市', 442219, 'city'),
(442430, '431200', '27.557482901173', '109.98695879585', '怀化市', 442219, 'city'),
(442431, '431300', '27.741073302349', '111.99639635657', '娄底市', 442219, 'city'),
(442432, '433100', '28.317950793674', '109.74574580039', '湘西土家族苗族自治州', 442219, 'city'),
(442433, '440100', '23.120049102076', '113.30764967515', '广州市', 442220, 'city'),
(442434, '440200', '24.802960311892', '113.59446110744', '韶关市', 442220, 'city'),
(442435, '440300', '22.546053546205', '114.02597365732', '深圳市', 442220, 'city'),
(442436, '440400', '22.256914646126', '113.56244702619', '珠海市', 442220, 'city'),
(442437, '440500', '23.383908453269', '116.72865028834', '汕头市', 442220, 'city'),
(442438, '440600', '23.035094840514', '113.13402563539', '佛山市', 442220, 'city'),
(442439, '440700', '22.575116783451', '113.07812534115', '江门市', 442220, 'city'),
(442440, '440800', '21.257463103764', '110.36506726285', '湛江市', 442220, 'city'),
(442441, '440900', '21.668225718822', '110.93124533068', '茂名市', 442220, 'city'),
(442442, '441200', '23.078663282929', '112.47965336992', '肇庆市', 442220, 'city'),
(442443, '441300', '23.113539852408', '114.41065807997', '惠州市', 442220, 'city'),
(442444, '441400', '24.304570606031', '116.12640309837', '梅州市', 442220, 'city'),
(442445, '441500', '22.778730500164', '115.3729242894', '汕尾市', 442220, 'city'),
(442446, '441600', '23.757250850469', '114.71372147587', '河源市', 442220, 'city'),
(442447, '441700', '21.871517304519', '111.97700975587', '阳江市', 442220, 'city'),
(442448, '441800', '23.698468550422', '113.04077334891', '清远市', 442220, 'city'),
(442449, '445100', '23.661811676517', '116.63007599086', '潮州市', 442220, 'city'),
(442450, '445200', '23.547999466926', '116.37950085538', '揭阳市', 442220, 'city'),
(442451, '445300', '22.937975685537', '112.05094595865', '云浮市', 442220, 'city'),
(442452, '450100', '22.806492935603', '108.29723355587', '南宁市', 442221, 'city'),
(442453, '450200', '24.329053352467', '109.42240181015', '柳州市', 442221, 'city'),
(442454, '450300', '25.262901245955', '110.26092014748', '桂林市', 442221, 'city'),
(442455, '450400', '23.485394636734', '111.30547195007', '梧州市', 442221, 'city'),
(442456, '450500', '21.47271823501', '109.12262791919', '北海市', 442221, 'city'),
(442457, '450600', '21.617398470472', '108.35179115286', '防城港市', 442221, 'city'),
(442458, '450700', '21.973350465313', '108.63879805642', '钦州市', 442221, 'city'),
(442459, '450800', '23.103373164409', '109.61370755658', '贵港市', 442221, 'city'),
(442460, '450900', '22.643973608377', '110.15167631614', '玉林市', 442221, 'city'),
(442461, '451000', '23.90151236791', '106.63182140365', '百色市', 442221, 'city'),
(442462, '451100', '24.411053547113', '111.55259417884', '贺州市', 442221, 'city'),
(442463, '451200', '24.699520782873', '108.06994770937', '河池市', 442221, 'city'),
(442464, '451300', '23.741165926515', '109.23181650474', '来宾市', 442221, 'city'),
(442465, '451400', '22.415455296546', '107.35732203837', '崇左市', 442221, 'city'),
(442466, '460100', '20.022071276952', '110.33080184834', '海口市', 442222, 'city'),
(442467, '460200', '18.257775914897', '109.52277128136', '三亚市', 442222, 'city'),
(442468, '460300', '12.464712920653', '113.75535610385', '三沙市', 442222, 'city'),
(442469, '469000', '19.180500801261', '109.73375548794', '省直辖县级行政区划', 442222, 'city'),
(442470, '500100', '29.544606108886', '106.53063501341', '市辖区', 442223, 'city'),
(442471, '500200', '29.544606108886', '106.53063501341', '县', 442223, 'city'),
(442472, '510100', '30.67994284542', '104.0679234633', '成都市', 442224, 'city'),
(442473, '510300', '29.359156889476', '104.77607133936', '自贡市', 442224, 'city'),
(442474, '510400', '26.587571257109', '101.72242315249', '攀枝花市', 442224, 'city'),
(442475, '510500', '28.89592980386', '105.44397028921', '泸州市', 442224, 'city'),
(442476, '510600', '31.131139652701', '104.40239781824', '德阳市', 442224, 'city'),
(442477, '510700', '31.504701258061', '104.70551897529', '绵阳市', 442224, 'city'),
(442478, '510800', '32.441040158428', '105.81968694', '广元市', 442224, 'city'),
(442479, '510900', '30.55749135038', '105.56488779226', '遂宁市', 442224, 'city'),
(442480, '511000', '29.599461534775', '105.07305599171', '内江市', 442224, 'city'),
(442481, '511100', '29.600957611095', '103.76082423877', '乐山市', 442224, 'city'),
(442482, '511300', '30.800965168237', '106.10555398379', '南充市', 442224, 'city'),
(442483, '511400', '30.061115079945', '103.84142956287', '眉山市', 442224, 'city'),
(442484, '511500', '28.769674796266', '104.63301906153', '宜宾市', 442224, 'city'),
(442485, '511600', '30.463983887888', '106.63572033137', '广安市', 442224, 'city'),
(442486, '511700', '31.214198858945', '107.49497344659', '达州市', 442224, 'city'),
(442487, '511800', '29.999716337066', '103.00935646635', '雅安市', 442224, 'city'),
(442488, '511900', '31.86918915916', '106.75791584175', '巴中市', 442224, 'city'),
(442489, '512000', '30.132191433952', '104.63593030167', '资阳市', 442224, 'city'),
(442490, '513200', '31.905762858339', '102.22856468921', '阿坝藏族羌族自治州', 442224, 'city'),
(442491, '513300', '30.055144114356', '101.96923206306', '甘孜藏族自治州', 442224, 'city'),
(442492, '513400', '27.892392903666', '102.2595908032', '凉山彝族自治州', 442224, 'city'),
(442493, '520100', '26.629906741441', '106.70917709618', '贵阳市', 442225, 'city'),
(442494, '520200', '26.591866060319', '104.85208676007', '六盘水市', 442225, 'city'),
(442495, '520300', '27.699961377076', '106.93126031648', '遵义市', 442225, 'city'),
(442496, '520400', '26.228594577737', '105.92826996576', '安顺市', 442225, 'city'),
(442497, '520500', '27.408562131331', '105.33332337117', '毕节市', 442225, 'city'),
(442498, '520600', '27.674902690624', '109.16855802826', '铜仁市', 442225, 'city'),
(442499, '522300', '25.095148055927', '104.90055779825', '黔西南布依族苗族自治州', 442225, 'city'),
(442500, '522600', '26.583991766542', '107.98535257274', '黔东南苗族侗族自治州', 442225, 'city'),
(442501, '522700', '26.264535997442', '107.52320511006', '黔南布依族苗族自治州', 442225, 'city'),
(442502, '530100', '25.049153100453', '102.71460113878', '昆明市', 442226, 'city'),
(442503, '530300', '25.520758142871', '103.78253888803', '曲靖市', 442226, 'city'),
(442504, '530400', '24.370447134438', '102.54506789248', '玉溪市', 442226, 'city'),
(442505, '530500', '25.12048919619', '99.177995613278', '保山市', 442226, 'city'),
(442506, '530600', '27.340632963635', '103.72502065573', '昭通市', 442226, 'city'),
(442507, '530700', '26.875351089481', '100.22962839888', '丽江市', 442226, 'city'),
(442508, '530800', '22.788777780149', '100.98005773013', '普洱市', 442226, 'city'),
(442509, '530900', '23.887806103773', '100.09261291373', '临沧市', 442226, 'city'),
(442510, '532300', '25.066355674186', '101.52938223914', '楚雄彝族自治州', 442226, 'city'),
(442511, '532500', '23.367717516499', '103.38406475716', '红河哈尼族彝族自治州', 442226, 'city'),
(442512, '532600', '23.37408685041', '104.24629431757', '文山壮族苗族自治州', 442226, 'city'),
(442513, '532800', '22.009433002236', '100.80303827521', '西双版纳傣族自治州', 442226, 'city'),
(442514, '532900', '25.596899639421', '100.22367478928', '大理白族自治州', 442226, 'city'),
(442515, '533100', '24.441239663008', '98.589434287407', '德宏傣族景颇族自治州', 442226, 'city'),
(442516, '533300', '25.860676978165', '98.859932042482', '怒江傈僳族自治州', 442226, 'city'),
(442517, '533400', '27.831029461167', '99.713681598883', '迪庆藏族自治州', 442226, 'city'),
(442518, '540100', '29.662557062057', '91.111890895984', '拉萨市', 442227, 'city'),
(442519, '540200', '29.268160032655', '88.956062773518', '日喀则市', 442227, 'city'),
(442520, '540300', '30.510924801158', '96.362440472918', '昌都市', 442227, 'city'),
(442521, '540400', '29.128080197802', '95.466234246683', '林芝市', 442227, 'city'),
(442522, '540500', '28.354982378107', '92.22087273151', '山南市', 442227, 'city'),
(442523, '542400', '31.48067983012', '92.067018368859', '那曲地区', 442227, 'city'),
(442524, '542500', '30.404556588325', '81.10766868949', '阿里地区', 442227, 'city'),
(442525, '610100', '34.277799897831', '108.9530982792', '西安市', 442228, 'city'),
(442526, '610200', '34.908367696384', '108.9680670134', '铜川市', 442228, 'city'),
(442527, '610300', '34.364080809748', '107.17064545238', '宝鸡市', 442228, 'city'),
(442528, '610400', '34.345372995999', '108.7075092782', '咸阳市', 442228, 'city'),
(442529, '610500', '34.502357975829', '109.48393269658', '渭南市', 442228, 'city'),
(442530, '610600', '36.60332035226', '109.50050975697', '延安市', 442228, 'city'),
(442531, '610700', '33.081568978158', '107.04547762873', '汉中市', 442228, 'city'),
(442532, '610800', '38.279439240071', '109.74592574433', '榆林市', 442228, 'city'),
(442533, '610900', '32.704370449994', '109.03804456348', '安康市', 442228, 'city'),
(442534, '611000', '33.873907395085', '109.9342081538', '商洛市', 442228, 'city'),
(442535, '620100', '36.064225525043', '103.82330544073', '兰州市', 442229, 'city'),
(442536, '620300', '38.516071799532', '102.20812626259', '金昌市', 442229, 'city'),
(442537, '620400', '36.546681706163', '104.17124090374', '白银市', 442229, 'city'),
(442538, '620500', '34.584319418869', '105.73693162286', '天水市', 442229, 'city'),
(442539, '620600', '37.933172142906', '102.64014734337', '武威市', 442229, 'city'),
(442540, '620700', '38.939320296982', '100.45989186892', '张掖市', 442229, 'city'),
(442541, '620800', '35.550110190017', '106.68891115655', '平凉市', 442229, 'city'),
(442542, '620900', '39.741473768159', '98.508414506167', '酒泉市', 442229, 'city'),
(442543, '621000', '35.72680075453', '107.64422708673', '庆阳市', 442229, 'city'),
(442544, '621100', '35.586056241828', '104.62663760066', '定西市', 442229, 'city'),
(442545, '621200', '33.394479972938', '104.93457340575', '陇南市', 442229, 'city'),
(442546, '622900', '35.598514348802', '103.21524917832', '临夏回族自治州', 442229, 'city'),
(442547, '623000', '34.992211178379', '102.9174424865', '甘南藏族自治州', 442229, 'city'),
(442548, '630100', '36.640738611958', '101.7679209898', '西宁市', 442230, 'city'),
(442549, '630200', '36.312743354178', '102.37668874252', '海东市', 442230, 'city'),
(442550, '632200', '36.960654101084', '100.87980217448', '海北藏族自治州', 442230, 'city'),
(442551, '632300', '35.522851551728', '102.00760030834', '黄南藏族自治州', 442230, 'city'),
(442552, '632500', '36.284363803805', '100.6240660941', '海南藏族自治州', 442230, 'city'),
(442553, '632600', '34.48048458461', '100.22372276899', '果洛藏族自治州', 442230, 'city'),
(442554, '632700', '33.006239909722', '97.013316137414', '玉树藏族自治州', 442230, 'city'),
(442555, '632800', '37.37379907059', '97.342625415333', '海西蒙古族藏族自治州', 442230, 'city'),
(442556, '640100', '38.502621011876', '106.20647860784', '银川市', 442231, 'city'),
(442557, '640200', '39.020223283603', '106.37933720153', '石嘴山市', 442231, 'city'),
(442558, '640300', '37.993561002936', '106.20825419851', '吴忠市', 442231, 'city'),
(442559, '640400', '36.021523480709', '106.28526799598', '固原市', 442231, 'city'),
(442560, '640500', '37.521124191595', '105.19675419936', '中卫市', 442231, 'city'),
(442561, '650100', '43.840380347218', '87.564987741116', '乌鲁木齐市', 442232, 'city'),
(442562, '650200', '45.594331066706', '84.881180186144', '克拉玛依市', 442232, 'city'),
(442563, '650400', '42.678924820794', '89.266025488642', '吐鲁番市', 442232, 'city'),
(442564, '650500', '42.344467104552', '93.529373012389', '哈密市', 442232, 'city'),
(442565, '652300', '44.007057898533', '87.296038125667', '昌吉回族自治州', 442232, 'city'),
(442566, '652700', '44.913651374298', '82.052436267224', '博尔塔拉蒙古自治州', 442232, 'city'),
(442567, '652800', '41.771362202569', '86.121688362984', '巴音郭楞蒙古自治州', 442232, 'city'),
(442568, '652900', '41.171730901452', '80.269846179329', '阿克苏地区', 442232, 'city'),
(442569, '653000', '39.750345577845', '76.137564477462', '克孜勒苏柯尔克孜自治州', 442232, 'city'),
(442570, '653100', '39.470627188746', '75.992973267492', '喀什地区', 442232, 'city'),
(442571, '653200', '37.116774492678', '79.930238637213', '和田地区', 442232, 'city'),
(442572, '654000', '43.922248096341', '81.297853530366', '伊犁哈萨克自治州', 442232, 'city'),
(442573, '654200', '46.75868362968', '82.974880583744', '塔城地区', 442232, 'city'),
(442574, '654300', '47.839744486198', '88.137915487132', '阿勒泰地区', 442232, 'city'),
(442575, '659000', '42.127000957642', '85.614899338339', '自治区直辖县级行政区划', 442232, 'city'),
(442576, '110101', '39.938574012986', '116.42188470126', '东城区', 442236, 'county'),
(442577, '110102', '39.934280143709', '116.37319010402', '西城区', 442236, 'county'),
(442578, '110105', '39.958953166407', '116.52169489108', '朝阳区', 442236, 'county'),
(442579, '110106', '39.841937852205', '116.25837033547', '丰台区', 442236, 'county'),
(442580, '110107', '39.938866544646', '116.18455581037', '石景山区', 442236, 'county'),
(442581, '110108', '40.033162045078', '116.23967780102', '海淀区', 442236, 'county'),
(442582, '110109', '40.000893031476', '115.79579538125', '门头沟区', 442236, 'county'),
(442583, '110111', '39.726752620796', '115.8628363129', '房山区', 442236, 'county'),
(442584, '110112', '39.809814883851', '116.74007918068', '通州区', 442236, 'county'),
(442585, '110113', '40.154951470441', '116.72822904528', '顺义区', 442236, 'county'),
(442586, '110114', '40.221723549832', '116.21645635689', '昌平区', 442236, 'county'),
(442587, '110115', '39.652790118364', '116.42519459738', '大兴区', 442236, 'county'),
(442588, '110116', '40.638139340311', '116.59340835643', '怀柔区', 442236, 'county'),
(442589, '110117', '40.215925453896', '117.15043344819', '平谷区', 442236, 'county'),
(442590, '110118', '40.517334853846', '117.09666568438', '密云区', 442236, 'county'),
(442591, '110119', '40.535475747111', '116.1618831398', '延庆区', 442236, 'county'),
(442592, '120101', '39.124808844703', '117.20281365403', '和平区', 442237, 'county'),
(442593, '120102', '39.126625684666', '117.26169316527', '河东区', 442237, 'county'),
(442594, '120103', '39.084493739615', '117.23616545062', '河西区', 442237, 'county'),
(442595, '120104', '39.116987285522', '117.16272794945', '南开区', 442237, 'county'),
(442596, '120105', '39.173148933924', '117.22029676508', '河北区', 442237, 'county'),
(442597, '120106', '39.170621331225', '117.16221680792', '红桥区', 442237, 'county'),
(442598, '120110', '39.139604642775', '117.41478234325', '东丽区', 442237, 'county'),
(442599, '120111', '39.035064611485', '117.12620134665', '西青区', 442237, 'county'),
(442600, '120112', '38.969790532725', '117.39290995972', '津南区', 442237, 'county'),
(442601, '120113', '39.259130625979', '117.18060609828', '北辰区', 442237, 'county'),
(442602, '120114', '39.457042575494', '117.03457791373', '武清区', 442237, 'county'),
(442603, '120115', '39.615544004133', '117.41142059078', '宝坻区', 442237, 'county'),
(442604, '120116', '39.059176638035', '117.64628627057', '滨海新区', 442237, 'county'),
(442605, '120117', '39.390421570053', '117.6312358292', '宁河区', 442237, 'county'),
(442606, '120118', '38.837510804607', '116.98682530718', '静海区', 442237, 'county'),
(442607, '120119', '40.009456311951', '117.47034191571', '蓟州区', 442237, 'county'),
(442608, '130102', '38.076874795787', '114.59262155387', '长安区', 442238, 'county'),
(442609, '130104', '38.033364550068', '114.43813995532', '桥西区', 442238, 'county'),
(442610, '130105', '38.117218640478', '114.45350142869', '新华区', 442238, 'county'),
(442611, '130107', '38.08109756116', '114.05074376291', '井陉矿区', 442238, 'county'),
(442612, '130108', '38.014621045712', '114.58638255261', '裕华区', 442238, 'county'),
(442613, '130109', '38.089490113945', '114.82809608578', '藁城区', 442238, 'county'),
(442614, '130110', '38.089969323509', '114.35731900345', '鹿泉区', 442238, 'county'),
(442615, '130111', '37.91328595181', '114.64775310253', '栾城区', 442238, 'county'),
(442616, '130121', '38.000890815811', '114.07795206335', '井陉县', 442238, 'county'),
(442617, '130123', '38.227072535479', '114.57020132348', '正定县', 442238, 'county'),
(442618, '130125', '38.546695301387', '114.45743612437', '行唐县', 442238, 'county'),
(442619, '130126', '38.510935985414', '114.18781898137', '灵寿县', 442238, 'county'),
(442620, '130127', '37.622650870757', '114.6073846934', '高邑县', 442238, 'county'),
(442621, '130128', '38.194680827355', '115.23310242793', '深泽县', 442238, 'county'),
(442622, '130129', '37.628132452966', '114.28955340433', '赞皇县', 442238, 'county'),
(442623, '130130', '38.1832860202', '114.95113960113', '无极县', 442238, 'county'),
(442624, '130131', '38.408762191725', '113.87242852701', '平山县', 442238, 'county'),
(442625, '130132', '37.807352641009', '114.42836015628', '元氏县', 442238, 'county'),
(442626, '130133', '37.769612448365', '114.83493823756', '赵县', 442238, 'county'),
(442627, '130183', '37.991145102246', '115.09173828064', '晋州市', 442238, 'county'),
(442628, '130184', '38.377578025839', '114.76227076683', '新乐市', 442238, 'county'),
(442629, '130202', '39.612986996735', '118.20604028639', '路南区', 442239, 'county'),
(442630, '130203', '39.657845680029', '118.18506997308', '路北区', 442239, 'county'),
(442631, '130204', '39.723044780378', '118.46223153818', '古冶区', 442239, 'county'),
(442632, '130205', '39.692123420846', '118.25784790075', '开平区', 442239, 'county'),
(442633, '130207', '39.384662748593', '118.08584709899', '丰南区', 442239, 'county'),
(442634, '130208', '39.789909410339', '118.05949036617', '丰润区', 442239, 'county'),
(442635, '130209', '39.266037841072', '118.41596118319', '曹妃甸区', 442239, 'county'),
(442636, '130223', '39.785508848229', '118.5837772519', '滦县', 442239, 'county'),
(442637, '130224', '39.360738899901', '118.54938466456', '滦南县', 442239, 'county'),
(442638, '130225', '39.357228891896', '118.93994305703', '乐亭县', 442239, 'county'),
(442639, '130227', '40.238507660812', '118.37138905434', '迁西县', 442239, 'county'),
(442640, '130229', '39.818843355788', '117.7347526449', '玉田县', 442239, 'county'),
(442641, '130281', '40.137901064021', '117.95763912762', '遵化市', 442239, 'county'),
(442642, '130283', '40.04044251326', '118.68695461732', '迁安市', 442239, 'county'),
(442643, '130302', '39.988779577117', '119.57761724583', '海港区', 442240, 'county'),
(442644, '130303', '40.032899628101', '119.7136155797', '山海关区', 442240, 'county'),
(442645, '130304', '39.854292584187', '119.47932079421', '北戴河区', 442240, 'county'),
(442646, '130306', '39.910857115367', '119.34003537992', '抚宁区', 442240, 'county'),
(442647, '130321', '40.353650308648', '119.13758245072', '青龙满族自治县', 442240, 'county'),
(442648, '130322', '39.638021164728', '119.09462149738', '昌黎县', 442240, 'county'),
(442649, '130324', '39.920978455186', '118.98556414609', '卢龙县', 442240, 'county'),
(442650, '130402', '36.536153078937', '114.46928986668', '邯山区', 442241, 'county'),
(442651, '130403', '36.637214815152', '114.51106763052', '丛台区', 442241, 'county'),
(442652, '130404', '36.610368592227', '114.44809470749', '复兴区', 442241, 'county'),
(442653, '130406', '36.474684997423', '114.19042164993', '峰峰矿区', 442241, 'county'),
(442654, '130421', '36.620347221062', '114.49448604232', '邯郸县', 442241, 'county'),
(442655, '130423', '36.266141946474', '114.58694416944', '临漳县', 442241, 'county'),
(442656, '130424', '36.428150647186', '114.70477468285', '成安县', 442241, 'county'),
(442657, '130425', '36.309543770756', '115.24863464404', '大名县', 442241, 'county'),
(442658, '130426', '36.598104535573', '113.74291352234', '涉县', 442241, 'county'),
(442659, '130427', '36.406730602547', '114.25510074085', '磁县', 442241, 'county'),
(442660, '130428', '36.577260887621', '114.83690510574', '肥乡县', 442241, 'county'),
(442661, '130429', '36.770200181653', '114.64160198718', '永年县', 442241, 'county'),
(442662, '130430', '36.797269787143', '115.20670231619', '邱县', 442241, 'county'),
(442663, '130431', '36.873677489817', '114.86956581384', '鸡泽县', 442241, 'county'),
(442664, '130432', '36.51192631393', '115.02087402114', '广平县', 442241, 'county'),
(442665, '130433', '36.618537005781', '115.29915662582', '馆陶县', 442241, 'county'),
(442666, '130434', '36.250567761095', '114.93600011898', '魏县', 442241, 'county'),
(442667, '130435', '36.752651265719', '115.03853247193', '曲周县', 442241, 'county'),
(442668, '130481', '36.748995476597', '114.05833396936', '武安市', 442241, 'county'),
(442669, '130502', '37.059046252073', '114.52129744384', '桥东区', 442242, 'county'),
(442670, '130503', '37.053579664221', '114.46840126286', '桥西区', 442242, 'county'),
(442671, '130521', '37.152421699275', '114.16774440241', '邢台县', 442242, 'county'),
(442672, '130522', '37.463137591617', '114.38466503755', '临城县', 442242, 'county'),
(442673, '130523', '37.314224311167', '114.30459575437', '内丘县', 442242, 'county'),
(442674, '130524', '37.517418414338', '114.70742434434', '柏乡县', 442242, 'county'),
(442675, '130525', '37.36468808358', '114.79291584707', '隆尧县', 442242, 'county'),
(442676, '130526', '37.174630101755', '114.7699671597', '任县', 442242, 'county'),
(442677, '130527', '37.016963874379', '114.75308935883', '南和县', 442242, 'county'),
(442678, '130528', '37.612086758173', '115.02167843721', '宁晋县', 442242, 'county'),
(442679, '130529', '37.278679297084', '115.05888578855', '巨鹿县', 442242, 'county'),
(442680, '130530', '37.499362567334', '115.25720361984', '新河县', 442242, 'county'),
(442681, '130531', '37.083548692406', '115.19817308929', '广宗县', 442242, 'county'),
(442682, '130532', '37.056110207564', '115.00481854709', '平乡县', 442242, 'county'),
(442683, '130533', '37.078394650565', '115.38772530687', '威县', 442242, 'county'),
(442684, '130534', '37.040529913617', '115.69158951605', '清河县', 442242, 'county'),
(442685, '130535', '36.858027353556', '115.52844117588', '临西县', 442242, 'county'),
(442686, '130581', '37.286427413275', '115.47940958601', '南宫市', 442242, 'county'),
(442687, '130582', '36.938635459346', '114.28309250179', '沙河市', 442242, 'county'),
(442688, '130602', '38.896799171923', '115.4337718341', '竞秀区', 442243, 'county'),
(442689, '130606', '38.878869183082', '115.52517138526', '莲池区', 442243, 'county'),
(442690, '130607', '38.936509575446', '115.22854614305', '满城区', 442243, 'county'),
(442691, '130608', '38.746793898598', '115.50474549359', '清苑区', 442243, 'county'),
(442692, '130609', '39.030072064834', '115.56341421452', '徐水区', 442243, 'county'),
(442693, '130623', '39.616117563205', '115.44462792481', '涞水县', 442243, 'county'),
(442694, '130624', '38.894806411217', '114.16421062387', '阜平县', 442243, 'county'),
(442695, '130626', '39.211518314259', '115.75504588838', '定兴县', 442243, 'county'),
(442696, '130627', '38.904521131249', '114.80609127315', '唐县', 442243, 'county'),
(442697, '130628', '38.673020900262', '115.83844188387', '高阳县', 442243, 'county'),
(442698, '130629', '39.057813549536', '115.90877891487', '容城县', 442243, 'county'),
(442699, '130630', '39.366936787031', '114.73045121001', '涞源县', 442243, 'county'),
(442700, '130631', '38.679014979104', '115.17834559654', '望都县', 442243, 'county'),
(442701, '130632', '38.8782552166', '115.88673101005', '安新县', 442243, 'county'),
(442702, '130633', '39.317566051144', '115.25402170203', '易县', 442243, 'county'),
(442703, '130634', '38.706612214921', '114.66066397519', '曲阳县', 442243, 'county'),
(442704, '130635', '38.528232136022', '115.66928195753', '蠡县', 442243, 'county'),
(442705, '130636', '38.927951375985', '115.07398905469', '顺平县', 442243, 'county'),
(442706, '130637', '38.459123140672', '115.48778569396', '博野县', 442243, 'county'),
(442707, '130638', '39.042786858077', '116.18329894846', '雄县', 442243, 'county'),
(442708, '130681', '39.482481810572', '115.99905364071', '涿州市', 442243, 'county'),
(442709, '130683', '38.393739990352', '115.33482671534', '安国市', 442243, 'county'),
(442710, '130684', '39.265087764832', '116.04093362477', '高碑店市', 442243, 'county'),
(442711, '130702', '40.782910350247', '114.91516641164', '桥东区', 442244, 'county'),
(442712, '130703', '40.83764647974', '114.8616234507', '桥西区', 442244, 'county'),
(442713, '130705', '40.632394360149', '115.25847218771', '宣化区', 442244, 'county'),
(442714, '130706', '40.568836928653', '115.35049833098', '下花园区', 442244, 'county'),
(442715, '130708', '40.854322579125', '114.60159442219', '万全区', 442244, 'county'),
(442716, '130709', '41.041738952718', '115.18918281511', '崇礼区', 442244, 'county'),
(442717, '130722', '41.293640752346', '114.77289736584', '张北县', 442244, 'county'),
(442718, '130723', '41.784595269099', '114.60653573475', '康保县', 442244, 'county'),
(442719, '130724', '41.580403842568', '115.63609164922', '沽源县', 442244, 'county'),
(442720, '130725', '41.132634994489', '114.15252831523', '尚义县', 442244, 'county'),
(442721, '130726', '39.879353147831', '114.71253718704', '蔚县', 442244, 'county'),
(442722, '130727', '40.138642120211', '114.39439590667', '阳原县', 442244, 'county'),
(442723, '130728', '40.559533575131', '114.50260736695', '怀安县', 442244, 'county'),
(442724, '130730', '40.34798364385', '115.63406061974', '怀来县', 442244, 'county'),
(442725, '130731', '40.101875913481', '115.22392517513', '涿鹿县', 442244, 'county'),
(442726, '130732', '40.956026259537', '115.89222267195', '赤城县', 442244, 'county'),
(442727, '130802', '40.971406352197', '117.94835524238', '双桥区', 442245, 'county'),
(442728, '130803', '41.051453160703', '117.80933581725', '双滦区', 442245, 'county'),
(442729, '130804', '40.531760281234', '117.67942626427', '鹰手营子矿区', 442245, 'county'),
(442730, '130821', '40.9732421823', '118.12571829805', '承德县', 442245, 'county'),
(442731, '130822', '40.458141686295', '117.72613599005', '兴隆县', 442245, 'county'),
(442732, '130823', '41.075303768703', '118.73932350858', '平泉县', 442245, 'county'),
(442733, '130824', '40.924820741761', '117.36956340989', '滦平县', 442245, 'county'),
(442734, '130825', '41.517994972231', '117.56992967905', '隆化县', 442245, 'county'),
(442735, '130826', '41.425684335184', '116.62379481268', '丰宁满族自治县', 442245, 'county'),
(442736, '130827', '40.578090378096', '118.63588822017', '宽城满族自治县', 442245, 'county'),
(442737, '130828', '42.108024565862', '117.54702150524', '围场满族蒙古族自治县', 442245, 'county'),
(442738, '130902', '38.308375333084', '116.89305880724', '新华区', 442246, 'county'),
(442739, '130903', '38.314446124596', '116.84485357764', '运河区', 442246, 'county'),
(442740, '130921', '38.302138696207', '116.86271383128', '沧县', 442246, 'county'),
(442741, '130922', '38.565778328556', '116.85123400252', '青县', 442246, 'county'),
(442742, '130923', '37.887451603688', '116.67783233648', '东光县', 442246, 'county'),
(442743, '130924', '38.142470216907', '117.56726425888', '海兴县', 442246, 'county'),
(442744, '130925', '37.960369724102', '117.26693989632', '盐山县', 442246, 'county'),
(442745, '130926', '38.422207122829', '115.88581610558', '肃宁县', 442246, 'county'),
(442746, '130927', '38.023185702825', '116.8658497774', '南皮县', 442246, 'county'),
(442747, '130928', '37.661863472094', '116.5080334073', '吴桥县', 442246, 'county'),
(442748, '130929', '38.242725840471', '116.17550530237', '献县', 442246, 'county'),
(442749, '130930', '38.091264713342', '117.15953838544', '孟村回族自治县', 442246, 'county'),
(442750, '130981', '38.090278710884', '116.38923597745', '泊头市', 442246, 'county'),
(442751, '130982', '38.74110464111', '116.16321405193', '任丘市', 442246, 'county'),
(442752, '130983', '38.401521845487', '117.40021701974', '黄骅市', 442246, 'county'),
(442753, '130984', '38.483721432479', '116.27159283893', '河间市', 442246, 'county'),
(442754, '131002', '39.345312180639', '116.79612310881', '安次区', 442247, 'county'),
(442755, '131003', '39.533685537455', '116.69423648939', '广阳区', 442247, 'county'),
(442756, '131022', '39.351105940994', '116.28967015726', '固安县', 442247, 'county'),
(442757, '131023', '39.302836430211', '116.5605569701', '永清县', 442247, 'county'),
(442758, '131024', '39.743100032865', '117.05130555355', '香河县', 442247, 'county'),
(442759, '131025', '38.668802703656', '116.58863867606', '大城县', 442247, 'county'),
(442760, '131026', '38.911390482572', '116.49481687118', '文安县', 442247, 'county'),
(442761, '131028', '39.89531635509', '116.95507644864', '大厂回族自治县', 442247, 'county'),
(442762, '131081', '39.109320079055', '116.57430598976', '霸州市', 442247, 'county'),
(442763, '131082', '39.96742764877', '117.02128418409', '三河市', 442247, 'county'),
(442764, '131102', '37.72421788608', '115.66665700012', '桃城区', 442248, 'county'),
(442765, '131103', '37.53643502058', '115.44750567041', '冀州区', 442248, 'county'),
(442766, '131121', '37.461024106054', '115.75767748261', '枣强县', 442248, 'county'),
(442767, '131122', '37.827678592246', '115.94450660708', '武邑县', 442248, 'county'),
(442768, '131123', '38.050513034027', '115.920118282', '武强县', 442248, 'county'),
(442769, '131124', '38.223059241042', '115.74000746168', '饶阳县', 442248, 'county'),
(442770, '131125', '38.243195869487', '115.49041582246', '安平县', 442248, 'county'),
(442771, '131126', '37.356997906367', '115.97805666289', '故城县', 442248, 'county'),
(442772, '131127', '37.668477471141', '116.20013356506', '景县', 442248, 'county'),
(442773, '131128', '37.912309213617', '116.32842518537', '阜城县', 442248, 'county'),
(442774, '131182', '37.957012862702', '115.58669880842', '深州市', 442248, 'county'),
(442775, '139001', '38.465839158048', '115.05740695232', '定州市', 442249, 'county'),
(442776, '139002', '37.924121876409', '115.29874950521', '辛集市', 442249, 'county'),
(442777, '140105', '37.753527970896', '112.57740860671', '小店区', 442250, 'county'),
(442778, '140106', '37.865737302061', '112.66320298122', '迎泽区', 442250, 'county'),
(442779, '140107', '37.915556056965', '112.62983632135', '杏花岭区', 442250, 'county'),
(442780, '140108', '37.972757839535', '112.48843997984', '尖草坪区', 442250, 'county'),
(442781, '140109', '37.894693447581', '112.40285697662', '万柏林区', 442250, 'county'),
(442782, '140110', '37.748674917003', '112.48158725626', '晋源区', 442250, 'county'),
(442783, '140121', '37.59324244737', '112.38708511797', '清徐县', 442250, 'county'),
(442784, '140122', '38.158246373698', '112.67265853687', '阳曲县', 442250, 'county'),
(442785, '140123', '38.034584043133', '111.797820928', '娄烦县', 442250, 'county'),
(442786, '140181', '37.90517928255', '112.1077390237', '古交市', 442250, 'county'),
(442787, '140202', '40.102542866559', '113.29696587275', '城区', 442251, 'county'),
(442788, '140203', '40.036495634995', '113.0470017583', '矿区', 442251, 'county'),
(442789, '140211', '40.051891387407', '113.22645661564', '南郊区', 442251, 'county'),
(442790, '140212', '40.267127127574', '113.23689411719', '新荣区', 442251, 'county'),
(442791, '140221', '40.222311526135', '113.82318140606', '阳高县', 442251, 'county'),
(442792, '140222', '40.403528534338', '114.16812988719', '天镇县', 442251, 'county'),
(442793, '140223', '39.76899447952', '114.16170176527', '广灵县', 442251, 'county'),
(442794, '140224', '39.377267777348', '114.21309517425', '灵丘县', 442251, 'county'),
(442795, '140225', '39.634162361299', '113.71075899599', '浑源县', 442251, 'county'),
(442796, '140226', '40.000737963069', '112.77785639076', '左云县', 442251, 'county'),
(442797, '140227', '40.001627488893', '113.58386582098', '大同县', 442251, 'county'),
(442798, '140302', '37.85786536147', '113.61283811719', '城区', 442252, 'county'),
(442799, '140303', '37.890804244519', '113.54077065934', '矿区', 442252, 'county'),
(442800, '140311', '37.911503911114', '113.56808615363', '郊区', 442252, 'county'),
(442801, '140321', '37.8492714173', '113.76897794042', '平定县', 442252, 'county'),
(442802, '140322', '38.229385734147', '113.36096660369', '盂县', 442252, 'county'),
(442803, '140402', '36.184511192113', '113.12316935827', '城区', 442253, 'county'),
(442804, '140411', '36.270339558413', '113.11069620661', '郊区', 442253, 'county'),
(442805, '140421', '36.024679976201', '113.08619419794', '长治县', 442253, 'county'),
(442806, '140423', '36.580200785754', '112.98897348398', '襄垣县', 442253, 'county'),
(442807, '140424', '36.342609751076', '112.75036278967', '屯留县', 442253, 'county'),
(442808, '140425', '36.221794153091', '113.53368897635', '平顺县', 442253, 'county'),
(442809, '140426', '36.619367610278', '113.39685159379', '黎城县', 442253, 'county'),
(442810, '140427', '35.99265193372', '113.37199790438', '壶关县', 442253, 'county'),
(442811, '140428', '36.110999402019', '112.80225403294', '长子县', 442253, 'county'),
(442812, '140429', '36.888322821209', '112.96751985958', '武乡县', 442253, 'county'),
(442813, '140430', '36.70738347605', '112.65221013617', '沁县', 442253, 'county'),
(442814, '140431', '36.701566639488', '112.29009399197', '沁源县', 442253, 'county'),
(442815, '140481', '36.374406273238', '113.25438708828', '潞城市', 442253, 'county'),
(442816, '140502', '35.513593270468', '112.84269710529', '城区', 442254, 'county'),
(442817, '140521', '35.751489118151', '112.37742990987', '沁水县', 442254, 'county'),
(442818, '140522', '35.426540841161', '112.36152699508', '阳城县', 442254, 'county'),
(442819, '140524', '35.690743897919', '113.34338659863', '陵川县', 442254, 'county'),
(442820, '140525', '35.475851325496', '112.87098535033', '泽州县', 442254, 'county'),
(442821, '140581', '35.809742457991', '112.93511535362', '高平市', 442254, 'county'),
(442822, '140602', '39.243272437238', '112.5562001526', '朔城区', 442255, 'county'),
(442823, '140603', '39.640007394398', '112.30434987236', '平鲁区', 442255, 'county');
INSERT INTO `region` (`id`, `code`, `lat`, `lng`, `name`, `parent_id`, `by_type`) VALUES
(442824, '140621', '39.521049673137', '112.78680490549', '山阴县', 442255, 'county'),
(442825, '140622', '39.509316043686', '113.26059286958', '应县', 442255, 'county'),
(442826, '140623', '40.008135706467', '112.42167745341', '右玉县', 442255, 'county'),
(442827, '140624', '39.793570836032', '113.11230462343', '怀仁县', 442255, 'county'),
(442828, '140702', '37.650824689054', '112.84373652716', '榆次区', 442256, 'county'),
(442829, '140721', '37.140049981591', '112.95418082333', '榆社县', 442256, 'county'),
(442830, '140722', '37.03279458538', '113.47453786444', '左权县', 442256, 'county'),
(442831, '140723', '37.348373699108', '113.47493445138', '和顺县', 442256, 'county'),
(442832, '140724', '37.563418385072', '113.76210572071', '昔阳县', 442256, 'county'),
(442833, '140725', '37.825118914407', '113.14161086395', '寿阳县', 442256, 'county'),
(442834, '140726', '37.407696414459', '112.73643253249', '太谷县', 442256, 'county'),
(442835, '140727', '37.292198086629', '112.46906595172', '祁县', 442256, 'county'),
(442836, '140728', '37.148089778462', '112.26549326017', '平遥县', 442256, 'county'),
(442837, '140729', '36.834487193362', '111.73550355035', '灵石县', 442256, 'county'),
(442838, '140781', '37.02547627594', '111.99518801957', '介休市', 442256, 'county'),
(442839, '140802', '35.063676878932', '110.96193094165', '盐湖区', 442257, 'county'),
(442840, '140821', '35.149379501121', '110.62589540589', '临猗县', 442257, 'county'),
(442841, '140822', '35.388134013652', '110.71553950499', '万荣县', 442257, 'county'),
(442842, '140823', '35.373753157', '111.31928675078', '闻喜县', 442257, 'county'),
(442843, '140824', '35.59826692411', '110.96512183757', '稷山县', 442257, 'county'),
(442844, '140825', '35.631582540507', '111.17287529232', '新绛县', 442257, 'county'),
(442845, '140826', '35.498578532808', '111.64482039841', '绛县', 442257, 'county'),
(442846, '140827', '35.221584155393', '111.82478688142', '垣曲县', 442257, 'county'),
(442847, '140828', '35.126679510784', '111.35838628885', '夏县', 442257, 'county'),
(442848, '140829', '34.888645774448', '111.25110932094', '平陆县', 442257, 'county'),
(442849, '140830', '34.709534760447', '110.61649553806', '芮城县', 442257, 'county'),
(442850, '140881', '34.894671510755', '110.48894872131', '永济市', 442257, 'county'),
(442851, '140882', '35.631891049091', '110.70853926353', '河津市', 442257, 'county'),
(442852, '140902', '38.437831964453', '112.60520013418', '忻府区', 442258, 'county'),
(442853, '140921', '38.516749763878', '113.03558876456', '定襄县', 442258, 'county'),
(442854, '140922', '38.778174001492', '113.44210404535', '五台县', 442258, 'county'),
(442855, '140923', '39.093197224067', '113.05058168825', '代县', 442258, 'county'),
(442856, '140924', '39.204756994709', '113.596213567', '繁峙县', 442258, 'county'),
(442857, '140925', '38.821889666345', '112.19389583349', '宁武县', 442258, 'county'),
(442858, '140926', '38.400067154102', '112.06499425223', '静乐县', 442258, 'county'),
(442859, '140927', '39.173053445654', '112.00991986754', '神池县', 442258, 'county'),
(442860, '140928', '39.008730857984', '111.74475714392', '五寨县', 442258, 'county'),
(442861, '140929', '38.73795692606', '111.54356839151', '岢岚县', 442258, 'county'),
(442862, '140930', '39.206439528631', '111.3598292601', '河曲县', 442258, 'county'),
(442863, '140931', '38.887135247044', '111.14283481361', '保德县', 442258, 'county'),
(442864, '140932', '39.464649232881', '111.67190327635', '偏关县', 442258, 'county'),
(442865, '140981', '38.838876172747', '112.68212831914', '原平市', 442258, 'county'),
(442866, '141002', '36.125936912419', '111.47466486211', '尧都区', 442259, 'county'),
(442867, '141021', '35.704200978944', '111.52704105623', '曲沃县', 442259, 'county'),
(442868, '141022', '35.695397582179', '111.83920947478', '翼城县', 442259, 'county'),
(442869, '141023', '35.874204029953', '111.38595309536', '襄汾县', 442259, 'county'),
(442870, '141024', '36.325514180326', '111.65937789135', '洪洞县', 442259, 'county'),
(442871, '141025', '36.303822531038', '112.01124254119', '古县', 442259, 'county'),
(442872, '141026', '36.164295531066', '112.30790366347', '安泽县', 442259, 'county'),
(442873, '141027', '35.945830766006', '111.92840887398', '浮山县', 442259, 'county'),
(442874, '141028', '36.158677317484', '110.7281619704', '吉县', 442259, 'county'),
(442875, '141029', '35.925119179378', '110.94412841404', '乡宁县', 442259, 'county'),
(442876, '141030', '36.432636300532', '110.71080544253', '大宁县', 442259, 'county'),
(442877, '141031', '36.711950508392', '111.00996531617', '隰县', 442259, 'county'),
(442878, '141032', '36.737137367462', '110.61789818355', '永和县', 442259, 'county'),
(442879, '141033', '36.424599698879', '111.16235867375', '蒲县', 442259, 'county'),
(442880, '141034', '36.642781389504', '111.48314834543', '汾西县', 442259, 'county'),
(442881, '141081', '35.62178548788', '111.37150924676', '侯马市', 442259, 'county'),
(442882, '141082', '36.599677829115', '111.8308356262', '霍州市', 442259, 'county'),
(442883, '141102', '37.552339254903', '111.31314199347', '离石区', 442260, 'county'),
(442884, '141121', '37.459705909704', '111.96499464978', '文水县', 442260, 'county'),
(442885, '141122', '37.68704558482', '111.81992715422', '交城县', 442260, 'county'),
(442886, '141123', '38.392262583946', '111.0693110824', '兴县', 442260, 'county'),
(442887, '141124', '37.962867394138', '110.90114744504', '临县', 442260, 'county'),
(442888, '141125', '37.403754146298', '110.87692675415', '柳林县', 442260, 'county'),
(442889, '141126', '37.035145108626', '110.75347868183', '石楼县', 442260, 'county'),
(442890, '141127', '38.343813372012', '111.60664055968', '岚县', 442260, 'county'),
(442891, '141128', '37.886687741974', '111.33797892211', '方山县', 442260, 'county'),
(442892, '141129', '37.266317510804', '111.18590350772', '中阳县', 442260, 'county'),
(442893, '141130', '36.957718536996', '111.31592365888', '交口县', 442260, 'county'),
(442894, '141181', '37.118132778217', '111.63764576631', '孝义市', 442260, 'county'),
(442895, '141182', '37.316764309106', '111.74599591288', '汾阳市', 442260, 'county'),
(442896, '150102', '40.929360778776', '111.79132678714', '新城区', 442261, 'county'),
(442897, '150103', '40.838894763788', '111.5968855951', '回民区', 442261, 'county'),
(442898, '150104', '40.747386672042', '111.65855345988', '玉泉区', 442261, 'county'),
(442899, '150105', '40.788864152356', '111.87633478501', '赛罕区', 442261, 'county'),
(442900, '150121', '40.689987016139', '111.23470409261', '土默特左旗', 442261, 'county'),
(442901, '150122', '40.361083978494', '111.31970020313', '托克托县', 442261, 'county'),
(442902, '150123', '40.333868442059', '111.90169267122', '和林格尔县', 442261, 'county'),
(442903, '150124', '39.889117744685', '111.70623630691', '清水河县', 442261, 'county'),
(442904, '150125', '41.1162043874', '111.17957193814', '武川县', 442261, 'county'),
(442905, '150202', '40.589124487996', '110.07014136051', '东河区', 442262, 'county'),
(442906, '150203', '40.658057498224', '109.80683355282', '昆都仑区', 442262, 'county'),
(442907, '150204', '40.658777959476', '109.90367483934', '青山区', 442262, 'county'),
(442908, '150205', '40.716464297272', '110.29921474522', '石拐区', 442262, 'county'),
(442909, '150206', '41.789992502326', '109.98916893149', '白云鄂博矿区', 442262, 'county'),
(442910, '150207', '40.627202278275', '109.9491974592', '九原区', 442262, 'county'),
(442911, '150221', '40.527995764374', '110.69325794788', '土默特右旗', 442262, 'county'),
(442912, '150222', '41.104725412274', '110.16759209358', '固阳县', 442262, 'county'),
(442913, '150223', '41.943507148267', '110.28618869999', '达尔罕茂明安联合旗', 442262, 'county'),
(442914, '150302', '39.734833651275', '106.86148184332', '海勃湾区', 442263, 'county'),
(442915, '150303', '39.296209479392', '106.92539717866', '海南区', 442263, 'county'),
(442916, '150304', '39.535877701433', '106.72585891133', '乌达区', 442263, 'county'),
(442917, '150402', '42.286232134079', '118.99810293421', '红山区', 442264, 'county'),
(442918, '150403', '42.184130648802', '119.2681694129', '元宝山区', 442264, 'county'),
(442919, '150404', '42.268753015289', '118.75710571166', '松山区', 442264, 'county'),
(442920, '150421', '44.195956597411', '120.05324069384', '阿鲁科尔沁旗', 442264, 'county'),
(442921, '150422', '44.203430813088', '119.28076636509', '巴林左旗', 442264, 'county'),
(442922, '150423', '43.684786631454', '118.9460897431', '巴林右旗', 442264, 'county'),
(442923, '150424', '43.771462211479', '118.1102161479', '林西县', 442264, 'county'),
(442924, '150425', '43.218237176681', '117.35857031121', '克什克腾旗', 442264, 'county'),
(442925, '150426', '42.973979919258', '119.25464294075', '翁牛特旗', 442264, 'county'),
(442926, '150428', '41.908351449935', '118.66705601357', '喀喇沁旗', 442264, 'county'),
(442927, '150429', '41.571040867139', '118.90549936909', '宁城县', 442264, 'county'),
(442928, '150430', '42.430592238203', '120.15771329609', '敖汉旗', 442264, 'county'),
(442929, '150502', '43.658290149837', '122.29129415356', '科尔沁区', 442265, 'county'),
(442930, '150521', '44.0575792852', '122.49918004442', '科尔沁左翼中旗', 442265, 'county'),
(442931, '150522', '43.196082751665', '122.69734535162', '科尔沁左翼后旗', 442265, 'county'),
(442932, '150523', '43.734941954391', '121.32409399005', '开鲁县', 442265, 'county'),
(442933, '150524', '42.810038215314', '121.5730378859', '库伦旗', 442265, 'county'),
(442934, '150525', '42.972383010739', '120.94078899637', '奈曼旗', 442265, 'county'),
(442935, '150526', '44.82245130193', '120.59602806799', '扎鲁特旗', 442265, 'county'),
(442936, '150581', '45.52810605633', '119.57974844022', '霍林郭勒市', 442265, 'county'),
(442937, '150602', '39.805585913146', '109.76441928582', '东胜区', 442266, 'county'),
(442938, '150603', '39.640791926893', '109.84087569351', '康巴什区', 442266, 'county'),
(442939, '150621', '40.220264473893', '109.86619090676', '达拉特旗', 442266, 'county'),
(442940, '150622', '39.79472489563', '110.88623942079', '准格尔旗', 442266, 'county'),
(442941, '150623', '38.275938287288', '107.59700999652', '鄂托克前旗', 442266, 'county'),
(442942, '150624', '39.286296593278', '107.75202023325', '鄂托克旗', 442266, 'county'),
(442943, '150625', '40.212873152738', '108.21282820432', '杭锦旗', 442266, 'county'),
(442944, '150626', '38.640475147234', '108.88966323666', '乌审旗', 442266, 'county'),
(442945, '150627', '39.420695918404', '109.70418618841', '伊金霍洛旗', 442266, 'county'),
(442946, '150702', '49.279245456202', '120.04288208342', '海拉尔区', 442267, 'county'),
(442947, '150703', '49.461481568108', '117.72318498536', '扎赉诺尔区', 442267, 'county'),
(442948, '150721', '48.639988741071', '123.17195423134', '阿荣旗', 442267, 'county'),
(442949, '150722', '49.104886651718', '124.47443404901', '莫力达瓦达斡尔族自治旗', 442267, 'county'),
(442950, '150723', '50.348754571528', '123.81727783782', '鄂伦春自治旗', 442267, 'county'),
(442951, '150724', '48.499136514599', '120.06748322167', '鄂温克族自治旗', 442267, 'county'),
(442952, '150725', '49.605281276761', '119.53520765754', '陈巴尔虎旗', 442267, 'county'),
(442953, '150726', '48.43639187877', '118.62152477909', '新巴尔虎左旗', 442267, 'county'),
(442954, '150727', '48.644978915379', '116.8021843422', '新巴尔虎右旗', 442267, 'county'),
(442955, '150781', '49.500031717154', '117.60368677619', '满洲里市', 442267, 'county'),
(442956, '150782', '49.329995939597', '121.51266780552', '牙克石市', 442267, 'county'),
(442957, '150783', '47.7434033831', '121.92920216562', '扎兰屯市', 442267, 'county'),
(442958, '150784', '51.660818880977', '120.65276364824', '额尔古纳市', 442267, 'county'),
(442959, '150785', '51.37592516127', '121.79771324217', '根河市', 442267, 'county'),
(442960, '150802', '40.932018223224', '107.44183964667', '临河区', 442268, 'county'),
(442961, '150821', '41.045426664817', '108.07228406065', '五原县', 442268, 'county'),
(442962, '150822', '40.55518106886', '106.7000000567', '磴口县', 442268, 'county'),
(442963, '150823', '40.905993260887', '109.10529705882', '乌拉特前旗', 442268, 'county'),
(442964, '150824', '41.831044527428', '108.46454180074', '乌拉特中旗', 442268, 'county'),
(442965, '150825', '41.53194458396', '106.41380804671', '乌拉特后旗', 442268, 'county'),
(442966, '150826', '40.890870780779', '107.03345374933', '杭锦后旗', 442268, 'county'),
(442967, '150902', '41.027765971469', '113.11283222874', '集宁区', 442269, 'county'),
(442968, '150921', '40.958869485808', '112.44337671416', '卓资县', 442269, 'county'),
(442969, '150922', '41.979126377538', '114.16573790656', '化德县', 442269, 'county'),
(442970, '150923', '41.726516851564', '113.62215528367', '商都县', 442269, 'county'),
(442971, '150924', '40.952666521778', '113.77372051762', '兴和县', 442269, 'county'),
(442972, '150925', '40.502780210604', '112.55043247172', '凉城县', 442269, 'county'),
(442973, '150926', '40.981709597107', '113.24109639163', '察哈尔右翼前旗', 442269, 'county'),
(442974, '150927', '41.428255371505', '112.47074335399', '察哈尔右翼中旗', 442269, 'county'),
(442975, '150928', '41.529483090789', '113.06969288248', '察哈尔右翼后旗', 442269, 'county'),
(442976, '150929', '42.30714575607', '111.58903652853', '四子王旗', 442269, 'county'),
(442977, '150981', '40.558336025296', '113.30867650253', '丰镇市', 442269, 'county'),
(442978, '152201', '46.116943570165', '122.0815338095', '乌兰浩特市', 442270, 'county'),
(442979, '152202', '47.163696335727', '120.35753387505', '阿尔山市', 442270, 'county'),
(442980, '152221', '46.334025380898', '121.22152365342', '科尔沁右翼前旗', 442270, 'county'),
(442981, '152222', '45.242068815668', '121.19851019319', '科尔沁右翼中旗', 442270, 'county'),
(442982, '152223', '46.790807786397', '122.38814625782', '扎赉特旗', 442270, 'county'),
(442983, '152224', '45.632866219095', '121.51921179351', '突泉县', 442270, 'county'),
(442984, '152501', '43.417780458226', '111.96617841378', '二连浩特市', 442271, 'county'),
(442985, '152502', '44.078961129099', '116.13694826431', '锡林浩特市', 442271, 'county'),
(442986, '152522', '44.276507422523', '114.89347121165', '阿巴嘎旗', 442271, 'county'),
(442987, '152523', '44.039238043252', '113.14030742275', '苏尼特左旗', 442271, 'county'),
(442988, '152524', '42.900963777858', '112.91159981029', '苏尼特右旗', 442271, 'county'),
(442989, '152525', '45.826664793338', '117.8104504134', '东乌珠穆沁旗', 442271, 'county'),
(442990, '152526', '44.715902995292', '117.81696314273', '西乌珠穆沁旗', 442271, 'county'),
(442991, '152527', '41.906215635041', '115.30455821777', '太仆寺旗', 442271, 'county'),
(442992, '152528', '42.368275700926', '114.12058911409', '镶黄旗', 442271, 'county'),
(442993, '152529', '42.554842970033', '115.02434728451', '正镶白旗', 442271, 'county'),
(442994, '152530', '42.674413879311', '115.94010983058', '正蓝旗', 442271, 'county'),
(442995, '152531', '42.196600874379', '116.4986386762', '多伦县', 442271, 'county'),
(442996, '152921', '39.547806401013', '105.03824684198', '阿拉善左旗', 442272, 'county'),
(442997, '152922', '40.186228955604', '102.44385599727', '阿拉善右旗', 442272, 'county'),
(442998, '152923', '41.693799843161', '100.09951238471', '额济纳旗', 442272, 'county'),
(442999, '210102', '41.786474395792', '123.41433166046', '和平区', 442273, 'county'),
(443000, '210103', '41.798304641933', '123.45355228301', '沈河区', 442273, 'county'),
(443001, '210104', '41.835279080775', '123.49892677691', '大东区', 442273, 'county'),
(443002, '210105', '41.848913204573', '123.41537632672', '皇姑区', 442273, 'county'),
(443003, '210106', '41.805724167622', '123.35862982907', '铁西区', 442273, 'county'),
(443004, '210111', '41.589345157565', '123.42628905169', '苏家屯区', 442273, 'county'),
(443005, '210112', '41.794157738255', '123.5714290915', '浑南区', 442273, 'county'),
(443006, '210113', '42.043849976101', '123.5186904027', '沈北新区', 442273, 'county'),
(443007, '210114', '41.843551023712', '123.2428469731', '于洪区', 442273, 'county'),
(443008, '210115', '41.500330370098', '122.79857550059', '辽中区', 442273, 'county'),
(443009, '210123', '42.765540738313', '123.27359808776', '康平县', 442273, 'county'),
(443010, '210124', '42.415297839562', '123.24889709003', '法库县', 442273, 'county'),
(443011, '210181', '42.016776193846', '122.86641820399', '新民市', 442273, 'county'),
(443012, '210202', '38.900436431992', '121.67796628923', '中山区', 442274, 'county'),
(443013, '210203', '38.913369529939', '121.6258229781', '西岗区', 442274, 'county'),
(443014, '210204', '38.921778341674', '121.5826178068', '沙河口区', 442274, 'county'),
(443015, '210211', '38.955461760661', '121.52850037949', '甘井子区', 442274, 'county'),
(443016, '210212', '38.908290673003', '121.29593564059', '旅顺口区', 442274, 'county'),
(443017, '210213', '39.29861907186', '121.95658248044', '金州区', 442274, 'county'),
(443018, '210214', '39.651792833684', '122.21603953088', '普兰店区', 442274, 'county'),
(443019, '210224', '39.26010853029', '122.74826454271', '长海县', 442274, 'county'),
(443020, '210281', '39.70895639619', '121.79069878874', '瓦房店市', 442274, 'county'),
(443021, '210283', '39.858909784172', '122.934145267', '庄河市', 442274, 'county'),
(443022, '210302', '41.118235115557', '123.02070584518', '铁东区', 442275, 'county'),
(443023, '210303', '41.127872476833', '122.98578619475', '铁西区', 442275, 'county'),
(443024, '210304', '41.164172891853', '123.04047350708', '立山区', 442275, 'county'),
(443025, '210311', '41.061328521987', '123.01400529455', '千山区', 442275, 'county'),
(443026, '210321', '41.347099748004', '122.4436825276', '台安县', 442275, 'county'),
(443027, '210323', '40.4031809953', '123.34606899826', '岫岩满族自治县', 442275, 'county'),
(443028, '210381', '40.840354247523', '122.79120058219', '海城市', 442275, 'county'),
(443029, '210402', '41.869789660664', '123.91136857188', '新抚区', 442276, 'county'),
(443030, '210403', '41.833588275171', '124.02924934124', '东洲区', 442276, 'county'),
(443031, '210404', '41.860403588778', '123.78599647355', '望花区', 442276, 'county'),
(443032, '210411', '41.916014133796', '123.90172355545', '顺城区', 442276, 'county'),
(443033, '210421', '41.750076669591', '124.1365888338', '抚顺县', 442276, 'county'),
(443034, '210422', '41.635119411', '124.82786556411', '新宾满族自治县', 442276, 'county'),
(443035, '210423', '42.118882344791', '124.92431743309', '清原满族自治县', 442276, 'county'),
(443036, '210502', '41.240400691895', '123.69257521577', '平山区', 442277, 'county'),
(443037, '210503', '41.45615399333', '123.71186569778', '溪湖区', 442277, 'county'),
(443038, '210504', '41.347752110456', '123.90173685037', '明山区', 442277, 'county'),
(443039, '210505', '41.122716220999', '123.82788014761', '南芬区', 442277, 'county'),
(443040, '210521', '41.195670233912', '124.15856431847', '本溪满族自治县', 442277, 'county'),
(443041, '210522', '41.261815877129', '125.29002787', '桓仁满族自治县', 442277, 'county'),
(443042, '210602', '40.173197015058', '124.35032097797', '元宝区', 442278, 'county'),
(443043, '210603', '40.067035318752', '124.35556286011', '振兴区', 442278, 'county'),
(443044, '210604', '40.211546606919', '124.29219665893', '振安区', 442278, 'county'),
(443045, '210624', '40.766142006754', '124.93410611424', '宽甸满族自治县', 442278, 'county'),
(443046, '210681', '39.981217334184', '123.876870274', '东港市', 442278, 'county'),
(443047, '210682', '40.579570306659', '124.07296025051', '凤城市', 442278, 'county'),
(443048, '210702', '41.14138819307', '121.1264337451', '古塔区', 442279, 'county'),
(443049, '210703', '41.13438040426', '121.18266452595', '凌河区', 442279, 'county'),
(443050, '210711', '41.136830132753', '121.11864471768', '太和区', 442279, 'county'),
(443051, '210726', '41.799697885598', '122.26073588726', '黑山县', 442279, 'county'),
(443052, '210727', '41.534928118312', '121.30187737888', '义县', 442279, 'county'),
(443053, '210781', '41.152566155094', '121.28557458803', '凌海市', 442279, 'county'),
(443054, '210782', '41.547118023827', '121.86454971392', '北镇市', 442279, 'county'),
(443055, '210802', '40.703009826765', '122.2655920301', '站前区', 442280, 'county'),
(443056, '210803', '40.66694904618', '122.21012624622', '西市区', 442280, 'county'),
(443057, '210804', '40.25258448446', '122.17689658108', '鲅鱼圈区', 442280, 'county'),
(443058, '210811', '40.672565437571', '122.33090270339', '老边区', 442280, 'county'),
(443059, '210881', '40.235441470469', '122.47732679351', '盖州市', 442280, 'county'),
(443060, '210882', '40.646915451877', '122.57155106236', '大石桥市', 442280, 'county'),
(443061, '210902', '41.99090249247', '121.65270512981', '海州区', 442281, 'county'),
(443062, '210903', '42.074627619468', '121.82432100766', '新邱区', 442281, 'county'),
(443063, '210904', '42.00945236252', '121.73775310227', '太平区', 442281, 'county'),
(443064, '210905', '41.754998439335', '121.44683854847', '清河门区', 442281, 'county'),
(443065, '210911', '42.043253678758', '121.6275568874', '细河区', 442281, 'county'),
(443066, '210921', '42.157500408157', '121.69557778355', '阜新蒙古族自治县', 442281, 'county'),
(443067, '210922', '42.523754435526', '122.47417316389', '彰武县', 442281, 'county'),
(443068, '211002', '41.279285816853', '123.17516309965', '白塔区', 442282, 'county'),
(443069, '211003', '41.271122206557', '123.20121638487', '文圣区', 442282, 'county'),
(443070, '211004', '41.220763801748', '123.22051827536', '宏伟区', 442282, 'county'),
(443071, '211005', '41.145969646405', '123.42628014056', '弓长岭区', 442282, 'county'),
(443072, '211011', '41.274593139071', '123.17837427236', '太子河区', 442282, 'county'),
(443073, '211021', '41.077281158776', '123.21982126206', '辽阳县', 442282, 'county'),
(443074, '211081', '41.420098857086', '123.31257357315', '灯塔市', 442282, 'county'),
(443075, '211102', '41.193224510116', '122.03203843649', '双台子区', 442283, 'county'),
(443076, '211103', '41.155830887559', '121.96962911034', '兴隆台区', 442283, 'county'),
(443077, '211104', '40.905899458766', '122.08839097548', '大洼区', 442283, 'county'),
(443078, '211122', '41.193475065521', '121.95216562366', '盘山县', 442283, 'county'),
(443082, '211202', '42.248294823185', '123.85851586889', '银州区', 442284, 'county'),
(443084, '211204', '42.508557048192', '124.27578016446', '清河区', 442284, 'county'),
(443085, '211221', '42.222764650024', '123.91452868265', '铁岭县', 442284, 'county'),
(443086, '211223', '42.712739429005', '124.73850222789', '西丰县', 442284, 'county'),
(443087, '211224', '43.000462116167', '123.94640914451', '昌图县', 442284, 'county'),
(443088, '211281', '42.442929890534', '123.58434789559', '调兵山市', 442284, 'county'),
(443089, '211282', '42.471223289128', '124.28377598099', '开原市', 442284, 'county'),
(443090, '211302', '41.605740189556', '120.48407290204', '双塔区', 442285, 'county'),
(443091, '211303', '41.606226996662', '120.40133294592', '龙城区', 442285, 'county'),
(443092, '211321', '41.372795903547', '120.30506072918', '朝阳县', 442285, 'county'),
(443093, '211322', '41.842222586595', '119.63252714815', '建平县', 442285, 'county'),
(443094, '211324', '41.143623845035', '119.77553367022', '喀喇沁左翼蒙古族自治县', 442285, 'county'),
(443095, '211381', '41.865071031498', '120.81188458747', '北票市', 442285, 'county'),
(443096, '211382', '40.981801128352', '119.27154312683', '凌源市', 442285, 'county'),
(443097, '211402', '40.888537340117', '120.6883607801', '连山区', 442286, 'county'),
(443098, '211403', '40.750992710489', '120.90458597059', '龙港区', 442286, 'county'),
(443099, '211404', '41.137035783771', '120.66464506548', '南票区', 442286, 'county'),
(443100, '211421', '40.305129005823', '120.02630174192', '绥中县', 442286, 'county'),
(443101, '211422', '40.716827705586', '119.83489152944', '建昌县', 442286, 'county'),
(443102, '211481', '40.596284243832', '120.47552727234', '兴城市', 442286, 'county'),
(443103, '220102', '43.732190540843', '125.41964874071', '南关区', 442287, 'county'),
(443104, '220103', '43.998252407951', '125.34489933527', '宽城区', 442287, 'county'),
(443105, '220104', '43.689108619451', '125.27822648218', '朝阳区', 442287, 'county'),
(443106, '220105', '43.872222715497', '125.61148484631', '二道区', 442287, 'county'),
(443107, '220106', '43.912164564835', '125.19133076327', '绿园区', 442287, 'county'),
(443108, '220112', '43.531747024963', '125.71282235937', '双阳区', 442287, 'county'),
(443109, '220113', '44.194372106981', '125.96882675838', '九台区', 442287, 'county'),
(443110, '220122', '44.461506089801', '125.09432707273', '农安县', 442287, 'county'),
(443111, '220182', '44.879422926679', '126.60250076501', '榆树市', 442287, 'county'),
(443112, '220183', '44.510507146916', '125.76904438895', '德惠市', 442287, 'county'),
(443113, '220202', '44.023897560596', '126.3265130609', '昌邑区', 442288, 'county'),
(443114, '220203', '44.100874364702', '126.69508484724', '龙潭区', 442288, 'county'),
(443115, '220204', '43.882171941455', '126.38908947188', '船营区', 442288, 'county'),
(443116, '220211', '43.654515333155', '126.69820214702', '丰满区', 442288, 'county'),
(443117, '220221', '43.601481147552', '126.22756009767', '永吉县', 442288, 'county'),
(443118, '220281', '43.716756082246', '127.35174186542', '蛟河市', 442288, 'county'),
(443119, '220282', '43.056631099131', '127.04139243957', '桦甸市', 442288, 'county'),
(443120, '220283', '44.335465144158', '127.11677230895', '舒兰市', 442288, 'county'),
(443121, '220284', '43.05745611333', '126.17462779101', '磐石市', 442288, 'county'),
(443122, '220302', '43.214159722508', '124.35539155325', '铁西区', 442289, 'county'),
(443123, '220303', '43.101528833564', '124.45989915866', '铁东区', 442289, 'county'),
(443124, '220322', '43.414437629602', '124.38049140672', '梨树县', 442289, 'county'),
(443125, '220323', '43.346321828789', '125.27114939123', '伊通满族自治县', 442289, 'county'),
(443126, '220381', '43.791826067578', '124.6858822207', '公主岭市', 442289, 'county'),
(443127, '220382', '43.767694883217', '123.70852021747', '双辽市', 442289, 'county'),
(443128, '220402', '42.913196595909', '125.2109975481', '龙山区', 442290, 'county'),
(443129, '220403', '42.986364946378', '125.15014857862', '西安区', 442290, 'county'),
(443130, '220421', '42.683933895982', '125.45480890408', '东丰县', 442290, 'county'),
(443131, '220422', '42.94792512736', '125.18493119325', '东辽县', 442290, 'county'),
(443132, '220502', '41.677262396551', '125.9601237078', '东昌区', 442291, 'county'),
(443133, '220503', '41.772625959427', '126.15628012439', '二道江区', 442291, 'county'),
(443134, '220521', '41.729156130979', '125.85733217991', '通化县', 442291, 'county'),
(443135, '220523', '42.557948885604', '126.34272419975', '辉南县', 442291, 'county'),
(443136, '220524', '42.185665412078', '125.91727588294', '柳河县', 442291, 'county'),
(443137, '220581', '42.542649892656', '125.72351563218', '梅河口市', 442291, 'county'),
(443138, '220582', '41.251410585346', '125.99899197532', '集安市', 442291, 'county'),
(443139, '220602', '41.791642228255', '126.39664287376', '浑江区', 442292, 'county'),
(443140, '220605', '42.078958587922', '126.82530168684', '江源区', 442292, 'county'),
(443141, '220621', '42.277909113144', '127.62393805705', '抚松县', 442292, 'county'),
(443142, '220622', '42.449966505533', '126.90246851455', '靖宇县', 442292, 'county'),
(443143, '220623', '41.584709161363', '127.86435839919', '长白朝鲜族自治县', 442292, 'county'),
(443144, '220681', '41.816565968987', '127.19171033688', '临江市', 442292, 'county'),
(443145, '220702', '45.292709616884', '124.86757114896', '宁江区', 442293, 'county'),
(443146, '220721', '44.86912678932', '124.48165037618', '前郭尔罗斯蒙古族自治县', 442293, 'county'),
(443147, '220722', '44.305644527778', '123.8665042888', '长岭县', 442293, 'county'),
(443148, '220723', '44.92691448746', '123.96912337789', '乾安县', 442293, 'county'),
(443149, '220781', '45.171384133354', '125.60981401543', '扶余市', 442293, 'county'),
(443150, '220802', '45.623300921069', '122.78907446427', '洮北区', 442294, 'county'),
(443151, '220821', '45.956171923796', '123.45227210722', '镇赉县', 442294, 'county'),
(443152, '220822', '44.785716778696', '122.74529133311', '通榆县', 442294, 'county'),
(443153, '220881', '45.475604304499', '122.45367732552', '洮南市', 442294, 'county'),
(443154, '220882', '45.432438158186', '123.72371415195', '大安市', 442294, 'county'),
(443155, '222401', '43.05966660114', '129.47130153101', '延吉市', 442295, 'county'),
(443156, '222402', '43.03054892373', '129.83431076023', '图们市', 442295, 'county'),
(443157, '222403', '43.560201838077', '128.23949928011', '敦化市', 442295, 'county'),
(443158, '222404', '43.074719340737', '130.70236659184', '珲春市', 442295, 'county'),
(443159, '222405', '42.844249320769', '129.38381622469', '龙井市', 442295, 'county'),
(443160, '222406', '42.466442285556', '128.91121076889', '和龙市', 442295, 'county'),
(443161, '222424', '43.540143921506', '129.95399441696', '汪清县', 442295, 'county'),
(443162, '222426', '42.70103301919', '128.43765169208', '安图县', 442295, 'county'),
(443163, '230102', '45.686139243933', '126.36841846875', '道里区', 442296, 'county'),
(443164, '230103', '45.66612348458', '126.59025453924', '南岗区', 442296, 'county'),
(443165, '230104', '45.799105971955', '126.79557490271', '道外区', 442296, 'county'),
(443166, '230108', '45.773224633239', '126.65771685545', '平房区', 442296, 'county'),
(443167, '230109', '45.941458151669', '126.45227113075', '松北区', 442296, 'county'),
(443168, '230110', '45.710449322359', '126.79204413625', '香坊区', 442296, 'county'),
(443169, '230111', '46.079315096502', '126.78775713041', '呼兰区', 442296, 'county'),
(443170, '230112', '45.557335189202', '127.12462182332', '阿城区', 442296, 'county'),
(443171, '230113', '45.429694282772', '126.20893033512', '双城区', 442296, 'county'),
(443172, '230123', '46.275637068421', '129.72150310519', '依兰县', 442296, 'county'),
(443173, '230124', '45.819769362966', '128.94941872931', '方正县', 442296, 'county'),
(443174, '230125', '45.783825431221', '127.66161209688', '宾县', 442296, 'county'),
(443175, '230126', '46.340415542078', '127.32428735381', '巴彦县', 442296, 'county'),
(443176, '230127', '46.248171654041', '127.92983800734', '木兰县', 442296, 'county'),
(443177, '230128', '46.247857247283', '128.7622323166', '通河县', 442296, 'county'),
(443178, '230129', '45.489520215745', '128.4639428653', '延寿县', 442296, 'county'),
(443179, '230183', '45.083893011118', '128.31617023054', '尚志市', 442296, 'county'),
(443180, '230184', '44.772543560859', '127.49111263245', '五常市', 442296, 'county'),
(443181, '230202', '47.301073163863', '123.94483825767', '龙沙区', 442297, 'county'),
(443182, '230203', '47.404865706359', '124.02127875657', '建华区', 442297, 'county'),
(443183, '230204', '47.303488569291', '124.26293093367', '铁锋区', 442297, 'county'),
(443184, '230205', '47.104048383337', '123.97293464894', '昂昂溪区', 442297, 'county'),
(443185, '230206', '47.228951853753', '123.57199835236', '富拉尔基区', 442297, 'county'),
(443186, '230207', '47.585869259054', '122.93233528482', '碾子山区', 442297, 'county'),
(443187, '230208', '47.583080065198', '124.00548681519', '梅里斯达斡尔族区', 442297, 'county'),
(443188, '230221', '47.258895031048', '123.08910277315', '龙江县', 442297, 'county'),
(443189, '230223', '47.70687276451', '125.29463341876', '依安县', 442297, 'county'),
(443190, '230224', '46.603290111422', '123.55804791893', '泰来县', 442297, 'county'),
(443191, '230225', '48.011583079958', '123.84689963764', '甘南县', 442297, 'county'),
(443192, '230227', '47.66582009392', '124.57174679759', '富裕县', 442297, 'county'),
(443193, '230229', '48.16709075607', '125.70647087609', '克山县', 442297, 'county'),
(443194, '230230', '48.009015428979', '126.35213605416', '克东县', 442297, 'county'),
(443195, '230231', '47.59225565379', '126.02178604309', '拜泉县', 442297, 'county'),
(443196, '230281', '48.481453388811', '125.07655310394', '讷河市', 442297, 'county'),
(443197, '230302', '45.307610212685', '130.95993684965', '鸡冠区', 442298, 'county'),
(443198, '230303', '45.138570833129', '130.91626680525', '恒山区', 442298, 'county'),
(443199, '230304', '45.354342346984', '130.73483586173', '滴道区', 442298, 'county'),
(443200, '230305', '45.097064304174', '130.76523847274', '梨树区', 442298, 'county'),
(443201, '230306', '45.379689760283', '131.02770429868', '城子河区', 442298, 'county'),
(443202, '230307', '45.205825834254', '130.56688686698', '麻山区', 442298, 'county'),
(443203, '230321', '45.273228207889', '131.22565372007', '鸡东县', 442298, 'county'),
(443204, '230381', '45.997276203515', '133.12110607261', '虎林市', 442298, 'county'),
(443205, '230382', '45.469765426971', '132.17656238974', '密山市', 442298, 'county'),
(443206, '230402', '47.350919505165', '130.30123313444', '向阳区', 442299, 'county'),
(443207, '230403', '47.327770216306', '130.27719618578', '工农区', 442299, 'county'),
(443208, '230404', '47.298820938262', '130.28176460828', '南山区', 442299, 'county'),
(443209, '230405', '47.23371006572', '130.24437533634', '兴安区', 442299, 'county'),
(443210, '230406', '47.483737355287', '130.24750143952', '东山区', 442299, 'county'),
(443211, '230407', '47.393964799831', '130.32664592783', '兴山区', 442299, 'county'),
(443212, '230421', '47.74693489479', '130.76133324012', '萝北县', 442299, 'county'),
(443213, '230422', '47.483007019685', '131.85659492327', '绥滨县', 442299, 'county'),
(443214, '230502', '46.658524603822', '131.17851398363', '尖山区', 442300, 'county'),
(443215, '230503', '46.459521565337', '131.24602424779', '岭东区', 442300, 'county'),
(443216, '230505', '46.669775046181', '131.30870692831', '四方台区', 442300, 'county'),
(443217, '230506', '46.5292279819', '131.56483592752', '宝山区', 442300, 'county'),
(443218, '230521', '46.818437079003', '131.15055588277', '集贤县', 442300, 'county'),
(443219, '230522', '46.788592814562', '131.8549989164', '友谊县', 442300, 'county'),
(443220, '230523', '46.409383212717', '132.40927864827', '宝清县', 442300, 'county'),
(443221, '230524', '47.072628542857', '133.7292586825', '饶河县', 442300, 'county'),
(443222, '230602', '46.663311354817', '125.0424515298', '萨尔图区', 442301, 'county'),
(443223, '230603', '46.53556824178', '125.14176665986', '龙凤区', 442301, 'county'),
(443224, '230604', '46.729160383306', '124.83842676542', '让胡路区', 442301, 'county'),
(443225, '230605', '46.420778588396', '124.91428498269', '红岗区', 442301, 'county'),
(443226, '230606', '46.070051001663', '124.69907739268', '大同区', 442301, 'county'),
(443227, '230621', '45.837071583611', '125.3089692416', '肇州县', 442301, 'county'),
(443228, '230622', '45.647200471445', '124.76904364094', '肇源县', 442301, 'county'),
(443229, '230623', '47.159692937417', '124.8967829092', '林甸县', 442301, 'county'),
(443230, '230624', '46.561613536188', '124.24651264677', '杜尔伯特蒙古族自治县', 442301, 'county'),
(443231, '230702', '47.741959238189', '128.90057964259', '伊春区', 442302, 'county'),
(443232, '230703', '46.964156236684', '129.5388741261', '南岔区', 442302, 'county'),
(443233, '230704', '48.128001664241', '128.46596407584', '友好区', 442302, 'county'),
(443234, '230705', '47.500962038143', '129.22725517859', '西林区', 442302, 'county'),
(443235, '230706', '47.589933517239', '128.3654114401', '翠峦区', 442302, 'county'),
(443236, '230707', '48.216126405552', '129.78735692847', '新青区', 442302, 'county'),
(443237, '230708', '47.768892089215', '129.40940395803', '美溪区', 442302, 'county'),
(443238, '230709', '47.498543610736', '129.77190301946', '金山屯区', 442302, 'county'),
(443239, '230710', '48.229327781105', '129.061485473', '五营区', 442302, 'county'),
(443240, '230711', '47.549368172364', '128.79469008399', '乌马河区', 442302, 'county'),
(443241, '230712', '48.563262601637', '129.53875384299', '汤旺河区', 442302, 'county'),
(443242, '230713', '47.090162166708', '128.86147460713', '带岭区', 442302, 'county'),
(443243, '230714', '48.836655251992', '129.49893645126', '乌伊岭区', 442302, 'county'),
(443244, '230715', '48.298020306125', '129.25191896484', '红星区', 442302, 'county'),
(443245, '230716', '48.036509272978', '129.02239948161', '上甘岭区', 442302, 'county'),
(443246, '230722', '48.769519787363', '130.00824972425', '嘉荫县', 442302, 'county'),
(443247, '230781', '46.866328682376', '128.55251746527', '铁力市', 442302, 'county'),
(443248, '230803', '46.826706255713', '130.36295545541', '向阳区', 442303, 'county'),
(443249, '230804', '46.809721977545', '130.39791016311', '前进区', 442303, 'county'),
(443250, '230805', '46.894910414945', '130.51740321928', '东风区', 442303, 'county'),
(443251, '230811', '46.775887398703', '130.26396912133', '郊区', 442303, 'county'),
(443252, '230822', '46.306671717134', '130.63701542096', '桦南县', 442303, 'county'),
(443253, '230826', '46.989258424239', '130.9630176143', '桦川县', 442303, 'county'),
(443254, '230828', '46.988318509463', '130.07240618628', '汤原县', 442303, 'county'),
(443255, '230881', '47.833684686564', '133.27332836382', '同江市', 442303, 'county'),
(443256, '230882', '47.170672548244', '132.53900135629', '富锦市', 442303, 'county'),
(443257, '230883', '47.955162063941', '134.39306261929', '抚远市', 442303, 'county'),
(443258, '230902', '45.8134935903', '130.89318834856', '新兴区', 442304, 'county'),
(443259, '230903', '45.770092507257', '130.9925031193', '桃山区', 442304, 'county'),
(443260, '230904', '45.883167710316', '131.47522375459', '茄子河区', 442304, 'county'),
(443261, '230921', '45.930545419106', '130.81816940292', '勃利县', 442304, 'county'),
(443262, '231002', '44.408404499377', '129.86044675749', '东安区', 442305, 'county'),
(443263, '231003', '44.58797510378', '129.78391508059', '阳明区', 442305, 'county'),
(443264, '231004', '44.685920648737', '129.54456588932', '爱民区', 442305, 'county'),
(443265, '231005', '44.491714149262', '129.58492424063', '西安区', 442305, 'county'),
(443266, '231025', '45.396101732571', '130.02318050895', '林口县', 442305, 'county'),
(443267, '231081', '44.408005174587', '131.10245653286', '绥芬河市', 442305, 'county'),
(443268, '231083', '44.903617439366', '129.2214141346', '海林市', 442305, 'county'),
(443269, '231084', '44.058017259883', '129.21531714201', '宁安市', 442305, 'county'),
(443270, '231085', '44.576869855321', '130.39552588753', '穆棱市', 442305, 'county'),
(443271, '231086', '44.085228695883', '130.82976155466', '东宁市', 442305, 'county'),
(443272, '231102', '50.21824505447', '126.76426227527', '爱辉区', 442306, 'county'),
(443273, '231121', '49.621866015064', '125.77127508963', '嫩江县', 442306, 'county'),
(443274, '231123', '48.886739946849', '128.37087710653', '逊克县', 442306, 'county'),
(443275, '231124', '49.370655539474', '127.31667232079', '孙吴县', 442306, 'county'),
(443276, '231181', '48.115945723953', '127.11154600578', '北安市', 442306, 'county'),
(443277, '231182', '48.749166077372', '126.63450133401', '五大连池市', 442306, 'county'),
(443278, '231202', '46.747536778515', '126.95786274455', '北林区', 442307, 'county'),
(443279, '231221', '46.869481261175', '126.59302313008', '望奎县', 442307, 'county'),
(443280, '231222', '46.358350137762', '126.21354291791', '兰西县', 442307, 'county'),
(443281, '231223', '46.846560509098', '125.96052417701', '青冈县', 442307, 'county'),
(443282, '231224', '47.070365971064', '127.84448982607', '庆安县', 442307, 'county'),
(443283, '231225', '47.201247327838', '125.84126811337', '明水县', 442307, 'county'),
(443284, '231226', '47.584142706971', '127.71941343154', '绥棱县', 442307, 'county'),
(443285, '231281', '46.535467128182', '125.38455235789', '安达市', 442307, 'county'),
(443286, '231282', '46.009305917541', '125.84973124624', '肇东市', 442307, 'county'),
(443287, '231283', '47.447269604837', '126.89712924928', '海伦市', 442307, 'county'),
(443288, '232721', '51.813130087054', '124.91200234302', '呼玛县', 442308, 'county'),
(443289, '232722', '52.716506252523', '124.64020335752', '塔河县', 442308, 'county'),
(443290, '232723', '52.945658619469', '122.71572081474', '漠河县', 442308, 'county'),
(443291, '310101', '31.227203440769', '121.49607206403', '黄浦区', 442309, 'county'),
(443292, '310104', '31.169152089592', '121.44623500473', '徐汇区', 442309, 'county'),
(443293, '310105', '31.213301496814', '121.38761610866', '长宁区', 442309, 'county'),
(443294, '310106', '31.235380803488', '121.454755557', '静安区', 442309, 'county'),
(443295, '310107', '31.263742929076', '121.39844294375', '普陀区', 442309, 'county'),
(443296, '310109', '31.282497228987', '121.49191854079', '虹口区', 442309, 'county'),
(443297, '310110', '31.304510479542', '121.53571659963', '杨浦区', 442309, 'county'),
(443298, '310112', '31.093537540382', '121.42502428093', '闵行区', 442309, 'county'),
(443299, '310113', '31.398622694467', '121.40904121845', '宝山区', 442309, 'county'),
(443300, '310114', '31.364338055434', '121.25101353756', '嘉定区', 442309, 'county'),
(443301, '310115', '31.230895349134', '121.63848131409', '浦东新区', 442309, 'county'),
(443302, '310116', '30.835080777082', '121.24840817975', '金山区', 442309, 'county'),
(443303, '310117', '31.021244628099', '121.22679050142', '松江区', 442309, 'county'),
(443304, '310118', '31.130862397997', '121.09142524282', '青浦区', 442309, 'county'),
(443305, '310120', '30.915122452606', '121.56064167963', '奉贤区', 442309, 'county'),
(443306, '310151', '31.52860136251', '121.56909950183', '崇明区', 442309, 'county'),
(443307, '320102', '32.07176566029', '118.84893734485', '玄武区', 442310, 'county'),
(443308, '320104', '32.007969136143', '118.81722069709', '秦淮区', 442310, 'county'),
(443309, '320105', '32.012518207527', '118.71334176065', '建邺区', 442310, 'county'),
(443310, '320106', '32.068604458801', '118.76505691316', '鼓楼区', 442310, 'county'),
(443311, '320111', '32.05906230054', '118.56912478518', '浦口区', 442310, 'county'),
(443312, '320113', '32.16942425653', '118.96372475912', '栖霞区', 442310, 'county'),
(443313, '320114', '31.954552108797', '118.72197857905', '雨花台区', 442310, 'county'),
(443314, '320115', '31.863971430281', '118.83541822485', '江宁区', 442310, 'county'),
(443315, '320116', '32.400640243232', '118.84816604456', '六合区', 442310, 'county'),
(443316, '320117', '31.59098879063', '119.03955092741', '溧水区', 442310, 'county'),
(443317, '320118', '31.363673442531', '118.9648579166', '高淳区', 442310, 'county'),
(443318, '320205', '31.615587416408', '120.49100821099', '锡山区', 442311, 'county'),
(443319, '320206', '31.656376333546', '120.21529447552', '惠山区', 442311, 'county'),
(443320, '320211', '31.466578565031', '120.24850182101', '滨湖区', 442311, 'county'),
(443321, '320213', '31.57842412658', '120.30311934862', '梁溪区', 442311, 'county'),
(443322, '320214', '31.519399416228', '120.43882764569', '新吴区', 442311, 'county'),
(443323, '320281', '31.837425422051', '120.31067896716', '江阴市', 442311, 'county'),
(443324, '320282', '31.362244911879', '119.79026529658', '宜兴市', 442311, 'county'),
(443325, '320302', '34.301409800357', '117.29612858533', '鼓楼区', 442312, 'county'),
(443326, '320303', '34.22248667954', '117.27617608552', '云龙区', 442312, 'county'),
(443327, '320305', '34.410527773608', '117.49824588411', '贾汪区', 442312, 'county'),
(443328, '320311', '34.241946575704', '117.1755840183', '泉山区', 442312, 'county'),
(443329, '320312', '34.348981539618', '117.22940160979', '铜山区', 442312, 'county'),
(443330, '320321', '34.695773328628', '116.61573315373', '丰县', 442312, 'county'),
(443331, '320322', '34.700648164694', '116.91146840815', '沛县', 442312, 'county'),
(443332, '320324', '33.946570640866', '117.89036426969', '睢宁县', 442312, 'county'),
(443333, '320381', '34.284442736534', '118.34412147229', '新沂市', 442312, 'county'),
(443334, '320382', '34.402946394877', '117.90306004276', '邳州市', 442312, 'county'),
(443335, '320402', '31.777803256373', '120.00176576036', '天宁区', 442313, 'county'),
(443336, '320404', '31.79851137455', '119.91243874189', '钟楼区', 442313, 'county'),
(443337, '320411', '31.939946043961', '119.90315390841', '新北区', 442313, 'county'),
(443338, '320412', '31.672903473648', '119.94343167667', '武进区', 442313, 'county'),
(443339, '320413', '31.728356462124', '119.53415121469', '金坛区', 442313, 'county'),
(443340, '320481', '31.425241931012', '119.38283894831', '溧阳市', 442313, 'county'),
(443341, '320505', '31.351869327642', '120.47842441781', '虎丘区', 442314, 'county'),
(443342, '320506', '31.179869740166', '120.36577637267', '吴中区', 442314, 'county'),
(443343, '320507', '31.450775031111', '120.64685298258', '相城区', 442314, 'county'),
(443344, '320508', '31.326429631222', '120.61427934735', '姑苏区', 442314, 'county'),
(443345, '320509', '31.000093080624', '120.65734994979', '吴江区', 442314, 'county'),
(443346, '320581', '31.669446047798', '120.83148596516', '常熟市', 442314, 'county'),
(443347, '320582', '31.907812337769', '120.62727852834', '张家港市', 442314, 'county'),
(443348, '320583', '31.328936795497', '120.96580778411', '昆山市', 442314, 'county'),
(443349, '320585', '31.571904296415', '121.15897767248', '太仓市', 442314, 'county'),
(443350, '320602', '31.962660695271', '120.88759857738', '崇川区', 442315, 'county'),
(443351, '320611', '32.071256422788', '120.82387483505', '港闸区', 442315, 'county'),
(443352, '320612', '32.067098964254', '121.07249442751', '通州区', 442315, 'county'),
(443353, '320621', '32.553985066143', '120.47392692165', '海安县', 442315, 'county'),
(443354, '320623', '32.387662145338', '121.05924442185', '如东县', 442315, 'county'),
(443355, '320681', '31.871301838383', '121.67882229665', '启东市', 442315, 'county'),
(443356, '320682', '32.273616272606', '120.580143985', '如皋市', 442315, 'county'),
(443357, '320684', '31.956038868177', '121.31247014367', '海门市', 442315, 'county'),
(443358, '320703', '34.638921829102', '119.46701669742', '连云区', 442316, 'county'),
(443359, '320706', '34.514160144549', '119.16219625272', '海州区', 442316, 'county'),
(443360, '320707', '34.921103960847', '119.07859315245', '赣榆区', 442316, 'county'),
(443361, '320722', '34.556383225488', '118.79230964695', '东海县', 442316, 'county'),
(443362, '320723', '34.406832167104', '119.39277519918', '灌云县', 442316, 'county'),
(443363, '320724', '34.175194871764', '119.44639688138', '灌南县', 442316, 'county'),
(443364, '320803', '33.528348966942', '119.31329513264', '淮安区', 442317, 'county'),
(443365, '320804', '33.664059258402', '118.93566378046', '淮阴区', 442317, 'county'),
(443366, '320812', '33.494331166176', '119.04477992516', '清江浦区', 442317, 'county'),
(443367, '320813', '33.230193969134', '118.83000637571', '洪泽区', 442317, 'county'),
(443368, '320826', '33.884155184174', '119.32495655858', '涟水县', 442317, 'county'),
(443369, '320830', '32.971613125783', '118.53823246743', '盱眙县', 442317, 'county'),
(443370, '320831', '33.02583443776', '119.14563113528', '金湖县', 442317, 'county'),
(443371, '320902', '33.378948242447', '120.20635135183', '亭湖区', 442318, 'county'),
(443372, '320903', '33.265898266894', '119.96850073907', '盐都区', 442318, 'county'),
(443373, '320904', '33.265908526078', '120.58506449027', '大丰区', 442318, 'county'),
(443374, '320921', '34.232797426966', '119.79760156833', '响水县', 442318, 'county'),
(443375, '320922', '34.092317176392', '120.02660867811', '滨海县', 442318, 'county'),
(443376, '320923', '33.71197604815', '119.70499024879', '阜宁县', 442318, 'county'),
(443377, '320924', '33.745462250481', '120.27950474858', '射阳县', 442318, 'county'),
(443378, '320925', '33.488907986634', '119.83649673997', '建湖县', 442318, 'county'),
(443379, '320981', '32.791442548289', '120.56376947144', '东台市', 442318, 'county'),
(443380, '321002', '32.395670095608', '119.48667775758', '广陵区', 442319, 'county'),
(443381, '321003', '32.425830218252', '119.45826385876', '邗江区', 442319, 'county'),
(443382, '321012', '32.549160271061', '119.71731808779', '江都区', 442319, 'county'),
(443383, '321023', '33.225833658364', '119.45565078384', '宝应县', 442319, 'county'),
(443384, '321081', '32.392636465119', '119.20095502034', '仪征市', 442319, 'county'),
(443385, '321084', '32.835943695939', '119.50340701788', '高邮市', 442319, 'county'),
(443386, '321102', '32.201996095087', '119.5848217021', '京口区', 442320, 'county'),
(443387, '321111', '32.19664652864', '119.43092031591', '润州区', 442320, 'county'),
(443388, '321112', '32.114041364762', '119.4989723505', '丹徒区', 442320, 'county'),
(443389, '321181', '31.960263455083', '119.64430350829', '丹阳市', 442320, 'county'),
(443390, '321182', '32.189469410323', '119.84513751029', '扬中市', 442320, 'county'),
(443391, '321183', '31.932634957798', '119.20707980344', '句容市', 442320, 'county'),
(443392, '321202', '32.488257837661', '119.92117442715', '海陵区', 442321, 'county'),
(443393, '321203', '32.330075314459', '119.92574377278', '高港区', 442321, 'county'),
(443394, '321204', '32.532466165694', '120.06704535319', '姜堰区', 442321, 'county'),
(443395, '321281', '32.961954308808', '119.99641814069', '兴化市', 442321, 'county'),
(443396, '321282', '32.039442789049', '120.27689862725', '靖江市', 442321, 'county'),
(443397, '321283', '32.213678940627', '120.135346292', '泰兴市', 442321, 'county'),
(443398, '321302', '33.862829055956', '118.27463983758', '宿城区', 442322, 'county'),
(443399, '321311', '34.009529591744', '118.34369284322', '宿豫区', 442322, 'county'),
(443400, '321322', '34.154013659597', '118.85774971753', '沭阳县', 442322, 'county'),
(443401, '321323', '33.708800542074', '118.65694128685', '泗阳县', 442322, 'county'),
(443402, '321324', '33.425955266134', '118.3125512525', '泗洪县', 442322, 'county'),
(443403, '330102', '30.232357639233', '120.18012613889', '上城区', 442323, 'county'),
(443404, '330103', '30.310287874904', '120.18653502974', '下城区', 442323, 'county'),
(443405, '330104', '30.315832099954', '120.30382324371', '江干区', 442323, 'county'),
(443406, '330105', '30.344732010358', '120.15884493257', '拱墅区', 442323, 'county'),
(443407, '330106', '30.207036169515', '120.08899292561', '西湖区', 442323, 'county'),
(443408, '330108', '30.187587607727', '120.19237042946', '滨江区', 442323, 'county'),
(443409, '330109', '30.172893839066', '120.38908074858', '萧山区', 442323, 'county'),
(443410, '330110', '30.388119980754', '119.99808906005', '余杭区', 442323, 'county'),
(443411, '330111', '29.977808419757', '119.81096609176', '富阳区', 442323, 'county'),
(443412, '330122', '29.836582478934', '119.5604618667', '桐庐县', 442323, 'county'),
(443413, '330127', '29.614714225509', '118.89576489835', '淳安县', 442323, 'county'),
(443414, '330182', '29.487115319259', '119.37953322636', '建德市', 442323, 'county'),
(443415, '330185', '30.207683765784', '119.35029466684', '临安市', 442323, 'county'),
(443416, '330203', '29.876800511994', '121.5353945773', '海曙区', 442324, 'county'),
(443417, '330204', '29.87539247212', '121.5980008523', '江东区', 442324, 'county'),
(443418, '330205', '29.96639219001', '121.49329902932', '江北区', 442324, 'county'),
(443419, '330206', '29.868332319465', '121.88941885595', '北仑区', 442324, 'county'),
(443420, '330211', '29.995449382446', '121.61663045279', '镇海区', 442324, 'county'),
(443421, '330212', '29.78545893326', '121.53783481355', '鄞州区', 442324, 'county'),
(443422, '330225', '29.378771009449', '121.85866557564', '象山县', 442324, 'county'),
(443423, '330226', '29.314474088639', '121.46362436946', '宁海县', 442324, 'county'),
(443424, '330281', '29.996456719011', '121.15277918829', '余姚市', 442324, 'county'),
(443425, '330282', '30.189257122714', '121.33840825932', '慈溪市', 442324, 'county'),
(443426, '330283', '29.617073470394', '121.37718563878', '奉化市', 442324, 'county'),
(443427, '330302', '28.067865050513', '120.56579853224', '鹿城区', 442325, 'county'),
(443428, '330303', '27.913340713281', '120.81107773683', '龙湾区', 442325, 'county'),
(443429, '330304', '27.972177190591', '120.55840358596', '瓯海区', 442325, 'county'),
(443430, '330305', '27.884883705563', '121.15231818926', '洞头区', 442325, 'county'),
(443431, '330324', '28.336390468031', '120.66880872172', '永嘉县', 442325, 'county'),
(443432, '330326', '27.637700763436', '120.38938725481', '平阳县', 442325, 'county'),
(443433, '330327', '27.434436382653', '120.44554278341', '苍南县', 442325, 'county'),
(443434, '330328', '27.81271343668', '120.02842209847', '文成县', 442325, 'county'),
(443435, '330329', '27.536406837073', '119.88486761051', '泰顺县', 442325, 'county'),
(443436, '330381', '27.82923052833', '120.46834036335', '瑞安市', 442325, 'county'),
(443437, '330382', '28.26183898877', '121.01617490318', '乐清市', 442325, 'county'),
(443438, '330402', '30.716357921235', '120.84453542647', '南湖区', 442326, 'county'),
(443439, '330411', '30.777678969089', '120.69190746888', '秀洲区', 442326, 'county'),
(443440, '330421', '30.905748069187', '120.90887281597', '嘉善县', 442326, 'county'),
(443441, '330424', '30.526042585394', '120.88557558868', '海盐县', 442326, 'county'),
(443442, '330481', '30.442176799317', '120.61872710778', '海宁市', 442326, 'county');
INSERT INTO `region` (`id`, `code`, `lat`, `lng`, `name`, `parent_id`, `by_type`) VALUES
(443443, '330482', '30.716528587208', '121.10583903762', '平湖市', 442326, 'county'),
(443444, '330483', '30.612341030328', '120.49041120216', '桐乡市', 442326, 'county'),
(443445, '330502', '30.808545234564', '120.08891886954', '吴兴区', 442327, 'county'),
(443446, '330503', '30.766830865515', '120.30914675944', '南浔区', 442327, 'county'),
(443447, '330521', '30.567582881042', '120.04983138985', '德清县', 442327, 'county'),
(443448, '330522', '30.983352787535', '119.81941984715', '长兴县', 442327, 'county'),
(443449, '330523', '30.626370494334', '119.58315792627', '安吉县', 442327, 'county'),
(443450, '330602', '30.015792939952', '120.61832665179', '越城区', 442328, 'county'),
(443451, '330603', '29.999366392659', '120.54020524674', '柯桥区', 442328, 'county'),
(443452, '330604', '30.00645910703', '120.87986642651', '上虞区', 442328, 'county'),
(443453, '330624', '29.414313976622', '120.97570154218', '新昌县', 442328, 'county'),
(443454, '330681', '29.699399516981', '120.28143440994', '诸暨市', 442328, 'county'),
(443455, '330683', '29.591008031468', '120.76143097735', '嵊州市', 442328, 'county'),
(443456, '330702', '28.984539673649', '119.51757234284', '婺城区', 442329, 'county'),
(443457, '330703', '29.155526265081', '119.80922749595', '金东区', 442329, 'county'),
(443458, '330723', '28.774055561598', '119.72083317224', '武义县', 442329, 'county'),
(443459, '330726', '29.526266410155', '119.91048752626', '浦江县', 442329, 'county'),
(443460, '330727', '29.04420249188', '120.56744721648', '磐安县', 442329, 'county'),
(443461, '330781', '29.284102536325', '119.53333759742', '兰溪市', 442329, 'county'),
(443462, '330782', '29.306443911839', '120.06729564867', '义乌市', 442329, 'county'),
(443463, '330783', '29.237426947341', '120.38081772668', '东阳市', 442329, 'county'),
(443464, '330784', '28.940176566983', '120.10868352215', '永康市', 442329, 'county'),
(443465, '330802', '28.998535292058', '118.8130029548', '柯城区', 442330, 'county'),
(443466, '330803', '28.941983087299', '118.93904421103', '衢江区', 442330, 'county'),
(443467, '330822', '28.973666155532', '118.54767046745', '常山县', 442330, 'county'),
(443468, '330824', '29.18993794143', '118.33165006627', '开化县', 442330, 'county'),
(443469, '330825', '28.997079389242', '119.19866420604', '龙游县', 442330, 'county'),
(443470, '330881', '28.581969944141', '118.60708619901', '江山市', 442330, 'county'),
(443471, '330902', '30.06484716159', '122.07302446869', '定海区', 442331, 'county'),
(443472, '330903', '29.871101375771', '122.27876474766', '普陀区', 442331, 'county'),
(443473, '330921', '30.319415586505', '122.26035914727', '岱山县', 442331, 'county'),
(443474, '330922', '30.705003931261', '122.48168649477', '嵊泗县', 442331, 'county'),
(443475, '331002', '28.657015656331', '121.46737635254', '椒江区', 442332, 'county'),
(443476, '331003', '28.604655275769', '121.08831775253', '黄岩区', 442332, 'county'),
(443477, '331004', '28.548659438247', '121.45024245576', '路桥区', 442332, 'county'),
(443478, '331021', '28.179738010609', '121.28442605522', '玉环县', 442332, 'county'),
(443479, '331022', '29.017744246024', '121.48822880178', '三门县', 442332, 'county'),
(443480, '331023', '29.151778640761', '120.98556322305', '天台县', 442332, 'county'),
(443481, '331024', '28.738741988629', '120.64060572539', '仙居县', 442332, 'county'),
(443482, '331081', '28.400553817107', '121.42104597878', '温岭市', 442332, 'county'),
(443483, '331082', '28.857388590573', '121.22191927302', '临海市', 442332, 'county'),
(443484, '331102', '28.447361330679', '119.84995169272', '莲都区', 442333, 'county'),
(443485, '331121', '28.208428623515', '120.14673815822', '青田县', 442333, 'county'),
(443486, '331122', '28.666326291231', '120.19188183536', '缙云县', 442333, 'county'),
(443487, '331123', '28.525410332354', '119.08934238361', '遂昌县', 442333, 'county'),
(443488, '331124', '28.41158038279', '119.44101320226', '松阳县', 442333, 'county'),
(443489, '331125', '28.131320418187', '119.54173007925', '云和县', 442333, 'county'),
(443490, '331126', '27.62804612399', '119.15761923529', '庆元县', 442333, 'county'),
(443491, '331127', '27.896052631241', '119.61928969769', '景宁畲族自治县', 442333, 'county'),
(443492, '331181', '28.050639306133', '119.08229725532', '龙泉市', 442333, 'county'),
(443493, '340102', '31.905375399342', '117.33122366889', '瑶海区', 442334, 'county'),
(443494, '340103', '31.912901051134', '117.24783468704', '庐阳区', 442334, 'county'),
(443495, '340104', '31.838184928803', '117.23128044361', '蜀山区', 442334, 'county'),
(443496, '340111', '31.790724288122', '117.35391279997', '包河区', 442334, 'county'),
(443497, '340121', '32.286111151904', '117.17443835982', '长丰县', 442334, 'county'),
(443498, '340122', '32.003189086973', '117.57585687571', '肥东县', 442334, 'county'),
(443499, '340123', '31.732638067993', '117.03626088173', '肥西县', 442334, 'county'),
(443500, '340124', '31.228413825483', '117.33587636592', '庐江县', 442334, 'county'),
(443501, '340181', '31.676058567558', '117.7717833762', '巢湖市', 442334, 'county'),
(443502, '340202', '31.351965582559', '118.38724548573', '镜湖区', 442335, 'county'),
(443503, '340203', '31.216676779902', '118.33596966824', '弋江区', 442335, 'county'),
(443504, '340207', '31.375481957255', '118.49397424134', '鸠江区', 442335, 'county'),
(443505, '340208', '31.212824987426', '118.3117984229', '三山区', 442335, 'county'),
(443506, '340221', '31.191698969307', '118.53246218925', '芜湖县', 442335, 'county'),
(443507, '340222', '31.12832958697', '118.2001179722', '繁昌县', 442335, 'county'),
(443508, '340223', '30.8959818627', '118.28821596372', '南陵县', 442335, 'county'),
(443509, '340225', '31.22249365658', '117.82005160307', '无为县', 442335, 'county'),
(443510, '340302', '32.926342521363', '117.47832568768', '龙子湖区', 442336, 'county'),
(443511, '340303', '32.881522954878', '117.35635619096', '蚌山区', 442336, 'county'),
(443512, '340304', '32.889696360476', '117.3055150635', '禹会区', 442336, 'county'),
(443513, '340311', '33.023815185908', '117.38818423314', '淮上区', 442336, 'county'),
(443514, '340321', '33.037130745984', '117.04208647136', '怀远县', 442336, 'county'),
(443515, '340322', '33.138465310137', '117.764210401', '五河县', 442336, 'county'),
(443516, '340323', '33.272840934373', '117.35403405942', '固镇县', 442336, 'county'),
(443517, '340402', '32.643535866152', '117.11713761331', '大通区', 442337, 'county'),
(443518, '340403', '32.564363767687', '117.01468721736', '田家庵区', 442337, 'county'),
(443519, '340404', '32.544400181652', '116.90877214688', '谢家集区', 442337, 'county'),
(443520, '340405', '32.652390199515', '116.82552132442', '八公山区', 442337, 'county'),
(443521, '340406', '32.800694621968', '116.86619300469', '潘集区', 442337, 'county'),
(443522, '340421', '32.791416300893', '116.58490534783', '凤台县', 442337, 'county'),
(443523, '340422', '32.287816164667', '116.77854729708', '寿县', 442337, 'county'),
(443524, '340503', '31.711627118315', '118.57834785585', '花山区', 442338, 'county'),
(443525, '340504', '31.659719310829', '118.55455812086', '雨山区', 442338, 'county'),
(443526, '340506', '31.56550080289', '118.85133588367', '博望区', 442338, 'county'),
(443527, '340521', '31.503024380618', '118.64667323993', '当涂县', 442338, 'county'),
(443528, '340522', '31.68852815888', '118.51588184662', '含山县', 442338, 'county'),
(443529, '340523', '31.757568623793', '118.29986391138', '和县', 442338, 'county'),
(443530, '340602', '34.113251414374', '116.95496714841', '杜集区', 442339, 'county'),
(443531, '340603', '33.988334722309', '116.72896156685', '相山区', 442339, 'county'),
(443532, '340604', '33.84405351094', '116.9081817805', '烈山区', 442339, 'county'),
(443533, '340621', '33.693204649044', '116.73689934705', '濉溪县', 442339, 'county'),
(443534, '340705', '30.943050294456', '117.83324857069', '铜官区', 442340, 'county'),
(443535, '340706', '30.944585477816', '117.95780890267', '义安区', 442340, 'county'),
(443536, '340711', '30.754631362428', '117.64155067342', '郊区', 442340, 'county'),
(443537, '340722', '30.863982478208', '117.41703591878', '枞阳县', 442340, 'county'),
(443538, '340802', '30.541457598958', '117.15254234871', '迎江区', 442341, 'county'),
(443539, '340803', '30.532487247564', '116.9809683319', '大观区', 442341, 'county'),
(443540, '340811', '30.614339999814', '117.05612964375', '宜秀区', 442341, 'county'),
(443541, '340822', '30.579024527459', '116.80352690196', '怀宁县', 442341, 'county'),
(443542, '340824', '30.758639275993', '116.55281551688', '潜山县', 442341, 'county'),
(443543, '340825', '30.50109966504', '116.18253924827', '太湖县', 442341, 'county'),
(443544, '340826', '30.108216635083', '116.25351835628', '宿松县', 442341, 'county'),
(443545, '340827', '30.242568216534', '116.68809225224', '望江县', 442341, 'county'),
(443546, '340828', '30.901821144678', '116.22007036688', '岳西县', 442341, 'county'),
(443547, '340881', '30.972567972107', '116.95355904596', '桐城市', 442341, 'county'),
(443548, '341002', '29.716534699341', '118.30963663452', '屯溪区', 442342, 'county'),
(443549, '341003', '30.27774589512', '118.07754612726', '黄山区', 442342, 'county'),
(443550, '341004', '29.902140398578', '118.27859128593', '徽州区', 442342, 'county'),
(443551, '341021', '29.871177014075', '118.57515564084', '歙县', 442342, 'county'),
(443552, '341022', '29.669120361013', '118.09308178818', '休宁县', 442342, 'county'),
(443553, '341023', '30.014778480875', '117.91075047481', '黟县', 442342, 'county'),
(443554, '341024', '29.873705688292', '117.60052812882', '祁门县', 442342, 'county'),
(443555, '341102', '32.338458080903', '118.33756892154', '琅琊区', 442343, 'county'),
(443556, '341103', '32.310209092866', '118.27082841537', '南谯区', 442343, 'county'),
(443557, '341122', '32.473711637442', '118.53562960741', '来安县', 442343, 'county'),
(443558, '341124', '32.069932749958', '118.10577829394', '全椒县', 442343, 'county'),
(443559, '341125', '32.473258599425', '117.66596452497', '定远县', 442343, 'county'),
(443560, '341126', '32.792214955967', '117.61147230278', '凤阳县', 442343, 'county'),
(443561, '341181', '32.721213784185', '118.9729126449', '天长市', 442343, 'county'),
(443562, '341182', '32.81183581812', '118.14072656734', '明光市', 442343, 'county'),
(443563, '341202', '32.867688563381', '115.72772731323', '颍州区', 442344, 'county'),
(443564, '341203', '32.941585109575', '116.03998540511', '颍东区', 442344, 'county'),
(443565, '341204', '33.073509996971', '115.73402623147', '颍泉区', 442344, 'county'),
(443566, '341221', '32.909769412643', '115.24846137013', '临泉县', 442344, 'county'),
(443567, '341222', '33.33774827164', '115.64875595615', '太和县', 442344, 'county'),
(443568, '341225', '32.655881179954', '115.65409851632', '阜南县', 442344, 'county'),
(443569, '341226', '32.662460220803', '116.26531418265', '颍上县', 442344, 'county'),
(443570, '341282', '33.226192689105', '115.39864296673', '界首市', 442344, 'county'),
(443571, '341302', '33.726032251705', '117.15907588963', '埇桥区', 442345, 'county'),
(443572, '341321', '34.454057242308', '116.42028227207', '砀山县', 442345, 'county'),
(443573, '341322', '34.208529641052', '116.81242175884', '萧县', 442345, 'county'),
(443574, '341323', '33.690737031018', '117.54312668944', '灵璧县', 442345, 'county'),
(443575, '341324', '33.544346537362', '117.89035897388', '泗县', 442345, 'county'),
(443576, '341502', '31.631258470539', '116.66194105885', '金安区', 442346, 'county'),
(443577, '341503', '31.753038540484', '116.30257286162', '裕安区', 442346, 'county'),
(443578, '341504', '31.755558355198', '116.50525268298', '叶集区', 442346, 'county'),
(443579, '341522', '32.201507325967', '116.17352091075', '霍邱县', 442346, 'county'),
(443580, '341523', '31.310003081421', '116.82855911938', '舒城县', 442346, 'county'),
(443581, '341524', '31.47909281966', '115.77931490356', '金寨县', 442346, 'county'),
(443582, '341525', '31.287055799576', '116.24667502387', '霍山县', 442346, 'county'),
(443583, '341602', '33.782924407833', '115.81281423257', '谯城区', 442347, 'county'),
(443584, '341621', '33.557949046136', '116.22355045352', '涡阳县', 442347, 'county'),
(443585, '341622', '33.22304396133', '116.5915120873', '蒙城县', 442347, 'county'),
(443586, '341623', '33.157375760354', '116.16627183049', '利辛县', 442347, 'county'),
(443587, '341702', '30.514085692989', '117.50847770852', '贵池区', 442348, 'county'),
(443588, '341721', '30.034069906871', '117.00682739944', '东至县', 442348, 'county'),
(443589, '341722', '30.199160540051', '117.53828189034', '石台县', 442348, 'county'),
(443590, '341723', '30.602013463857', '117.90815913595', '青阳县', 442348, 'county'),
(443591, '341802', '30.943631043255', '118.7978027295', '宣州区', 442349, 'county'),
(443592, '341821', '31.100123797933', '119.16790406676', '郎溪县', 442349, 'county'),
(443593, '341822', '30.893949749016', '119.36471289716', '广德县', 442349, 'county'),
(443594, '341823', '30.599286819492', '118.37604020629', '泾县', 442349, 'county'),
(443595, '341824', '30.162401081144', '118.6637768779', '绩溪县', 442349, 'county'),
(443596, '341825', '30.321833135921', '118.48289793271', '旌德县', 442349, 'county'),
(443597, '341881', '30.502936034943', '118.99702452598', '宁国市', 442349, 'county'),
(443598, '350102', '26.097871106548', '119.29063293961', '鼓楼区', 442350, 'county'),
(443599, '350103', '26.062153767548', '119.32406268487', '台江区', 442350, 'county'),
(443600, '350104', '26.019664381274', '119.33493643794', '仓山区', 442350, 'county'),
(443601, '350105', '26.082650321112', '119.51080249492', '马尾区', 442350, 'county'),
(443602, '350111', '26.221752079694', '119.31492287341', '晋安区', 442350, 'county'),
(443603, '350121', '26.182432187564', '119.12238323588', '闽侯县', 442350, 'county'),
(443604, '350122', '26.301591411273', '119.5683393031', '连江县', 442350, 'county'),
(443605, '350123', '26.506325719276', '119.46523419293', '罗源县', 442350, 'county'),
(443606, '350124', '26.212273389994', '118.77880310691', '闽清县', 442350, 'county'),
(443607, '350125', '25.857384057085', '118.79474057257', '永泰县', 442350, 'county'),
(443608, '350128', '25.537737674887', '119.76645322176', '平潭县', 442350, 'county'),
(443609, '350181', '25.638120577122', '119.37754701319', '福清市', 442350, 'county'),
(443610, '350182', '25.915538436925', '119.56271983507', '长乐市', 442350, 'county'),
(443611, '350203', '24.468728076403', '118.13453488213', '思明区', 442351, 'county'),
(443612, '350205', '24.53619033141', '117.98395590267', '海沧区', 442351, 'county'),
(443613, '350206', '24.521973931072', '118.14467575095', '湖里区', 442351, 'county'),
(443614, '350211', '24.640972798479', '118.02941167016', '集美区', 442351, 'county'),
(443615, '350212', '24.781704734783', '118.11468496447', '同安区', 442351, 'county'),
(443616, '350213', '24.675484915197', '118.28080317925', '翔安区', 442351, 'county'),
(443617, '350302', '25.433374872116', '118.95444257513', '城厢区', 442352, 'county'),
(443618, '350303', '25.604741724857', '119.07903889678', '涵江区', 442352, 'county'),
(443619, '350304', '25.427591842484', '119.07410333682', '荔城区', 442352, 'county'),
(443620, '350305', '25.276364535891', '119.13146589277', '秀屿区', 442352, 'county'),
(443621, '350322', '25.468258336396', '118.70462563885', '仙游县', 442352, 'county'),
(443622, '350402', '26.307448553348', '117.63050069122', '梅列区', 442353, 'county'),
(443623, '350403', '26.173967139255', '117.51689648494', '三元区', 442353, 'county'),
(443624, '350421', '26.418484134559', '117.21859881719', '明溪县', 442353, 'county'),
(443625, '350423', '26.099297668335', '116.9211934366', '清流县', 442353, 'county'),
(443626, '350424', '26.310073098848', '116.67811816013', '宁化县', 442353, 'county'),
(443627, '350425', '25.797449314745', '117.81799668394', '大田县', 442353, 'county'),
(443628, '350426', '26.150593850717', '118.25386835128', '尤溪县', 442353, 'county'),
(443629, '350427', '26.446505905088', '117.81884600477', '沙县', 442353, 'county'),
(443630, '350428', '26.732328679548', '117.40083967575', '将乐县', 442353, 'county'),
(443631, '350429', '26.865476881883', '117.12565958885', '泰宁县', 442353, 'county'),
(443632, '350430', '26.817741252365', '116.79307136804', '建宁县', 442353, 'county'),
(443633, '350481', '25.919433151382', '117.32853545664', '永安市', 442353, 'county'),
(443634, '350502', '24.905744690408', '118.56845525017', '鲤城区', 442354, 'county'),
(443635, '350503', '24.936275095413', '118.6074317381', '丰泽区', 442354, 'county'),
(443636, '350504', '25.133414113301', '118.64345333988', '洛江区', 442354, 'county'),
(443637, '350505', '25.173479375703', '118.81901718056', '泉港区', 442354, 'county'),
(443638, '350521', '24.991871443315', '118.80947288339', '惠安县', 442354, 'county'),
(443639, '350524', '25.125684138245', '117.91163244343', '安溪县', 442354, 'county'),
(443640, '350525', '25.395598523493', '118.14097079846', '永春县', 442354, 'county'),
(443641, '350526', '25.674049363102', '118.2580388856', '德化县', 442354, 'county'),
(443642, '350527', '24.453685081793', '118.3797724059', '金门县', 442354, 'county'),
(443643, '350581', '24.744894247253', '118.69248092208', '石狮市', 442354, 'county'),
(443644, '350582', '24.729638297698', '118.55865054225', '晋江市', 442354, 'county'),
(443645, '350583', '25.017972545094', '118.38898065958', '南安市', 442354, 'county'),
(443646, '350602', '24.575089413411', '117.63336610614', '芗城区', 442355, 'county'),
(443647, '350603', '24.537177249549', '117.70403687855', '龙文区', 442355, 'county'),
(443648, '350622', '23.984924590871', '117.3381105564', '云霄县', 442355, 'county'),
(443649, '350623', '24.134610348852', '117.69145555574', '漳浦县', 442355, 'county'),
(443650, '350624', '23.87404072539', '117.13294195697', '诏安县', 442355, 'county'),
(443651, '350625', '24.744593711082', '117.81298738987', '长泰县', 442355, 'county'),
(443652, '350626', '23.691110309815', '117.42541646767', '东山县', 442355, 'county'),
(443653, '350627', '24.668805586956', '117.29305472699', '南靖县', 442355, 'county'),
(443654, '350628', '24.324490604831', '117.20072092242', '平和县', 442355, 'county'),
(443655, '350629', '24.918688094608', '117.54380454982', '华安县', 442355, 'county'),
(443656, '350681', '24.398816824823', '117.80759027663', '龙海市', 442355, 'county'),
(443657, '350702', '26.590155096909', '118.25473662436', '延平区', 442356, 'county'),
(443658, '350703', '27.42298490861', '118.09503169529', '建阳区', 442356, 'county'),
(443659, '350721', '26.908712277835', '117.87368081029', '顺昌县', 442356, 'county'),
(443660, '350722', '27.945164125785', '118.52429759856', '浦城县', 442356, 'county'),
(443661, '350723', '27.655597572386', '117.3555359708', '光泽县', 442356, 'county'),
(443662, '350724', '27.610704490355', '118.76568912522', '松溪县', 442356, 'county'),
(443663, '350725', '27.324781791328', '118.97167122766', '政和县', 442356, 'county'),
(443664, '350781', '27.235197069611', '117.48057222854', '邵武市', 442356, 'county'),
(443665, '350782', '27.748135171112', '118.01154264632', '武夷山市', 442356, 'county'),
(443666, '350783', '27.044913662799', '118.48514716959', '建瓯市', 442356, 'county'),
(443667, '350802', '25.22220637939', '117.08632241393', '新罗区', 442357, 'county'),
(443668, '350803', '24.733216812374', '116.75552020871', '永定区', 442357, 'county'),
(443669, '350821', '25.696958495476', '116.37188399052', '长汀县', 442357, 'county'),
(443670, '350823', '25.126526144211', '116.56866906668', '上杭县', 442357, 'county'),
(443671, '350824', '25.139021186901', '116.13591657582', '武平县', 442357, 'county'),
(443672, '350825', '25.60417681052', '116.82144796403', '连城县', 442357, 'county'),
(443673, '350881', '25.379998346458', '117.45172162006', '漳平市', 442357, 'county'),
(443674, '350902', '26.763865425402', '119.45455949068', '蕉城区', 442358, 'county'),
(443675, '350921', '26.868876533651', '119.99055111407', '霞浦县', 442358, 'county'),
(443676, '350922', '26.618899035408', '118.87954004139', '古田县', 442358, 'county'),
(443677, '350923', '26.921561586231', '118.98929146416', '屏南县', 442358, 'county'),
(443678, '350924', '27.426229516207', '119.5055198374', '寿宁县', 442358, 'county'),
(443679, '350925', '27.094312780593', '119.31332559174', '周宁县', 442358, 'county'),
(443680, '350926', '27.207067709716', '119.88752229998', '柘荣县', 442358, 'county'),
(443681, '350981', '27.055896714799', '119.65627713286', '福安市', 442358, 'county'),
(443682, '350982', '27.224828701234', '120.19830746412', '福鼎市', 442358, 'county'),
(443683, '360102', '28.692375145425', '115.91014826387', '东湖区', 442359, 'county'),
(443684, '360103', '28.657325885604', '115.89894765179', '西湖区', 442359, 'county'),
(443685, '360104', '28.636601455215', '115.9219541542', '青云谱区', 442359, 'county'),
(443686, '360105', '28.800556903151', '115.75048047817', '湾里区', 442359, 'county'),
(443687, '360111', '28.700848503487', '115.93090639742', '青山湖区', 442359, 'county'),
(443688, '360112', '28.762510375641', '115.97766347318', '新建区', 442359, 'county'),
(443689, '360121', '28.620772037399', '116.07126087416', '南昌县', 442359, 'county'),
(443690, '360123', '28.836411855907', '115.59520240179', '安义县', 442359, 'county'),
(443691, '360124', '28.441758032984', '116.3174577813', '进贤县', 442359, 'county'),
(443692, '360202', '29.272154837188', '117.1861998641', '昌江区', 442360, 'county'),
(443693, '360203', '29.303230556708', '117.23411943253', '珠山区', 442360, 'county'),
(443694, '360222', '29.556555537931', '117.30897851315', '浮梁县', 442360, 'county'),
(443695, '360281', '28.969928213838', '117.27327879748', '乐平市', 442360, 'county'),
(443696, '360302', '27.645394991779', '113.87886885384', '安源区', 442361, 'county'),
(443697, '360313', '27.53370963141', '113.73981816772', '湘东区', 442361, 'county'),
(443698, '360321', '27.223445481289', '113.95977686775', '莲花县', 442361, 'county'),
(443699, '360322', '27.832260223294', '113.86780638258', '上栗县', 442361, 'county'),
(443700, '360323', '27.578022564845', '114.07000665468', '芦溪县', 442361, 'county'),
(443701, '360402', '29.719639526122', '115.99984802155', '濂溪区', 442362, 'county'),
(443702, '360403', '29.717848894949', '116.00276787378', '浔阳区', 442362, 'county'),
(443703, '360421', '29.640229926977', '115.84203547109', '九江县', 442362, 'county'),
(443704, '360423', '29.263844028424', '115.02315949078', '武宁县', 442362, 'county'),
(443705, '360424', '29.000021311275', '114.4461918569', '修水县', 442362, 'county'),
(443706, '360425', '29.141310623242', '115.74247538366', '永修县', 442362, 'county'),
(443707, '360426', '29.401728483728', '115.63408426446', '德安县', 442362, 'county'),
(443708, '360428', '29.356214912479', '116.34204769578', '都昌县', 442362, 'county'),
(443709, '360429', '29.66806050769', '116.29256118736', '湖口县', 442362, 'county'),
(443710, '360430', '29.834597412665', '116.62933206226', '彭泽县', 442362, 'county'),
(443711, '360481', '29.628544625483', '115.45968602847', '瑞昌市', 442362, 'county'),
(443712, '360482', '29.236083846739', '115.820204477', '共青城市', 442362, 'county'),
(443713, '360483', '29.347769476561', '115.98274999338', '庐山市', 442362, 'county'),
(443714, '360502', '27.850578117027', '115.00785062298', '渝水区', 442363, 'county'),
(443715, '360521', '27.844993335525', '114.67816306735', '分宜县', 442363, 'county'),
(443716, '360602', '28.2472053807', '117.05770601694', '月湖区', 442364, 'county'),
(443717, '360622', '28.321070494465', '116.92157395441', '余江县', 442364, 'county'),
(443718, '360681', '28.190604458955', '117.19787036817', '贵溪市', 442364, 'county'),
(443719, '360702', '25.838710922212', '114.93736527747', '章贡区', 442365, 'county'),
(443720, '360703', '25.857651685208', '114.70979725341', '南康区', 442365, 'county'),
(443721, '360721', '25.90202543961', '115.07258602937', '赣县', 442365, 'county'),
(443722, '360722', '25.286018342725', '114.98179982408', '信丰县', 442365, 'county'),
(443723, '360723', '25.44847167429', '114.36649000169', '大余县', 442365, 'county'),
(443724, '360724', '25.939253373895', '114.402605282', '上犹县', 442365, 'county'),
(443725, '360725', '25.679632268061', '114.19933700414', '崇义县', 442365, 'county'),
(443726, '360726', '25.238854104103', '115.39661257033', '安远县', 442365, 'county'),
(443727, '360727', '24.772706198589', '114.73182493834', '龙南县', 442365, 'county'),
(443728, '360728', '24.824160396247', '115.09388033666', '定南县', 442365, 'county'),
(443729, '360729', '24.853232801668', '114.52234265684', '全南县', 442365, 'county'),
(443730, '360730', '26.590232461651', '116.01211627388', '宁都县', 442365, 'county'),
(443731, '360731', '25.936771660723', '115.50889266701', '于都县', 442365, 'county'),
(443732, '360732', '26.425200601326', '115.44650725812', '兴国县', 442365, 'county'),
(443733, '360733', '25.505756516053', '115.76515116427', '会昌县', 442365, 'county'),
(443734, '360734', '24.905101066212', '115.66514812504', '寻乌县', 442365, 'county'),
(443735, '360735', '26.305565307867', '116.37232152813', '石城县', 442365, 'county'),
(443736, '360781', '25.92183136176', '115.98586699622', '瑞金市', 442365, 'county'),
(443737, '360802', '27.160925346239', '114.96043668241', '吉州区', 442366, 'county'),
(443738, '360803', '26.859217102443', '115.2661672372', '青原区', 442366, 'county'),
(443739, '360821', '27.144039043235', '114.75127781381', '吉安县', 442366, 'county'),
(443740, '360822', '27.19746539341', '115.2546383758', '吉水县', 442366, 'county'),
(443741, '360823', '27.589281248366', '115.2144367887', '峡江县', 442366, 'county'),
(443742, '360824', '27.73857991921', '115.50683935381', '新干县', 442366, 'county'),
(443743, '360825', '27.097544566001', '115.59283108743', '永丰县', 442366, 'county'),
(443744, '360826', '26.744020657469', '114.90935609718', '泰和县', 442366, 'county'),
(443745, '360827', '26.344268552348', '114.37058927285', '遂川县', 442366, 'county'),
(443746, '360828', '26.444632606143', '114.82501601739', '万安县', 442366, 'county'),
(443747, '360829', '27.361338381942', '114.45559104078', '安福县', 442366, 'county'),
(443748, '360830', '26.973089209998', '114.18844710958', '永新县', 442366, 'county'),
(443749, '360881', '26.633149538063', '114.12543918071', '井冈山市', 442366, 'county'),
(443750, '360902', '27.839383216183', '114.29035792969', '袁州区', 442367, 'county'),
(443751, '360921', '28.714689488559', '115.18007761153', '奉新县', 442367, 'county'),
(443752, '360922', '28.209464188761', '114.33614285625', '万载县', 442367, 'county'),
(443753, '360923', '28.199053404375', '114.86095818884', '上高县', 442367, 'county'),
(443754, '360924', '28.454955048263', '114.77436594756', '宜丰县', 442367, 'county'),
(443755, '360925', '28.946083546903', '115.23770855063', '靖安县', 442367, 'county'),
(443756, '360926', '28.615515536873', '114.37013409066', '铜鼓县', 442367, 'county'),
(443757, '360981', '28.11151587847', '115.8234035155', '丰城市', 442367, 'county'),
(443758, '360982', '28.002513613496', '115.42134592031', '樟树市', 442367, 'county'),
(443759, '360983', '28.365231807956', '115.30448193078', '高安市', 442367, 'county'),
(443760, '361002', '27.924731514346', '116.36297445174', '临川区', 442368, 'county'),
(443761, '361021', '27.518966176458', '116.68173230038', '南城县', 442368, 'county'),
(443762, '361022', '27.261522440114', '116.93171710122', '黎川县', 442368, 'county'),
(443763, '361023', '27.114896155721', '116.50036153348', '南丰县', 442368, 'county'),
(443764, '361024', '27.714537232977', '116.0663364594', '崇仁县', 442368, 'county'),
(443765, '361025', '27.372428601937', '115.8433235072', '乐安县', 442368, 'county'),
(443766, '361026', '27.393066587894', '116.25124162127', '宜黄县', 442368, 'county'),
(443767, '361027', '27.931491559982', '116.7577119166', '金溪县', 442368, 'county'),
(443768, '361028', '27.745228535574', '117.03576739532', '资溪县', 442368, 'county'),
(443769, '361029', '28.221297983216', '116.6196227029', '东乡县', 442368, 'county'),
(443770, '361030', '26.761885358703', '116.36311652024', '广昌县', 442368, 'county'),
(443771, '361102', '28.497223477761', '118.05057821628', '信州区', 442369, 'county'),
(443772, '361103', '28.344342110797', '118.2644206827', '广丰区', 442369, 'county'),
(443773, '361121', '28.405679688374', '117.94436679858', '上饶县', 442369, 'county'),
(443774, '361123', '28.759339988568', '118.16891675165', '玉山县', 442369, 'county'),
(443775, '361124', '28.109822141358', '117.71346110788', '铅山县', 442369, 'county'),
(443776, '361125', '28.513847494908', '117.64519741314', '横峰县', 442369, 'county'),
(443777, '361126', '28.452236031909', '117.41664984164', '弋阳县', 442369, 'county'),
(443778, '361127', '28.682775556852', '116.62132713524', '余干县', 442369, 'county'),
(443779, '361128', '29.243055725231', '116.78769263036', '鄱阳县', 442369, 'county'),
(443780, '361129', '28.703236407929', '117.01441274225', '万年县', 442369, 'county'),
(443781, '361130', '29.327231721148', '117.78748504184', '婺源县', 442369, 'county'),
(443782, '361181', '28.940751536947', '117.75325925179', '德兴市', 442369, 'county'),
(443783, '370102', '36.659338577102', '117.10158579685', '历下区', 442370, 'county'),
(443784, '370103', '36.584025608593', '116.97943490154', '市中区', 442370, 'county'),
(443785, '370104', '36.682531368156', '116.89119924147', '槐荫区', 442370, 'county'),
(443786, '370105', '36.778077694991', '116.98315714712', '天桥区', 442370, 'county'),
(443787, '370112', '36.612688160201', '117.1908183999', '历城区', 442370, 'county'),
(443788, '370113', '36.428570220761', '116.8035523233', '长清区', 442370, 'county'),
(443789, '370124', '36.203933440502', '116.42250204992', '平阴县', 442370, 'county'),
(443790, '370125', '37.032805727164', '117.15002119645', '济阳县', 442370, 'county'),
(443791, '370126', '37.32594723869', '117.20871442383', '商河县', 442370, 'county'),
(443792, '370181', '36.744883031601', '117.47934537885', '章丘市', 442370, 'county'),
(443793, '370202', '36.072517005321', '120.37618412944', '市南区', 442371, 'county'),
(443794, '370203', '36.100057507009', '120.37849501736', '市北区', 442371, 'county'),
(443795, '370211', '36.005019406172', '120.16954109898', '黄岛区', 442371, 'county'),
(443796, '370212', '36.195587169547', '120.58490643507', '崂山区', 442371, 'county'),
(443797, '370213', '36.192897252321', '120.43114552866', '李沧区', 442371, 'county'),
(443798, '370214', '36.284246909785', '120.34632618533', '城阳区', 442371, 'county'),
(443799, '370281', '36.248031458483', '119.95942122689', '胶州市', 442371, 'county'),
(443800, '370282', '36.487908601599', '120.52110561991', '即墨市', 442371, 'county'),
(443801, '370283', '36.788550047135', '119.95106201677', '平度市', 442371, 'county'),
(443802, '370285', '36.863636936232', '120.44283105064', '莱西市', 442371, 'county'),
(443803, '370302', '36.58546320707', '118.02018132413', '淄川区', 442372, 'county'),
(443804, '370303', '36.816096523468', '118.07715128035', '张店区', 442372, 'county'),
(443805, '370304', '36.425426903116', '117.96555278725', '博山区', 442372, 'county'),
(443806, '370305', '36.854244021624', '118.30069695082', '临淄区', 442372, 'county'),
(443807, '370306', '36.771218733055', '117.87510840602', '周村区', 442372, 'county'),
(443808, '370321', '36.996290174374', '118.0343674972', '桓台县', 442372, 'county'),
(443809, '370322', '37.171377591723', '117.82824157972', '高青县', 442372, 'county'),
(443810, '370323', '36.135641879756', '118.20397204172', '沂源县', 442372, 'county'),
(443811, '370402', '34.870585491515', '117.60608168197', '市中区', 442373, 'county'),
(443812, '370403', '34.796330499958', '117.35850706735', '薛城区', 442373, 'county'),
(443813, '370404', '34.716097133125', '117.60355623943', '峄城区', 442373, 'county'),
(443814, '370405', '34.587964202085', '117.63824339976', '台儿庄区', 442373, 'county'),
(443815, '370406', '35.093150446743', '117.48403628836', '山亭区', 442373, 'county'),
(443816, '370481', '35.065790871862', '117.1476161953', '滕州市', 442373, 'county'),
(443817, '370502', '37.408666288041', '118.61264305188', '东营区', 442374, 'county'),
(443818, '370503', '37.969499930854', '118.62001162992', '河口区', 442374, 'county'),
(443819, '370505', '37.708139143783', '118.80543474393', '垦利区', 442374, 'county'),
(443820, '370522', '37.655326413663', '118.40033677253', '利津县', 442374, 'county'),
(443821, '370523', '37.162071119184', '118.53856931196', '广饶县', 442374, 'county'),
(443822, '370602', '37.520933396965', '121.36415635471', '芝罘区', 442375, 'county'),
(443823, '370611', '37.4810742238', '121.20346125307', '福山区', 442375, 'county'),
(443824, '370612', '37.272445856085', '121.56924005155', '牟平区', 442375, 'county'),
(443825, '370613', '37.407476077054', '121.45153473051', '莱山区', 442375, 'county'),
(443826, '370634', '38.07745626718', '120.75599624581', '长岛县', 442375, 'county'),
(443827, '370681', '37.610401281677', '120.5227995064', '龙口市', 442375, 'county'),
(443828, '370682', '36.905533169255', '120.75134338103', '莱阳市', 442375, 'county'),
(443829, '370683', '37.190401374398', '120.00134352944', '莱州市', 442375, 'county'),
(443830, '370684', '37.661160410834', '120.86269428184', '蓬莱市', 442375, 'county'),
(443831, '370685', '37.344145870524', '120.40051706225', '招远市', 442375, 'county'),
(443832, '370686', '37.311748207049', '120.9015556194', '栖霞市', 442375, 'county'),
(443833, '370687', '36.861587988875', '121.11361421128', '海阳市', 442375, 'county'),
(443834, '370702', '36.70198215587', '119.03430547775', '潍城区', 442376, 'county'),
(443835, '370703', '36.908365760671', '119.17913537725', '寒亭区', 442376, 'county'),
(443836, '370704', '36.625674339008', '119.25846542234', '坊子区', 442376, 'county'),
(443837, '370705', '36.691227364273', '119.19697218249', '奎文区', 442376, 'county'),
(443838, '370724', '36.365388839543', '118.55825637254', '临朐县', 442376, 'county'),
(443839, '370725', '36.535532052698', '118.91391393621', '昌乐县', 442376, 'county'),
(443840, '370781', '36.680584425831', '118.47018708791', '青州市', 442376, 'county'),
(443841, '370782', '36.016657533378', '119.41616966208', '诸城市', 442376, 'county'),
(443842, '370783', '37.029891849506', '118.85253352124', '寿光市', 442376, 'county'),
(443843, '370784', '36.335046466579', '119.15599227984', '安丘市', 442376, 'county'),
(443844, '370785', '36.387317992315', '119.70251223974', '高密市', 442376, 'county'),
(443845, '370786', '36.834234247985', '119.44991748822', '昌邑市', 442376, 'county'),
(443846, '370811', '35.380134737043', '116.57219935158', '任城区', 442377, 'county'),
(443847, '370812', '35.564429514451', '116.75256014243', '兖州区', 442377, 'county'),
(443848, '370826', '34.892715408071', '116.99240869227', '微山县', 442377, 'county'),
(443849, '370827', '35.01985835793', '116.57843727094', '鱼台县', 442377, 'county'),
(443850, '370828', '35.051246098924', '116.31512496802', '金乡县', 442377, 'county'),
(443851, '370829', '35.434199027209', '116.30729105899', '嘉祥县', 442377, 'county'),
(443852, '370830', '35.715701266031', '116.50644367868', '汶上县', 442377, 'county'),
(443853, '370831', '35.640740666213', '117.34526415391', '泗水县', 442377, 'county'),
(443854, '370832', '35.801606249716', '116.12480570072', '梁山县', 442377, 'county'),
(443855, '370881', '35.615760566258', '117.03178985128', '曲阜市', 442377, 'county'),
(443856, '370883', '35.354042540878', '117.08958175113', '邹城市', 442377, 'county'),
(443857, '370902', '36.215457241311', '117.18390217966', '泰山区', 442378, 'county'),
(443858, '370911', '36.148101133087', '117.19048736581', '岱岳区', 442378, 'county'),
(443859, '370921', '35.833600319907', '116.93293882598', '宁阳县', 442378, 'county'),
(443860, '370923', '35.97516090244', '116.34295320558', '东平县', 442378, 'county'),
(443861, '370982', '35.89581023511', '117.61301622046', '新泰市', 442378, 'county'),
(443862, '370983', '36.112514344701', '116.74476246765', '肥城市', 442378, 'county'),
(443863, '371002', '37.399343698592', '122.15207450216', '环翠区', 442379, 'county'),
(443864, '371003', '37.16608344728', '121.96829072766', '文登区', 442379, 'county'),
(443865, '371082', '37.128686091876', '122.40692581532', '荣成市', 442379, 'county'),
(443866, '371083', '36.976575050291', '121.52978797795', '乳山市', 442379, 'county'),
(443867, '371102', '35.469377334235', '119.37785169728', '东港区', 442380, 'county'),
(443868, '371103', '35.292714155339', '119.25182522442', '岚山区', 442380, 'county'),
(443869, '371121', '35.744382733588', '119.2494328324', '五莲县', 442380, 'county'),
(443870, '371122', '35.655874955573', '118.8935850849', '莒县', 442380, 'county'),
(443871, '371202', '36.313394584932', '117.6459130158', '莱城区', 442381, 'county'),
(443872, '371203', '36.092835887233', '117.8275371813', '钢城区', 442381, 'county'),
(443873, '371302', '35.174844704086', '118.31224292902', '兰山区', 442382, 'county'),
(443874, '371311', '34.964343085469', '118.29727935276', '罗庄区', 442382, 'county'),
(443875, '371312', '35.127030975379', '118.51731091285', '河东区', 442382, 'county'),
(443876, '371321', '35.536723374853', '118.41758556843', '沂南县', 442382, 'county'),
(443877, '371322', '34.649855053512', '118.32443065841', '郯城县', 442382, 'county'),
(443878, '371323', '35.914368629366', '118.60935780958', '沂水县', 442382, 'county'),
(443879, '371324', '34.862619866599', '118.00750944174', '兰陵县', 442382, 'county'),
(443880, '371325', '35.254970793112', '117.98583765075', '费县', 442382, 'county'),
(443881, '371326', '35.434249996001', '117.68244768554', '平邑县', 442382, 'county'),
(443882, '371327', '35.213123220035', '118.89007890268', '莒南县', 442382, 'county'),
(443883, '371328', '35.747440083102', '118.03674237099', '蒙阴县', 442382, 'county'),
(443884, '371329', '34.885484018739', '118.65944529359', '临沭县', 442382, 'county'),
(443885, '371402', '37.45743710416', '116.33291247583', '德城区', 442383, 'county'),
(443886, '371403', '37.418030354096', '116.67557519942', '陵城区', 442383, 'county'),
(443887, '371422', '37.68562160185', '116.81455550432', '宁津县', 442383, 'county'),
(443888, '371423', '37.801823529258', '117.46273738393', '庆云县', 442383, 'county'),
(443889, '371424', '37.235892912121', '116.89959541702', '临邑县', 442383, 'county'),
(443890, '371425', '36.723454326503', '116.67825351242', '齐河县', 442383, 'county'),
(443891, '371426', '37.156617614138', '116.43007889018', '平原县', 442383, 'county'),
(443892, '371427', '37.016688548156', '116.03732249608', '夏津县', 442383, 'county'),
(443893, '371428', '37.243982507441', '116.09122537249', '武城县', 442383, 'county'),
(443894, '371481', '37.674416911054', '117.14555333466', '乐陵市', 442383, 'county'),
(443895, '371482', '36.919142889593', '116.58133068117', '禹城市', 442383, 'county'),
(443896, '371502', '36.455829587246', '115.90770556753', '东昌府区', 442384, 'county'),
(443897, '371521', '36.146774001697', '115.87350298472', '阳谷县', 442384, 'county'),
(443898, '371522', '36.139121538984', '115.55267289485', '莘县', 442384, 'county'),
(443899, '371523', '36.588519734091', '116.18017382824', '茌平县', 442384, 'county'),
(443900, '371524', '36.331642489915', '116.2831984139', '东阿县', 442384, 'county'),
(443901, '371525', '36.53635700997', '115.54083712129', '冠县', 442384, 'county'),
(443902, '371526', '36.839764457085', '116.25743002174', '高唐县', 442384, 'county'),
(443903, '371581', '36.782069473113', '115.78260175173', '临清市', 442384, 'county'),
(443904, '371602', '37.424890835984', '117.98121111677', '滨城区', 442385, 'county'),
(443905, '371603', '37.868312497909', '118.05636772417', '沾化区', 442385, 'county'),
(443906, '371621', '37.375971318454', '117.57898363784', '惠民县', 442385, 'county'),
(443907, '371622', '37.605500456412', '117.57342951076', '阳信县', 442385, 'county'),
(443908, '371623', '37.942568300077', '117.79778189995', '无棣县', 442385, 'county'),
(443909, '371625', '37.19135384581', '118.22571531705', '博兴县', 442385, 'county'),
(443910, '371626', '36.956593309429', '117.67080618616', '邹平县', 442385, 'county'),
(443911, '371702', '35.283536562407', '115.47002526505', '牡丹区', 442386, 'county'),
(443912, '371703', '35.111855206745', '115.57403571958', '定陶区', 442386, 'county'),
(443913, '371721', '34.827952767182', '115.55360067628', '曹县', 442386, 'county'),
(443914, '371722', '34.738238141223', '116.122984618', '单县', 442386, 'county'),
(443915, '371723', '34.989110950657', '115.94498857738', '成武县', 442386, 'county'),
(443916, '371724', '35.279400360462', '116.04113122185', '巨野县', 442386, 'county'),
(443917, '371725', '35.612979519727', '115.89463235246', '郓城县', 442386, 'county'),
(443918, '371726', '35.555043149647', '115.55287125102', '鄄城县', 442386, 'county'),
(443919, '371728', '35.182435455789', '115.07411464426', '东明县', 442386, 'county'),
(443920, '410102', '34.779474293205', '113.55728142479', '中原区', 442387, 'county'),
(443921, '410103', '34.75661006414', '113.64964384986', '二七区', 442387, 'county'),
(443922, '410104', '34.70900380778', '113.72186105524', '管城回族区', 442387, 'county'),
(443923, '410105', '34.797406405145', '113.70801125038', '金水区', 442387, 'county'),
(443924, '410106', '34.822088918243', '113.29818225705', '上街区', 442387, 'county'),
(443925, '410108', '34.869446814666', '113.62834116351', '惠济区', 442387, 'county'),
(443926, '410122', '34.720319012422', '114.01122240275', '中牟县', 442387, 'county'),
(443927, '410181', '34.703798883243', '113.03959002892', '巩义市', 442387, 'county'),
(443928, '410182', '34.806179937519', '113.35180180957', '荥阳市', 442387, 'county'),
(443929, '410183', '34.514074899467', '113.43985443365', '新密市', 442387, 'county'),
(443930, '410184', '34.459442752589', '113.73611501497', '新郑市', 442387, 'county'),
(443931, '410185', '34.418362166819', '113.04174933248', '登封市', 442387, 'county'),
(443932, '410202', '34.860572766851', '114.34098849918', '龙亭区', 442388, 'county'),
(443933, '410203', '34.81777146999', '114.42852744048', '顺河回族区', 442388, 'county'),
(443934, '410204', '34.797982546084', '114.34190563407', '鼓楼区', 442388, 'county'),
(443935, '410205', '34.75102886185', '114.38560958232', '禹王台区', 442388, 'county'),
(443936, '410211', '34.860572766851', '114.34098849918', '金明区', 442388, 'county'),
(443937, '410212', '34.725946945916', '114.43805957404', '祥符区', 442388, 'county'),
(443938, '410221', '34.505963464038', '114.76878210877', '杞县', 442388, 'county'),
(443939, '410222', '34.441630948349', '114.50219933719', '通许县', 442388, 'county'),
(443940, '410223', '34.388437240132', '114.16103722407', '尉氏县', 442388, 'county'),
(443941, '410225', '34.879764140336', '114.98029307097', '兰考县', 442388, 'county'),
(443942, '410302', '34.704033141562', '112.45917255752', '老城区', 442389, 'county'),
(443943, '410303', '34.689693743302', '112.4071257244', '西工区', 442389, 'county'),
(443944, '410304', '34.702931706602', '112.50509438434', '瀍河回族区', 442389, 'county'),
(443945, '410305', '34.671667591915', '112.39075320818', '涧西区', 442389, 'county'),
(443946, '410306', '34.905378745091', '112.58976455586', '吉利区', 442389, 'county'),
(443947, '410311', '34.638792103903', '112.46709264771', '洛龙区', 442389, 'county'),
(443948, '410322', '34.831148181123', '112.47699634585', '孟津县', 442389, 'county'),
(443949, '410323', '34.837606946675', '112.12774350044', '新安县', 442389, 'county'),
(443950, '410324', '33.912392483904', '111.61701356274', '栾川县', 442389, 'county'),
(443951, '410325', '34.010600110067', '112.04951135131', '嵩县', 442389, 'county'),
(443952, '410326', '34.06296675028', '112.4355439591', '汝阳县', 442389, 'county'),
(443953, '410327', '34.486036200799', '112.04046789874', '宜阳县', 442389, 'county'),
(443954, '410328', '34.345208388992', '111.50679130206', '洛宁县', 442389, 'county'),
(443955, '410329', '34.407088177948', '112.46887702474', '伊川县', 442389, 'county'),
(443956, '410381', '34.630801858346', '112.73482167429', '偃师市', 442389, 'county'),
(443957, '410402', '33.771546437308', '113.20808222559', '新华区', 442390, 'county'),
(443958, '410403', '33.769107814671', '113.36538845598', '卫东区', 442390, 'county'),
(443959, '410404', '33.892093587751', '112.89469073779', '石龙区', 442390, 'county'),
(443960, '410411', '33.71234144492', '113.27818922149', '湛河区', 442390, 'county'),
(443961, '410421', '33.915497347446', '113.03577147499', '宝丰县', 442390, 'county'),
(443962, '410422', '33.551013481912', '113.3506762416', '叶县', 442390, 'county'),
(443963, '410423', '33.748697388191', '112.74030934124', '鲁山县', 442390, 'county'),
(443964, '410425', '34.005498968871', '113.23328182561', '郏县', 442390, 'county'),
(443965, '410481', '33.289605497055', '113.52599604654', '舞钢市', 442390, 'county'),
(443966, '410482', '34.162777545453', '112.8127174803', '汝州市', 442390, 'county'),
(443967, '410502', '36.034147665845', '114.41852222061', '文峰区', 442391, 'county'),
(443968, '410503', '36.141695896219', '114.39143588406', '北关区', 442391, 'county'),
(443969, '410505', '36.135573231517', '114.29712997501', '殷都区', 442391, 'county'),
(443970, '410506', '36.056024537571', '114.25660364057', '龙安区', 442391, 'county'),
(443971, '410522', '36.125134517065', '114.31712430011', '安阳县', 442391, 'county'),
(443972, '410523', '35.907982338855', '114.46206281377', '汤阴县', 442391, 'county'),
(443973, '410526', '35.471733779112', '114.67364721954', '滑县', 442391, 'county'),
(443974, '410527', '35.906569063676', '114.82334356443', '内黄县', 442391, 'county'),
(443975, '410581', '36.016561032268', '113.86108354948', '林州市', 442391, 'county'),
(443976, '410602', '35.973345969386', '114.09845417079', '鹤山区', 442392, 'county'),
(443977, '410603', '35.927453768113', '114.25302901346', '山城区', 442392, 'county'),
(443978, '410611', '35.812418921012', '114.19951434914', '淇滨区', 442392, 'county'),
(443979, '410621', '35.686206113273', '114.46718581475', '浚县', 442392, 'county'),
(443980, '410622', '35.667571747251', '114.16903374394', '淇县', 442392, 'county'),
(443981, '410702', '35.286150085139', '113.91461891258', '红旗区', 442393, 'county'),
(443982, '410703', '35.294831576876', '113.86463773299', '卫滨区', 442393, 'county'),
(443983, '410704', '35.399318437608', '113.86418902939', '凤泉区', 442393, 'county'),
(443984, '410711', '35.338890167673', '113.89672215157', '牧野区', 442393, 'county'),
(443985, '410721', '35.220522070112', '113.84824573704', '新乡县', 442393, 'county'),
(443986, '410724', '35.203480558843', '113.65196887023', '获嘉县', 442393, 'county'),
(443987, '410725', '35.029035610429', '113.95316420007', '原阳县', 442393, 'county'),
(443988, '410726', '35.279607523872', '114.23135664543', '延津县', 442393, 'county'),
(443989, '410727', '35.040384096253', '114.48767812651', '封丘县', 442393, 'county'),
(443990, '410728', '35.218127613796', '114.76690326799', '长垣县', 442393, 'county'),
(443991, '410781', '35.499572079266', '114.07811240389', '卫辉市', 442393, 'county'),
(443992, '410782', '35.543594465927', '113.68789198968', '辉县市', 442393, 'county'),
(443993, '410802', '35.241712363011', '113.23080396516', '解放区', 442394, 'county'),
(443994, '410803', '35.257023702543', '113.16153562728', '中站区', 442394, 'county'),
(443995, '410804', '35.304171016133', '113.36732116029', '马村区', 442394, 'county'),
(443996, '410811', '35.241160124283', '113.27635056977', '山阳区', 442394, 'county'),
(443997, '410821', '35.309677964198', '113.36352820836', '修武县', 442394, 'county'),
(443998, '410822', '35.186007002113', '113.07507819608', '博爱县', 442394, 'county'),
(443999, '410823', '35.057332269363', '113.39993452059', '武陟县', 442394, 'county'),
(444000, '410825', '34.950259905072', '113.05529612566', '温县', 442394, 'county'),
(444001, '410882', '35.133826023222', '112.8883049259', '沁阳市', 442394, 'county'),
(444002, '410883', '34.925884390003', '112.76969911916', '孟州市', 442394, 'county'),
(444003, '410902', '35.77193370823', '115.04809659609', '华龙区', 442395, 'county'),
(444004, '410922', '35.924381925846', '115.1612013425', '清丰县', 442395, 'county'),
(444005, '410923', '36.097697402715', '115.24982310475', '南乐县', 442395, 'county'),
(444006, '410926', '35.801404731968', '115.53840075342', '范县', 442395, 'county'),
(444007, '410927', '35.966389126572', '115.88573804863', '台前县', 442395, 'county'),
(444008, '410928', '35.59228702617', '115.15660204659', '濮阳县', 442395, 'county'),
(444009, '411002', '34.043477065508', '113.82531644192', '魏都区', 442396, 'county'),
(444010, '411023', '34.048516339751', '113.83526207686', '许昌县', 442396, 'county'),
(444011, '411024', '34.01192963976', '114.20240879522', '鄢陵县', 442396, 'county'),
(444012, '411025', '33.86190518971', '113.56898289597', '襄城县', 442396, 'county'),
(444013, '411081', '34.200307558026', '113.39269360872', '禹州市', 442396, 'county'),
(444014, '411082', '34.236601226737', '113.85556820652', '长葛市', 442396, 'county'),
(444015, '411102', '33.53475547247', '113.92360106938', '源汇区', 442397, 'county'),
(444016, '411103', '33.670703809923', '113.94136182694', '郾城区', 442397, 'county'),
(444017, '411104', '33.57798961468', '114.18514173047', '召陵区', 442397, 'county'),
(444018, '411121', '33.549301454759', '113.68005525753', '舞阳县', 442397, 'county'),
(444019, '411122', '33.844425731931', '113.96389863435', '临颍县', 442397, 'county'),
(444020, '411202', '34.771777672947', '111.28129514586', '湖滨区', 442398, 'county'),
(444021, '411203', '34.642257128616', '111.38347360282', '陕州区', 442398, 'county'),
(444022, '411221', '34.839691429224', '111.80253536998', '渑池县', 442398, 'county'),
(444023, '411224', '33.973393506457', '110.99472361928', '卢氏县', 442398, 'county'),
(444024, '411281', '34.749524796841', '111.90609266704', '义马市', 442398, 'county'),
(444025, '411282', '34.437104010525', '110.77973742779', '灵宝市', 442398, 'county'),
(444026, '411302', '32.934703186447', '112.61390774771', '宛城区', 442399, 'county'),
(444027, '411303', '33.009838704626', '112.48426735075', '卧龙区', 442399, 'county'),
(444028, '411321', '33.472841576965', '112.39366620514', '南召县', 442399, 'county'),
(444029, '411322', '33.29995432977', '113.01682220295', '方城县', 442399, 'county'),
(444030, '411323', '33.48692481474', '111.43898978054', '西峡县', 442399, 'county'),
(444031, '411324', '33.070817074221', '112.19328453943', '镇平县', 442399, 'county'),
(444032, '411325', '33.224377176241', '111.8474050987', '内乡县', 442399, 'county'),
(444033, '411326', '32.989722669393', '111.44539628251', '淅川县', 442399, 'county'),
(444034, '411327', '32.982431382713', '112.99852720955', '社旗县', 442399, 'county'),
(444035, '411328', '32.619993292449', '112.85911827542', '唐河县', 442399, 'county'),
(444036, '411329', '32.553440600793', '112.41599071451', '新野县', 442399, 'county'),
(444037, '411330', '32.495650299965', '113.43416900109', '桐柏县', 442399, 'county'),
(444038, '411381', '32.684649552173', '112.0568605764', '邓州市', 442399, 'county'),
(444039, '411402', '34.5030395946', '115.63773066554', '梁园区', 442400, 'county'),
(444040, '411403', '34.286754693787', '115.58978387844', '睢阳区', 442400, 'county'),
(444041, '411421', '34.696116524323', '115.17841405829', '民权县', 442400, 'county'),
(444042, '411422', '34.39975982873', '115.04300110058', '睢县', 442400, 'county'),
(444043, '411423', '34.454601801008', '115.29840053317', '宁陵县', 442400, 'county'),
(444044, '411424', '34.111651823091', '115.30904185846', '柘城县', 442400, 'county'),
(444045, '411425', '34.36907192525', '115.9142248589', '虞城县', 442400, 'county'),
(444046, '411426', '34.223680706067', '116.15745373108', '夏邑县', 442400, 'county'),
(444047, '411481', '33.972013062908', '116.33077515791', '永城市', 442400, 'county'),
(444048, '411502', '32.031339669892', '113.96277662182', '浉河区', 442401, 'county'),
(444049, '411503', '32.307840062297', '114.1390859663', '平桥区', 442401, 'county'),
(444050, '411521', '32.031230299697', '114.44356295731', '罗山县', 442401, 'county'),
(444051, '411522', '31.941431722351', '114.84316193505', '光山县', 442401, 'county'),
(444052, '411523', '31.646279005794', '114.85908905243', '新县', 442401, 'county'),
(444053, '411524', '31.766261672209', '115.37524581828', '商城县', 442401, 'county'),
(444054, '411525', '32.13694390485', '115.70974321125', '固始县', 442401, 'county'),
(444055, '411526', '32.132798426222', '115.16440991805', '潢川县', 442401, 'county'),
(444056, '411527', '32.44657354908', '115.32456065214', '淮滨县', 442401, 'county'),
(444057, '411528', '32.410808174844', '114.87168181062', '息县', 442401, 'county'),
(444058, '411602', '33.630875553438', '114.65795015653', '川汇区', 442402, 'county'),
(444059, '411621', '34.100655472765', '114.43732658093', '扶沟县', 442402, 'county');
INSERT INTO `region` (`id`, `code`, `lat`, `lng`, `name`, `parent_id`, `by_type`) VALUES
(444060, '411622', '33.793632327288', '114.47808721231', '西华县', 442402, 'county'),
(444061, '411623', '33.52093272236', '114.5595768694', '商水县', 442402, 'county'),
(444062, '411624', '33.295149932293', '115.17871821127', '沈丘县', 442402, 'county'),
(444063, '411625', '33.641500072188', '115.30129735228', '郸城县', 442402, 'county'),
(444064, '411626', '33.709946652498', '114.90201820622', '淮阳县', 442402, 'county'),
(444065, '411627', '34.097096248874', '114.85570075514', '太康县', 442402, 'county'),
(444066, '411628', '33.894050509383', '115.38398333433', '鹿邑县', 442402, 'county'),
(444067, '411681', '33.274470322798', '114.89338047633', '项城市', 442402, 'county'),
(444068, '411702', '32.968356527361', '114.00828960502', '驿城区', 442403, 'county'),
(444069, '411721', '33.37154892996', '113.92283839684', '西平县', 442403, 'county'),
(444070, '411722', '33.301221213377', '114.40923857452', '上蔡县', 442403, 'county'),
(444071, '411723', '32.992143963522', '114.64744862019', '平舆县', 442403, 'county'),
(444072, '411724', '32.546931233463', '114.49796073761', '正阳县', 442403, 'county'),
(444073, '411725', '32.711951228899', '113.96358973796', '确山县', 442403, 'county'),
(444074, '411726', '32.883863636522', '113.44717429859', '泌阳县', 442403, 'county'),
(444075, '411727', '32.921968466052', '114.3257758188', '汝南县', 442403, 'county'),
(444076, '411728', '33.167855168478', '113.90248496569', '遂平县', 442403, 'county'),
(444077, '411729', '32.783574270118', '114.94939334965', '新蔡县', 442403, 'county'),
(444078, '419001', '35.093893094508', '112.40383005708', '济源市', 442404, 'county'),
(444079, '420102', '30.656090889378', '114.33286813952', '江岸区', 442405, 'county'),
(444080, '420103', '30.610951375707', '114.26638369307', '江汉区', 442405, 'county'),
(444081, '420104', '30.603890608484', '114.21975676824', '硚口区', 442405, 'county'),
(444082, '420105', '30.547265210116', '114.21759191464', '汉阳区', 442405, 'county'),
(444083, '420106', '30.564860292785', '114.35362228468', '武昌区', 442405, 'county'),
(444084, '420107', '30.633205056354', '114.44449542245', '青山区', 442405, 'county'),
(444085, '420111', '30.54362328175', '114.43389643664', '洪山区', 442405, 'county'),
(444086, '420112', '30.69815326481', '114.08715512184', '东西湖区', 442405, 'county'),
(444087, '420113', '30.287139798861', '113.96273175623', '汉南区', 442405, 'county'),
(444088, '420114', '30.456183515878', '113.97206459286', '蔡甸区', 442405, 'county'),
(444089, '420115', '30.252484112134', '114.36708160048', '江夏区', 442405, 'county'),
(444090, '420116', '30.985285897674', '114.36464422879', '黄陂区', 442405, 'county'),
(444091, '420117', '30.803887901859', '114.76208468205', '新洲区', 442405, 'county'),
(444092, '420202', '30.233764966969', '115.0731593966', '黄石港区', 442406, 'county'),
(444093, '420203', '30.184485507434', '115.1322665517', '西塞山区', 442406, 'county'),
(444094, '420204', '30.195818128952', '114.99298679763', '下陆区', 442406, 'county'),
(444095, '420205', '30.218698027629', '114.90300946351', '铁山区', 442406, 'county'),
(444096, '420222', '29.828087088129', '115.14049262648', '阳新县', 442406, 'county'),
(444097, '420281', '30.072895848258', '114.84614160381', '大冶市', 442406, 'county'),
(444098, '420302', '32.605601870191', '110.78595269258', '茅箭区', 442407, 'county'),
(444099, '420303', '32.663839857981', '110.7174012025', '张湾区', 442407, 'county'),
(444100, '420304', '32.848666872', '110.70709242813', '郧阳区', 442407, 'county'),
(444101, '420322', '33.04842762997', '110.15015123042', '郧西县', 442407, 'county'),
(444102, '420323', '32.240141680909', '110.07273955599', '竹山县', 442407, 'county'),
(444103, '420324', '32.0377375614', '109.7912365606', '竹溪县', 442407, 'county'),
(444104, '420325', '31.896989987694', '110.71456120963', '房县', 442407, 'county'),
(444105, '420381', '32.567476506858', '111.19322791899', '丹江口市', 442407, 'county'),
(444106, '420502', '30.740828168194', '111.31370556274', '西陵区', 442408, 'county'),
(444107, '420503', '30.678659340635', '111.380922081', '伍家岗区', 442408, 'county'),
(444108, '420504', '30.625384685781', '111.21627903018', '点军区', 442408, 'county'),
(444109, '420505', '30.551849254685', '111.45521482125', '猇亭区', 442408, 'county'),
(444110, '420506', '30.979970536584', '111.31064943757', '夷陵区', 442408, 'county'),
(444111, '420525', '31.176854341724', '111.58511301877', '远安县', 442408, 'county'),
(444112, '420526', '31.319349537746', '110.82440565254', '兴山县', 442408, 'county'),
(444113, '420527', '30.903334635073', '110.68599344932', '秭归县', 442408, 'county'),
(444114, '420528', '30.482854820654', '110.85396847661', '长阳土家族自治县', 442408, 'county'),
(444115, '420529', '30.173164959818', '110.70999872376', '五峰土家族自治县', 442408, 'county'),
(444116, '420581', '30.294919731409', '111.37553355505', '宜都市', 442408, 'county'),
(444117, '420582', '30.825538036113', '111.84271236769', '当阳市', 442408, 'county'),
(444118, '420583', '30.451766635038', '111.72856708021', '枝江市', 442408, 'county'),
(444119, '420602', '31.935360283633', '112.01708254994', '襄城区', 442409, 'county'),
(444120, '420606', '32.153953344009', '111.92852759276', '樊城区', 442409, 'county'),
(444121, '420607', '32.161267821333', '112.1615782359', '襄州区', 442409, 'county'),
(444122, '420624', '31.643279800381', '111.76462860893', '南漳县', 442409, 'county'),
(444123, '420625', '32.173451559392', '111.49595776173', '谷城县', 442409, 'county'),
(444124, '420626', '31.719672647836', '111.20990495958', '保康县', 442409, 'county'),
(444125, '420682', '32.434165591299', '111.76583021988', '老河口市', 442409, 'county'),
(444126, '420683', '32.092510578007', '112.77260678733', '枣阳市', 442409, 'county'),
(444127, '420684', '31.673335169944', '112.37274539501', '宜城市', 442409, 'county'),
(444128, '420702', '30.172732100474', '114.65002920477', '梁子湖区', 442410, 'county'),
(444129, '420703', '30.473067617235', '114.7014718376', '华容区', 442410, 'county'),
(444130, '420704', '30.320603111112', '114.90101603375', '鄂城区', 442410, 'county'),
(444131, '420802', '31.129834655672', '112.08731072725', '东宝区', 442411, 'county'),
(444132, '420804', '30.932878257728', '112.19392270314', '掇刀区', 442411, 'county'),
(444133, '420821', '31.085751895572', '113.1122609366', '京山县', 442411, 'county'),
(444134, '420822', '30.664549510743', '112.39598267744', '沙洋县', 442411, 'county'),
(444135, '420881', '31.244981073964', '112.58482623119', '钟祥市', 442411, 'county'),
(444136, '420902', '30.9446167023', '114.01614199013', '孝南区', 442412, 'county'),
(444137, '420921', '31.239758867241', '114.03487209446', '孝昌县', 442412, 'county'),
(444138, '420922', '31.57825524841', '114.31029950549', '大悟县', 442412, 'county'),
(444139, '420923', '31.004978516713', '113.77818589474', '云梦县', 442412, 'county'),
(444140, '420981', '30.925709286687', '113.55644020385', '应城市', 442412, 'county'),
(444141, '420982', '31.304354863067', '113.63338728419', '安陆市', 442412, 'county'),
(444142, '420984', '30.622039213976', '113.68167835943', '汉川市', 442412, 'county'),
(444143, '421002', '30.325722718965', '112.42410926804', '沙市区', 442413, 'county'),
(444144, '421003', '30.396103360853', '112.09985718065', '荆州区', 442413, 'county'),
(444145, '421022', '29.957130184896', '112.15361758468', '公安县', 442413, 'county'),
(444146, '421023', '29.848933249111', '113.0019564425', '监利县', 442413, 'county'),
(444147, '421024', '30.101502949806', '112.47370114506', '江陵县', 442413, 'county'),
(444148, '421081', '29.742222414324', '112.51435972656', '石首市', 442413, 'county'),
(444149, '421083', '29.996772000415', '113.53891465228', '洪湖市', 442413, 'county'),
(444150, '421087', '30.105224314496', '111.69620454012', '松滋市', 442413, 'county'),
(444151, '421102', '30.518802478736', '114.94956939748', '黄州区', 442414, 'county'),
(444152, '421121', '30.723706101243', '115.01408720557', '团风县', 442414, 'county'),
(444153, '421122', '31.29012275323', '114.62811879353', '红安县', 442414, 'county'),
(444154, '421123', '30.932372750757', '115.48102224121', '罗田县', 442414, 'county'),
(444155, '421124', '30.872992046545', '115.77430241642', '英山县', 442414, 'county'),
(444156, '421125', '30.507400278808', '115.27625105135', '浠水县', 442414, 'county'),
(444157, '421126', '30.328717011744', '115.60077083531', '蕲春县', 442414, 'county'),
(444158, '421127', '29.998875662753', '115.94188335896', '黄梅县', 442414, 'county'),
(444159, '421181', '31.217943121813', '115.08971464087', '麻城市', 442414, 'county'),
(444160, '421182', '30.01561431062', '115.62583375392', '武穴市', 442414, 'county'),
(444161, '421202', '29.854650359958', '114.39186727646', '咸安区', 442415, 'county'),
(444162, '421221', '30.013807145954', '113.9671389967', '嘉鱼县', 442415, 'county'),
(444163, '421222', '29.229496067967', '113.85326552547', '通城县', 442415, 'county'),
(444164, '421223', '29.46178869538', '114.06793496135', '崇阳县', 442415, 'county'),
(444165, '421224', '29.557670344417', '114.61524564759', '通山县', 442415, 'county'),
(444166, '421281', '29.742560741036', '113.88916760653', '赤壁市', 442415, 'county'),
(444167, '421303', '31.607981069768', '113.46768060015', '曾都区', 442416, 'county'),
(444168, '421321', '31.89292220952', '113.26226604576', '随县', 442416, 'county'),
(444169, '421381', '31.68232502305', '113.81261910549', '广水市', 442416, 'county'),
(444170, '422801', '30.463309797502', '109.15843052724', '恩施市', 442417, 'county'),
(444171, '422802', '30.42403337354', '108.75827737341', '利川市', 442417, 'county'),
(444172, '422822', '30.578575985623', '109.93959920981', '建始县', 442417, 'county'),
(444173, '422823', '30.827452858588', '110.30061735767', '巴东县', 442417, 'county'),
(444174, '422825', '30.044021286424', '109.45211696118', '宣恩县', 442417, 'county'),
(444175, '422826', '29.64880608709', '109.11475831378', '咸丰县', 442417, 'county'),
(444176, '422827', '29.425663227736', '109.2467141194', '来凤县', 442417, 'county'),
(444177, '422828', '29.959848783933', '110.2232960585', '鹤峰县', 442417, 'county'),
(444178, '429004', '30.293966004922', '113.38744819358', '仙桃市', 442418, 'county'),
(444179, '429005', '30.343115792601', '112.76876801686', '潜江市', 442418, 'county'),
(444180, '429006', '30.649047356422', '113.12623048765', '天门市', 442418, 'county'),
(444181, '429021', '31.595767599083', '110.48723070015', '神农架林区', 442418, 'county'),
(444182, '430102', '28.203810552355', '113.02096885649', '芙蓉区', 442419, 'county'),
(444183, '430103', '28.144470861087', '112.99619520748', '天心区', 442419, 'county'),
(444184, '430104', '28.202706634928', '112.90869935253', '岳麓区', 442419, 'county'),
(444185, '430105', '28.260219056422', '113.02472997183', '开福区', 442419, 'county'),
(444186, '430111', '28.146444362118', '113.02020071545', '雨花区', 442419, 'county'),
(444187, '430112', '28.277901873199', '112.84853518023', '望城区', 442419, 'county'),
(444188, '430121', '28.322758625178', '113.22494603976', '长沙县', 442419, 'county'),
(444189, '430124', '28.131212630242', '112.36046547366', '宁乡县', 442419, 'county'),
(444190, '430181', '28.234472053802', '113.72198528266', '浏阳市', 442419, 'county'),
(444191, '430202', '27.907228809861', '113.2125259488', '荷塘区', 442420, 'county'),
(444192, '430203', '27.822072525123', '113.16975977942', '芦淞区', 442420, 'county'),
(444193, '430204', '27.941584145955', '113.16351107646', '石峰区', 442420, 'county'),
(444194, '430211', '27.77777212283', '113.06800898383', '天元区', 442420, 'county'),
(444195, '430221', '27.535936240494', '113.15334777322', '株洲县', 442420, 'county'),
(444196, '430223', '27.172267738735', '113.48783136261', '攸县', 442420, 'county'),
(444197, '430224', '26.806729309467', '113.6524812712', '茶陵县', 442420, 'county'),
(444198, '430225', '26.382712485446', '113.85053602814', '炎陵县', 442420, 'county'),
(444199, '430281', '27.662278573878', '113.47062497305', '醴陵市', 442420, 'county'),
(444200, '430302', '27.871843464684', '112.89447989496', '雨湖区', 442421, 'county'),
(444201, '430304', '27.927747363022', '113.02348797463', '岳塘区', 442421, 'county'),
(444202, '430321', '27.66922281069', '112.78880535021', '湘潭县', 442421, 'county'),
(444203, '430381', '27.77667974388', '112.35516854771', '湘乡市', 442421, 'county'),
(444204, '430382', '27.927332779842', '112.53309503972', '韶山市', 442421, 'county'),
(444205, '430405', '26.882224641246', '112.68848999752', '珠晖区', 442422, 'county'),
(444206, '430406', '26.852862113311', '112.60790741194', '雁峰区', 442422, 'county'),
(444207, '430407', '26.958880199218', '112.60248766531', '石鼓区', 442422, 'county'),
(444208, '430408', '26.886508776556', '112.5550474327', '蒸湘区', 442422, 'county'),
(444209, '430412', '27.259358565856', '112.70876706188', '南岳区', 442422, 'county'),
(444210, '430421', '27.109626113862', '112.35157940823', '衡阳县', 442422, 'county'),
(444211, '430422', '26.759844895044', '112.64851378595', '衡南县', 442422, 'county'),
(444212, '430423', '27.281912376828', '112.71963002036', '衡山县', 442422, 'county'),
(444213, '430424', '27.085080215257', '113.02900158518', '衡东县', 442422, 'county'),
(444214, '430426', '26.806848291159', '111.96160590404', '祁东县', 442422, 'county'),
(444215, '430481', '26.423992793417', '112.9215515181', '耒阳市', 442422, 'county'),
(444216, '430482', '26.365629347663', '112.43550437188', '常宁市', 442422, 'county'),
(444217, '430502', '27.248222019138', '111.54534736863', '双清区', 442423, 'county'),
(444218, '430503', '27.15673687542', '111.48663933069', '大祥区', 442423, 'county'),
(444219, '430511', '27.250338344113', '111.42227870533', '北塔区', 442423, 'county'),
(444220, '430521', '27.193653689477', '111.85672034136', '邵东县', 442423, 'county'),
(444221, '430522', '27.431198790186', '111.47127474176', '新邵县', 442423, 'county'),
(444222, '430523', '26.984976684914', '111.33237232124', '邵阳县', 442423, 'county'),
(444223, '430524', '27.351830793846', '110.97332605607', '隆回县', 442423, 'county'),
(444224, '430525', '27.103195627285', '110.5997390171', '洞口县', 442423, 'county'),
(444225, '430527', '26.714433355354', '110.20598518573', '绥宁县', 442423, 'county'),
(444226, '430528', '26.548580699981', '110.92469767578', '新宁县', 442423, 'county'),
(444227, '430529', '26.325514573582', '110.32530265472', '城步苗族自治县', 442423, 'county'),
(444228, '430581', '26.786578072622', '110.74581533919', '武冈市', 442423, 'county'),
(444229, '430602', '29.367743455935', '113.15536982346', '岳阳楼区', 442424, 'county'),
(444230, '430603', '29.526210726593', '113.35377424951', '云溪区', 442424, 'county'),
(444231, '430611', '29.461963175999', '112.82353001902', '君山区', 442424, 'county'),
(444232, '430621', '29.178498531192', '113.23752715256', '岳阳县', 442424, 'county'),
(444233, '430623', '29.493395834151', '112.65100948964', '华容县', 442424, 'county'),
(444234, '430624', '28.713089704815', '112.8053736108', '湘阴县', 442424, 'county'),
(444235, '430626', '28.762202955269', '113.72084646866', '平江县', 442424, 'county'),
(444236, '430681', '28.801958087001', '113.12502676793', '汨罗市', 442424, 'county'),
(444237, '430682', '29.496146011064', '113.51974938156', '临湘市', 442424, 'county'),
(444238, '430702', '28.996871241883', '111.69744989482', '武陵区', 442425, 'county'),
(444239, '430703', '28.99524298628', '111.74779560677', '鼎城区', 442425, 'county'),
(444240, '430721', '29.448996008449', '112.16243681004', '安乡县', 442425, 'county'),
(444241, '430722', '28.864800229907', '112.04431060341', '汉寿县', 442425, 'county'),
(444242, '430723', '29.750168137633', '111.70770306732', '澧县', 442425, 'county'),
(444243, '430724', '29.486256878123', '111.62542246954', '临澧县', 442425, 'county'),
(444244, '430725', '28.917817681602', '111.27070654871', '桃源县', 442425, 'county'),
(444245, '430726', '29.801742760215', '111.04428685665', '石门县', 442425, 'county'),
(444246, '430781', '29.474442427089', '111.90685042221', '津市市', 442425, 'county'),
(444247, '430802', '29.08853881247', '110.50100729665', '永定区', 442426, 'county'),
(444248, '430811', '29.35720050871', '110.48849578734', '武陵源区', 442426, 'county'),
(444249, '430821', '29.397692771035', '110.9362003537', '慈利县', 442426, 'county'),
(444250, '430822', '29.567691591611', '110.18733600686', '桑植县', 442426, 'county'),
(444251, '430902', '28.694069428897', '112.34312135279', '资阳区', 442427, 'county'),
(444252, '430903', '28.456919373898', '112.46132362565', '赫山区', 442427, 'county'),
(444253, '430921', '29.242714345729', '112.4444992186', '南县', 442427, 'county'),
(444254, '430922', '28.464142378681', '111.99046415183', '桃江县', 442427, 'county'),
(444255, '430923', '28.286580101198', '111.39078157302', '安化县', 442427, 'county'),
(444256, '430981', '28.977186044013', '112.56494222194', '沅江市', 442427, 'county'),
(444257, '431002', '25.679158376796', '112.88447564616', '北湖区', 442428, 'county'),
(444258, '431003', '25.773515156215', '113.05100154527', '苏仙区', 442428, 'county'),
(444259, '431021', '25.893490018268', '112.60810756507', '桂阳县', 442428, 'county'),
(444260, '431022', '25.275886554538', '112.93344735219', '宜章县', 442428, 'county'),
(444261, '431023', '26.216491688814', '113.19839325538', '永兴县', 442428, 'county'),
(444262, '431024', '25.637287293573', '112.41435261569', '嘉禾县', 442428, 'county'),
(444263, '431025', '25.34399717934', '112.56804110466', '临武县', 442428, 'county'),
(444264, '431026', '25.555136753643', '113.67767672321', '汝城县', 442428, 'county'),
(444265, '431027', '25.98664473819', '113.90640126356', '桂东县', 442428, 'county'),
(444266, '431028', '26.580785897827', '113.3656988724', '安仁县', 442428, 'county'),
(444267, '431081', '25.937184405929', '113.4685220784', '资兴市', 442428, 'county'),
(444268, '431102', '26.102311299933', '111.56391866724', '零陵区', 442429, 'county'),
(444269, '431103', '26.560381677834', '111.6215855691', '冷水滩区', 442429, 'county'),
(444270, '431121', '26.460846002508', '111.97259355447', '祁阳县', 442429, 'county'),
(444271, '431122', '26.495587621014', '111.3428094117', '东安县', 442429, 'county'),
(444272, '431123', '25.914932997744', '111.71629417694', '双牌县', 442429, 'county'),
(444273, '431124', '25.499396959983', '111.60204209765', '道县', 442429, 'county'),
(444274, '431125', '25.199988241379', '111.25388667817', '江永县', 442429, 'county'),
(444275, '431126', '25.653839564231', '111.98806316398', '宁远县', 442429, 'county'),
(444276, '431127', '25.319502616064', '112.1963927883', '蓝山县', 442429, 'county'),
(444277, '431128', '25.890527389354', '112.23480727989', '新田县', 442429, 'county'),
(444278, '431129', '24.977642122796', '111.75249569192', '江华瑶族自治县', 442429, 'county'),
(444279, '431202', '27.612024135064', '109.94553900894', '鹤城区', 442430, 'county'),
(444280, '431221', '27.52093513528', '110.16536245669', '中方县', 442430, 'county'),
(444281, '431222', '28.576604506247', '110.60117801132', '沅陵县', 442430, 'county'),
(444282, '431223', '27.895902086692', '110.27300890779', '辰溪县', 442430, 'county'),
(444283, '431224', '27.83590994386', '110.65858111747', '溆浦县', 442430, 'county'),
(444284, '431225', '26.914136373938', '109.8099454141', '会同县', 442430, 'county'),
(444285, '431226', '27.791375726707', '109.72917909558', '麻阳苗族自治县', 442430, 'county'),
(444286, '431227', '27.234509109112', '109.1687410593', '新晃侗族自治县', 442430, 'county'),
(444287, '431228', '27.402510416382', '109.61110485123', '芷江侗族自治县', 442430, 'county'),
(444288, '431229', '26.550430723333', '109.59083349436', '靖州苗族侗族自治县', 442430, 'county'),
(444289, '431230', '26.215115332486', '109.7446605455', '通道侗族自治县', 442430, 'county'),
(444290, '431281', '27.239105321481', '110.08719342097', '洪江市', 442430, 'county'),
(444291, '431302', '27.766945342839', '112.00461910688', '娄星区', 442431, 'county'),
(444292, '431321', '27.465564445594', '112.18792282367', '双峰县', 442431, 'county'),
(444293, '431322', '27.873272599439', '111.24684472009', '新化县', 442431, 'county'),
(444294, '431381', '27.684914712556', '111.49394197482', '冷水江市', 442431, 'county'),
(444295, '431382', '27.743727453351', '111.79458146238', '涟源市', 442431, 'county'),
(444296, '433101', '28.297553747059', '109.90596604398', '吉首市', 442432, 'county'),
(444297, '433122', '28.004620053587', '109.83368299284', '泸溪县', 442432, 'county'),
(444298, '433123', '28.128806804716', '109.627609014', '凤凰县', 442432, 'county'),
(444299, '433124', '28.573833156579', '109.45712787573', '花垣县', 442432, 'county'),
(444300, '433125', '28.653191600514', '109.69701784684', '保靖县', 442432, 'county'),
(444301, '433126', '28.603594321825', '110.00814905055', '古丈县', 442432, 'county'),
(444302, '433127', '28.753308819921', '109.95878299439', '永顺县', 442432, 'county'),
(444303, '433130', '29.458093683151', '109.44489996147', '龙山县', 442432, 'county'),
(444304, '440103', '23.093666203644', '113.23442278391', '荔湾区', 442433, 'county'),
(444305, '440104', '23.139277859339', '113.28783302666', '越秀区', 442433, 'county'),
(444306, '440105', '23.087629228789', '113.33384126613', '海珠区', 442433, 'county'),
(444307, '440106', '23.166129265425', '113.38564289133', '天河区', 442433, 'county'),
(444308, '440111', '23.294514083014', '113.33130628641', '白云区', 442433, 'county'),
(444309, '440112', '23.108711814239', '113.49288457425', '黄埔区', 442433, 'county'),
(444310, '440113', '22.934590795798', '113.41679952965', '番禺区', 442433, 'county'),
(444311, '440114', '23.446660997141', '113.22017551212', '花都区', 442433, 'county'),
(444312, '440115', '22.729893804121', '113.58022392527', '南沙区', 442433, 'county'),
(444313, '440117', '23.705203224537', '113.69870948609', '从化区', 442433, 'county'),
(444314, '440118', '23.332025887963', '113.77002334194', '增城区', 442433, 'county'),
(444315, '440203', '24.708193228698', '113.37960618165', '武江区', 442434, 'county'),
(444316, '440204', '24.919162254549', '113.57745027759', '浈江区', 442434, 'county'),
(444317, '440205', '24.651897914445', '113.64217762719', '曲江区', 442434, 'county'),
(444318, '440222', '24.852706291962', '114.11540446493', '始兴县', 442434, 'county'),
(444319, '440224', '25.148465646013', '113.78547373726', '仁化县', 442434, 'county'),
(444320, '440229', '24.426734740638', '114.03042755919', '翁源县', 442434, 'county'),
(444321, '440232', '24.812051773842', '113.17577755468', '乳源瑶族自治县', 442434, 'county'),
(444322, '440233', '24.070091776392', '114.14177489194', '新丰县', 442434, 'county'),
(444323, '440281', '25.244441914003', '113.24695611826', '乐昌市', 442434, 'county'),
(444324, '440282', '25.189905400508', '114.38658277052', '南雄市', 442434, 'county'),
(444325, '440303', '22.581934478848', '114.15639529324', '罗湖区', 442435, 'county'),
(444326, '440304', '22.551730572433', '114.05559275391', '福田区', 442435, 'county'),
(444327, '440305', '22.558887751083', '113.95072266574', '南山区', 442435, 'county'),
(444328, '440306', '22.707432793082', '113.93001313569', '宝安区', 442435, 'county'),
(444329, '440307', '22.657462286882', '114.34769572771', '龙岗区', 442435, 'county'),
(444330, '440308', '22.606981337589', '114.27848287567', '盐田区', 442435, 'county'),
(444331, '440402', '22.26559983535', '113.53373098039', '香洲区', 442436, 'county'),
(444332, '440403', '22.216636753124', '113.24798167517', '斗门区', 442436, 'county'),
(444333, '440404', '22.04721492726', '113.41758987066', '金湾区', 442436, 'county'),
(444334, '440507', '23.408849226222', '116.75934746239', '龙湖区', 442437, 'county'),
(444335, '440511', '23.399887892781', '116.65179359137', '金平区', 442437, 'county'),
(444336, '440512', '23.282442837577', '116.71136293853', '濠江区', 442437, 'county'),
(444337, '440513', '23.347253898106', '116.48544753544', '潮阳区', 442437, 'county'),
(444338, '440514', '23.181395091106', '116.41405584392', '潮南区', 442437, 'county'),
(444339, '440515', '23.532996549632', '116.8148077949', '澄海区', 442437, 'county'),
(444340, '440523', '23.439131822072', '117.0704048247', '南澳县', 442437, 'county'),
(444341, '440604', '23.004210165991', '113.07042319497', '禅城区', 442438, 'county'),
(444342, '440605', '23.07826538747', '113.04138132585', '南海区', 442438, 'county'),
(444343, '440606', '22.848510084787', '113.18702987688', '顺德区', 442438, 'county'),
(444344, '440607', '23.294580845555', '112.90467719327', '三水区', 442438, 'county'),
(444345, '440608', '22.824522683444', '112.68325830314', '高明区', 442438, 'county'),
(444346, '440703', '22.660132832793', '113.06077007598', '蓬江区', 442439, 'county'),
(444347, '440704', '22.554846678035', '113.13537054201', '江海区', 442439, 'county'),
(444348, '440705', '22.38821506964', '113.0347511329', '新会区', 442439, 'county'),
(444349, '440781', '22.034638545952', '112.7159079377', '台山市', 442439, 'county'),
(444350, '440783', '22.374200664984', '112.54804114164', '开平市', 442439, 'county'),
(444351, '440784', '22.675317373533', '112.80161841196', '鹤山市', 442439, 'county'),
(444352, '440785', '22.240985208711', '112.28646122263', '恩平市', 442439, 'county'),
(444353, '440802', '21.287667885107', '110.37972297262', '赤坎区', 442440, 'county'),
(444354, '440803', '21.2048473973', '110.38519600028', '霞山区', 442440, 'county'),
(444355, '440804', '21.283819774873', '110.51272613161', '坡头区', 442440, 'county'),
(444356, '440811', '21.094100364979', '110.33802177707', '麻章区', 442440, 'county'),
(444357, '440823', '21.270307383787', '110.0398954377', '遂溪县', 442440, 'county'),
(444358, '440825', '20.429967572815', '110.25784725094', '徐闻县', 442440, 'county'),
(444359, '440881', '21.645265225554', '110.14171137206', '廉江市', 442440, 'county'),
(444360, '440882', '20.796584309564', '110.01263612715', '雷州市', 442440, 'county'),
(444361, '440883', '21.441681041112', '110.70818705195', '吴川市', 442440, 'county'),
(444362, '440902', '21.676115917529', '110.86860979348', '茂南区', 442441, 'county'),
(444363, '440904', '21.66821689615', '111.15968915137', '电白区', 442441, 'county'),
(444364, '440981', '22.035521645119', '110.97560541086', '高州市', 442441, 'county'),
(444365, '440982', '21.845482259109', '110.53959146838', '化州市', 442441, 'county'),
(444366, '440983', '22.431974274304', '111.12542886235', '信宜市', 442441, 'county'),
(444367, '441202', '23.103323258382', '112.47779387429', '端州区', 442442, 'county'),
(444368, '441203', '23.208968105809', '112.62524912783', '鼎湖区', 442442, 'county'),
(444369, '441204', '23.110684686218', '112.51216619847', '高要区', 442442, 'county'),
(444370, '441223', '23.677207015329', '112.44331648004', '广宁县', 442442, 'county'),
(444371, '441224', '23.974272952942', '112.18024001499', '怀集县', 442442, 'county'),
(444372, '441225', '23.561267405148', '111.72348651223', '封开县', 442442, 'county'),
(444373, '441226', '23.276366860198', '111.98726848872', '德庆县', 442442, 'county'),
(444374, '441284', '23.431443755334', '112.68755812366', '四会市', 442442, 'county'),
(444375, '441302', '23.278292790243', '114.7325947848', '惠城区', 442443, 'county'),
(444376, '441303', '22.788789691764', '114.47977020249', '惠阳区', 442443, 'county'),
(444377, '441322', '23.352582051478', '114.28847482844', '博罗县', 442443, 'county'),
(444378, '441323', '23.049117499162', '114.95551769006', '惠东县', 442443, 'county'),
(444379, '441324', '23.666408023307', '114.13724281901', '龙门县', 442443, 'county'),
(444380, '441402', '24.290750354901', '116.11595202018', '梅江区', 442444, 'county'),
(444381, '441403', '24.3647824353', '116.171027251', '梅县区', 442444, 'county'),
(444382, '441422', '24.347933570693', '116.66412418408', '大埔县', 442444, 'county'),
(444383, '441423', '23.916084592091', '116.29139470791', '丰顺县', 442444, 'county'),
(444384, '441424', '23.802833236552', '115.64131969769', '五华县', 442444, 'county'),
(444385, '441426', '24.695653660804', '115.93265634975', '平远县', 442444, 'county'),
(444386, '441427', '24.683283405987', '116.19614150108', '蕉岭县', 442444, 'county'),
(444387, '441481', '24.267311238028', '115.75329965584', '兴宁市', 442444, 'county'),
(444388, '441502', '22.768710049741', '115.42435769122', '城区', 442445, 'county'),
(444389, '441521', '22.969599520286', '115.2863223299', '海丰县', 442445, 'county'),
(444390, '441523', '23.284406924899', '115.62919633367', '陆河县', 442445, 'county'),
(444391, '441581', '22.967876723873', '115.78802975191', '陆丰市', 442445, 'county'),
(444392, '441602', '23.693604112347', '114.65448360226', '源城区', 442446, 'county'),
(444393, '441621', '23.525442374357', '115.06447099781', '紫金县', 442446, 'county'),
(444394, '441622', '24.334679775761', '115.36229172074', '龙川县', 442446, 'county'),
(444395, '441623', '24.340566290031', '114.54297659273', '连平县', 442446, 'county'),
(444396, '441624', '24.45211039106', '115.01181507521', '和平县', 442446, 'county'),
(444397, '441625', '23.933052556598', '114.82694608538', '东源县', 442446, 'county'),
(444398, '441702', '21.762803637074', '111.93003574135', '江城区', 442447, 'county'),
(444399, '441704', '21.90761038558', '112.04622577462', '阳东区', 442447, 'county'),
(444400, '441721', '21.720609599412', '111.60050919755', '阳西县', 442447, 'county'),
(444401, '441781', '22.223897927949', '111.69444876956', '阳春市', 442447, 'county'),
(444402, '441802', '23.62585596526', '113.11458528252', '清城区', 442448, 'county'),
(444403, '441803', '23.932290452567', '112.94889933526', '清新区', 442448, 'county'),
(444404, '441821', '23.881077228129', '113.56668917499', '佛冈县', 442448, 'county'),
(444405, '441823', '24.509485552315', '112.68133014518', '阳山县', 442448, 'county'),
(444406, '441825', '24.515164969495', '112.10080575295', '连山壮族瑶族自治县', 442448, 'county'),
(444407, '441826', '24.574155992653', '112.26364236788', '连南瑶族自治县', 442448, 'county'),
(444408, '441881', '24.225680391225', '113.32316898492', '英德市', 442448, 'county'),
(444409, '441882', '24.937020846031', '112.45918890578', '连州市', 442448, 'county'),
(444410, '441900', '23.043023815368', '113.76343399076', '东莞市', 442220, 'county'),
(444411, '442000', '22.545177514513', '113.4220600208', '中山市', 442220, 'county'),
(444412, '445102', '23.700043577114', '116.67789952964', '湘桥区', 442449, 'county'),
(444413, '445103', '23.717386141778', '116.60876927831', '潮安区', 442449, 'county'),
(444414, '445122', '23.865029718048', '116.90612266997', '饶平县', 442449, 'county'),
(444415, '445202', '23.529452754199', '116.3692235802', '榕城区', 442450, 'county'),
(444416, '445203', '23.585024810833', '116.37807073325', '揭东区', 442450, 'county'),
(444417, '445222', '23.494712399671', '115.91682503049', '揭西县', 442450, 'county'),
(444418, '445224', '23.034046544147', '116.2247989034', '惠来县', 442450, 'county'),
(444419, '445281', '23.288953583142', '116.07816590835', '普宁市', 442450, 'county'),
(444420, '445302', '22.973002378136', '112.17160356227', '云城区', 442451, 'county'),
(444421, '445303', '22.856466364893', '111.96143088808', '云安区', 442451, 'county'),
(444422, '445321', '22.626992446128', '112.21754109744', '新兴县', 442451, 'county'),
(444423, '445322', '23.043633197681', '111.61993760725', '郁南县', 442451, 'county'),
(444424, '445381', '22.690983986437', '111.49324209266', '罗定市', 442451, 'county'),
(444425, '450102', '22.924530825243', '108.41762068739', '兴宁区', 442452, 'county'),
(444426, '450103', '22.829217973591', '108.54167973252', '青秀区', 442452, 'county'),
(444427, '450105', '22.663806639444', '108.13559066584', '江南区', 442452, 'county'),
(444428, '450107', '22.912937296114', '108.21544203073', '西乡塘区', 442452, 'county'),
(444429, '450108', '22.498910081219', '108.37044913796', '良庆区', 442452, 'county'),
(444430, '450109', '22.595811549706', '108.62620569962', '邕宁区', 442452, 'county'),
(444431, '450110', '23.233267218289', '108.23369489981', '武鸣区', 442452, 'county'),
(444432, '450123', '23.110227709531', '107.69066557406', '隆安县', 442452, 'county'),
(444433, '450124', '23.664942974082', '108.1696043635', '马山县', 442452, 'county'),
(444434, '450125', '23.521730154673', '108.64581538209', '上林县', 442452, 'county'),
(444435, '450126', '23.168344342302', '108.94049469657', '宾阳县', 442452, 'county'),
(444436, '450127', '22.774919317685', '109.16892656267', '横县', 442452, 'county'),
(444437, '450202', '24.371128485733', '109.48318080161', '城中区', 442453, 'county'),
(444438, '450203', '24.275815550781', '109.45632703637', '鱼峰区', 442453, 'county'),
(444439, '450204', '24.306183897363', '109.34346581857', '柳南区', 442453, 'county'),
(444440, '450205', '24.471742756535', '109.41391452987', '柳北区', 442453, 'county'),
(444441, '450206', '24.21578019619', '109.33837797157', '柳江区', 442453, 'county'),
(444442, '450222', '24.62988200842', '109.23019655363', '柳城县', 442453, 'county'),
(444443, '450223', '24.532198388889', '109.80281600679', '鹿寨县', 442453, 'county'),
(444444, '450224', '25.139782632024', '109.51401020724', '融安县', 442453, 'county'),
(444445, '450225', '25.343698638547', '109.05786347353', '融水苗族自治县', 442453, 'county'),
(444446, '450226', '25.74756560612', '109.5100810614', '三江侗族自治县', 442453, 'county'),
(444447, '450302', '25.287138490985', '110.27454852003', '秀峰区', 442454, 'county'),
(444448, '450303', '25.318874237568', '110.336225817', '叠彩区', 442454, 'county'),
(444449, '450304', '25.215755465426', '110.28460774513', '象山区', 442454, 'county'),
(444450, '450305', '25.264669861823', '110.35658833681', '七星区', 442454, 'county'),
(444451, '450311', '25.112805740761', '110.37148547606', '雁山区', 442454, 'county'),
(444452, '450312', '25.266798702759', '110.05831249425', '临桂区', 442454, 'county'),
(444453, '450321', '24.857282289724', '110.48292929478', '阳朔县', 442454, 'county'),
(444454, '450323', '25.381008804927', '110.41812911351', '灵川县', 442454, 'county'),
(444455, '450324', '25.936464773168', '111.02643476452', '全州县', 442454, 'county'),
(444456, '450325', '25.6070310342', '110.60102057414', '兴安县', 442454, 'county'),
(444457, '450326', '24.997329894857', '109.91693042182', '永福县', 442454, 'county'),
(444458, '450327', '25.458880833514', '111.0777084233', '灌阳县', 442454, 'county'),
(444459, '450328', '25.868327982022', '110.0102504878', '龙胜各族自治县', 442454, 'county'),
(444460, '450329', '26.067857197159', '110.59842700994', '资源县', 442454, 'county'),
(444461, '450330', '24.558919773879', '110.79768988938', '平乐县', 442454, 'county'),
(444462, '450331', '24.525342885432', '110.36832789757', '荔浦县', 442454, 'county'),
(444463, '450332', '24.949325584117', '110.90944732333', '恭城瑶族自治县', 442454, 'county'),
(444464, '450403', '23.563455294046', '111.42162608637', '万秀区', 442455, 'county'),
(444465, '450405', '23.560200006306', '111.1899141988', '长洲区', 442455, 'county'),
(444466, '450406', '23.205423202289', '111.32167060016', '龙圩区', 442455, 'county'),
(444467, '450421', '23.626737954219', '111.29835212828', '苍梧县', 442455, 'county'),
(444468, '450422', '23.510902782468', '110.77883787789', '藤县', 442455, 'county'),
(444469, '450423', '24.133850543878', '110.56122298515', '蒙山县', 442455, 'county'),
(444470, '450481', '22.925290987321', '111.02872021172', '岑溪市', 442455, 'county'),
(444471, '450502', '21.518620780285', '109.16534360381', '海城区', 442456, 'county'),
(444472, '450503', '21.48972262057', '109.2515908141', '银海区', 442456, 'county'),
(444473, '450512', '21.574915371765', '109.42248930511', '铁山港区', 442456, 'county'),
(444474, '450521', '21.740444343774', '109.33539345631', '合浦县', 442456, 'county'),
(444475, '450602', '21.662035674238', '108.44916612265', '港口区', 442457, 'county'),
(444476, '450603', '21.764841822261', '108.02974018357', '防城区', 442457, 'county'),
(444477, '450621', '22.053625294887', '107.90234352919', '上思县', 442457, 'county'),
(444478, '450681', '21.627169839712', '108.0610807332', '东兴市', 442457, 'county'),
(444479, '450702', '21.89668072285', '108.8165239388', '钦南区', 442458, 'county'),
(444480, '450703', '22.171133309191', '108.52867631111', '钦北区', 442458, 'county'),
(444481, '450721', '22.315715686267', '109.14774755818', '灵山县', 442458, 'county'),
(444482, '450722', '22.271304072712', '109.54236668008', '浦北县', 442458, 'county'),
(444483, '450802', '23.244654866397', '109.68955750941', '港北区', 442459, 'county'),
(444484, '450803', '22.87475110083', '109.7098514885', '港南区', 442459, 'county'),
(444485, '450804', '23.147899675106', '109.4013360968', '覃塘区', 442459, 'county'),
(444486, '450821', '23.538682883685', '110.41260119285', '平南县', 442459, 'county'),
(444487, '450881', '23.3332806173', '110.08711890997', '桂平市', 442459, 'county'),
(444488, '450902', '22.557212692568', '110.0645342655', '玉州区', 442460, 'county'),
(444489, '450903', '22.485121229661', '109.99939646175', '福绵区', 442460, 'county'),
(444490, '450921', '22.831614121088', '110.61027737584', '容县', 442460, 'county'),
(444491, '450922', '22.251747037814', '110.27211293424', '陆川县', 442460, 'county'),
(444492, '450923', '22.066766171087', '109.87890451509', '博白县', 442460, 'county'),
(444493, '450924', '22.798461756462', '109.92861094693', '兴业县', 442460, 'county'),
(444494, '450981', '22.528890370522', '110.46705456426', '北流市', 442460, 'county'),
(444495, '451002', '23.941865593712', '106.50559640624', '右江区', 442461, 'county'),
(444496, '451021', '23.729759302774', '106.81127009414', '田阳县', 442461, 'county'),
(444497, '451022', '23.614585367817', '107.19163711741', '田东县', 442461, 'county'),
(444498, '451023', '23.540954424157', '107.57751209903', '平果县', 442461, 'county'),
(444499, '451024', '23.382214509826', '106.59428466728', '德保县', 442461, 'county'),
(444500, '451026', '23.247545560208', '105.8347049622', '那坡县', 442461, 'county'),
(444501, '451027', '24.363726145418', '106.64837922239', '凌云县', 442461, 'county'),
(444502, '451028', '24.829664240385', '106.5178987429', '乐业县', 442461, 'county'),
(444503, '451029', '24.392538479127', '105.99982724993', '田林县', 442461, 'county'),
(444504, '451030', '24.391377583083', '105.09732745516', '西林县', 442461, 'county'),
(444505, '451031', '24.680432837057', '105.30321343556', '隆林各族自治县', 442461, 'county'),
(444506, '451081', '23.221036271428', '106.38310874744', '靖西市', 442461, 'county'),
(444507, '451102', '24.309335821524', '111.68835191834', '八步区', 442462, 'county'),
(444508, '451103', '24.272024331072', '111.4583206726', '平桂区', 442462, 'county'),
(444509, '451121', '24.108072861819', '110.97690768696', '昭平县', 442462, 'county'),
(444510, '451122', '24.513864981375', '111.24883282187', '钟山县', 442462, 'county'),
(444511, '451123', '24.891613643714', '111.31324328294', '富川瑶族自治县', 442462, 'county'),
(444512, '451202', '24.660762069433', '107.87344356952', '金城江区', 442463, 'county'),
(444513, '451221', '25.11943883054', '107.46800068753', '南丹县', 442463, 'county'),
(444514, '451222', '25.01883375149', '106.99659443884', '天峨县', 442463, 'county'),
(444515, '451223', '24.560064974996', '107.01971572195', '凤山县', 442463, 'county'),
(444516, '451224', '24.511600489222', '107.41353376084', '东兰县', 442463, 'county'),
(444517, '451225', '24.904567511665', '108.82719124199', '罗城仫佬族自治县', 442463, 'county'),
(444518, '451226', '25.104531056442', '108.29198518646', '环江毛南族自治县', 442463, 'county'),
(444519, '451227', '24.157595548736', '107.20766596976', '巴马瑶族自治县', 442463, 'county'),
(444520, '451228', '24.169778074597', '108.11806068056', '都安瑶族自治县', 442463, 'county'),
(444521, '451229', '23.970744702117', '107.71195932144', '大化瑶族自治县', 442463, 'county'),
(444522, '451281', '24.481176748089', '108.5465522796', '宜州市', 442463, 'county'),
(444523, '451302', '23.664270771977', '109.19320522678', '兴宾区', 442464, 'county'),
(444524, '451321', '24.018747261796', '108.75231859732', '忻城县', 442464, 'county'),
(444525, '451322', '24.019170132851', '109.77196784577', '象州县', 442464, 'county'),
(444526, '451323', '23.61072110732', '109.68768015891', '武宣县', 442464, 'county'),
(444527, '451324', '24.089876611192', '110.13777637174', '金秀瑶族自治县', 442464, 'county'),
(444528, '451381', '23.802816135427', '108.94253993058', '合山市', 442464, 'county'),
(444529, '451402', '22.529826577387', '107.46135714079', '江州区', 442465, 'county'),
(444530, '451421', '22.524058231311', '107.82912504554', '扶绥县', 442465, 'county'),
(444531, '451422', '22.005062342039', '107.29465888577', '宁明县', 442465, 'county'),
(444532, '451423', '22.431578425316', '106.85853904762', '龙州县', 442465, 'county'),
(444533, '451424', '22.813462764842', '107.13710947577', '大新县', 442465, 'county'),
(444534, '451425', '23.117161246424', '107.08133912276', '天等县', 442465, 'county'),
(444535, '451481', '22.093647276973', '106.83705317757', '凭祥市', 442465, 'county'),
(444536, '460105', '19.884344360797', '110.26320040619', '秀英区', 442466, 'county'),
(444537, '460106', '19.905350664019', '110.33522411653', '龙华区', 442466, 'county'),
(444538, '460107', '19.741333613805', '110.48011046473', '琼山区', 442466, 'county'),
(444539, '460108', '19.942908977934', '110.50726929452', '美兰区', 442466, 'county'),
(444540, '460202', '18.38141790489', '109.73605457423', '海棠区', 442467, 'county'),
(444541, '460203', '18.266590591978', '109.57378482237', '吉阳区', 442467, 'county'),
(444542, '460204', '18.395908258064', '109.38879057584', '天涯区', 442467, 'county'),
(444543, '460205', '18.448774794407', '109.18636245975', '崖州区', 442467, 'county'),
(444544, '460321', '16.497085431044', '111.67308686126', '西沙群岛', 442468, 'county'),
(444545, '460322', '4.9743661921368', '112.66030170907', '南沙群岛', 442468, 'county'),
(444546, '460323', '12.464712920653', '113.75535610385', '中沙群岛的岛礁及其海域', 442468, 'county'),
(444547, '460400', '19.574787798597', '109.33458619886', '儋州市', 442222, 'county'),
(444548, '469001', '18.831305749013', '109.51775006369', '五指山市', 442469, 'county'),
(444549, '469002', '19.214830368617', '110.41435935151', '琼海市', 442469, 'county'),
(444550, '469005', '19.750947380145', '110.78090944499', '文昌市', 442469, 'county'),
(444551, '469006', '18.839885909177', '110.29250485724', '万宁市', 442469, 'county'),
(444552, '469007', '18.998160861218', '108.85100963157', '东方市', 442469, 'county'),
(444553, '469021', '20.050057124473', '110.20642407813', '定安县', 442469, 'county'),
(444554, '469022', '19.347749127852', '110.06336404474', '屯昌县', 442469, 'county'),
(444555, '469023', '19.693135069577', '109.99673620157', '澄迈县', 442469, 'county'),
(444556, '469024', '19.805922012409', '109.72410152868', '临高县', 442469, 'county'),
(444557, '469025', '19.216056142062', '109.35858558291', '白沙黎族自治县', 442469, 'county'),
(444558, '469026', '19.222482900957', '109.01129968163', '昌江黎族自治县', 442469, 'county'),
(444559, '469027', '18.658613560734', '109.0626980127', '乐东黎族自治县', 442469, 'county'),
(444560, '469028', '18.575984851566', '109.94866071004', '陵水黎族自治县', 442469, 'county'),
(444561, '469029', '18.597592346267', '109.65611337969', '保亭黎族苗族自治县', 442469, 'county'),
(444562, '469030', '19.039771066968', '109.86184857077', '琼中黎族苗族自治县', 442469, 'county'),
(444563, '500101', '30.710054184366', '108.4134386367', '万州区', 442470, 'county'),
(444564, '500102', '29.66467054056', '107.34079973803', '涪陵区', 442470, 'county'),
(444565, '500103', '29.555236194395', '106.54696678483', '渝中区', 442470, 'county'),
(444566, '500104', '29.424139786946', '106.46532181465', '大渡口区', 442470, 'county'),
(444567, '500105', '29.619317744064', '106.71361473094', '江北区', 442470, 'county'),
(444568, '500106', '29.630548136629', '106.37480489265', '沙坪坝区', 442470, 'county'),
(444569, '500107', '29.434566154958', '106.37059488439', '九龙坡区', 442470, 'county'),
(444570, '500108', '29.541514618903', '106.66717849904', '南岸区', 442470, 'county'),
(444571, '500109', '29.866596066865', '106.52034245432', '北碚区', 442470, 'county'),
(444572, '500110', '28.825949323551', '106.73584657225', '綦江区', 442470, 'county'),
(444573, '500111', '29.622204718555', '105.76093297492', '大足区', 442470, 'county'),
(444574, '500112', '29.816264082426', '106.7537985312', '渝北区', 442470, 'county'),
(444575, '500113', '29.378027968889', '106.7582741592', '巴南区', 442470, 'county'),
(444576, '500114', '29.440981033584', '108.71480796402', '黔江区', 442470, 'county'),
(444577, '500115', '29.96049135503', '107.14661537132', '长寿区', 442470, 'county'),
(444578, '500116', '29.035351190668', '106.26928185639', '江津区', 442470, 'county'),
(444579, '500117', '30.118708260134', '106.31802875449', '合川区', 442470, 'county'),
(444580, '500118', '29.296487646991', '105.88035760368', '永川区', 442470, 'county'),
(444581, '500119', '29.141685769527', '107.17788827954', '南川区', 442470, 'county'),
(444582, '500120', '29.588328631909', '106.21326949786', '璧山区', 442470, 'county'),
(444583, '500151', '29.813265758673', '106.03488288304', '铜梁区', 442470, 'county'),
(444584, '500152', '30.116632232545', '105.78466162818', '潼南区', 442470, 'county'),
(444585, '500153', '29.472620663129', '105.52149235061', '荣昌区', 442470, 'county'),
(444586, '500154', '31.262995406524', '108.42256829126', '开州区', 442470, 'county'),
(444587, '500228', '30.66436343529', '107.72542817193', '梁平县', 442471, 'county'),
(444588, '500229', '31.888131392209', '108.74185516517', '城口县', 442471, 'county'),
(444589, '500230', '29.890595717682', '107.8375173643', '丰都县', 442471, 'county'),
(444590, '500231', '30.259498445887', '107.44444454166', '垫江县', 442471, 'county'),
(444591, '500232', '29.379270963599', '107.71610570339', '武隆县', 442471, 'county'),
(444592, '500233', '29.544606108886', '106.53063501341', '忠县', 442471, 'county'),
(444593, '500235', '31.042409267237', '108.86318575675', '云阳县', 442471, 'county'),
(444594, '500236', '30.958552797156', '109.35566670168', '奉节县', 442471, 'county'),
(444595, '500237', '31.121151720268', '109.90861122268', '巫山县', 442471, 'county'),
(444596, '500238', '31.509161376321', '109.36053147066', '巫溪县', 442471, 'county'),
(444597, '500240', '30.099636944155', '108.30489042793', '石柱土家族自治县', 442471, 'county'),
(444598, '500241', '28.498315398405', '109.02532125368', '秀山土家族苗族自治县', 442471, 'county'),
(444599, '500242', '28.905277662391', '108.80680823733', '酉阳土家族苗族自治县', 442471, 'county'),
(444600, '500243', '29.359628264894', '108.27286773419', '彭水苗族土家族自治县', 442471, 'county'),
(444601, '510104', '30.606301824621', '104.12426938462', '锦江区', 442472, 'county'),
(444602, '510105', '30.685101946314', '103.98842870094', '青羊区', 442472, 'county'),
(444603, '510106', '30.735622100763', '104.06137695451', '金牛区', 442472, 'county'),
(444604, '510107', '30.612881788753', '104.04124020837', '武侯区', 442472, 'county'),
(444605, '510108', '30.695040111899', '104.15003204704', '成华区', 442472, 'county'),
(444606, '510112', '30.603368382019', '104.30118080707', '龙泉驿区', 442472, 'county'),
(444607, '510113', '30.796353967983', '104.34642982356', '青白江区', 442472, 'county'),
(444608, '510114', '30.839503886637', '104.11658349961', '新都区', 442472, 'county'),
(444609, '510115', '30.730254927008', '103.81646839534', '温江区', 442472, 'county'),
(444610, '510116', '30.450175430612', '104.0328303402', '双流区', 442472, 'county'),
(444611, '510121', '30.728612610912', '104.61537139695', '金堂县', 442472, 'county'),
(444612, '510124', '30.839641883011', '103.88462503305', '郫县', 442472, 'county'),
(444613, '510129', '30.614941412606', '103.38845160801', '大邑县', 442472, 'county'),
(444614, '510131', '30.239938504594', '103.49773846901', '蒲江县', 442472, 'county'),
(444615, '510132', '30.42786608997', '103.83217681027', '新津县', 442472, 'county'),
(444616, '510181', '31.039123659728', '103.63734201321', '都江堰市', 442472, 'county'),
(444617, '510182', '31.148577255886', '103.88986635887', '彭州市', 442472, 'county'),
(444618, '510183', '30.388736018151', '103.37651244321', '邛崃市', 442472, 'county'),
(444619, '510184', '30.71964092397', '103.52946689588', '崇州市', 442472, 'county'),
(444620, '510185', '30.37250750046', '104.55059629796', '简阳市', 442472, 'county'),
(444621, '510302', '29.28261396923', '104.70785437828', '自流井区', 442473, 'county'),
(444622, '510303', '29.314590727756', '104.6027348472', '贡井区', 442473, 'county'),
(444623, '510304', '29.411547695333', '104.87756638738', '大安区', 442473, 'county'),
(444624, '510311', '29.242640479342', '104.854763441', '沿滩区', 442473, 'county'),
(444625, '510321', '29.398978496698', '104.372407917', '荣县', 442473, 'county'),
(444626, '510322', '29.152297063892', '105.02222048778', '富顺县', 442473, 'county'),
(444627, '510402', '26.587571257109', '101.72242315249', '东区', 442474, 'county'),
(444628, '510403', '26.587571257109', '101.72242315249', '西区', 442474, 'county'),
(444629, '510411', '26.56790741922', '101.66970205128', '仁和区', 442474, 'county'),
(444630, '510421', '26.932749356485', '102.00072626456', '米易县', 442474, 'county'),
(444631, '510422', '26.940087094351', '101.58605027726', '盐边县', 442474, 'county'),
(444632, '510502', '28.87690067554', '105.37171257028', '江阳区', 442475, 'county'),
(444633, '510503', '28.614041373614', '105.3906055521', '纳溪区', 442475, 'county'),
(444634, '510504', '28.987460236388', '105.4378416897', '龙马潭区', 442475, 'county'),
(444635, '510521', '29.124919969133', '105.50826734902', '泸县', 442475, 'county'),
(444636, '510522', '28.751865254096', '105.93160013109', '合江县', 442475, 'county'),
(444637, '510524', '28.099206628496', '105.46859233328', '叙永县', 442475, 'county'),
(444638, '510525', '27.983319448381', '105.93629331276', '古蔺县', 442475, 'county'),
(444639, '510603', '31.179805144786', '104.41525849556', '旌阳区', 442476, 'county'),
(444640, '510623', '30.887114236708', '104.80495180574', '中江县', 442476, 'county'),
(444641, '510626', '31.320265186662', '104.53541026815', '罗江县', 442476, 'county'),
(444642, '510681', '31.006480881164', '104.29847583599', '广汉市', 442476, 'county'),
(444643, '510682', '31.29369418585', '104.01987074915', '什邡市', 442476, 'county'),
(444644, '510683', '31.436657312108', '104.12929386201', '绵竹市', 442476, 'county'),
(444645, '510703', '31.435734812547', '104.67051389601', '涪城区', 442477, 'county'),
(444646, '510704', '31.518816009605', '104.98157984665', '游仙区', 442477, 'county'),
(444647, '510705', '31.589559671673', '104.37720699346', '安州区', 442477, 'county'),
(444648, '510722', '31.118872490873', '105.04258112078', '三台县', 442477, 'county'),
(444649, '510723', '31.247942979309', '105.4790711008', '盐亭县', 442477, 'county'),
(444650, '510725', '31.653620996937', '105.19383418448', '梓潼县', 442477, 'county'),
(444651, '510726', '31.962527312739', '104.25834135739', '北川羌族自治县', 442477, 'county'),
(444652, '510727', '32.446911722865', '104.40430826693', '平武县', 442477, 'county'),
(444653, '510781', '31.952426668806', '104.93314929993', '江油市', 442477, 'county'),
(444654, '510802', '32.478529639449', '105.7853172322', '利州区', 442478, 'county'),
(444655, '510811', '32.141760307902', '105.82174977463', '昭化区', 442478, 'county'),
(444656, '510812', '32.708417209014', '106.02216392398', '朝天区', 442478, 'county'),
(444657, '510821', '32.372139642174', '106.40182287359', '旺苍县', 442478, 'county'),
(444658, '510822', '32.515859827572', '105.19044673467', '青川县', 442478, 'county'),
(444659, '510823', '31.921947731961', '105.50302096949', '剑阁县', 442478, 'county'),
(444660, '510824', '31.918551658673', '106.11328295036', '苍溪县', 442478, 'county'),
(444661, '510903', '30.523499649283', '105.62152802077', '船山区', 442479, 'county'),
(444662, '510904', '30.363522338679', '105.41441146849', '安居区', 442479, 'county'),
(444663, '510921', '30.657491289748', '105.71608763636', '蓬溪县', 442479, 'county'),
(444664, '510922', '30.908078631387', '105.38824463742', '射洪县', 442479, 'county'),
(444665, '510923', '30.580190633917', '105.25637201729', '大英县', 442479, 'county'),
(444666, '511002', '29.55164493068', '104.95397876928', '市中区', 442480, 'county'),
(444667, '511011', '29.628088552472', '105.20216881381', '东兴区', 442480, 'county'),
(444668, '511024', '29.599588801619', '104.59397578195', '威远县', 442480, 'county'),
(444669, '511025', '29.813836235002', '104.80746566888', '资中县', 442480, 'county'),
(444670, '511028', '29.367868749158', '105.25295771714', '隆昌县', 442480, 'county'),
(444671, '511102', '29.61984411709', '103.80478219007', '市中区', 442481, 'county'),
(444672, '511111', '29.316409760812', '103.60454818519', '沙湾区', 442481, 'county'),
(444673, '511112', '29.395443506532', '103.84663334546', '五通桥区', 442481, 'county'),
(444674, '511113', '29.293819974164', '103.07336628607', '金口河区', 442481, 'county');
INSERT INTO `region` (`id`, `code`, `lat`, `lng`, `name`, `parent_id`, `by_type`) VALUES
(444675, '511123', '29.231190495122', '103.98019853458', '犍为县', 442481, 'county'),
(444676, '511124', '29.644500661501', '104.05532967168', '井研县', 442481, 'county'),
(444677, '511126', '29.7761069203', '103.55926293457', '夹江县', 442481, 'county'),
(444678, '511129', '29.006905081763', '103.82650268685', '沐川县', 442481, 'county'),
(444679, '511132', '29.050415556838', '103.2167397181', '峨边彝族自治县', 442481, 'county'),
(444680, '511133', '28.776739333365', '103.48138754926', '马边彝族自治县', 442481, 'county'),
(444681, '511181', '29.50700404085', '103.40091230856', '峨眉山市', 442481, 'county'),
(444682, '511302', '30.949624560849', '106.11579825983', '顺庆区', 442482, 'county'),
(444683, '511303', '30.75468404314', '106.25975917374', '高坪区', 442482, 'county'),
(444684, '511304', '30.665451829003', '105.93870307769', '嘉陵区', 442482, 'county'),
(444685, '511321', '31.349802866479', '105.92351381942', '南部县', 442482, 'county'),
(444686, '511322', '31.162322799073', '106.7185269662', '营山县', 442482, 'county'),
(444687, '511323', '31.007075500318', '106.42891733521', '蓬安县', 442482, 'county'),
(444688, '511324', '31.443593221681', '106.53472488695', '仪陇县', 442482, 'county'),
(444689, '511325', '31.063877074354', '105.85733163521', '西充县', 442482, 'county'),
(444690, '511381', '31.602117348886', '106.07809314825', '阆中市', 442482, 'county'),
(444691, '511402', '30.057372008382', '103.74833257305', '东坡区', 442483, 'county'),
(444692, '511403', '30.24443648473', '103.84644479804', '彭山区', 442483, 'county'),
(444693, '511421', '29.985868914405', '104.22551880085', '仁寿县', 442483, 'county'),
(444694, '511423', '29.694316499556', '103.18015949893', '洪雅县', 442483, 'county'),
(444695, '511424', '30.014802935586', '103.43451305805', '丹棱县', 442483, 'county'),
(444696, '511425', '29.82275999862', '103.83750799161', '青神县', 442483, 'county'),
(444697, '511502', '28.81581998264', '104.69325460374', '翠屏区', 442484, 'county'),
(444698, '511503', '28.891857434171', '104.92244522579', '南溪区', 442484, 'county'),
(444699, '511521', '28.906871431718', '104.38270989151', '宜宾县', 442484, 'county'),
(444700, '511523', '28.663532600917', '105.12877827717', '江安县', 442484, 'county'),
(444701, '511524', '28.515433786755', '104.93114856989', '长宁县', 442484, 'county'),
(444702, '511525', '28.463200492005', '104.5930664103', '高县', 442484, 'county'),
(444703, '511526', '28.196990137689', '104.8066179908', '珙县', 442484, 'county'),
(444704, '511527', '28.042098884244', '104.58843340511', '筠连县', 442484, 'county'),
(444705, '511528', '28.255538437302', '105.14122589128', '兴文县', 442484, 'county'),
(444706, '511529', '28.702428662485', '103.99911803649', '屏山县', 442484, 'county'),
(444707, '511602', '30.599249987199', '106.75891196362', '广安区', 442485, 'county'),
(444708, '511603', '30.543834838815', '106.86565774045', '前锋区', 442485, 'county'),
(444709, '511621', '30.540768629653', '106.4208329851', '岳池县', 442485, 'county'),
(444710, '511622', '30.373904543993', '106.23136624407', '武胜县', 442485, 'county'),
(444711, '511623', '30.263283994028', '107.00333361946', '邻水县', 442485, 'county'),
(444712, '511681', '30.321832376319', '106.75941195402', '华蓥市', 442485, 'county'),
(444713, '511702', '31.238764440346', '107.51920394973', '通川区', 442486, 'county'),
(444714, '511703', '31.187291385014', '107.42129730953', '达川区', 442486, 'county'),
(444715, '511722', '31.51979762495', '107.93603281988', '宣汉县', 442486, 'county'),
(444716, '511723', '31.05158729925', '107.89101188441', '开江县', 442486, 'county'),
(444717, '511724', '30.690772377766', '107.27987739412', '大竹县', 442486, 'county'),
(444718, '511725', '30.94881416065', '106.98760176612', '渠县', 442486, 'county'),
(444719, '511781', '31.986241088206', '107.99381097493', '万源市', 442486, 'county'),
(444720, '511802', '29.928506655301', '103.03840450831', '雨城区', 442487, 'county'),
(444721, '511803', '30.117458953474', '103.23102630214', '名山区', 442487, 'county'),
(444722, '511822', '29.740877769322', '102.69194616494', '荥经县', 442487, 'county'),
(444723, '511823', '29.431575643201', '102.62513643454', '汉源县', 442487, 'county'),
(444724, '511824', '29.235484876512', '102.2939695159', '石棉县', 442487, 'county'),
(444725, '511825', '30.078874542047', '102.57830462584', '天全县', 442487, 'county'),
(444726, '511826', '30.440281571631', '103.01809878481', '芦山县', 442487, 'county'),
(444727, '511827', '30.567649711279', '102.71689365787', '宝兴县', 442487, 'county'),
(444728, '511902', '31.785302790667', '106.739266453', '巴州区', 442488, 'county'),
(444729, '511903', '31.86918915916', '106.75791584175', '恩阳区', 442488, 'county'),
(444730, '511921', '32.13640689395', '107.35277526385', '通江县', 442488, 'county'),
(444731, '511922', '32.337239209081', '106.83618103409', '南江县', 442488, 'county'),
(444732, '511923', '31.59771477028', '107.16735749976', '平昌县', 442488, 'county'),
(444733, '512002', '30.091647255037', '104.75541652784', '雁江区', 442489, 'county'),
(444734, '512021', '29.999677270422', '105.4008757725', '安岳县', 442489, 'county'),
(444735, '512022', '30.313944636249', '105.02831576248', '乐至县', 442489, 'county'),
(444736, '513201', '32.007871202647', '101.9836278113', '马尔康市', 442490, 'county'),
(444737, '513221', '31.168774069592', '103.29431691527', '汶川县', 442490, 'county'),
(444738, '513222', '31.566906370691', '103.42033582964', '理县', 442490, 'county'),
(444739, '513223', '30.367480937958', '102.8991597236', '茂县', 442490, 'county'),
(444740, '513224', '32.625458557695', '103.532712222', '松潘县', 442490, 'county'),
(444741, '513225', '33.317446497617', '103.9340437688', '九寨沟县', 442490, 'county'),
(444742, '513226', '31.52757038818', '101.80476934386', '金川县', 442490, 'county'),
(444743, '513227', '30.969288643982', '102.41921664895', '小金县', 442490, 'county'),
(444744, '513228', '32.052158211237', '103.01249848065', '黑水县', 442490, 'county'),
(444745, '513230', '32.148226253207', '101.05971696123', '壤塘县', 442490, 'county'),
(444746, '513231', '32.916574446999', '101.70212990273', '阿坝县', 442490, 'county'),
(444747, '513232', '33.584805758741', '102.97487609843', '若尔盖县', 442490, 'county'),
(444748, '513233', '32.736132092126', '102.64115041582', '红原县', 442490, 'county'),
(444749, '513301', '29.963390007018', '101.75312764174', '康定市', 442491, 'county'),
(444750, '513322', '29.747744290103', '102.12006613226', '泸定县', 442491, 'county'),
(444751, '513323', '30.9670743425', '101.75239771652', '丹巴县', 442491, 'county'),
(444752, '513324', '28.917804185231', '101.63507969271', '九龙县', 442491, 'county'),
(444753, '513325', '29.922924021131', '100.96923972469', '雅江县', 442491, 'county'),
(444754, '513326', '30.870125609599', '101.19484158408', '道孚县', 442491, 'county'),
(444755, '513327', '31.492154542768', '100.67587127372', '炉霍县', 442491, 'county'),
(444756, '513328', '32.029329338001', '99.762676935333', '甘孜县', 442491, 'county'),
(444757, '513329', '30.945762801068', '100.28751803177', '新龙县', 442491, 'county'),
(444758, '513330', '32.059408545008', '98.967480948584', '德格县', 442491, 'county'),
(444759, '513331', '31.052585679081', '99.291922023716', '白玉县', 442491, 'county'),
(444760, '513332', '33.187627237402', '98.204993247891', '石渠县', 442491, 'county'),
(444761, '513333', '32.356620371592', '100.21388463777', '色达县', 442491, 'county'),
(444762, '513334', '29.895282575765', '100.18511019101', '理塘县', 442491, 'county'),
(444763, '513335', '29.916287662541', '99.300290950528', '巴塘县', 442491, 'county'),
(444764, '513336', '29.11737591967', '99.738451912881', '乡城县', 442491, 'county'),
(444765, '513337', '28.766496640591', '100.26589077053', '稻城县', 442491, 'county'),
(444766, '513338', '28.736358436486', '99.324235091425', '得荣县', 442491, 'county'),
(444767, '513401', '27.86337739584', '102.11788786038', '西昌市', 442492, 'county'),
(444768, '513422', '28.360344107012', '100.95305714268', '木里藏族自治县', 442492, 'county'),
(444769, '513423', '27.603027908142', '101.46762448738', '盐源县', 442492, 'county'),
(444770, '513424', '27.331194175431', '102.19173440069', '德昌县', 442492, 'county'),
(444771, '513425', '26.591300796186', '102.2639270515', '会理县', 442492, 'county'),
(444772, '513426', '26.573608339176', '102.74296743101', '会东县', 442492, 'county'),
(444773, '513427', '27.091250349517', '102.71663446894', '宁南县', 442492, 'county'),
(444774, '513428', '27.54828572105', '102.56809148368', '普格县', 442492, 'county'),
(444775, '513429', '27.599974195145', '102.88192797888', '布拖县', 442492, 'county'),
(444776, '513430', '27.706169003934', '103.20105938361', '金阳县', 442492, 'county'),
(444777, '513431', '28.013719135153', '102.83281789781', '昭觉县', 442492, 'county'),
(444778, '513432', '28.196488558773', '102.44996824625', '喜德县', 442492, 'county'),
(444779, '513433', '28.514858657537', '102.06891407501', '冕宁县', 442492, 'county'),
(444780, '513434', '28.592190495109', '102.6286813356', '越西县', 442492, 'county'),
(444781, '513435', '28.974853435967', '102.76740070722', '甘洛县', 442492, 'county'),
(444782, '513436', '28.443545061087', '103.10172987962', '美姑县', 442492, 'county'),
(444783, '513437', '28.279340727749', '103.5125046952', '雷波县', 442492, 'county'),
(444784, '520102', '26.541413272278', '106.72417349818', '南明区', 442493, 'county'),
(444785, '520103', '26.6035246503', '106.71791401556', '云岩区', 442493, 'county'),
(444786, '520111', '26.39791693477', '106.66527322287', '花溪区', 442493, 'county'),
(444787, '520112', '26.688326312941', '106.73344967037', '乌当区', 442493, 'county'),
(444788, '520113', '26.71973739529', '106.68674281438', '白云区', 442493, 'county'),
(444789, '520115', '26.650328732081', '106.59533224014', '观山湖区', 442493, 'county'),
(444790, '520121', '27.075427307857', '107.04688065585', '开阳县', 442493, 'county'),
(444791, '520122', '27.150807565921', '106.68198036543', '息烽县', 442493, 'county'),
(444792, '520123', '26.931538038107', '106.590592735', '修文县', 442493, 'county'),
(444793, '520181', '26.688621110571', '106.35381440326', '清镇市', 442493, 'county'),
(444794, '520201', '26.731157002932', '104.76254690076', '钟山区', 442494, 'county'),
(444795, '520203', '26.235865065306', '105.3830336754', '六枝特区', 442494, 'county'),
(444796, '520221', '26.430546898236', '104.93035685319', '水城县', 442494, 'county'),
(444797, '520222', '25.772838336514', '104.66691307994', '盘县', 442494, 'county'),
(444798, '520302', '27.670445028837', '106.92265113614', '红花岗区', 442495, 'county'),
(444799, '520303', '27.887590184121', '107.00310975556', '汇川区', 442495, 'county'),
(444800, '520304', '27.634108765721', '106.87453374646', '播州区', 442495, 'county'),
(444801, '520322', '28.414479762728', '106.88633093203', '桐梓县', 442495, 'county'),
(444802, '520323', '28.146365347962', '107.20354220552', '绥阳县', 442495, 'county'),
(444803, '520324', '28.506639188144', '107.412773457', '正安县', 442495, 'county'),
(444804, '520325', '28.934154342524', '107.61686480802', '道真仡佬族苗族自治县', 442495, 'county'),
(444805, '520326', '28.661403914202', '107.91993460165', '务川仡佬族苗族自治县', 442495, 'county'),
(444806, '520327', '27.928826877455', '107.77157370195', '凤冈县', 442495, 'county'),
(444807, '520328', '27.764873370783', '107.49167985383', '湄潭县', 442495, 'county'),
(444808, '520329', '27.394794444136', '107.70936003115', '余庆县', 442495, 'county'),
(444809, '520330', '28.357319781328', '106.35892584857', '习水县', 442495, 'county'),
(444810, '520381', '28.493333651299', '105.92051307621', '赤水市', 442495, 'county'),
(444811, '520382', '27.839203217967', '106.34790800681', '仁怀市', 442495, 'county'),
(444812, '520402', '26.197376772867', '106.0600169739', '西秀区', 442496, 'county'),
(444813, '520403', '26.443751196397', '106.28653433135', '平坝区', 442496, 'county'),
(444814, '520422', '26.345747551067', '105.74269311886', '普定县', 442496, 'county'),
(444815, '520423', '25.844353005861', '105.83355264869', '镇宁布依族苗族自治县', 442496, 'county'),
(444816, '520424', '25.862190437976', '105.56872665252', '关岭布依族苗族自治县', 442496, 'county'),
(444817, '520425', '25.700614716072', '106.18836244554', '紫云苗族布依族自治县', 442496, 'county'),
(444818, '520502', '27.464053316005', '105.42355760084', '七星关区', 442497, 'county'),
(444819, '520521', '27.253059626031', '105.73720221998', '大方县', 442497, 'county'),
(444820, '520522', '27.086384569459', '106.14050275681', '黔西县', 442497, 'county'),
(444821, '520523', '27.471542677862', '106.22685215924', '金沙县', 442497, 'county'),
(444822, '520524', '26.615333373403', '105.73204873021', '织金县', 442497, 'county'),
(444823, '520525', '26.795102083008', '105.26868668571', '纳雍县', 442497, 'county'),
(444824, '520526', '26.921382002531', '104.22408619137', '威宁彝族回族苗族自治县', 442497, 'county'),
(444825, '520527', '27.15332246261', '104.5980318783', '赫章县', 442497, 'county'),
(444826, '520602', '27.716136520691', '109.19370501854', '碧江区', 442498, 'county'),
(444827, '520603', '27.546566730898', '109.11781910744', '万山区', 442498, 'county'),
(444828, '520621', '27.674902690624', '109.16855802826', '江口县', 442498, 'county'),
(444829, '520622', '27.337802674507', '109.00175995258', '玉屏侗族自治县', 442498, 'county'),
(444830, '520623', '27.496152657798', '108.14106368738', '石阡县', 442498, 'county'),
(444831, '520624', '27.856658927235', '108.19797894198', '思南县', 442498, 'county'),
(444832, '520625', '27.986045252865', '108.52830153805', '印江土家族苗族自治县', 442498, 'county'),
(444833, '520626', '28.30284362728', '108.06756938624', '德江县', 442498, 'county'),
(444834, '520627', '28.642296722444', '108.33962765519', '沿河土家族自治县', 442498, 'county'),
(444835, '520628', '27.674902690624', '109.16855802826', '松桃苗族自治县', 442498, 'county'),
(444836, '522301', '25.236664590554', '105.07190822677', '兴义市', 442499, 'county'),
(444837, '522322', '25.436104684385', '105.21234670506', '兴仁县', 442499, 'county'),
(444838, '522323', '25.72781408682', '105.00016731249', '普安县', 442499, 'county'),
(444839, '522324', '25.697662011039', '105.19013699964', '晴隆县', 442499, 'county'),
(444840, '522325', '25.438979713387', '105.63574297484', '贞丰县', 442499, 'county'),
(444841, '522326', '24.936694569809', '106.13757227494', '望谟县', 442499, 'county'),
(444842, '522327', '24.940047609962', '105.79746392761', '册亨县', 442499, 'county'),
(444843, '522328', '24.950885976914', '105.34855137966', '安龙县', 442499, 'county'),
(444844, '522601', '26.670643028177', '108.03104164859', '凯里市', 442500, 'county'),
(444845, '522622', '26.802372712542', '108.08892037089', '黄平县', 442500, 'county'),
(444846, '522623', '27.147665744201', '108.01532489539', '施秉县', 442500, 'county'),
(444847, '522624', '26.940229768581', '108.76221698279', '三穗县', 442500, 'county'),
(444848, '522625', '26.912627316255', '108.48422420195', '镇远县', 442500, 'county'),
(444849, '522626', '27.440109779329', '108.95781984971', '岑巩县', 442500, 'county'),
(444850, '522627', '27.027180472033', '109.47993207974', '天柱县', 442500, 'county'),
(444851, '522628', '26.497609137737', '109.15647562165', '锦屏县', 442500, 'county'),
(444852, '522629', '26.902825927797', '106.7349961033', '剑河县', 442500, 'county'),
(444853, '522630', '26.676404735086', '108.17122222338', '台江县', 442500, 'county'),
(444854, '522631', '25.938276335425', '109.33697304601', '黎平县', 442500, 'county'),
(444855, '522632', '26.250544367069', '108.43782402746', '榕江县', 442500, 'county'),
(444856, '522633', '25.758440923722', '108.78396090306', '从江县', 442500, 'county'),
(444857, '522634', '26.346498520621', '108.09819178205', '雷山县', 442500, 'county'),
(444858, '522635', '26.512050397344', '107.79954768993', '麻江县', 442500, 'county'),
(444859, '522636', '26.126097716769', '108.11538894273', '丹寨县', 442500, 'county'),
(444860, '522701', '26.902825927797', '106.7349961033', '都匀市', 442501, 'county'),
(444861, '522702', '26.902825927797', '106.7349961033', '福泉市', 442501, 'county'),
(444862, '522722', '25.597752027123', '107.79056706026', '荔波县', 442501, 'county'),
(444863, '522723', '26.262176502508', '107.16183225437', '贵定县', 442501, 'county'),
(444864, '522725', '27.189412906689', '107.5629905221', '瓮安县', 442501, 'county'),
(444865, '522726', '25.636840589583', '107.56375230978', '独山县', 442501, 'county'),
(444866, '522727', '25.850446129607', '107.37217138777', '平塘县', 442501, 'county'),
(444867, '522728', '26.902825927797', '106.7349961033', '罗甸县', 442501, 'county'),
(444868, '522729', '26.000476134172', '106.40419817264', '长顺县', 442501, 'county'),
(444869, '522730', '26.51764181381', '107.00653768938', '龙里县', 442501, 'county'),
(444870, '522731', '25.98299665897', '106.72222309186', '惠水县', 442501, 'county'),
(444871, '522732', '25.852864250197', '107.95650555321', '三都水族自治县', 442501, 'county'),
(444872, '530102', '25.261305956605', '102.64937733166', '五华区', 442502, 'county'),
(444873, '530103', '25.274019484219', '102.76755633841', '盘龙区', 442502, 'county'),
(444874, '530111', '25.031310976713', '102.82881924705', '官渡区', 442502, 'county'),
(444875, '530112', '24.983630124462', '102.60347769299', '西山区', 442502, 'county'),
(444876, '530113', '26.139328854726', '103.07856150869', '东川区', 442502, 'county'),
(444877, '530114', '24.855409037478', '102.88428310764', '呈贡区', 442502, 'county'),
(444878, '530122', '24.605041073447', '102.5796139323', '晋宁县', 442502, 'county'),
(444879, '530124', '25.363439290284', '102.58410264122', '富民县', 442502, 'county'),
(444880, '530125', '24.944907933143', '103.1928154872', '宜良县', 442502, 'county'),
(444881, '530126', '24.754309493364', '103.42733563256', '石林彝族自治县', 442502, 'county'),
(444882, '530127', '25.317900180495', '103.00652503386', '嵩明县', 442502, 'county'),
(444883, '530128', '25.943771040548', '102.59302748518', '禄劝彝族苗族自治县', 442502, 'county'),
(444884, '530129', '25.666609835146', '103.12781347645', '寻甸回族彝族自治县', 442502, 'county'),
(444885, '530181', '24.852355456268', '102.39112679952', '安宁市', 442502, 'county'),
(444886, '530302', '25.360057471573', '103.91332638626', '麒麟区', 442503, 'county'),
(444887, '530303', '25.79421035848', '103.86810959342', '沾益区', 442503, 'county'),
(444888, '530321', '25.368839999918', '103.51309543424', '马龙县', 442503, 'county'),
(444889, '530322', '25.037570538056', '103.70738599876', '陆良县', 442503, 'county'),
(444890, '530323', '24.680198025566', '104.12947917517', '师宗县', 442503, 'county'),
(444891, '530324', '24.983157127291', '104.34927875646', '罗平县', 442503, 'county'),
(444892, '530325', '25.467214378875', '104.36745192446', '富源县', 442503, 'county'),
(444893, '530326', '26.46221827304', '103.46854362948', '会泽县', 442503, 'county'),
(444894, '530381', '26.276828622628', '104.15257073219', '宣威市', 442503, 'county'),
(444895, '530402', '24.369853985289', '102.49989459797', '红塔区', 442504, 'county'),
(444896, '530403', '24.367487731796', '102.75575323372', '江川区', 442504, 'county'),
(444897, '530422', '24.678380080254', '102.94685033975', '澄江县', 442504, 'county'),
(444898, '530423', '24.117558495247', '102.71141640598', '通海县', 442504, 'county'),
(444899, '530424', '24.284812305871', '102.99906774243', '华宁县', 442504, 'county'),
(444900, '530425', '24.6964042729', '102.12219715311', '易门县', 442504, 'county'),
(444901, '530426', '24.246114547538', '102.21924987866', '峨山彝族自治县', 442504, 'county'),
(444902, '530427', '24.029740767019', '101.73913066729', '新平彝族傣族自治县', 442504, 'county'),
(444903, '530428', '23.605002999101', '102.01115013144', '元江哈尼族彝族傣族自治县', 442504, 'county'),
(444904, '530502', '25.205265354944', '99.069046057861', '隆阳区', 442505, 'county'),
(444905, '530521', '24.657220496518', '99.157489563481', '施甸县', 442505, 'county'),
(444906, '530523', '24.499046233076', '98.842541709908', '龙陵县', 442505, 'county'),
(444907, '530524', '24.758162812306', '99.591112178323', '昌宁县', 442505, 'county'),
(444908, '530581', '25.248177969272', '98.43366397623', '腾冲市', 442505, 'county'),
(444909, '530602', '27.427583042152', '103.60727718737', '昭阳区', 442506, 'county'),
(444910, '530621', '27.205702890521', '103.42585557677', '鲁甸县', 442506, 'county'),
(444911, '530622', '27.008327725094', '103.13002031079', '巧家县', 442506, 'county'),
(444912, '530623', '28.130706512198', '104.23053478313', '盐津县', 442506, 'county'),
(444913, '530624', '27.905095827254', '103.91217766939', '大关县', 442506, 'county'),
(444914, '530625', '27.953163331681', '103.65282254144', '永善县', 442506, 'county'),
(444915, '530626', '28.538865566801', '104.01558782767', '绥江县', 442506, 'county'),
(444916, '530627', '27.568915967438', '104.83385203039', '镇雄县', 442506, 'county'),
(444917, '530628', '27.630986376229', '104.24144905945', '彝良县', 442506, 'county'),
(444918, '530629', '27.891462851573', '105.05028255746', '威信县', 442506, 'county'),
(444919, '530630', '28.510929836359', '104.22883253661', '水富县', 442506, 'county'),
(444920, '530702', '26.859300417703', '100.32859641682', '古城区', 442507, 'county'),
(444921, '530721', '27.104463367195', '99.951633936724', '玉龙纳西族自治县', 442507, 'county'),
(444922, '530722', '26.491706080711', '100.70492052637', '永胜县', 442507, 'county'),
(444923, '530723', '26.645807144841', '101.25172921237', '华坪县', 442507, 'county'),
(444924, '530724', '27.265588579997', '100.7783019296', '宁蒗彝族自治县', 442507, 'county'),
(444925, '530802', '22.739133092283', '100.85525310555', '思茅区', 442508, 'county'),
(444926, '530821', '23.097350457989', '101.19686023959', '宁洱哈尼族彝族自治县', 442508, 'county'),
(444927, '530822', '23.363251135433', '101.55548645512', '墨江哈尼族自治县', 442508, 'county'),
(444928, '530823', '24.39672894394', '100.79520569746', '景东彝族自治县', 442508, 'county'),
(444929, '530824', '23.368117190796', '100.56429126294', '景谷傣族彝族自治县', 442508, 'county'),
(444930, '530825', '24.011540716931', '101.11331766944', '镇沅彝族哈尼族拉祜族自治县', 442508, 'county'),
(444931, '530826', '22.625657650356', '101.79692922563', '江城哈尼族彝族自治县', 442508, 'county'),
(444932, '530827', '22.334366217371', '99.580342878181', '孟连傣族拉祜族佤族自治县', 442508, 'county'),
(444933, '530828', '22.665993561569', '99.98453733381', '澜沧拉祜族自治县', 442508, 'county'),
(444934, '530829', '22.708423462771', '99.522119995137', '西盟佤族自治县', 442508, 'county'),
(444935, '530902', '23.849570452879', '100.13990768016', '临翔区', 442509, 'county'),
(444936, '530921', '24.610505511987', '99.92091022745', '凤庆县', 442509, 'county'),
(444937, '530922', '24.32740647676', '100.23368014335', '云县', 442509, 'county'),
(444938, '530923', '24.089579787148', '99.427631734164', '永德县', 442509, 'county'),
(444939, '530924', '23.901062771813', '99.005735747996', '镇康县', 442509, 'county'),
(444940, '530925', '23.476856812064', '99.840913908222', '双江拉祜族佤族布朗族傣族自治县', 442509, 'county'),
(444941, '530926', '23.641730399889', '99.434265495794', '耿马傣族佤族自治县', 442509, 'county'),
(444942, '530927', '23.274581274109', '99.270497931724', '沧源佤族自治县', 442509, 'county'),
(444943, '532301', '24.880252472651', '101.32863799918', '楚雄市', 442510, 'county'),
(444944, '532322', '24.535545259465', '101.64032208579', '双柏县', 442510, 'county'),
(444945, '532323', '25.407356738979', '101.59675770511', '牟定县', 442510, 'county'),
(444946, '532324', '25.103522672439', '101.0380121979', '南华县', 442510, 'county'),
(444947, '532325', '25.516954435787', '101.2112377333', '姚安县', 442510, 'county'),
(444948, '532326', '25.947669905565', '101.24291307892', '大姚县', 442510, 'county'),
(444949, '532327', '26.143679315458', '101.56019002604', '永仁县', 442510, 'county'),
(444950, '532328', '25.783195511954', '101.87051082301', '元谋县', 442510, 'county'),
(444951, '532329', '25.731109547237', '102.20117587964', '武定县', 442510, 'county'),
(444952, '532331', '25.185818987516', '102.02612983069', '禄丰县', 442510, 'county'),
(444953, '532501', '24.864212795483', '101.59295163701', '个旧市', 442511, 'county'),
(444954, '532502', '24.864212795483', '101.59295163701', '开远市', 442511, 'county'),
(444955, '532503', '23.338656934664', '103.51669152583', '蒙自市', 442511, 'county'),
(444956, '532504', '24.251508766722', '103.445318018', '弥勒市', 442511, 'county'),
(444957, '532523', '23.21267768326', '103.89743584577', '屏边苗族自治县', 442511, 'county'),
(444958, '532524', '23.987913437671', '102.79065788154', '建水县', 442511, 'county'),
(444959, '532525', '23.789535774797', '102.40773898854', '石屏县', 442511, 'county'),
(444960, '532527', '24.539744740964', '103.75100845447', '泸西县', 442511, 'county'),
(444961, '532528', '23.141055739179', '102.73114873474', '元阳县', 442511, 'county'),
(444962, '532529', '23.211095049214', '102.51563446331', '红河县', 442511, 'county'),
(444963, '532530', '22.996373389905', '103.25176348949', '金平苗族瑶族傣族自治县', 442511, 'county'),
(444964, '532531', '23.091544011399', '102.35379214946', '绿春县', 442511, 'county'),
(444965, '532532', '22.862620371198', '103.67125958623', '河口瑶族自治县', 442511, 'county'),
(444966, '532601', '23.416009535072', '104.03093981246', '文山市', 442512, 'county'),
(444967, '532622', '23.89947126948', '104.5218246496', '砚山县', 442512, 'county'),
(444968, '532623', '23.49211237168', '104.8239553349', '西畴县', 442512, 'county'),
(444969, '532624', '23.433721461415', '105.06044414168', '麻栗坡县', 442512, 'county'),
(444970, '532625', '24.864212795483', '101.59295163701', '马关县', 442512, 'county'),
(444971, '532626', '24.08610830304', '104.34003905514', '丘北县', 442512, 'county'),
(444972, '532627', '24.222835784674', '104.83870730798', '广南县', 442512, 'county'),
(444973, '532628', '23.396160831269', '105.60430973793', '富宁县', 442512, 'county'),
(444974, '532801', '24.864212795483', '101.59295163701', '景洪市', 442513, 'county'),
(444975, '532822', '21.960731038528', '100.33738150932', '勐海县', 442513, 'county'),
(444976, '532823', '21.736659717735', '101.46195902318', '勐腊县', 442513, 'county'),
(444977, '532901', '25.57616489493', '100.15242712507', '大理市', 442514, 'county'),
(444978, '532922', '25.605571782134', '99.898375043674', '漾濞彝族自治县', 442514, 'county'),
(444979, '532923', '25.501610700196', '100.57035927192', '祥云县', 442514, 'county'),
(444980, '532924', '25.875307433534', '100.62753770311', '宾川县', 442514, 'county'),
(444981, '532925', '25.1911077724', '100.58186613328', '弥渡县', 442514, 'county'),
(444982, '532926', '24.903013805535', '100.42490043802', '南涧彝族自治县', 442514, 'county'),
(444983, '532927', '25.343492434694', '100.26759078972', '巍山彝族回族自治县', 442514, 'county'),
(444984, '532928', '25.374646522171', '99.600792211043', '永平县', 442514, 'county'),
(444985, '532929', '25.894118475707', '99.310077976062', '云龙县', 442514, 'county'),
(444986, '532930', '26.294924841349', '100.03831537618', '洱源县', 442514, 'county'),
(444987, '532931', '26.439596125001', '99.750307802477', '剑川县', 442514, 'county'),
(444988, '532932', '26.3354536106', '100.27717450154', '鹤庆县', 442514, 'county'),
(444989, '533102', '24.864212795483', '101.59295163701', '瑞丽市', 442515, 'county'),
(444990, '533103', '24.441239663008', '98.589434287407', '芒市', 442515, 'county'),
(444991, '533122', '24.743716502863', '98.322123152856', '梁河县', 442515, 'county'),
(444992, '533123', '24.706749398739', '97.950762066645', '盈江县', 442515, 'county'),
(444993, '533124', '24.381370607265', '97.965384779773', '陇川县', 442515, 'county'),
(444994, '533301', '26.042265332796', '98.86274058298', '泸水市', 442516, 'county'),
(444995, '533323', '26.996507466856', '98.86865857308', '福贡县', 442516, 'county'),
(444996, '533324', '24.864212795483', '101.59295163701', '贡山独龙族怒族自治县', 442516, 'county'),
(444997, '533325', '26.443506114149', '99.117417482927', '兰坪白族普米族自治县', 442516, 'county'),
(444998, '533401', '27.866680825387', '99.85507644287', '香格里拉市', 442517, 'county'),
(444999, '533422', '28.351417174855', '99.037553971725', '德钦县', 442517, 'county'),
(445000, '533423', '27.45295793965', '99.152722827441', '维西傈僳族自治县', 442517, 'county'),
(445001, '540102', '29.666400338845', '91.168729990815', '城关区', 442518, 'county'),
(445002, '540103', '29.796237760398', '90.8294509947', '堆龙德庆区', 442518, 'county'),
(445003, '540121', '30.116477915324', '91.347042959548', '林周县', 442518, 'county'),
(445004, '540122', '30.424299479353', '90.894814857309', '当雄县', 442518, 'county'),
(445005, '540123', '29.603193843519', '90.095471065982', '尼木县', 442518, 'county'),
(445006, '540124', '29.445004244787', '90.714553495792', '曲水县', 442518, 'county'),
(445007, '540126', '29.747665564603', '91.473900848722', '达孜县', 442518, 'county'),
(445008, '540127', '29.916717538581', '92.031891526243', '墨竹工卡县', 442518, 'county'),
(445009, '540202', '29.268160032655', '88.956062773518', '桑珠孜区', 442519, 'county'),
(445010, '540221', '29.268160032655', '88.956062773518', '南木林县', 442519, 'county'),
(445011, '540222', '29.268160032655', '88.956062773518', '江孜县', 442519, 'county'),
(445012, '540223', '29.268160032655', '88.956062773518', '定日县', 442519, 'county'),
(445013, '540224', '29.268160032655', '88.956062773518', '萨迦县', 442519, 'county'),
(445014, '540225', '29.268160032655', '88.956062773518', '拉孜县', 442519, 'county'),
(445015, '540226', '29.268160032655', '88.956062773518', '昂仁县', 442519, 'county'),
(445016, '540227', '29.268160032655', '88.956062773518', '谢通门县', 442519, 'county'),
(445017, '540228', '28.795794414747', '89.113585077496', '白朗县', 442519, 'county'),
(445018, '540229', '29.247386928273', '90.003352252057', '仁布县', 442519, 'county'),
(445019, '540230', '29.268160032655', '88.956062773518', '康马县', 442519, 'county'),
(445020, '540231', '29.268160032655', '88.956062773518', '定结县', 442519, 'county'),
(445021, '540232', '29.268160032655', '88.956062773518', '仲巴县', 442519, 'county'),
(445022, '540233', '29.268160032655', '88.956062773518', '亚东县', 442519, 'county'),
(445023, '540234', '29.268160032655', '88.956062773518', '吉隆县', 442519, 'county'),
(445024, '540235', '29.268160032655', '88.956062773518', '聂拉木县', 442519, 'county'),
(445025, '540236', '29.268160032655', '88.956062773518', '萨嘎县', 442519, 'county'),
(445026, '540237', '29.268160032655', '88.956062773518', '岗巴县', 442519, 'county'),
(445027, '540302', '31.529862428285', '97.334535331605', '卡若区', 442520, 'county'),
(445028, '540321', '31.780569180094', '98.118022293299', '江达县', 442520, 'county'),
(445029, '540322', '30.736504388643', '98.426429044036', '贡觉县', 442520, 'county'),
(445030, '540323', '31.449065979774', '96.391967073454', '类乌齐县', 442520, 'county'),
(445031, '540324', '31.685241377535', '95.522471824657', '丁青县', 442520, 'county'),
(445032, '540325', '30.618372794064', '97.836858866086', '察雅县', 442520, 'county'),
(445033, '540326', '30.074689806895', '96.879160712332', '八宿县', 442520, 'county'),
(445034, '540327', '29.444978973304', '97.887595370154', '左贡县', 442520, 'county'),
(445035, '540328', '29.51433481024', '98.554769564416', '芒康县', 442520, 'county'),
(445036, '540329', '30.698457783096', '95.916491128377', '洛隆县', 442520, 'county'),
(445037, '540330', '30.96906728495', '94.483413447372', '边坝县', 442520, 'county'),
(445038, '540402', '29.813114097649', '94.375930017941', '巴宜区', 442521, 'county'),
(445039, '540421', '30.032418475925', '93.262111473599', '工布江达县', 442521, 'county'),
(445040, '540422', '29.25246445514', '94.174542402829', '米林县', 442521, 'county'),
(445041, '540423', '28.754711260372', '94.931464872257', '墨脱县', 442521, 'county'),
(445042, '540424', '30.019416163945', '95.345896846749', '波密县', 442521, 'county'),
(445043, '540425', '28.653566547177', '97.229506149139', '察隅县', 442521, 'county'),
(445044, '540426', '29.087717194008', '93.126863813454', '朗县', 442521, 'county'),
(445045, '540502', '29.167743326287', '91.797519071958', '乃东区', 442522, 'county'),
(445046, '540521', '29.266820605393', '91.407298324182', '扎囊县', 442522, 'county'),
(445047, '540522', '29.240130838536', '90.860869080783', '贡嘎县', 442522, 'county'),
(445048, '540523', '29.42065032555', '92.231280965366', '桑日县', 442522, 'county'),
(445049, '540524', '29.013065914396', '91.584038524668', '琼结县', 442522, 'county'),
(445050, '540525', '28.954175694618', '92.237345606421', '曲松县', 442522, 'county'),
(445051, '540526', '28.585924343435', '91.551753322243', '措美县', 442522, 'county'),
(445052, '540527', '28.210518915815', '90.897039902791', '洛扎县', 442522, 'county'),
(445053, '540528', '29.275255680226', '92.727658842783', '加查县', 442522, 'county'),
(445054, '540529', '28.486722025563', '93.019223010095', '隆子县', 442522, 'county'),
(445055, '540530', '27.66585127009', '92.888732384978', '错那县', 442522, 'county'),
(445056, '540531', '28.732790957089', '90.702914725708', '浪卡子县', 442522, 'county'),
(445057, '542421', '31.252314725152', '92.034626453644', '那曲县', 442523, 'county'),
(445058, '542422', '30.668911708265', '92.961316438644', '嘉黎县', 442523, 'county'),
(445059, '542423', '31.44713553851', '93.493424136652', '比如县', 442523, 'county'),
(445060, '542424', '32.249649761022', '92.642153446415', '聂荣县', 442523, 'county'),
(445061, '542425', '33.321681895077', '90.569314254249', '安多县', 442523, 'county'),
(445062, '542426', '31.035234259381', '88.735362127732', '申扎县', 442523, 'county'),
(445063, '542427', '31.592787589013', '94.312549818243', '索县', 442523, 'county'),
(445064, '542428', '31.2181120282', '90.12340113956', '班戈县', 442523, 'county'),
(445065, '542429', '32.198838522007', '94.018948797784', '巴青县', 442523, 'county'),
(445066, '542430', '33.536965980784', '87.654846646508', '尼玛县', 442523, 'county'),
(445067, '542431', '34.102579150651', '88.221417061569', '双湖县', 442523, 'county'),
(445068, '542521', '30.637119738777', '81.530582849369', '普兰县', 442524, 'county'),
(445069, '542522', '31.553648618356', '79.552757074516', '札达县', 442524, 'county'),
(445070, '542523', '32.005501431945', '80.315974443536', '噶尔县', 442524, 'county'),
(445071, '542524', '33.984683055318', '80.719742169545', '日土县', 442524, 'county'),
(445072, '542525', '32.057883395434', '82.03379760961', '革吉县', 442524, 'county'),
(445073, '542526', '33.841204623772', '84.285002167349', '改则县', 442524, 'county'),
(445074, '542527', '30.749850801541', '85.210285811396', '措勤县', 442524, 'county'),
(445075, '610102', '34.271473780191', '108.99153865841', '新城区', 442525, 'county'),
(445076, '610103', '34.255484557671', '108.96625890407', '碑林区', 442525, 'county'),
(445077, '610104', '34.273192373169', '108.91554659362', '莲湖区', 442525, 'county'),
(445078, '610111', '34.303915149746', '109.10875495118', '灞桥区', 442525, 'county'),
(445079, '610112', '34.331331489423', '108.92646199371', '未央区', 442525, 'county'),
(445080, '610113', '34.221414918471', '108.93879042836', '雁塔区', 442525, 'county'),
(445081, '610114', '34.686373084486', '109.31341715315', '阎良区', 442525, 'county'),
(445082, '610115', '34.456277329548', '109.3104528348', '临潼区', 442525, 'county'),
(445083, '610116', '34.066898727937', '108.87425634018', '长安区', 442525, 'county'),
(445084, '610117', '34.513346424398', '109.07152291236', '高陵区', 442525, 'county'),
(445085, '610122', '34.100786931955', '109.42339003093', '蓝田县', 442525, 'county'),
(445086, '610124', '33.953602363476', '108.11354147874', '周至县', 442525, 'county'),
(445087, '610125', '34.00383365133', '108.59248134192', '户县', 442525, 'county'),
(445088, '610202', '35.070041017281', '109.06850448637', '王益区', 442526, 'county'),
(445089, '610203', '35.160933883455', '109.18538598068', '印台区', 442526, 'county'),
(445090, '610204', '35.032000358937', '108.8354996676', '耀州区', 442526, 'county'),
(445091, '610222', '35.383901876425', '109.20440179145', '宜君县', 442526, 'county'),
(445092, '610302', '34.311027035867', '107.10824439064', '渭滨区', 442527, 'county'),
(445093, '610303', '34.40317453128', '107.11761362728', '金台区', 442527, 'county'),
(445094, '610304', '34.482540082479', '106.92358089475', '陈仓区', 442527, 'county'),
(445095, '610322', '34.577025723794', '107.43678881989', '凤翔县', 442527, 'county'),
(445096, '610323', '34.410705264779', '107.68898501373', '岐山县', 442527, 'county'),
(445097, '610324', '34.41197448025', '107.92510162193', '扶风县', 442527, 'county'),
(445098, '610326', '34.150539928532', '107.83384402175', '眉县', 442527, 'county'),
(445099, '610327', '34.876941335239', '106.7730643229', '陇县', 442527, 'county'),
(445100, '610328', '34.766951491427', '107.17797400373', '千阳县', 442527, 'county'),
(445101, '610329', '34.785692691421', '107.71077450759', '麟游县', 442527, 'county'),
(445102, '610330', '33.993251781372', '106.76610395886', '凤县', 442527, 'county'),
(445103, '610331', '33.94297244023', '107.4168652793', '太白县', 442527, 'county'),
(445104, '610402', '34.354285427987', '108.68341537696', '秦都区', 442528, 'county'),
(445105, '610403', '34.290198720106', '108.05873803758', '杨陵区', 442528, 'county'),
(445106, '610404', '34.423852572977', '108.81731239458', '渭城区', 442528, 'county'),
(445107, '610422', '34.703211629709', '108.98069993821', '三原县', 442528, 'county'),
(445108, '610423', '34.608867001852', '108.78075311312', '泾阳县', 442528, 'county'),
(445109, '610424', '34.527672579796', '108.22948289516', '乾县', 442528, 'county'),
(445110, '610425', '34.597853791406', '108.48256879405', '礼泉县', 442528, 'county'),
(445111, '610426', '34.777655607134', '108.13671381859', '永寿县', 442528, 'county'),
(445112, '610427', '35.051834974906', '108.06798630717', '彬县', 442528, 'county'),
(445113, '610428', '35.170581688184', '107.83479969951', '长武县', 442528, 'county'),
(445114, '610429', '35.216832056498', '108.49412543869', '旬邑县', 442528, 'county'),
(445115, '610430', '34.869115751197', '108.57021884883', '淳化县', 442528, 'county'),
(445116, '610431', '34.316553316648', '108.19099325441', '武功县', 442528, 'county'),
(445117, '610481', '34.307609399651', '108.47576040598', '兴平市', 442528, 'county'),
(445118, '610502', '34.553520116268', '109.56474625615', '临渭区', 442529, 'county'),
(445119, '610503', '34.420454032973', '109.82852431434', '华州区', 442529, 'county'),
(445120, '610522', '34.507137056057', '110.29554551613', '潼关县', 442529, 'county'),
(445121, '610523', '34.796840374649', '110.01194954265', '大荔县', 442529, 'county'),
(445122, '610524', '35.208388187296', '110.19110357566', '合阳县', 442529, 'county'),
(445123, '610525', '35.222564490705', '109.90160517601', '澄城县', 442529, 'county'),
(445124, '610526', '34.967696650545', '109.62824611949', '蒲城县', 442529, 'county'),
(445125, '610527', '35.271645917395', '109.5701661435', '白水县', 442529, 'county'),
(445126, '610528', '34.879423511794', '109.23593971498', '富平县', 442529, 'county'),
(445127, '610581', '35.582782138309', '110.39377368099', '韩城市', 442529, 'county'),
(445128, '610582', '34.532717876993', '110.05818818766', '华阴市', 442529, 'county'),
(445129, '610602', '36.575992490922', '109.64860224516', '宝塔区', 442530, 'county'),
(445130, '610603', '36.926615808304', '109.15556502968', '安塞区', 442530, 'county'),
(445131, '610621', '36.543668537707', '110.13820395785', '延长县', 442530, 'county'),
(445132, '610622', '36.88242672637', '110.08409714122', '延川县', 442530, 'county'),
(445133, '610623', '37.231001638593', '109.62229012795', '子长县', 442530, 'county'),
(445134, '610625', '36.753503067474', '108.66244666802', '志丹县', 442530, 'county'),
(445135, '610626', '36.985223505156', '108.12948505986', '吴起县', 442530, 'county'),
(445136, '610627', '36.353544169394', '109.18223909796', '甘泉县', 442530, 'county'),
(445137, '610628', '36.017427088571', '109.04960350294', '富县', 442530, 'county'),
(445138, '610629', '35.744158257757', '109.56098175038', '洛川县', 442530, 'county'),
(445139, '610630', '36.071139382475', '110.19112656349', '宜川县', 442530, 'county'),
(445140, '610631', '35.702635706301', '109.94510069451', '黄龙县', 442530, 'county'),
(445141, '610632', '35.62841424749', '108.95305831904', '黄陵县', 442530, 'county'),
(445142, '610702', '33.187204162513', '107.04616716185', '汉台区', 442531, 'county'),
(445143, '610721', '32.812036143125', '106.96974070111', '南郑县', 442531, 'county'),
(445144, '610722', '33.223582827388', '107.26083703889', '城固县', 442531, 'county'),
(445145, '610723', '33.371586660725', '107.61609308741', '洋县', 442531, 'county'),
(445146, '610724', '32.894902801657', '107.75371241439', '西乡县', 442531, 'county'),
(445147, '610725', '33.243885511916', '106.66457828015', '勉县', 442531, 'county'),
(445148, '610726', '32.914183257269', '106.14087102725', '宁强县', 442531, 'county'),
(445149, '610727', '33.385373533804', '106.16283351204', '略阳县', 442531, 'county'),
(445150, '610728', '32.517415574628', '107.88277388136', '镇巴县', 442531, 'county'),
(445151, '610729', '33.612960467486', '106.95962831346', '留坝县', 442531, 'county'),
(445152, '610730', '33.549939112272', '107.92883622761', '佛坪县', 442531, 'county'),
(445153, '610802', '38.386406641165', '109.64269245717', '榆阳区', 442532, 'county'),
(445154, '610803', '37.80809785663', '109.50067321533', '横山区', 442532, 'county'),
(445155, '610821', '38.829035865956', '110.33126976909', '神木县', 442532, 'county'),
(445156, '610822', '39.187272466272', '110.86693418362', '府谷县', 442532, 'county'),
(445157, '610824', '37.484215805492', '108.81325925462', '靖边县', 442532, 'county'),
(445158, '610825', '37.388791134452', '107.7542930803', '定边县', 442532, 'county'),
(445159, '610826', '37.520861333414', '110.39614377168', '绥德县', 442532, 'county'),
(445160, '610827', '37.8285293893', '110.18690099232', '米脂县', 442532, 'county'),
(445161, '610828', '38.078380449363', '110.37373997088', '佳县', 442532, 'county'),
(445162, '610829', '37.594879166095', '110.69187682122', '吴堡县', 442532, 'county'),
(445163, '610830', '37.187443767355', '110.28929412737', '清涧县', 442532, 'county'),
(445164, '610831', '37.533672486299', '109.8772926757', '子洲县', 442532, 'county'),
(445165, '610902', '32.814464034575', '108.89624328129', '汉滨区', 442533, 'county'),
(445166, '610921', '32.902520654164', '108.49695491326', '汉阴县', 442533, 'county'),
(445167, '610922', '33.065316023116', '108.25051841167', '石泉县', 442533, 'county'),
(445168, '610923', '33.536923574813', '108.45179634269', '宁陕县', 442533, 'county'),
(445169, '610924', '32.448942187958', '108.44482568913', '紫阳县', 442533, 'county'),
(445170, '610925', '32.242470474479', '108.88718069832', '岚皋县', 442533, 'county'),
(445171, '610926', '32.291256567392', '109.2703969757', '平利县', 442533, 'county'),
(445172, '610927', '31.939261564672', '109.45671118087', '镇坪县', 442533, 'county'),
(445173, '610928', '32.902076990198', '109.42357994353', '旬阳县', 442533, 'county'),
(445174, '610929', '32.729864671398', '109.91837503137', '白河县', 442533, 'county'),
(445175, '611002', '33.895484903711', '109.87327053686', '商州区', 442534, 'county'),
(445176, '611021', '34.16568436231', '110.27264280953', '洛南县', 442534, 'county'),
(445177, '611022', '33.684553642613', '110.44379951579', '丹凤县', 442534, 'county'),
(445178, '611023', '33.411702755168', '110.76653283748', '商南县', 442534, 'county'),
(445179, '611024', '33.427684397681', '109.98131923576', '山阳县', 442534, 'county'),
(445180, '611025', '33.380938764863', '109.07737051732', '镇安县', 442534, 'county'),
(445181, '611026', '33.695399655075', '109.28054880136', '柞水县', 442534, 'county'),
(445182, '620102', '36.054008131567', '103.85157116258', '城关区', 442535, 'county'),
(445183, '620103', '35.992495346876', '103.77199449949', '七里河区', 442535, 'county'),
(445184, '620104', '36.106471763711', '103.56267979363', '西固区', 442535, 'county'),
(445185, '620105', '36.11552303805', '103.7191558999', '安宁区', 442535, 'county'),
(445186, '620111', '36.303488391492', '103.06027548801', '红古区', 442535, 'county'),
(445187, '620121', '36.616923609035', '103.25279353462', '永登县', 442535, 'county'),
(445188, '620122', '36.394687882673', '103.89046691011', '皋兰县', 442535, 'county'),
(445189, '620123', '35.999785042711', '104.244289521', '榆中县', 442535, 'county'),
(445190, '620201', '39.802397326734', '98.281634585257', '嘉峪关市', 442229, 'county'),
(445191, '620302', '38.492171668259', '102.32867993808', '金川区', 442536, 'county'),
(445192, '620321', '38.433409665467', '102.03431627622', '永昌县', 442536, 'county'),
(445193, '620402', '36.50182182871', '104.2056493285', '白银区', 442537, 'county'),
(445194, '620403', '36.690350490926', '104.94560896536', '平川区', 442537, 'county'),
(445195, '620421', '36.749103432427', '104.73232686762', '靖远县', 442537, 'county'),
(445196, '620422', '35.963481743844', '105.10186095322', '会宁县', 442537, 'county'),
(445197, '620423', '37.14607896393', '104.06166772084', '景泰县', 442537, 'county'),
(445198, '620502', '34.344448280622', '105.58117092709', '秦州区', 442538, 'county'),
(445199, '620503', '34.520218471455', '106.05204030761', '麦积区', 442538, 'county'),
(445200, '620521', '34.74252730496', '106.14008000664', '清水县', 442538, 'county'),
(445201, '620522', '34.953499919918', '105.69804091114', '秦安县', 442538, 'county'),
(445202, '620523', '34.809420550799', '105.27453175252', '甘谷县', 442538, 'county'),
(445203, '620524', '34.680181826047', '104.88672977677', '武山县', 442538, 'county'),
(445204, '620525', '34.995955449082', '106.28213682392', '张家川回族自治县', 442538, 'county'),
(445205, '620602', '37.916272406996', '102.75947740159', '凉州区', 442539, 'county'),
(445206, '620621', '38.827727985281', '103.20247261178', '民勤县', 442539, 'county'),
(445207, '620622', '37.531271711364', '103.34292346491', '古浪县', 442539, 'county'),
(445208, '620623', '37.280912201076', '102.76116389471', '天祝藏族自治县', 442539, 'county'),
(445209, '620702', '39.010620607403', '100.52207864992', '甘州区', 442540, 'county'),
(445210, '620721', '38.92057106606', '99.32677151937', '肃南裕固族自治县', 442540, 'county'),
(445211, '620722', '38.473163420728', '100.7984292987', '民乐县', 442540, 'county'),
(445212, '620723', '39.347031674446', '100.19122429388', '临泽县', 442540, 'county'),
(445213, '620724', '39.54167477275', '99.607521373805', '高台县', 442540, 'county'),
(445214, '620725', '38.530221367211', '101.23164701727', '山丹县', 442540, 'county'),
(445215, '620802', '35.515774315921', '106.74888681637', '崆峒区', 442541, 'county'),
(445216, '620821', '35.354114511504', '107.44140503868', '泾川县', 442541, 'county'),
(445217, '620822', '35.074478179591', '107.40960562376', '灵台县', 442541, 'county'),
(445218, '620823', '35.249102891785', '107.0037763949', '崇信县', 442541, 'county'),
(445219, '620824', '35.205549578778', '106.60867034279', '华亭县', 442541, 'county'),
(445220, '620825', '35.255968489859', '106.06568568013', '庄浪县', 442541, 'county'),
(445221, '620826', '35.434011745999', '105.67756247251', '静宁县', 442541, 'county'),
(445222, '620902', '39.598374259485', '98.802616462619', '肃州区', 442542, 'county'),
(445223, '620921', '40.382579195507', '99.186587021952', '金塔县', 442542, 'county'),
(445224, '620922', '40.734286870761', '95.804712825239', '瓜州县', 442542, 'county'),
(445225, '620923', '40.67651966541', '96.532550627515', '肃北蒙古族自治县', 442542, 'county'),
(445226, '620924', '39.025889605786', '94.452300569161', '阿克塞哈萨克族自治县', 442542, 'county'),
(445227, '620981', '40.225551802072', '97.461208851694', '玉门市', 442542, 'county'),
(445228, '620982', '40.388771499344', '94.158041766451', '敦煌市', 442542, 'county'),
(445229, '621002', '35.677201418546', '107.67367365978', '西峰区', 442543, 'county'),
(445230, '621021', '36.046137555053', '107.68254775923', '庆城县', 442543, 'county'),
(445231, '621022', '36.616788638949', '107.07217218514', '环县', 442543, 'county'),
(445232, '621023', '36.444471972715', '108.03431226296', '华池县', 442543, 'county'),
(445233, '621024', '36.014259860237', '108.31734058051', '合水县', 442543, 'county'),
(445234, '621025', '35.414731657592', '108.37808719083', '正宁县', 442543, 'county'),
(445235, '621026', '35.571366266826', '108.11417335803', '宁县', 442543, 'county'),
(445236, '621027', '35.787953892327', '107.17722652653', '镇原县', 442543, 'county'),
(445237, '621102', '35.644415174266', '104.63762366893', '安定区', 442544, 'county'),
(445238, '621121', '35.213473762851', '105.19397766216', '通渭县', 442544, 'county'),
(445239, '621122', '35.111801691091', '104.63291319296', '陇西县', 442544, 'county'),
(445240, '621123', '35.139480681839', '104.14632784195', '渭源县', 442544, 'county'),
(445241, '621124', '35.531078701642', '103.91201515484', '临洮县', 442544, 'county'),
(445242, '621125', '34.726750534701', '104.36540253683', '漳县', 442544, 'county'),
(445243, '621126', '34.429644403444', '104.24672610097', '岷县', 442544, 'county'),
(445244, '621202', '33.293917195649', '105.13455295643', '武都区', 442545, 'county'),
(445245, '621221', '33.747296636905', '105.68828896242', '成县', 442545, 'county'),
(445246, '621222', '32.947265418467', '104.78420570271', '文县', 442545, 'county'),
(445247, '621223', '34.013488842529', '104.45282709018', '宕昌县', 442545, 'county'),
(445248, '621224', '33.284990408681', '105.63797390347', '康县', 442545, 'county'),
(445249, '621225', '33.919624520579', '105.33853139264', '西和县', 442545, 'county'),
(445250, '621226', '34.111636708139', '105.06409130212', '礼县', 442545, 'county'),
(445251, '621227', '33.892851204433', '106.03331703965', '徽县', 442545, 'county'),
(445252, '621228', '33.911378923592', '106.40388517582', '两当县', 442545, 'county'),
(445253, '622901', '35.585834814564', '103.2005757611', '临夏市', 442546, 'county'),
(445254, '622921', '35.51871940176', '103.05079063073', '临夏县', 442546, 'county'),
(445255, '622922', '35.258018266344', '103.62902014045', '康乐县', 442546, 'county'),
(445256, '622923', '36.007874959311', '103.22504409432', '永靖县', 442546, 'county'),
(445257, '622924', '35.478027097747', '103.63113999251', '广河县', 442546, 'county'),
(445258, '622925', '35.345732331975', '103.29856767173', '和政县', 442546, 'county'),
(445259, '622926', '35.698472340993', '103.45214513327', '东乡族自治县', 442546, 'county'),
(445260, '622927', '35.710873026896', '102.86781858816', '积石山保安族东乡族撒拉族自治县', 442546, 'county'),
(445261, '623001', '34.997259505739', '103.08564921659', '合作市', 442547, 'county'),
(445262, '623021', '34.742615145611', '103.63190648409', '临潭县', 442547, 'county'),
(445263, '623022', '34.614457775996', '103.39362024363', '卓尼县', 442547, 'county'),
(445264, '623023', '33.634810419739', '104.32632271288', '舟曲县', 442547, 'county'),
(445265, '623024', '34.005620769228', '103.57044621531', '迭部县', 442547, 'county'),
(445266, '623025', '33.850721989423', '101.66897741851', '玛曲县', 442547, 'county'),
(445267, '623026', '34.392608970483', '102.4775472855', '碌曲县', 442547, 'county'),
(445268, '623027', '35.023030857767', '102.50657841215', '夏河县', 442547, 'county'),
(445269, '630102', '36.602116754388', '101.8318647116', '城东区', 442548, 'county'),
(445270, '630103', '36.606648708407', '101.77736110275', '城中区', 442548, 'county'),
(445271, '630104', '36.631635686769', '101.72760342157', '城西区', 442548, 'county'),
(445272, '630105', '36.686367847542', '101.7126636128', '城北区', 442548, 'county'),
(445273, '630121', '37.120688447453', '101.49047766775', '大通回族土族自治县', 442548, 'county'),
(445274, '630122', '36.579759412822', '101.54449443066', '湟中县', 442548, 'county'),
(445275, '630123', '36.636354795068', '101.16317752228', '湟源县', 442548, 'county'),
(445276, '630202', '36.535266451079', '102.45288779666', '乐都区', 442549, 'county'),
(445277, '630203', '36.410605515699', '102.00299964296', '平安区', 442549, 'county'),
(445278, '630222', '36.312743354178', '102.37668874252', '民和回族土族自治县', 442549, 'county'),
(445279, '630223', '36.83096012588', '102.25718820705', '互助土族自治县', 442549, 'county'),
(445280, '630224', '36.063668678141', '102.19192348838', '化隆回族自治县', 442549, 'county'),
(445281, '630225', '35.70370031381', '102.41213008567', '循化撒拉族自治县', 442549, 'county'),
(445282, '632221', '37.45838446475', '101.73134392349', '门源回族自治县', 442550, 'county'),
(445283, '632222', '38.327948935969', '99.711262922683', '祁连县', 442550, 'county'),
(445284, '632223', '37.114748322372', '100.84335509134', '海晏县', 442550, 'county'),
(445285, '632224', '37.556876866897', '99.988382638435', '刚察县', 442550, 'county'),
(445286, '632321', '35.426828765429', '102.07844901848', '同仁县', 442551, 'county'),
(445287, '632322', '35.918696822502', '101.8497538518', '尖扎县', 442551, 'county'),
(445288, '632323', '35.139216924404', '101.43544631681', '泽库县', 442551, 'county');
INSERT INTO `region` (`id`, `code`, `lat`, `lng`, `name`, `parent_id`, `by_type`) VALUES
(445289, '632324', '34.511389737869', '101.55630729533', '河南蒙古族自治县', 442551, 'county'),
(445290, '632521', '36.538342364813', '100.06487566684', '共和县', 442552, 'county'),
(445291, '632522', '35.068401149266', '100.60173869992', '同德县', 442552, 'county'),
(445292, '632523', '36.010503374887', '101.41576189108', '贵德县', 442552, 'county'),
(445293, '632524', '35.54029982537', '99.733309029', '兴海县', 442552, 'county'),
(445294, '632525', '35.698086207737', '100.8846104318', '贵南县', 442552, 'county'),
(445295, '632621', '34.504017087053', '99.794261606919', '玛沁县', 442553, 'county'),
(445296, '632622', '32.909735756429', '100.55042865772', '班玛县', 442553, 'county'),
(445297, '632623', '34.021807573602', '100.1478423084', '甘德县', 442553, 'county'),
(445298, '632624', '33.482696864248', '99.410809497102', '达日县', 442553, 'county'),
(445299, '632625', '33.473902951608', '101.00550828784', '久治县', 442553, 'county'),
(445300, '632626', '34.79757019551', '98.244476788626', '玛多县', 442553, 'county'),
(445301, '632701', '32.906574629922', '96.712350119487', '玉树市', 442554, 'county'),
(445302, '632722', '33.065763568805', '94.30131455019', '杂多县', 442554, 'county'),
(445303, '632723', '33.935171842212', '97.001973841494', '称多县', 442554, 'county'),
(445304, '632724', '34.884438571607', '92.608641864013', '治多县', 442554, 'county'),
(445305, '632725', '32.178288570852', '96.137026010488', '囊谦县', 442554, 'county'),
(445306, '632726', '34.876865391833', '95.140845875343', '曲麻莱县', 442554, 'county'),
(445307, '632801', '35.499761004275', '96.202543672261', '格尔木市', 442555, 'county'),
(445308, '632802', '35.499761004275', '96.202543672261', '德令哈市', 442555, 'county'),
(445309, '632821', '36.902366896364', '98.672630599729', '乌兰县', 442555, 'county'),
(445310, '632822', '36.160067040805', '97.154434686537', '都兰县', 442555, 'county'),
(445311, '632823', '38.051753388375', '98.496512304144', '天峻县', 442555, 'county'),
(445312, '640104', '38.464266316255', '106.38212078081', '兴庆区', 442556, 'county'),
(445313, '640105', '38.55328059311', '106.05555591606', '西夏区', 442556, 'county'),
(445314, '640106', '38.47859072607', '106.24264950801', '金凤区', 442556, 'county'),
(445315, '640121', '38.295049444356', '106.10904802497', '永宁县', 442556, 'county'),
(445316, '640122', '38.687106885054', '106.26651804243', '贺兰县', 442556, 'county'),
(445317, '640181', '37.935174812169', '106.53199999229', '灵武市', 442556, 'county'),
(445318, '640202', '38.967534270672', '106.38721561034', '大武口区', 442557, 'county'),
(445319, '640205', '39.108073765064', '106.61377347013', '惠农区', 442557, 'county'),
(445320, '640221', '38.891511355897', '106.54437947509', '平罗县', 442557, 'county'),
(445321, '640302', '37.76788189318', '106.21901163377', '利通区', 442558, 'county'),
(445322, '640303', '37.374136412893', '106.16687896986', '红寺堡区', 442558, 'county'),
(445323, '640323', '37.625336523188', '107.04976116152', '盐池县', 442558, 'county'),
(445324, '640324', '37.098456634364', '106.24738743176', '同心县', 442558, 'county'),
(445325, '640381', '37.942124742884', '105.96146159918', '青铜峡市', 442558, 'county'),
(445326, '640402', '36.206829483476', '106.25401126905', '原州区', 442559, 'county'),
(445327, '640422', '35.939934380868', '105.72674858688', '西吉县', 442559, 'county'),
(445328, '640423', '35.589137720123', '106.07361128455', '隆德县', 442559, 'county'),
(445329, '640424', '35.529746376118', '106.35402263843', '泾源县', 442559, 'county'),
(445330, '640425', '35.972546262958', '106.66247325572', '彭阳县', 442559, 'county'),
(445331, '640502', '37.360638517868', '105.11127776143', '沙坡头区', 442560, 'county'),
(445332, '640521', '37.360097375108', '105.69186958245', '中宁县', 442560, 'county'),
(445333, '640522', '36.603124838712', '105.67964899633', '海原县', 442560, 'county'),
(445334, '650102', '43.783860225571', '87.632902512248', '天山区', 442561, 'county'),
(445335, '650103', '43.807885738392', '87.545631053987', '沙依巴克区', 442561, 'county'),
(445336, '650104', '43.898324290635', '87.549218796363', '新市区', 442561, 'county'),
(445337, '650105', '43.843907230143', '87.668013771241', '水磨沟区', 442561, 'county'),
(445338, '650106', '43.925789450498', '87.425048810466', '头屯河区', 442561, 'county'),
(445339, '650107', '42.840608943765', '87.895407243798', '达坂城区', 442561, 'county'),
(445340, '650109', '44.070554173621', '87.691186460177', '米东区', 442561, 'county'),
(445341, '650121', '43.419107804291', '87.360244284205', '乌鲁木齐县', 442561, 'county'),
(445342, '650202', '44.302338209135', '84.899916988861', '独山子区', 442562, 'county'),
(445343, '650203', '45.203919246039', '84.926989634948', '克拉玛依区', 442562, 'county'),
(445344, '650204', '45.633602431504', '85.177828513011', '白碱滩区', 442562, 'county'),
(445345, '650205', '46.006575616849', '85.511149264018', '乌尔禾区', 442562, 'county'),
(445346, '650402', '42.508199556726', '89.227738842032', '高昌区', 442563, 'county'),
(445347, '650421', '42.678924820794', '89.266025488642', '鄯善县', 442563, 'county'),
(445348, '650422', '42.678924820794', '89.266025488642', '托克逊县', 442563, 'county'),
(445349, '650502', '42.344467104552', '93.529373012389', '伊州区', 442564, 'county'),
(445350, '650521', '42.127000957642', '85.614899338339', '巴里坤哈萨克自治县', 442564, 'county'),
(445351, '650522', '42.127000957642', '85.614899338339', '伊吾县', 442564, 'county'),
(445352, '652301', '44.175083447891', '87.073618053225', '昌吉市', 442565, 'county'),
(445353, '652302', '44.424103693512', '88.305949271281', '阜康市', 442565, 'county'),
(445354, '652323', '44.380955717336', '86.693166111969', '呼图壁县', 442565, 'county'),
(445355, '652324', '44.503551752404', '86.137668859258', '玛纳斯县', 442565, 'county'),
(445356, '652325', '44.527652368056', '90.11026866784', '奇台县', 442565, 'county'),
(445357, '652327', '44.352913670744', '89.053073195064', '吉木萨尔县', 442565, 'county'),
(445358, '652328', '44.106618870761', '90.823487793346', '木垒哈萨克自治县', 442565, 'county'),
(445359, '652701', '44.844209020588', '81.874284679178', '博乐市', 442566, 'county'),
(445360, '652702', '45.061386641726', '82.895221509025', '阿拉山口市', 442566, 'county'),
(445361, '652722', '44.557568454509', '82.922361700992', '精河县', 442566, 'county'),
(445362, '652723', '44.9688196179', '80.952155808353', '温泉县', 442566, 'county'),
(445363, '652801', '41.705499905674', '85.709417601735', '库尔勒市', 442567, 'county'),
(445364, '652822', '41.819287515207', '84.57895946698', '轮台县', 442567, 'county'),
(445365, '652823', '40.858795810656', '86.866990811172', '尉犁县', 442567, 'county'),
(445366, '652824', '38.973844089966', '89.762772308375', '若羌县', 442567, 'county'),
(445367, '652825', '38.100709422823', '85.506365638195', '且末县', 442567, 'county'),
(445368, '652826', '42.096103707937', '86.07606847595', '焉耆回族自治县', 442567, 'county'),
(445369, '652827', '42.828681293853', '85.200093433149', '和静县', 442567, 'county'),
(445370, '652828', '42.141076067327', '87.588716477325', '和硕县', 442567, 'county'),
(445371, '652829', '41.857897990299', '86.88537877372', '博湖县', 442567, 'county'),
(445372, '652901', '40.349444301113', '81.156013147807', '阿克苏市', 442568, 'county'),
(445373, '652922', '41.582084613402', '80.461878185727', '温宿县', 442568, 'county'),
(445374, '652923', '41.781932892776', '83.459806782673', '库车县', 442568, 'county'),
(445375, '652924', '40.406065186743', '82.925515505452', '沙雅县', 442568, 'county'),
(445376, '652925', '41.365699703636', '81.985216276674', '新和县', 442568, 'county'),
(445377, '652926', '42.04528513577', '81.90123535088', '拜城县', 442568, 'county'),
(445378, '652927', '41.26184731177', '79.281638850531', '乌什县', 442568, 'county'),
(445379, '652928', '40.060787890713', '80.439931783004', '阿瓦提县', 442568, 'county'),
(445380, '652929', '40.456665812896', '78.994696137796', '柯坪县', 442568, 'county'),
(445381, '653001', '42.127000957642', '85.614899338339', '阿图什市', 442569, 'county'),
(445382, '653022', '39.12880375818', '75.814939311182', '阿克陶县', 442569, 'county'),
(445383, '653023', '42.127000957642', '85.614899338339', '阿合奇县', 442569, 'county'),
(445384, '653024', '39.971830894544', '75.146818569489', '乌恰县', 442569, 'county'),
(445385, '653101', '39.513110585312', '76.014342798943', '喀什市', 442570, 'county'),
(445386, '653121', '39.409740997776', '75.754898212901', '疏附县', 442570, 'county'),
(445387, '653122', '39.187644733788', '76.369990308095', '疏勒县', 442570, 'county'),
(445388, '653123', '38.800015263145', '76.368708511974', '英吉沙县', 442570, 'county'),
(445389, '653124', '38.122552699106', '77.226408238901', '泽普县', 442570, 'county'),
(445390, '653125', '38.322587836687', '77.014833164072', '莎车县', 442570, 'county'),
(445391, '653126', '36.993013961904', '77.223630915245', '叶城县', 442570, 'county'),
(445392, '653127', '38.848362710463', '78.242310158759', '麦盖提县', 442570, 'county'),
(445393, '653128', '39.116644959661', '76.989631103308', '岳普湖县', 442570, 'county'),
(445394, '653129', '39.599103145624', '77.231563046663', '伽师县', 442570, 'county'),
(445395, '653130', '39.618107499846', '78.907138995454', '巴楚县', 442570, 'county'),
(445396, '653131', '37.019583155993', '75.843222371735', '塔什库尔干塔吉克自治县', 442570, 'county'),
(445397, '653201', '37.153349739681', '79.915813731039', '和田市', 442571, 'county'),
(445398, '653221', '35.68343240637', '79.354993072983', '和田县', 442571, 'county'),
(445399, '653222', '38.384224145853', '80.047148111072', '墨玉县', 442571, 'county'),
(445400, '653223', '37.228318546135', '78.521850388972', '皮山县', 442571, 'county'),
(445401, '653224', '38.02421985339', '80.741311117244', '洛浦县', 442571, 'county'),
(445402, '653225', '37.084313855547', '81.097995717517', '策勒县', 442571, 'county'),
(445403, '653226', '37.169130186737', '81.995462903271', '于田县', 442571, 'county'),
(445404, '653227', '37.173146693576', '83.352763187', '民丰县', 442571, 'county'),
(445405, '654002', '44.020355819309', '81.289048071493', '伊宁市', 442572, 'county'),
(445406, '654003', '44.559556778997', '85.013934401512', '奎屯市', 442572, 'county'),
(445407, '654004', '44.452519773233', '80.472151391129', '霍尔果斯市', 442572, 'county'),
(445408, '654021', '44.008116880627', '81.756940142999', '伊宁县', 442572, 'county'),
(445409, '654022', '43.63837704253', '81.098298342118', '察布查尔锡伯自治县', 442572, 'county'),
(445410, '654023', '44.309120433611', '80.781158528097', '霍城县', 442572, 'county'),
(445411, '654024', '43.302460015973', '82.445700944329', '巩留县', 442572, 'county'),
(445412, '654025', '43.376951418093', '83.558150188258', '新源县', 442572, 'county'),
(445413, '654026', '42.776878220953', '80.984257123681', '昭苏县', 442572, 'county'),
(445414, '654027', '42.925563515093', '82.006852355503', '特克斯县', 442572, 'county'),
(445415, '654028', '43.816730949065', '83.23110039646', '尼勒克县', 442572, 'county'),
(445416, '654201', '46.75868362968', '82.974880583744', '塔城市', 442573, 'county'),
(445417, '654202', '44.40768749824', '84.277878264967', '乌苏市', 442573, 'county'),
(445418, '654221', '46.590663664844', '84.20931964579', '额敏县', 442573, 'county'),
(445419, '654223', '44.353744632126', '85.474874072005', '沙湾县', 442573, 'county'),
(445420, '654224', '45.656986383852', '83.895484795593', '托里县', 442573, 'county'),
(445421, '654225', '46.004456478157', '82.814799479048', '裕民县', 442573, 'county'),
(445422, '654226', '46.256702546595', '86.217435804622', '和布克赛尔蒙古自治县', 442573, 'county'),
(445423, '654301', '47.890135725749', '87.926214360189', '阿勒泰市', 442574, 'county'),
(445424, '654321', '48.31600661463', '87.235518096505', '布尔津县', 442574, 'county'),
(445425, '654322', '46.536156506123', '89.393483612342', '富蕴县', 442574, 'county'),
(445426, '654323', '46.391693535493', '88.050870553487', '福海县', 442574, 'county'),
(445427, '654324', '48.316559027363', '86.409672960245', '哈巴河县', 442574, 'county'),
(445428, '654325', '46.26815068272', '90.403028447838', '青河县', 442574, 'county'),
(445429, '654326', '47.40631111494', '86.208104287811', '吉木乃县', 442574, 'county'),
(445430, '659001', '42.127000957642', '85.614899338339', '石河子市', 442575, 'county'),
(445431, '659002', '40.615680005185', '81.291736550158', '阿拉尔市', 442575, 'county'),
(445432, '659003', '39.889222881804', '79.198155107904', '图木舒克市', 442575, 'county'),
(445433, '659004', '44.368899479018', '87.565448980181', '五家渠市', 442575, 'county'),
(445434, '659006', '41.806667022365', '85.726306886394', '铁门关市', 442575, 'county'),
(445435, '441900003', '23.034187558639', '113.78983123714', '东城街道办事处', 444410, 'town'),
(445436, '441900004', '23.043023815368', '113.76343399076', '南城街道办事处', 444410, 'town'),
(445437, '441900005', '23.053216729046', '113.74487765252', '万江街道办事处', 444410, 'town'),
(445438, '441900006', '23.044807443255', '113.75560020347', '莞城街道办事处', 444410, 'town'),
(445439, '441900101', '23.105009814264', '113.81981570219', '石碣镇', 444410, 'town'),
(445440, '441900102', '23.11161544389', '113.88072838846', '石龙镇', 444410, 'town'),
(445441, '441900103', '23.082481820485', '113.87562020652', '茶山镇', 444410, 'town'),
(445442, '441900104', '23.094860319218', '113.94654976997', '石排镇', 444410, 'town'),
(445443, '441900105', '23.079042407351', '114.02853135589', '企石镇', 444410, 'town'),
(445444, '441900106', '23.024814163604', '113.97299506133', '横沥镇', 444410, 'town'),
(445445, '441900107', '23.020458678747', '114.10677408198', '桥头镇', 444410, 'town'),
(445446, '441900108', '22.967217838002', '114.15514140002', '谢岗镇', 444410, 'town'),
(445447, '441900109', '23.001562568215', '113.94045100498', '东坑镇', 444410, 'town'),
(445448, '441900110', '22.981050796988', '113.9995109047', '常平镇', 444410, 'town'),
(445449, '441900111', '23.00371616099', '113.88126801675', '寮步镇', 444410, 'town'),
(445450, '441900112', '22.920830687532', '114.08977863491', '樟木头镇', 444410, 'town'),
(445451, '441900113', '22.945659062868', '113.95058428998', '大朗镇', 444410, 'town'),
(445452, '441900114', '22.921615129208', '114.00998764783', '黄江镇', 444410, 'town'),
(445453, '441900115', '22.85030931077', '114.17089092789', '清溪镇', 444410, 'town'),
(445454, '441900116', '22.812790577997', '114.07912123626', '塘厦镇', 444410, 'town'),
(445455, '441900117', '22.752715714135', '114.14334020333', '凤岗镇', 444410, 'town'),
(445456, '441900118', '22.905900630606', '113.84869038983', '大岭山镇', 444410, 'town'),
(445457, '441900119', '22.82104526943', '113.80903565699', '长安镇', 444410, 'town'),
(445458, '441900121', '22.820652927195', '113.67932364446', '虎门镇', 444410, 'town'),
(445459, '441900122', '22.941327853433', '113.67679510848', '厚街镇', 444410, 'town'),
(445460, '441900123', '22.925272079534', '113.62408243967', '沙田镇', 444410, 'town'),
(445461, '441900124', '23.010254161879', '113.6817198771', '道滘镇', 444410, 'town'),
(445462, '441900125', '23.000648523575', '113.61544017114', '洪梅镇', 444410, 'town'),
(445463, '441900126', '23.057083015858', '113.58837988097', '麻涌镇', 444410, 'town'),
(445464, '441900127', '23.061598763352', '113.66263830413', '望牛墩镇', 444410, 'town'),
(445465, '441900128', '23.098649541505', '113.66393529738', '中堂镇', 444410, 'town'),
(445466, '441900129', '23.097244208669', '113.75235767092', '高埗镇', 444410, 'town'),
(445467, '441900401', '22.929023833476', '113.90498400265', '松山湖管委会', 444410, 'town'),
(445468, '441900402', '22.87760055556', '113.5974063853', '虎门港管委会', 444410, 'town'),
(445469, '441900403', '23.06893955376', '113.93401286467', '东莞生态园', 444410, 'town'),
(445470, '442000001', '22.543405990677', '113.39476330111', '石岐区街道办事处', 444411, 'town'),
(445471, '442000002', '22.545177514513', '113.4220600208', '东区街道办事处', 444411, 'town'),
(445472, '442000003', '22.54191612433', '113.47638423802', '火炬开发区街道办事处', 444411, 'town'),
(445473, '442000004', '22.524075818178', '113.36301785094', '西区街道办事处', 444411, 'town'),
(445474, '442000005', '22.503167561223', '113.37678191523', '南区街道办事处', 444411, 'town'),
(445475, '442000006', '22.451434375841', '113.40930659782', '五桂山街道办事处', 444411, 'town'),
(445476, '442000100', '22.668653892986', '113.25710031734', '小榄镇', 444411, 'town'),
(445477, '442000101', '22.716774199156', '113.34579765142', '黄圃镇', 444411, 'town'),
(445478, '442000102', '22.627523677586', '113.50009575036', '民众镇', 444411, 'town'),
(445479, '442000103', '22.708252148345', '113.26390219773', '东凤镇', 444411, 'town'),
(445480, '442000104', '22.628979044198', '113.29799140513', '东升镇', 444411, 'town'),
(445481, '442000105', '22.61867275523', '113.19699907493', '古镇镇', 444411, 'town'),
(445482, '442000106', '22.514758626025', '113.32782880229', '沙溪镇', 444411, 'town'),
(445483, '442000107', '22.260588179755', '113.47430653463', '坦洲镇', 444411, 'town'),
(445484, '442000108', '22.591755080708', '113.39153101373', '港口镇', 444411, 'town'),
(445485, '442000109', '22.682488953575', '113.42447628565', '三角镇', 444411, 'town'),
(445486, '442000110', '22.574461443704', '113.24834255727', '横栏镇', 444411, 'town'),
(445487, '442000111', '22.723520491884', '113.29828270584', '南头镇', 444411, 'town'),
(445488, '442000112', '22.672921927334', '113.35641695563', '阜沙镇', 444411, 'town'),
(445489, '442000113', '22.504952068383', '113.53783552043', '南朗镇', 444411, 'town'),
(445490, '442000114', '22.363791945407', '113.44797569368', '三乡镇', 444411, 'town'),
(445491, '442000115', '22.422651529649', '113.3288721509', '板芙镇', 444411, 'town'),
(445492, '442000116', '22.471242810046', '113.30718743409', '大涌镇', 444411, 'town'),
(445493, '442000117', '22.308297939473', '113.3702758154', '神湾镇', 444411, 'town'),
(445494, '460400100', '19.52127763772', '109.552961497', '那大镇', 444547, 'town'),
(445495, '460400101', '19.531275426074', '109.64738779153', '和庆镇', 444547, 'town'),
(445496, '460400102', '19.415717747276', '109.56235340507', '南丰镇', 444547, 'town'),
(445497, '460400103', '19.513907807686', '109.40607236409', '大成镇', 444547, 'town'),
(445498, '460400104', '19.449779604127', '109.27567597122', '雅星镇', 444547, 'town'),
(445499, '460400105', '19.466430878427', '109.67367138789', '兰洋镇', 444547, 'town'),
(445500, '460400106', '19.823919412162', '109.48786919371', '光村镇', 444547, 'town'),
(445501, '460400107', '19.809926770596', '109.35673473687', '木棠镇', 444547, 'town'),
(445502, '460400108', '19.509695855917', '108.95966166166', '海头镇', 444547, 'town'),
(445503, '460400109', '19.860383433642', '109.27331128257', '峨蔓镇', 444547, 'town'),
(445504, '460400110', '19.793150845121', '109.22582623889', '三都镇', 444547, 'town'),
(445505, '460400111', '19.659803263052', '109.30218328967', '王五镇', 444547, 'town'),
(445506, '460400112', '19.574787798597', '109.33458619886', '白马井镇', 444547, 'town'),
(445507, '460400113', '19.749465537088', '109.35613533713', '中和镇', 444547, 'town'),
(445508, '460400114', '19.644673698003', '109.16975400269', '排浦镇', 444547, 'town'),
(445509, '460400115', '19.709924104042', '109.4680333127', '东成镇', 444547, 'town'),
(445510, '460400116', '19.720234743232', '109.32260133284', '新州镇', 444547, 'town'),
(445511, '460400400', '19.483502718426', '109.4599938961', '国营西培农场', 444547, 'town'),
(445512, '460400404', '19.574664060327', '109.57014071402', '国营西联农场', 444547, 'town'),
(445513, '460400405', '19.463516627749', '109.68307796619', '国营蓝洋农场', 444547, 'town'),
(445514, '460400407', '19.460913902693', '109.31617355538', '国营八一农场', 444547, 'town'),
(445515, '460400499', '19.775218244804', '109.19229656623', '洋浦经济开发区', 444547, 'town'),
(445516, '460400500', '19.574787798597', '109.33458619886', '华南热作学院', 444547, 'town'),
(445517, '620201100', '39.880279868432', '98.458266361225', '新城镇', 445190, 'town'),
(445518, '620201101', '39.813928611238', '98.23795042668', '峪泉镇', 445190, 'town'),
(445519, '620201102', '39.700128295254', '98.384821213543', '文殊镇', 445190, 'town'),
(445520, '620201401', '39.802397326734', '98.281634585257', '雄关区', 445190, 'town'),
(445521, '620201402', '39.802397326734', '98.281634585257', '镜铁区', 445190, 'town'),
(445522, '620201403', '39.914711003026', '98.404752795538', '长城区', 445190, 'town');
-- --------------------------------------------------------
--
-- 表的结构 `robot`
--
CREATE TABLE `robot` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`rid` varchar(255) NOT NULL,
`robot_name` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `role`
--
CREATE TABLE `role` (
`id` bigint(20) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`value` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`descriptions` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `role`
--
INSERT INTO `role` (`id`, `name`, `value`, `by_type`, `descriptions`) VALUES
(15, '免费会员', 'ROLE_FREE', 'platform', '平台角色,客服默认角色'),
(14, '注册管理员', 'ROLE_ADMIN', 'platform', '平台角色,注册用户默认角色'),
(16, '付费会员', 'ROLE_VIP', 'platform', '平台角色'),
(17, '客服组长', 'ROLE_WORKGROUP_ADMIN', 'workgroup', '管理客服组,具有组内最高权限'),
(19, '访客', 'ROLE_VISITOR', 'platform', '访客'),
(20, '超级管理员', 'ROLE_SUPER', 'platform', '超级管理员,平台最高权限'),
(21, '客服账号', 'ROLE_WORKGROUP_AGENT', 'workgroup', '工作组内客服角色'),
(22, '试用会员', 'ROLE_TRY', 'platform', '试用会员'),
(23, '第三方代理', 'ROLE_PROXY', 'platform', '第三方代理'),
(24, '质检人员', 'ROLE_WORKGROUP_CHECKER', 'workgroup', '质检人员'),
(25, '普通员工', 'ROLE_MEMBER', 'platform', '普通员工:非客服人员'),
(26, '智能客服', 'ROLE_ROBOT', 'workgroup', '智能客服机器人'),
(27, 'IM注册用户', 'ROLE_USER', 'platform', 'IM注册用户');
-- --------------------------------------------------------
--
-- 表的结构 `role_authority`
--
CREATE TABLE `role_authority` (
`role_id` bigint(20) NOT NULL,
`authority_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `role_authority`
--
INSERT INTO `role_authority` (`role_id`, `authority_id`) VALUES
(17, 1),
(17, 2),
(17, 3),
(17, 4),
(21, 1);
-- --------------------------------------------------------
--
-- 表的结构 `setting`
--
CREATE TABLE `setting` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`is_web_notification` bit(1) DEFAULT NULL,
`score` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `statistic`
--
CREATE TABLE `statistic` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`on_date` datetime DEFAULT NULL,
`users_id` bigint(20) DEFAULT NULL,
`accept_queue_rate` double DEFAULT NULL,
`current_thread_count` int(11) DEFAULT NULL,
`leave_queue_count` int(11) DEFAULT NULL,
`on_hour` int(11) DEFAULT NULL,
`online_agent_count` int(11) DEFAULT NULL,
`queuing_count` int(11) DEFAULT NULL,
`rate_rate` double DEFAULT NULL,
`satisfy_rate` double DEFAULT NULL,
`total_thread_count` int(11) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`average_leave_queue_length` double DEFAULT NULL,
`average_queue_time_length` double DEFAULT NULL,
`max_queue_time_length` bigint(20) DEFAULT NULL,
`rate_count` int(11) DEFAULT NULL,
`satisfy_count` int(11) DEFAULT NULL,
`total_queue_count` int(11) DEFAULT NULL,
`accept_count_gt5m` double DEFAULT NULL,
`accept_count_lt1m` double DEFAULT NULL,
`accept_count_lt3m` double DEFAULT NULL,
`accept_count_lt5m` double DEFAULT NULL,
`accept_queue_count` double DEFAULT NULL,
`accept_rate_gt5m` double DEFAULT NULL,
`accept_rate_lt1m` double DEFAULT NULL,
`accept_rate_lt5m` double DEFAULT NULL,
`accept_rate_lt3m` double DEFAULT NULL,
`leave_queue_rate` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `statistic`
--
INSERT INTO `statistic` (`id`, `created_at`, `updated_at`, `on_date`, `users_id`, `accept_queue_rate`, `current_thread_count`, `leave_queue_count`, `on_hour`, `online_agent_count`, `queuing_count`, `rate_rate`, `satisfy_rate`, `total_thread_count`, `by_type`, `average_leave_queue_length`, `average_queue_time_length`, `max_queue_time_length`, `rate_count`, `satisfy_count`, `total_queue_count`, `accept_count_gt5m`, `accept_count_lt1m`, `accept_count_lt3m`, `accept_count_lt5m`, `accept_queue_count`, `accept_rate_gt5m`, `accept_rate_lt1m`, `accept_rate_lt5m`, `accept_rate_lt3m`, `leave_queue_rate`) VALUES
(855922, '2019-03-09 04:00:00', '2019-03-09 04:00:00', '2019-03-08 00:00:00', 15, 0, 1, 0, 18, 1, 0, 0, 0, 0, 'hour', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
-- --------------------------------------------------------
--
-- 表的结构 `statistic_detail`
--
CREATE TABLE `statistic_detail` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`accept_rate_gt5m` double DEFAULT NULL,
`accept_rate_lt1m` double DEFAULT NULL,
`accept_rate_lt3m` double DEFAULT NULL,
`accept_rate_lt5m` double DEFAULT NULL,
`agent_message_count` int(11) DEFAULT NULL,
`agent_word_count` int(11) DEFAULT NULL,
`answer_question_rate` double DEFAULT NULL,
`average_init_response_length` int(11) DEFAULT NULL,
`average_response_time_length` int(11) DEFAULT NULL,
`average_time_length` int(11) DEFAULT NULL,
`on_date` datetime DEFAULT NULL,
`dimension_type` varchar(255) DEFAULT NULL,
`on_hour` int(11) DEFAULT NULL,
`long_thread_count` int(11) DEFAULT NULL,
`max_current_count` int(11) DEFAULT NULL,
`response_rate_lt30s` double DEFAULT NULL,
`slow_response_count` int(11) DEFAULT NULL,
`solve_once_rate` double DEFAULT NULL,
`time_type` varchar(255) DEFAULT NULL,
`total_message_count` int(11) DEFAULT NULL,
`visitor_message_count` int(11) DEFAULT NULL,
`users_id` bigint(20) DEFAULT NULL,
`accept_count_gt5m` int(11) DEFAULT NULL,
`accept_count_lt1m` int(11) DEFAULT NULL,
`accept_count_lt3m` int(11) DEFAULT NULL,
`accept_count_lt5m` int(11) DEFAULT NULL,
`response_count_lt30s` int(11) DEFAULT NULL,
`agent_thread_count` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `status`
--
CREATE TABLE `status` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`client` varchar(255) DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`session_id` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `subscribe`
--
CREATE TABLE `subscribe` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`leaved` tinyint(1) DEFAULT '0',
`thread_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `synonyms`
--
CREATE TABLE `synonyms` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`standard` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`is_synonym` bit(1) DEFAULT NULL,
`sid` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `synonyms_related`
--
CREATE TABLE `synonyms_related` (
`standard_id` bigint(20) NOT NULL,
`synonym_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `taboo`
--
CREATE TABLE `taboo` (
`id` bigint(20) NOT NULL COMMENT '主键,自动生成',
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`standard` varchar(255) DEFAULT NULL COMMENT '标准词',
`is_synonym` tinyint(1) DEFAULT NULL COMMENT '是否同义词',
`tid` varchar(100) NOT NULL COMMENT '唯一标识',
`users_id` bigint(20) NOT NULL COMMENT '创建人'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `taboo_related`
--
CREATE TABLE `taboo_related` (
`standard_id` bigint(20) NOT NULL COMMENT '主键,自动生成',
`taboo_id` bigint(20) NOT NULL COMMENT '主键,自动生成'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `tag`
--
CREATE TABLE `tag` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`text` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`name` varchar(255) DEFAULT NULL,
`is_robot` bit(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `template`
--
CREATE TABLE `template` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `thread`
--
CREATE TABLE `thread` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`closed_at` datetime DEFAULT NULL,
`content` varchar(255) DEFAULT NULL,
`started_at` datetime DEFAULT NULL,
`timestamp` datetime DEFAULT NULL,
`unread_count` int(11) DEFAULT NULL,
`queue_id` bigint(20) DEFAULT NULL,
`workgroup_id` bigint(20) DEFAULT NULL,
`is_closed` bit(1) DEFAULT NULL,
`visitor_id` bigint(20) DEFAULT NULL,
`session_id` varchar(255) DEFAULT NULL,
`agent_id` bigint(20) DEFAULT NULL,
`is_auto_close` bit(1) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`is_current` tinyint(1) DEFAULT '0',
`token` varchar(255) DEFAULT NULL,
`contact_id` bigint(20) DEFAULT NULL,
`group_id` bigint(20) DEFAULT NULL,
`tid` varchar(255) NOT NULL,
`is_appointed` bit(1) DEFAULT NULL,
`is_rated` bit(1) DEFAULT NULL,
`close_type` varchar(255) DEFAULT NULL,
`client` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `thread_agent`
--
CREATE TABLE `thread_agent` (
`thread_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `thread_deleted`
--
CREATE TABLE `thread_deleted` (
`thread_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `thread_disturb`
--
CREATE TABLE `thread_disturb` (
`thread_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `thread_top`
--
CREATE TABLE `thread_top` (
`thread_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `thread_unread`
--
CREATE TABLE `thread_unread` (
`thread_id` bigint(20) NOT NULL,
`users_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- 表的结构 `transfer`
--
CREATE TABLE `transfer` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`is_accepted` tinyint(1) DEFAULT '0',
`actioned_at` datetime DEFAULT NULL,
`from_client` varchar(255) DEFAULT NULL,
`t_tid` varchar(255) NOT NULL,
`to_client` varchar(255) DEFAULT NULL,
`from_user_id` bigint(20) DEFAULT NULL,
`thread_id` bigint(20) DEFAULT NULL,
`to_user_id` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `url`
--
CREATE TABLE `url` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`title` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`description` longtext,
`keywords` longtext
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `users`
--
CREATE TABLE `users` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`avatar` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`is_enabled` bit(1) NOT NULL,
`mobile` varchar(255) DEFAULT NULL,
`nickname` varchar(255) DEFAULT NULL,
`passwords` varchar(255) DEFAULT NULL,
`username` varchar(255) DEFAULT NULL,
`real_name` varchar(255) DEFAULT NULL,
`sub_domain` varchar(255) DEFAULT NULL,
`company` varchar(255) DEFAULT NULL,
`client` varchar(255) DEFAULT NULL,
`max_thread_count` int(11) DEFAULT '10',
`users_id` bigint(20) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`uuid` varchar(255) DEFAULT NULL,
`is_deleted` tinyint(1) DEFAULT '0',
`is_robot` tinyint(1) DEFAULT '0',
`welcome_tip` varchar(255) DEFAULT NULL,
`is_auto_reply` tinyint(1) DEFAULT '0',
`auto_reply_content` varchar(255) DEFAULT NULL,
`accept_status` varchar(255) DEFAULT NULL,
`connection_status` varchar(255) DEFAULT NULL,
`im_status` varchar(255) DEFAULT NULL,
`device_token` varchar(255) DEFAULT NULL,
`num` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `users`
--
INSERT INTO `users` (`id`, `created_at`, `updated_at`, `avatar`, `email`, `is_enabled`, `mobile`, `nickname`, `passwords`, `username`, `real_name`, `sub_domain`, `company`, `client`, `max_thread_count`, `users_id`, `description`, `uuid`, `is_deleted`, `is_robot`, `welcome_tip`, `is_auto_reply`, `auto_reply_content`, `accept_status`, `connection_status`, `im_status`, `device_token`, `num`) VALUES
(15, '2018-07-13 12:04:38', '2019-03-09 04:55:20', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', '270580156@qq.com', b'1', '13311156272', '客服001', '$2a$10$E3v2k1L.32GQQXo18M5SSudEXzX349qcxkuQ6vT2aqPoKl8noTAJu', '270580156@qq.com', '超级管理员', 'vip', NULL, NULL, 1, NULL, '个性签名1', '201808221551193', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'online', 'disconnected', NULL, NULL, NULL),
(19, '2018-07-18 00:00:00', '2018-07-18 00:00:00', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', 'bytedesk_notification@bytedesk.com', b'1', '13311158888', '系统通知', '0', 'bytedesk_notification', '系统通知', 'vip', 'bytedesk', '', 10, NULL, NULL, '201808221551195', 0, 0, NULL, 0, '无自动回复', NULL, NULL, NULL, NULL, NULL),
(36242, '2018-07-31 16:41:21', '2019-01-20 10:11:18', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/chrome_default_avatar.png', '201807311641201@bytedesk.com', b'1', NULL, '201807311641201', '$2a$10$NYSoWk3AWfqbN75MHXOGTOvbCb1SNqUAenT5Igi5UJ7ivsfeR7NxG', '201807311641201', NULL, 'vip', NULL, 'web', 10, NULL, NULL, '201808221551196', 0, 0, NULL, 0, '无自动回复', NULL, 'disconnected', NULL, NULL, NULL),
(169128, '2018-08-15 16:55:57', '2019-03-08 05:38:33', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', '123456@qq.com', b'1', NULL, '小王', '$2a$10$lJ/qT.Hxzwt5HnDmP1DAzOxzdfTH77cSnASRGRjPIgghOrySt0ZRu', 'test2@vip', '王晓晓', 'vip', NULL, NULL, 1, 15, '个性签名', '201808221551197', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'online', 'disconnected', NULL, NULL, NULL),
(161435, '2018-08-10 15:41:20', '2019-03-09 02:53:05', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', '123456@aa.com', b'1', NULL, '小例子2', '$2a$10$tcqye4afuSwIk8TDSR8Qxe7TrIks1E5/KEJzlaKi8v8zqzs5ZYzty', 'test1@vip', '李大大', 'vip', NULL, NULL, 9, 15, '个性签名', '201808221551198', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'online', 'disconnected', NULL, NULL, NULL),
(169157, '2018-08-15 17:37:33', '2019-03-04 17:39:52', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', '123456@qq.com', b'1', NULL, '小张', '$2a$10$QDmZJadaTaOHKV7N6YVnruaUQgEnFAWJ3hv07C81OWKnSIiDuZAIK', 'test3@vip', '张小小', 'vip', NULL, NULL, 9, 15, '个性签名', '201808221551199', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'logout', 'disconnected', NULL, NULL, NULL),
(194669, '2018-09-19 23:35:03', '2018-09-19 23:35:03', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/agent_default_avatar.png', '201809192335036@bytedesk.com', b'1', NULL, '智能客服', '201809192335036', '201809192335036', '智能客服', '335031', NULL, NULL, 10, 194665, '智能客服描述', '201809192335035', 0, 1, '您好,我是智能助理,请问有什么可以帮您的?', 0, '无自动回复', NULL, NULL, NULL, NULL, NULL),
(194670, '2018-09-19 23:35:03', '2018-09-20 07:16:49', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/agent_default_avatar.png', '201809192335037@bytedesk.com', b'1', NULL, '小薇', '201809192335037', '201809192335037@vip', '智能客服', 'vip', NULL, NULL, 10, 15, '智能客服描述', '201809192335038', 0, 1, 'Hello,欢迎来到大学长,我是智能学长小助手,请输入您的问题哦。', 0, '无自动回复', NULL, NULL, NULL, NULL, NULL),
(402937, '2018-10-20 17:58:13', '2019-01-13 22:09:28', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', NULL, b'1', NULL, '白玉红', '$2a$10$NAPYxhZTzW0zAi4FVGbcRuVc21M7Oks8xnBrLXqtv/X9gRUjgkR0S', '10984@vip', '白玉红', 'vip', NULL, NULL, 10, 15, '个性签名', '201810201758122', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'logout', 'disconnected', NULL, NULL, NULL),
(402938, '2018-10-20 17:58:13', '2018-12-07 12:34:58', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', NULL, b'1', NULL, '马萧瑶', '$2a$10$Jf9Yq7zwv.Q7d5EVBzh/P.HTHySy44HD5D32r5UhPbrkA8X/s2Af2', '210303@vip', '马萧瑶', 'vip', NULL, NULL, 10, 15, '个性签名', '201810201758123', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'online', 'disconnected', NULL, NULL, NULL),
(402939, '2018-10-20 17:58:13', '2018-10-20 17:58:13', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', NULL, b'1', NULL, '申辰', '$2a$10$izqYxiZ1PhXE.mnQhT1Za.z1LY4UfLV3YjtGhxzU2wagY72w1wO3i', '10375@vip', '申辰', 'vip', NULL, NULL, 10, 15, '个性签名', '201810201758124', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', NULL, NULL, NULL, NULL, NULL),
(402940, '2018-10-20 17:58:14', '2019-01-05 17:22:06', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', NULL, b'1', NULL, '李妍', '$2a$10$FaCtcYv1rVnJsRUBdXBDjOZKSdLVrS/JStC0h4W3D3u6Cbpto7HT.', '10910@vip', '李妍', 'vip', NULL, NULL, 10, 15, '个性签名', '201810201758125', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'logout', 'disconnected', NULL, NULL, NULL),
(402941, '2018-10-20 17:58:14', '2019-02-22 19:53:17', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', NULL, b'1', NULL, '李益', '$2a$10$5HWR7TkLRSO6MW8YEoCZs.DeYUUmsTa3xH/FxnWTYvynca1Uxj3DS', '11301@vip', '李益', 'vip', NULL, NULL, 10, 15, '个性签名', '201810201758126', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'logout', 'disconnected', NULL, NULL, NULL),
(402942, '2018-10-20 17:58:14', '2019-01-03 16:06:31', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/admin_default_avatar.png', NULL, b'1', NULL, '李靓竹', '$2a$10$Oh7H6SU/l9yMpby6v0LwCO9tv6CzsbzZBsfngJkqZdVmVNpRbXTI2', '11815@vip', '李靓竹', 'vip', NULL, NULL, 1, 15, '个性签名', '201810201758131', 0, 0, '您好,有什么可以帮您的?', 0, '无自动回复', 'logout', 'disconnected', NULL, NULL, NULL);
-- --------------------------------------------------------
--
-- 表的结构 `users_authority`
--
CREATE TABLE `users_authority` (
`users_id` bigint(20) NOT NULL,
`authority_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `users_follow`
--
CREATE TABLE `users_follow` (
`users_id` bigint(20) NOT NULL,
`follow_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `users_follow`
--
INSERT INTO `users_follow` (`users_id`, `follow_id`) VALUES
(402937, 161435),
(161435, 402937);
-- --------------------------------------------------------
--
-- 表的结构 `users_robot`
--
CREATE TABLE `users_robot` (
`users_id` bigint(20) NOT NULL,
`robot_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `users_robot`
--
INSERT INTO `users_robot` (`users_id`, `robot_id`) VALUES
(15, 194670),
(194395, 194399),
(194630, 194634),
(194642, 194646),
(194665, 194669),
(362757, 362761),
(826098, 826102),
(826116, 826120),
(826122, 826126),
(834086, 834090),
(839320, 839324),
(839334, 839338),
(854807, 854811);
-- --------------------------------------------------------
--
-- 表的结构 `users_role`
--
CREATE TABLE `users_role` (
`users_id` bigint(20) NOT NULL,
`role_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `users_role`
--
INSERT INTO `users_role` (`users_id`, `role_id`) VALUES
(6, 15),
(15, 14),
(15, 20),
(161413, 15),
(161413, 21),
(161435, 17),
(169128, 21),
(169157, 17),
(194353, 14),
(194353, 17),
(194364, 14),
(194364, 17),
(194370, 14),
(194370, 17),
(194377, 14),
(194377, 17),
(194389, 14),
(194389, 17),
(194665, 14),
(194665, 22),
(194669, 26),
(194670, 26),
(402937, 21),
(402938, 21),
(402939, 21),
(402940, 21),
(402941, 21),
(402942, 21);
-- --------------------------------------------------------
--
-- 表的结构 `users_tag`
--
CREATE TABLE `users_tag` (
`users_id` bigint(20) NOT NULL,
`tag_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `validations`
--
CREATE TABLE `validations` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`status` varchar(255) DEFAULT NULL,
`by_type` varchar(255) DEFAULT NULL,
`uuid` varchar(255) DEFAULT NULL,
`is_valid` bit(1) DEFAULT NULL,
`message` varchar(255) DEFAULT NULL,
`note` varchar(255) DEFAULT NULL,
`end_date` datetime DEFAULT NULL,
`start_date` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `validations`
--
INSERT INTO `validations` (`id`, `created_at`, `updated_at`, `status`, `by_type`, `uuid`, `is_valid`, `message`, `note`, `end_date`, `start_date`) VALUES
(1, '2018-10-18 00:00:00', '2018-10-18 00:00:00', 'normal', 'server', 'daxuezhang', b'1', '验证失败,请联系管理员', '私有部署用户', '2018-10-18 00:00:00', '2018-10-18 00:00:00');
-- --------------------------------------------------------
--
-- 表的结构 `wechat`
--
CREATE TABLE `wechat` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`aes_key` varchar(255) DEFAULT NULL,
`alias` varchar(255) DEFAULT NULL,
`app_id` varchar(255) DEFAULT NULL,
`app_secret` varchar(255) DEFAULT NULL,
`authorization_code` varchar(255) DEFAULT NULL,
`authorization_code_expired` varchar(255) DEFAULT NULL,
`authorize` bit(1) DEFAULT NULL,
`authorizer_access_token` varchar(255) DEFAULT NULL,
`authorizer_app_id` varchar(255) DEFAULT NULL,
`authorizer_refresh_token` varchar(255) DEFAULT NULL,
`business_info_open_card` int(11) DEFAULT NULL,
`business_info_open_pay` int(11) DEFAULT NULL,
`business_info_open_scan` int(11) DEFAULT NULL,
`business_info_open_shake` int(11) DEFAULT NULL,
`business_info_open_store` int(11) DEFAULT NULL,
`category` varchar(255) DEFAULT NULL,
`company` varchar(255) DEFAULT NULL,
`data_type` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`encode_type` varchar(255) DEFAULT NULL,
`expires_in` int(11) DEFAULT NULL,
`head_img` varchar(255) DEFAULT NULL,
`is_mini_program` bit(1) DEFAULT NULL,
`nick_name` varchar(255) DEFAULT NULL,
`original_id` varchar(255) DEFAULT NULL,
`principal_name` varchar(255) DEFAULT NULL,
`qrcode_url` varchar(255) DEFAULT NULL,
`service_type_info` int(11) DEFAULT NULL,
`signature` varchar(255) DEFAULT NULL,
`token` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`user_name` varchar(255) DEFAULT NULL,
`verify_type_info` int(11) DEFAULT NULL,
`wid` varchar(255) NOT NULL,
`mini_program_info_id` bigint(20) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`workgroup_id` bigint(20) DEFAULT NULL,
`wx_number` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `wechat`
--
INSERT INTO `wechat` (`id`, `created_at`, `updated_at`, `aes_key`, `alias`, `app_id`, `app_secret`, `authorization_code`, `authorization_code_expired`, `authorize`, `authorizer_access_token`, `authorizer_app_id`, `authorizer_refresh_token`, `business_info_open_card`, `business_info_open_pay`, `business_info_open_scan`, `business_info_open_shake`, `business_info_open_store`, `category`, `company`, `data_type`, `description`, `encode_type`, `expires_in`, `head_img`, `is_mini_program`, `nick_name`, `original_id`, `principal_name`, `qrcode_url`, `service_type_info`, `signature`, `token`, `url`, `user_name`, `verify_type_info`, `wid`, `mini_program_info_id`, `users_id`, `workgroup_id`, `wx_number`) VALUES
(556334, '2018-10-29 16:32:22', '2018-12-16 17:14:43', 'OadnyZnUEPiscOA4DsjCSCW4TY4uJQ3zj3aSB2XKDVg', NULL, 'wx89711c5fd9910289', '834605c44811aed6c6878608f45c7dc2', NULL, NULL, b'0', '16_SdJPASUTbHYe2UuDmf_2KrCkv-hS0JlIGKjv7f_A4FQT9hi8UpbvBx7u16AogZYNG4PgrbovXdM9QsorKtav6l85pr8rAdmdhApQfU0-MCq2nE1fbtllPI53tHdaqHz5lZklXnpyFg8OepL6HBPbAIAPJX', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '北京微语天下科技有限公司', NULL, '移动终端在线客服,app在线客服,提供SDK和客户端', '3', 0, NULL, b'0', '吾协', NULL, NULL, NULL, NULL, NULL, '201810291632211', 'https://wechat.bytedesk.com/wechat/mp/push/201810291632211', 'gh_93a8091893ed', NULL, '201810291632211', NULL, 15, 17, 'appkefu'),
(562614, '2018-10-29 23:02:00', '2018-10-29 23:02:00', 'YLOfuQ2DfNTx58PqdJoO4cceZOeT8Dv1NYBoZ1ftSjJ', NULL, 'wxaa30599823640966', 'ccfe985bb0150527df87874ab0a34c70', NULL, NULL, b'0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '北京微语天下科技有限公司', '2', '全渠道智能云客服手机客服端', '3', 0, NULL, b'1', '吾协', NULL, NULL, NULL, NULL, NULL, '201810292301591', 'https://wechat.bytedesk.com/wechat/mini/push/201810292301591', 'gh_a2745083632e', NULL, '201810292301592', NULL, 15, 17, NULL);
-- --------------------------------------------------------
--
-- 表的结构 `wechat_funcinfo`
--
CREATE TABLE `wechat_funcinfo` (
`wechat_id` bigint(20) NOT NULL,
`funcinfo_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `wechat_menu`
--
CREATE TABLE `wechat_menu` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`app_id` varchar(255) DEFAULT NULL,
`content` varchar(255) DEFAULT NULL,
`my_key` varchar(255) DEFAULT NULL,
`media_id` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`page_path` varchar(255) DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
`status` int(11) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`by_type` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `wechat_userinfo`
--
CREATE TABLE `wechat_userinfo` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`city` varchar(255) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`groupid` varchar(255) DEFAULT NULL,
`headimgurl` varchar(255) DEFAULT NULL,
`language` varchar(255) DEFAULT NULL,
`nickname` varchar(255) DEFAULT NULL,
`openid` varchar(255) DEFAULT NULL,
`province` varchar(255) DEFAULT NULL,
`remark` varchar(255) DEFAULT NULL,
`sex` bit(1) DEFAULT NULL,
`subscribe` bit(1) DEFAULT NULL,
`subscribe_time` time DEFAULT NULL,
`unionid` varchar(255) DEFAULT NULL,
`users_id` bigint(20) NOT NULL,
`wechat_id` bigint(20) NOT NULL,
`group_id` int(11) DEFAULT NULL,
`head_img_url` varchar(255) DEFAULT NULL,
`union_id` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `wechat_usertag`
--
CREATE TABLE `wechat_usertag` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`count` int(11) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`tag_id` int(11) DEFAULT NULL,
`wechat_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- 表的结构 `workgroup`
--
CREATE TABLE `workgroup` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`accept_tip` varchar(255) DEFAULT NULL,
`avatar` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`nickname` varchar(255) DEFAULT NULL,
`offline_tip` varchar(255) DEFAULT NULL,
`route_type` varchar(255) DEFAULT NULL,
`welcome_tip` varchar(255) DEFAULT NULL,
`users_id` bigint(20) DEFAULT NULL,
`is_default_robot` tinyint(1) DEFAULT '0',
`is_force_rate` tinyint(1) DEFAULT '0',
`is_offline_robot` tinyint(1) DEFAULT '0',
`wid` varchar(255) NOT NULL,
`non_working_time_tip` varchar(255) DEFAULT NULL,
`is_default` tinyint(1) DEFAULT '0',
`is_department` bit(1) DEFAULT NULL,
`about` varchar(255) DEFAULT NULL,
`slogan` longtext,
`company_id` bigint(20) DEFAULT NULL,
`on_duty_workgroup_id` bigint(20) DEFAULT NULL,
`questionnaire_id` bigint(20) DEFAULT NULL,
`is_auto_pop` tinyint(1) DEFAULT '0',
`pop_after_time_length` int(11) DEFAULT '10',
`auto_close_tip` varchar(255) DEFAULT NULL,
`close_tip` varchar(255) DEFAULT NULL,
`admin_id` bigint(20) DEFAULT NULL,
`max_queue_count` int(11) DEFAULT NULL,
`max_queue_count_exceed_tip` varchar(255) DEFAULT NULL,
`max_queue_second` int(11) DEFAULT NULL,
`max_queue_second_exceed_tip` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `workgroup`
--
INSERT INTO `workgroup` (`id`, `created_at`, `updated_at`, `accept_tip`, `avatar`, `description`, `nickname`, `offline_tip`, `route_type`, `welcome_tip`, `users_id`, `is_default_robot`, `is_force_rate`, `is_offline_robot`, `wid`, `non_working_time_tip`, `is_default`, `is_department`, `about`, `slogan`, `company_id`, `on_duty_workgroup_id`, `questionnaire_id`, `is_auto_pop`, `pop_after_time_length`, `auto_close_tip`, `close_tip`, `admin_id`, `max_queue_count`, `max_queue_count_exceed_tip`, `max_queue_second`, `max_queue_second_exceed_tip`) VALUES
(17, '2018-07-13 12:04:38', '2019-02-18 22:17:12', '您好,有什么可以帮您的?', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/workgroup_default_avatar.png', '这是一个默认工作组,系统自动生成', '萝卜丝', '当前无客服在线,请自助查询或留言', 'robin', '您好,请稍候,客服将很快为您服务', 15, 0, 0, 0, '201807171659201', '非工作时间提示语', 1, b'0', NULL, NULL, NULL, NULL, NULL, 0, 10, NULL, NULL, 15, 10, '人工繁忙,请稍后再试', 60, '很抱歉,目前人工服务全忙,小M尽快为您转接。如需自助服务请回复序号,退出排队后继续向小M提问:[1]继续等待 [2]退出排队'),
(161483, '2018-08-10 18:19:30', '2019-02-24 03:00:46', '您好有什么可以帮您的?', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/workgroup_default_avatar.png', '这是一个默认工作组,系统自动生成', '售前', '当前客服不在线,请留言', 'robin', '正在为您分配客服,请稍后', 15, 0, 0, 0, '201808101819291', '非工作时间提示语', 0, b'0', NULL, NULL, NULL, 17, 1, 0, 10, NULL, NULL, 169128, 10, '人工繁忙,请稍后再试', 60, '很抱歉,目前人工服务全忙,小M尽快为您转接。如需自助服务请回复序号,退出排队后继续向小M提问:[1]继续等待 [2]退出排队'),
(187513, '2018-09-06 17:16:23', '2019-01-01 11:30:56', '您好有什么可以帮您的?12', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/workgroup_default_avatar.png', '这是一个默认工作组,系统自动生成', '链雪', '当前客服不在线,请留言12', 'robin', '正在为您分配客服,请稍后12', 15, 0, 0, 0, '201809061716221', '当前非工作时间,请自助查询或留言', 0, b'0', NULL, NULL, NULL, 17, NULL, 0, 10, NULL, NULL, 161435, 10, '人工繁忙,请稍后再试', 60, '很抱歉,目前人工服务全忙,小M尽快为您转接。如需自助服务请回复序号,退出排队后继续向小M提问:[1]继续等待 [2]退出排队'),
(402935, '2018-10-20 17:58:13', '2019-02-24 01:46:19', '您好,有什么可以帮您的?', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/workgroup_default_avatar.png', '这是一个默认工作组,系统自动生成', '北京-澳大利亚', '当前无客服在线,请自助查询或留言', 'robin', '您好,请稍候,客服将很快为您服务', 15, 0, 0, 0, '201810201758121', '当前非工作时间,请自助查询或留言', 0, b'0', '关于我们', '全心全意为您服务', 216819, NULL, NULL, 0, 10, '长时间没有对话,系统自动关闭会话', '客服关闭会话', 402941, 10, '人工繁忙,请稍后再试', 60, '很抱歉,目前人工服务全忙,小M尽快为您转接。如需自助服务请回复序号,退出排队后继续向小M提问:[1]继续等待 [2]退出排队'),
(402953, '2018-10-20 17:58:15', '2019-02-24 01:46:14', '您好,有什么可以帮您的?', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/workgroup_default_avatar.png', '这是一个默认工作组,系统自动生成', '北京-新西兰', '当前无客服在线,请自助查询或留言', 'robin', '您好,请稍候,客服将很快为您服务', 15, 0, 0, 0, '201810201758144', '当前非工作时间,请自助查询或留言', 0, b'0', '关于我们', '全心全意为您服务', 216819, 17, NULL, 0, 10, '长时间没有对话,系统自动关闭会话', '客服关闭会话', 402939, 10, '人工繁忙,请稍后再试', 60, '很抱歉,目前人工服务全忙,小M尽快为您转接。如需自助服务请回复序号,退出排队后继续向小M提问:[1]继续等待 [2]退出排队'),
(402960, '2018-10-20 17:58:16', '2019-02-24 01:45:57', '您好,有什么可以帮您的?', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/workgroup_default_avatar.png', '这是一个默认工作组,系统自动生成', '北京-加拿大', '当前无客服在线,请自助查询或留言', 'robin', '您好,请稍候,客服将很快为您服务', 15, 0, 0, 0, '201810201758151', '当前非工作时间,请自助查询或留言', 0, b'0', '关于我们', '全心全意为您服务', 216819, 17, NULL, 0, 10, '长时间没有对话,系统自动关闭会话', '客服关闭会话', 402938, 10, '人工繁忙,请稍后再试', 60, '很抱歉,目前人工服务全忙,小M尽快为您转接。如需自助服务请回复序号,退出排队后继续向小M提问:[1]继续等待 [2]退出排队'),
(799261, '2018-12-20 00:05:36', '2019-01-01 11:26:46', '您好有什么可以帮您的?', 'https://chainsnow.oss-cn-shenzhen.aliyuncs.com/avatars/workgroup_default_avatar.png', '这是一个默认工作组,系统自动生成', '测试工作组', '当前客服不在线,请留言', 'robin', '正在为您分配客服,请稍后', 15, 0, 0, 0, '201812200005351', '当前非工作时间,请自助查询或留言', 0, b'0', '关于我们', '全心全意为您服务', NULL, 17, NULL, 0, 10, '长时间没有对话,系统自动关闭会话', '客服关闭会话', 169128, 10, '人工繁忙,请稍后再试', 60, '很抱歉,目前人工服务全忙,小M尽快为您转接。如需自助服务请回复序号,退出排队后继续向小M提问:[1]继续等待 [2]退出排队');
-- --------------------------------------------------------
--
-- 表的结构 `workgroup_app`
--
CREATE TABLE `workgroup_app` (
`workgroup_id` bigint(20) NOT NULL,
`app_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `workgroup_app`
--
INSERT INTO `workgroup_app` (`workgroup_id`, `app_id`) VALUES
(161483, 16),
(187513, 16),
(799261, 16);
-- --------------------------------------------------------
--
-- 表的结构 `workgroup_users`
--
CREATE TABLE `workgroup_users` (
`users_id` bigint(20) NOT NULL,
`workgroup_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `workgroup_users`
--
INSERT INTO `workgroup_users` (`users_id`, `workgroup_id`) VALUES
(15, 17),
(15, 161483),
(15, 187513),
(15, 402983),
(161435, 17),
(161435, 161483),
(161435, 187513),
(169128, 17),
(169128, 161483),
(169128, 187513),
(169128, 799261),
(169157, 17),
(169157, 187513),
(194670, 187513),
(402937, 402960),
(402938, 402960),
(402939, 402953),
(402939, 799261),
(402940, 402953),
(402941, 402935),
(402942, 402935);
-- --------------------------------------------------------
--
-- 表的结构 `workgroup_worktime`
--
CREATE TABLE `workgroup_worktime` (
`workgroup_id` bigint(20) NOT NULL,
`worktime_id` bigint(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `workgroup_worktime`
--
INSERT INTO `workgroup_worktime` (`workgroup_id`, `worktime_id`) VALUES
(17, 849861),
(161483, 851794),
(187513, 826661),
(194667, 194668),
(402935, 851778),
(402953, 851777),
(402960, 851776),
(799261, 826653),
(826100, 826101),
(826118, 826119),
(826124, 826125),
(834088, 834089),
(839322, 839323),
(839336, 839337),
(854809, 854810);
-- --------------------------------------------------------
--
-- 表的结构 `work_time`
--
CREATE TABLE `work_time` (
`id` bigint(20) NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`end_time` time DEFAULT NULL,
`start_time` time DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- 转存表中的数据 `work_time`
--
INSERT INTO `work_time` (`id`, `created_at`, `updated_at`, `end_time`, `start_time`) VALUES
(1, '2018-07-27 00:00:00', '2018-07-27 00:00:00', '23:59:59', '00:00:00'),
(161485, '2018-08-10 18:19:30', '2018-08-10 18:19:30', '23:59:59', '00:00:00'),
(161484, '2018-08-10 18:19:30', '2018-08-10 18:19:30', '23:59:59', '00:00:00'),
(187514, '2018-09-06 17:16:23', '2018-09-06 17:16:23', '23:59:59', '00:00:00'),
(187550, '2018-09-06 17:23:27', '2018-09-06 17:23:27', '23:59:59', '00:00:00'),
(187551, '2018-09-06 17:23:27', '2018-09-06 17:23:27', '23:59:59', '00:00:00'),
(187630, '2018-09-06 19:38:51', '2018-09-06 19:38:51', '23:59:59', '00:00:00'),
(187631, '2018-09-06 19:39:07', '2018-09-06 19:39:07', '23:59:59', '00:00:00'),
(187632, '2018-09-06 19:40:23', '2018-09-06 19:40:23', '23:59:59', '00:00:00'),
(187633, '2018-09-06 19:40:23', '2018-09-06 19:40:23', '23:59:59', '00:00:00'),
(187634, '2018-09-06 19:41:34', '2018-09-06 19:41:34', '23:59:59', '00:00:00'),
(187635, '2018-09-06 19:41:34', '2018-09-06 19:41:34', '23:59:59', '00:00:00'),
(187636, '2018-09-06 19:41:45', '2018-09-06 19:41:45', '23:59:59', '00:00:00'),
(187637, '2018-09-06 19:41:45', '2018-09-06 19:41:45', '23:59:59', '00:00:00'),
(187638, '2018-09-06 19:42:19', '2018-09-06 19:42:19', '23:59:59', '00:00:00'),
(187639, '2018-09-06 19:42:19', '2018-09-06 19:42:19', '23:59:59', '00:00:00'),
(187640, '2018-09-06 19:42:19', '2018-09-06 19:42:19', '23:59:59', '00:00:00'),
(187641, '2018-09-06 19:42:33', '2018-09-06 19:42:33', '23:59:59', '00:00:00'),
(187642, '2018-09-06 19:42:33', '2018-09-06 19:42:33', '23:59:59', '00:00:00'),
(194356, '2018-09-19 17:00:11', '2018-09-19 17:00:11', '23:59:59', '00:00:00'),
(194367, '2018-09-19 17:38:05', '2018-09-19 17:38:05', '23:59:59', '00:00:00'),
(194373, '2018-09-19 17:43:59', '2018-09-19 17:43:59', '23:59:59', '00:00:00'),
(194380, '2018-09-19 17:53:01', '2018-09-19 17:53:01', '23:59:59', '00:00:00'),
(194392, '2018-09-19 18:07:01', '2018-09-19 18:07:01', '23:59:59', '00:00:00'),
(194398, '2018-09-19 18:15:26', '2018-09-19 18:15:26', '23:59:59', '00:00:00'),
(194633, '2018-09-19 23:17:32', '2018-09-19 23:17:32', '23:59:59', '00:00:00'),
(194645, '2018-09-19 23:23:02', '2018-09-19 23:23:02', '23:59:59', '00:00:00'),
(194668, '2018-09-19 23:35:03', '2018-09-19 23:35:03', '23:59:59', '00:00:00'),
(402961, '2018-10-20 17:58:16', '2018-10-20 17:58:16', '23:59:59', '00:00:00'),
(402954, '2018-10-20 17:58:15', '2018-10-20 17:58:15', '23:59:59', '00:00:00'),
(402936, '2018-10-20 17:58:13', '2018-10-20 17:58:13', '23:59:59', '00:00:00'),
(799262, '2018-12-20 00:05:36', '2018-12-20 00:05:36', '11:30:00', '08:30:00'),
(824705, '2018-12-26 16:38:01', '2018-12-26 16:38:01', '11:30:00', '08:30:00'),
(824706, '2018-12-26 16:38:11', '2018-12-26 16:38:11', '23:59:59', '00:00:00'),
(824707, '2018-12-26 16:38:18', '2018-12-26 16:38:18', '23:59:59', '00:00:00'),
(824708, '2018-12-26 16:38:32', '2018-12-26 16:38:32', '23:59:59', '00:00:00'),
(824709, '2018-12-26 16:38:38', '2018-12-26 16:38:38', '23:59:59', '00:00:00'),
(824710, '2018-12-26 16:38:41', '2018-12-26 16:38:41', '23:59:59', '00:00:00'),
(824711, '2018-12-26 16:38:45', '2018-12-26 16:38:45', '23:59:59', '00:00:00'),
(824763, '2018-12-26 17:28:00', '2018-12-26 17:28:00', '11:30:00', '08:30:00'),
(824775, '2018-12-26 17:31:27', '2018-12-26 17:31:27', '23:59:59', '00:00:00'),
(826101, '2018-12-30 19:54:17', '2018-12-30 19:54:17', '23:59:59', '00:54:17'),
(826119, '2018-12-30 20:00:01', '2018-12-30 20:00:01', '23:59:59', '00:00:01'),
(826125, '2018-12-30 20:04:00', '2018-12-30 20:04:00', '23:59:59', '00:03:59'),
(826629, '2019-01-01 10:56:28', '2019-01-01 10:56:28', '23:59:59', '00:00:00'),
(826646, '2019-01-01 11:08:56', '2019-01-01 11:08:56', '11:30:00', '08:30:00'),
(826647, '2019-01-01 11:14:27', '2019-01-01 11:14:27', '11:30:00', '08:30:00'),
(826648, '2019-01-01 11:23:06', '2019-01-01 11:23:06', '11:30:00', '08:30:00'),
(826649, '2019-01-01 11:23:15', '2019-01-01 11:23:15', '11:30:00', '08:30:00'),
(826650, '2019-01-01 11:23:28', '2019-01-01 11:23:28', '23:59:59', '00:00:00'),
(826651, '2019-01-01 11:24:23', '2019-01-01 11:24:23', '11:30:00', '08:30:00'),
(826653, '2019-01-01 11:26:46', '2019-01-01 11:26:46', '11:30:00', '08:30:00'),
(826654, '2019-01-01 11:27:25', '2019-01-01 11:27:25', '23:59:59', '00:00:00'),
(826655, '2019-01-01 11:27:35', '2019-01-01 11:27:35', '23:59:59', '00:00:00'),
(826656, '2019-01-01 11:27:40', '2019-01-01 11:27:40', '23:59:59', '00:00:00'),
(826658, '2019-01-01 11:28:10', '2019-01-01 11:28:10', '11:30:00', '08:30:00'),
(826660, '2019-01-01 11:30:51', '2019-01-01 11:30:51', '23:59:59', '00:00:00'),
(826661, '2019-01-01 11:30:56', '2019-01-01 11:30:56', '23:59:59', '00:00:00'),
(826662, '2019-01-01 11:31:00', '2019-01-01 11:31:00', '23:59:59', '00:00:00'),
(826663, '2019-01-01 11:31:05', '2019-01-01 11:31:05', '23:59:59', '00:00:00'),
(826664, '2019-01-01 11:31:09', '2019-01-01 11:31:09', '23:59:59', '00:00:00'),
(826666, '2019-01-01 11:31:54', '2019-01-01 11:31:54', '11:30:00', '08:30:00'),
(826749, '2019-01-01 14:39:52', '2019-01-01 14:39:52', '11:30:00', '08:30:00'),
(826761, '2019-01-01 14:55:21', '2019-01-01 14:55:21', '11:30:00', '08:30:00'),
(826760, '2019-01-01 14:55:12', '2019-01-01 14:55:12', '11:30:00', '08:30:00'),
(826793, '2019-01-01 15:42:45', '2019-01-01 15:42:45', '11:30:00', '08:30:00'),
(827245, '2019-01-03 15:44:50', '2019-01-03 15:44:50', '23:59:59', '00:00:00'),
(831685, '2019-01-03 21:45:21', '2019-01-03 21:45:21', '23:59:59', '00:00:00'),
(834089, '2019-01-09 22:41:40', '2019-01-09 22:41:40', '23:59:59', '00:41:40'),
(839323, '2019-01-24 03:12:27', '2019-01-24 03:12:27', '09:59:59', '10:12:26'),
(839337, '2019-01-24 03:23:50', '2019-01-24 03:23:50', '09:59:59', '10:23:50'),
(849861, '2019-02-18 22:17:12', '2019-02-18 22:17:12', '06:59:59', '19:00:00'),
(850560, '2019-02-20 00:13:58', '2019-02-20 00:13:58', '04:59:59', '23:59:59'),
(851463, '2019-02-22 08:49:49', '2019-02-22 08:49:49', '09:59:59', '17:59:59'),
(851776, '2019-02-24 01:45:57', '2019-02-24 01:45:57', '06:59:59', '18:00:00'),
(851777, '2019-02-24 01:46:14', '2019-02-24 01:46:14', '06:59:59', '18:00:00'),
(851778, '2019-02-24 01:46:19', '2019-02-24 01:46:19', '09:59:59', '17:59:59'),
(851793, '2019-02-24 03:00:34', '2019-02-24 03:00:34', '23:59:59', '00:00:00'),
(851794, '2019-02-24 03:00:46', '2019-02-24 03:00:46', '23:59:59', '00:00:00'),
(854810, '2019-03-04 18:20:19', '2019-03-04 18:20:19', '09:59:59', '10:20:19');
--
-- 转储表的索引
--
--
-- 表的索引 `answer`
--
ALTER TABLE `answer`
ADD PRIMARY KEY (`id`),
ADD KEY `FKnmuoaicd084dw0peu780q2p9n` (`users_id`),
ADD KEY `FKe6w78io8diu625m36dmdp81vh` (`workgroup_id`);
--
-- 表的索引 `answer_category`
--
ALTER TABLE `answer_category`
ADD PRIMARY KEY (`answer_id`,`category_id`),
ADD KEY `FKhs18hmc6o51jwwe9nj4fusxdn` (`category_id`);
--
-- 表的索引 `answer_query`
--
ALTER TABLE `answer_query`
ADD PRIMARY KEY (`id`),
ADD KEY `FK79ifnhjv36uc8dgtrm74t5hrg` (`answer_id`),
ADD KEY `FKip913h5jl18ufns3bq7ufed8j` (`users_id`);
--
-- 表的索引 `answer_rate`
--
ALTER TABLE `answer_rate`
ADD PRIMARY KEY (`id`),
ADD KEY `FK5t88masgcn3u99gd39rchl69j` (`answer_id`),
ADD KEY `FK4e0slrnfa56eyd7eaaivcnjdc` (`message_id`),
ADD KEY `FKmv0khpm6thy5hleulbxfcco8x` (`users_id`);
--
-- 表的索引 `answer_related`
--
ALTER TABLE `answer_related`
ADD PRIMARY KEY (`answer_id`,`related_id`),
ADD KEY `FKqc9b5ycrl8e7w3edab1a9md8o` (`related_id`);
--
-- 表的索引 `app`
--
ALTER TABLE `app`
ADD PRIMARY KEY (`id`),
ADD KEY `FKpmajekr3d4un6x04ggbllfgol` (`users_id`);
--
-- 表的索引 `article`
--
ALTER TABLE `article`
ADD PRIMARY KEY (`id`),
ADD KEY `FK6qwjxued33ulih2djfjep0hva` (`users_id`);
--
-- 表的索引 `article_category`
--
ALTER TABLE `article_category`
ADD PRIMARY KEY (`article_id`,`category_id`),
ADD KEY `FK855bhtvb75kxl2e0nmf2sd7la` (`category_id`);
--
-- 表的索引 `article_keyword`
--
ALTER TABLE `article_keyword`
ADD PRIMARY KEY (`article_id`,`tag_id`),
ADD KEY `FK67kpfpu491k0wxihn298i5g6o` (`tag_id`);
--
-- 表的索引 `article_rate`
--
ALTER TABLE `article_rate`
ADD PRIMARY KEY (`id`),
ADD KEY `FKtnptrewjgcr6j7ichxuvci9c0` (`users_id`),
ADD KEY `FKel9hff2fly9w96pevb258trh5` (`article_id`);
--
-- 表的索引 `article_read`
--
ALTER TABLE `article_read`
ADD PRIMARY KEY (`id`),
ADD KEY `FKjyio3xyuvnperjigxyjynexgm` (`users_id`),
ADD KEY `FKftik528br89od1cpbhxrai38p` (`article_id`);
--
-- 表的索引 `authority`
--
ALTER TABLE `authority`
ADD PRIMARY KEY (`id`);
--
-- 表的索引 `block`
--
ALTER TABLE `block`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_7mf3un935du6542wch08p42pr` (`bid`),
ADD KEY `FKkwtg59orv2tbwct5cl83ia37c` (`blocked_user_id`),
ADD KEY `FKoyl2k03ss2jw0kk6wnsunuhth` (`users_id`);
--
-- 表的索引 `browse`
--
ALTER TABLE `browse`
ADD PRIMARY KEY (`id`),
ADD KEY `FKegpmixvpoggfgqrh88fcxwbta` (`visitor_id`),
ADD KEY `FK9mtm1ehh25qwdo4a5m5vnthvw` (`workgroup_id`),
ADD KEY `FKe3xuj3m46pmlfeu9ywqx43o9s` (`referrer_id`),
ADD KEY `FKr2w4n8sop4jkdhlig8kk46bja` (`url_id`);
--
-- 表的索引 `browse_invite`
--
ALTER TABLE `browse_invite`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_nudgiehal443c42gwet8r69ag` (`b_iid`),
ADD KEY `FKpnnwnhbw9umsoo3lkoepvcn6m` (`workgroup_id`),
ADD KEY `FK1vfmx54gmi5na68aj5v5em22f` (`browse_id`),
ADD KEY `FK8w7ho6knxcg70h301bttldll8` (`from_user_id`),
ADD KEY `FK23eio2ha3velpj0r2503cx64g` (`to_user_id`);
--
-- 表的索引 `category`
--
ALTER TABLE `category`
ADD PRIMARY KEY (`id`),
ADD KEY `FKpidjslvlcnjcj75t9lg7rm3nf` (`users_id`),
ADD KEY `FKap0cnk1255oj4bwam7in1hxxv` (`category_id`);
--
-- 表的索引 `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_5990k858oecspewp6xcbvv6xa` (`cid`),
ADD KEY `FKt55y2infwbbw3o942o2mhm0v4` (`users_id`),
ADD KEY `FKnwlc4xv9fm2swgesuas3uf3mo` (`article_id`),
ADD KEY `FKbqnvawwwv4gtlctsi3o7vs131` (`post_id`);
--
-- 表的索引 `company`
--
ALTER TABLE `company`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_p2lqb3288a46snm17w40lale` (`cid`),
ADD KEY `FKrkiogbcxxodv9h7r4yh50p674` (`users_id`);
--
-- 表的索引 `company_region`
--
ALTER TABLE `company_region`
ADD PRIMARY KEY (`company_id`,`region_id`),
ADD KEY `FK49ccp5h5mv4dp9svoeihwncng` (`region_id`);
--
-- 表的索引 `country`
--
ALTER TABLE `country`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_fijsnq7n1da00wfh3p85vf58s` (`cid`);
--
-- 表的索引 `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_1leedcwx9wcy3lk8rwo7n0pyh` (`cid`);
--
-- 表的索引 `cuw`
--
ALTER TABLE `cuw`
ADD PRIMARY KEY (`id`),
ADD KEY `FKtdqh8y9xbve7aggpt6phsdlhu` (`users_id`),
ADD KEY `FKd4e9btd6y5tc5o0fu00k1wji1` (`category_id`);
--
-- 表的索引 `department`
--
ALTER TABLE `department`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_36n1ji2jshj6nnyllhnda2dok` (`did`),
ADD KEY `FK30uqp70migimv1t29d0io3x5c` (`users_id`),
ADD KEY `FKh1m88q0f7sc0mk76kju4kcn6f` (`company_id`),
ADD KEY `FKfocjcc3h9f6kip2xk3wid89ce` (`department_id`);
--
-- 表的索引 `feedback`
--
ALTER TABLE `feedback`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_i6lte3tlwxcvlsranr1qop6mo` (`fid`),
ADD KEY `FK5kvmyu6eito8t2p9mk15xhmak` (`users_id`),
ADD KEY `FKcpx660msvmy16ht6dnvrtudbh` (`visitor_id`);
--
-- 表的索引 `fingerprint`
--
ALTER TABLE `fingerprint`
ADD PRIMARY KEY (`id`),
ADD KEY `FK1kmxgugco9h0ystff7mdk2big` (`users_id`);
--
-- 表的索引 `func_info`
--
ALTER TABLE `func_info`
ADD PRIMARY KEY (`id`);
--
-- 表的索引 `groups`
--
ALTER TABLE `groups`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_j0lyw3unt51fpx04lhsfq4jmx` (`gid`),
ADD KEY `FKm2v0pc8an83n8g3d2513ejyn0` (`users_id`);
--
-- 表的索引 `groups_admin`
--
ALTER TABLE `groups_admin`
ADD PRIMARY KEY (`groups_id`,`users_id`),
ADD KEY `FK4fn94ooa51o9fwd3wrucw6wn` (`users_id`);
--
-- 表的索引 `groups_detail`
--
ALTER TABLE `groups_detail`
ADD PRIMARY KEY (`id`),
ADD KEY `FKqm12i7h3f81xaqo4rx9em8v7b` (`groups_id`),
ADD KEY `FKt8qs4g9inlvpedt7e39r2tfhd` (`users_id`);
--
-- 表的索引 `groups_member`
--
ALTER TABLE `groups_member`
ADD PRIMARY KEY (`groups_id`,`users_id`),
ADD KEY `FKfqck0mq6ohpcw4pqiquptpx0u` (`users_id`);
--
-- 表的索引 `groups_muted`
--
ALTER TABLE `groups_muted`
ADD PRIMARY KEY (`groups_id`,`users_id`);
--
-- 表的索引 `invite`
--
ALTER TABLE `invite`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_9wmo4jd73bui0bbhhr3cmxwlq` (`t_iid`),
ADD KEY `FKp3wxvvtr3ofdxe1jm8x5ro83e` (`from_user_id`),
ADD KEY `FKk1p9cx2f2ky7yph1hxqxp9y4i` (`group_id`),
ADD KEY `FKp4mft3ydkinipit1bbn7vib0c` (`thread_id`),
ADD KEY `FKiemup544a6brhk5w2tfi1cilh` (`to_user_id`);
--
-- 表的索引 `ip`
--
ALTER TABLE `ip`
ADD PRIMARY KEY (`id`);
--
-- 表的索引 `leave_message`
--
ALTER TABLE `leave_message`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_20xb1a6o9ewy2lmbdrxddivf4` (`lid`),
ADD KEY `FKsibna01kcx1v3si8v5gfa792f` (`agent_id`),
ADD KEY `FKni2mm092la467sdrlvqqohvi` (`users_id`),
ADD KEY `FKnogt4o20nbb60n1bpnb3mgpdl` (`visitor_id`),
ADD KEY `FKe2lukj5wh2u2llfkpfgfhnvil` (`work_group_id`);
--
-- 表的索引 `message`
--
ALTER TABLE `message`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_n9e3t0yc6t4i4bher7htdxjwi` (`mid`),
ADD KEY `FKcwsjctg2caabo17bol1qv7iff` (`company_id`),
ADD KEY `FKat33lwutdphmv4jpmg2b8a10r` (`questionnaire_id`),
ADD KEY `FKg84ick4co3doh4bj85etwchy7` (`queue_id`),
ADD KEY `FK8gpbwekbva6ty81i7o4ccf1en` (`users_id`),
ADD KEY `FKng9f5tmplkvofk6x34knntjqs` (`thread_id`);
--
-- 表的索引 `message_answer`
--
ALTER TABLE `message_answer`
ADD PRIMARY KEY (`message_id`,`answer_id`),
ADD KEY `FKb3b5hqjisti91mv1lq8qqtco` (`answer_id`);
--
-- 表的索引 `message_deleted`
--
ALTER TABLE `message_deleted`
ADD PRIMARY KEY (`message_id`,`users_id`);
--
-- 表的索引 `message_status`
--
ALTER TABLE `message_status`
ADD PRIMARY KEY (`id`),
ADD KEY `FKqboxuo620r6qmh6ds85x5bt3l` (`message_id`),
ADD KEY `FKi3ngkv4cwkyytelu5ydwqydg` (`users_id`);
--
-- 表的索引 `message_workgroup`
--
ALTER TABLE `message_workgroup`
ADD PRIMARY KEY (`message_id`,`workgroup_id`),
ADD KEY `FKlxkwawefnpvrs2e94cgp1g83w` (`workgroup_id`);
--
-- 表的索引 `mini_program_info`
--
ALTER TABLE `mini_program_info`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_sf1rw338c9v12jl31dggx2mol` (`wid`),
ADD KEY `FK4pqoqeu5qal1tw054voip9rem` (`wechat_id`);
--
-- 表的索引 `monitor`
--
ALTER TABLE `monitor`
ADD PRIMARY KEY (`id`);
--
-- 表的索引 `notice`
--
ALTER TABLE `notice`
ADD PRIMARY KEY (`id`),
ADD KEY `FK30ik8roar52falaln0333i1wr` (`users_id`),
ADD KEY `FKbp7suppae78bj405wshkmw6e2` (`group_id`);
--
-- 表的索引 `notice_reader`
--
ALTER TABLE `notice_reader`
ADD PRIMARY KEY (`notice_id`,`users_id`),
ADD KEY `FKj6ft7fvx7as82jm17vu5u7v1d` (`users_id`);
--
-- 表的索引 `notice_users`
--
ALTER TABLE `notice_users`
ADD PRIMARY KEY (`notice_id`,`users_id`),
ADD KEY `FK2fk34oph284hwrg6h4l131d9u` (`users_id`);
--
-- 表的索引 `oauth_client_details`
--
ALTER TABLE `oauth_client_details`
ADD PRIMARY KEY (`client_id`);
--
-- 表的索引 `payment`
--
ALTER TABLE `payment`
ADD PRIMARY KEY (`id`),
ADD KEY `FKpxjvbghn15fxqirhheghgoxd7` (`users_id`);
--
-- 表的索引 `pay_feature`
--
ALTER TABLE `pay_feature`
ADD PRIMARY KEY (`id`),
ADD KEY `FKg3jakdl9x1l0135noavbokl69` (`users_id`);
--
-- 表的索引 `post`
--
ALTER TABLE `post`
ADD PRIMARY KEY (`id`),
ADD KEY `FK654j7e05utx6icpfaoqxrdds2` (`users_id`);
--
-- 表的索引 `post_category`
--
ALTER TABLE `post_category`
ADD PRIMARY KEY (`post_id`,`category_id`),
ADD KEY `FKqly0d5oc4npxdig2fjfoshhxg` (`category_id`);
--
-- 表的索引 `post_keyword`
--
ALTER TABLE `post_keyword`
ADD PRIMARY KEY (`post_id`,`tag_id`),
ADD KEY `FK6cj15behpd08v49ec97kvbq2b` (`tag_id`);
--
-- 表的索引 `questionnaire`
--
ALTER TABLE `questionnaire`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_16kct2qahck34j9jild7xwl1t` (`qid`),
ADD KEY `FKqi7qymksrf2il89xda147fv4s` (`users_id`);
--
-- 表的索引 `questionnaire_answer`
--
ALTER TABLE `questionnaire_answer`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_b9sw7ht6kr27q03i079ierqvm` (`qid`),
ADD KEY `FK4y5t6vy7mmh5cs7ax28m61agw` (`users_id`),
ADD KEY `FK12792158wcx9ufw8w8831bdbv` (`questionnaire_item_id`),
ADD KEY `FK4b8n7q6uyyi4pbqjfae4ta6wc` (`questionnaire_item_item_id`);
--
-- 表的索引 `questionnaire_answer_item`
--
ALTER TABLE `questionnaire_answer_item`
ADD PRIMARY KEY (`questionnaire_answer_id`,`questionnaire_item_item_id`),
ADD KEY `FKh4t3bpsutfnn1lgcwgqgkpqt6` (`questionnaire_item_item_id`);
--
-- 表的索引 `questionnaire_item`
--
ALTER TABLE `questionnaire_item`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_r9hdtxfldarvklqfy65mf3ll3` (`qid`),
ADD KEY `FKnco08xc354qqmccyd5cuf2iko` (`users_id`),
ADD KEY `FK2g19vhb8269p41wjuad3qk3rc` (`questionnaire_id`);
--
-- 表的索引 `questionnaire_item_item`
--
ALTER TABLE `questionnaire_item_item`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_e6c0hyjyn7axb6r53mpe3gk8n` (`qid`),
ADD KEY `FKqd6t0dsl0ye59yduqwv3o63am` (`users_id`),
ADD KEY `FKt9ai4xb30f93ot3htlq5wt7iw` (`questionnaire_item_id`);
--
-- 表的索引 `queue`
--
ALTER TABLE `queue`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_9t8jd4xkb5llex88uxgegmnrp` (`qid`),
ADD KEY `FKlttgrci2dkmxifi41tipbkora` (`agent_id`),
ADD KEY `FKfvuopclw92mffcpgschbl2ewv` (`thread_id`),
ADD KEY `FK6qkcf52dcysbhksuojy9f8uim` (`visitor_id`),
ADD KEY `FKqdd1mj21n1p2f0up8u1a6tlh7` (`workgroup_id`);
--
-- 表的索引 `rate`
--
ALTER TABLE `rate`
ADD PRIMARY KEY (`id`);
--
-- 表的索引 `region`
--
ALTER TABLE `region`
ADD PRIMARY KEY (`id`),
ADD KEY `FK5cgfpq4u2digwkllynq14k7te` (`parent_id`);
--
-- 表的索引 `robot`
--
ALTER TABLE `robot`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_lgb5ms6lfy8ilujwycr6tirwq` (`rid`),
ADD KEY `FKpijgh2dqn8omghdu1w1xan1bm` (`users_id`);
--
-- 表的索引 `role`
--
ALTER TABLE `role`
ADD PRIMARY KEY (`id`);
--
-- 表的索引 `role_authority`
--
ALTER TABLE `role_authority`
ADD PRIMARY KEY (`role_id`,`authority_id`),
ADD KEY `FKqbri833f7xop13bvdje3xxtnw` (`authority_id`);
--
-- 表的索引 `setting`
--
ALTER TABLE `setting`
ADD PRIMARY KEY (`id`),
ADD KEY `FKj0uyxhec59fajg73gx64tchjx` (`users_id`);
--
-- 表的索引 `statistic`
--
ALTER TABLE `statistic`
ADD PRIMARY KEY (`id`),
ADD KEY `FKgjvqgyarnkgeyqdi91a0b9rs3` (`users_id`);
--
-- 表的索引 `statistic_detail`
--
ALTER TABLE `statistic_detail`
ADD PRIMARY KEY (`id`),
ADD KEY `FK2a9xmi0qrhhe1n3r1inmpotkm` (`users_id`);
--
-- 表的索引 `status`
--
ALTER TABLE `status`
ADD PRIMARY KEY (`id`),
ADD KEY `FKihet23wm5mpltxd785ao02ea6` (`users_id`);
--
-- 表的索引 `subscribe`
--
ALTER TABLE `subscribe`
ADD PRIMARY KEY (`id`),
ADD KEY `FK3p60bl7sc74gk0a3vr2s1ylc` (`users_id`),
ADD KEY `FKe1dorf2oobq3wv2o6ec53lhhe` (`thread_id`);
--
-- 表的索引 `synonyms`
--
ALTER TABLE `synonyms`
ADD PRIMARY KEY (`id`),
ADD KEY `FKi5dq76hv7y55mmklycswiroup` (`users_id`);
--
-- 表的索引 `synonyms_related`
--
ALTER TABLE `synonyms_related`
ADD PRIMARY KEY (`standard_id`,`synonym_id`),
ADD KEY `FKoe2l70185homf8kcoe0v2ym5d` (`synonym_id`);
--
-- 表的索引 `taboo`
--
ALTER TABLE `taboo`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_78p6n2v7x520qr9n1ou8i2j3p` (`tid`),
ADD KEY `FKogmvfrt04mitm694qkk929tnx` (`users_id`);
--
-- 表的索引 `taboo_related`
--
ALTER TABLE `taboo_related`
ADD PRIMARY KEY (`standard_id`,`taboo_id`),
ADD KEY `FKjpjaqm1pnoy0cvnkmu9jwkxdm` (`taboo_id`);
--
-- 表的索引 `tag`
--
ALTER TABLE `tag`
ADD PRIMARY KEY (`id`),
ADD KEY `FKlhcrgyk7m8viqioyk5ak0ucs6` (`users_id`);
--
-- 表的索引 `template`
--
ALTER TABLE `template`
ADD PRIMARY KEY (`id`),
ADD KEY `FKh2ojvu7eyrutwafj2rysqqpa6` (`users_id`);
--
-- 表的索引 `thread`
--
ALTER TABLE `thread`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_6ec6jeppmgt33eccso1tgofxf` (`tid`),
ADD KEY `FKkooot5p7uhj9s7c2kx07dl8iw` (`agent_id`),
ADD KEY `FKm1tngych6m09kaa0h3xt2nmri` (`contact_id`),
ADD KEY `FKhmx3jcje168bhgn1vlkkgea3` (`group_id`),
ADD KEY `FK74wwpd6ug7oe80j1wx9y1rbs4` (`queue_id`),
ADD KEY `FKjb85m8ulwls88q6srtgp7irw5` (`workgroup_id`),
ADD KEY `FKhp38ylxtev1m8xpxshlmnjr1w` (`visitor_id`);
--
-- 表的索引 `thread_agent`
--
ALTER TABLE `thread_agent`
ADD PRIMARY KEY (`thread_id`,`users_id`),
ADD KEY `FK19161d6sh2raqitrhblgcdx6m` (`users_id`);
--
-- 表的索引 `thread_deleted`
--
ALTER TABLE `thread_deleted`
ADD PRIMARY KEY (`thread_id`,`users_id`);
--
-- 表的索引 `thread_disturb`
--
ALTER TABLE `thread_disturb`
ADD PRIMARY KEY (`thread_id`,`users_id`);
--
-- 表的索引 `thread_top`
--
ALTER TABLE `thread_top`
ADD PRIMARY KEY (`thread_id`,`users_id`);
--
-- 表的索引 `thread_unread`
--
ALTER TABLE `thread_unread`
ADD PRIMARY KEY (`thread_id`,`users_id`);
--
-- 表的索引 `transfer`
--
ALTER TABLE `transfer`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_jgv1l0t1nyjsih65iaffxc3wn` (`t_tid`),
ADD KEY `FKbchn0ky4cjs70br1w8x4dta08` (`to_user_id`),
ADD KEY `FKkeq6gsav47bsyk9yc1xsjptaq` (`from_user_id`),
ADD KEY `FKhvk5yjlp1sjuesq5gdjvsq37q` (`thread_id`);
--
-- 表的索引 `url`
--
ALTER TABLE `url`
ADD PRIMARY KEY (`id`);
--
-- 表的索引 `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_a7hlm8sj8kmijx6ucp7wfyt31` (`uuid`),
ADD KEY `FK7hg5l7arqs535pitlsyqhccq0` (`users_id`);
--
-- 表的索引 `users_authority`
--
ALTER TABLE `users_authority`
ADD PRIMARY KEY (`users_id`,`authority_id`),
ADD KEY `FKjaiv95no9046qme8nr3us9srp` (`authority_id`);
--
-- 表的索引 `users_follow`
--
ALTER TABLE `users_follow`
ADD PRIMARY KEY (`follow_id`,`users_id`),
ADD KEY `FKfmp8cxycif97gf4fh8sdwwrwg` (`users_id`);
--
-- 表的索引 `users_robot`
--
ALTER TABLE `users_robot`
ADD PRIMARY KEY (`users_id`,`robot_id`),
ADD KEY `FK6f6tjessmrlu5ykspc5cgsx5r` (`robot_id`);
--
-- 表的索引 `users_role`
--
ALTER TABLE `users_role`
ADD PRIMARY KEY (`users_id`,`role_id`),
ADD KEY `FK3qjq7qsiigxa82jgk0i0wuq3g` (`role_id`);
--
-- 表的索引 `users_tag`
--
ALTER TABLE `users_tag`
ADD PRIMARY KEY (`users_id`,`tag_id`),
ADD KEY `FKteunswcqfgao3j07bss3b6hmf` (`tag_id`);
--
-- 表的索引 `validations`
--
ALTER TABLE `validations`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_kgh8tiessj70ivmavx21sslh3` (`uuid`);
--
-- 表的索引 `wechat`
--
ALTER TABLE `wechat`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_7op5ij2ch51ugt9w38g5697og` (`wid`),
ADD KEY `FKm8v0myt7nsi8t6o6f3kfl0h6q` (`users_id`),
ADD KEY `FKqv53nm3hey2n84rdr81vxfv3f` (`workgroup_id`),
ADD KEY `FKn5l2ov807sej02qi4xrtbd22v` (`mini_program_info_id`);
--
-- 表的索引 `wechat_funcinfo`
--
ALTER TABLE `wechat_funcinfo`
ADD PRIMARY KEY (`wechat_id`,`funcinfo_id`),
ADD KEY `FKp9jmt3hex0i3ykf6hm9hfigt4` (`funcinfo_id`);
--
-- 表的索引 `wechat_menu`
--
ALTER TABLE `wechat_menu`
ADD PRIMARY KEY (`id`),
ADD KEY `FKsm0t2nm8ny2xplv3ivwylc0io` (`users_id`);
--
-- 表的索引 `wechat_userinfo`
--
ALTER TABLE `wechat_userinfo`
ADD PRIMARY KEY (`id`),
ADD KEY `FKqtgdp6lx2xtpmaf1kj3r3iun5` (`users_id`),
ADD KEY `FKcg7bmkmnpbdeu8d2jawfkwwt9` (`wechat_id`);
--
-- 表的索引 `wechat_usertag`
--
ALTER TABLE `wechat_usertag`
ADD PRIMARY KEY (`id`),
ADD KEY `FKa49vxeh6ygn3vowhm3sm8g92` (`wechat_id`);
--
-- 表的索引 `workgroup`
--
ALTER TABLE `workgroup`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_22bnbmdf1aopa84ruuofwkpt2` (`wid`),
ADD KEY `FKt78yad8fgq9pydlateoj3ddu8` (`admin_id`),
ADD KEY `FKdtgfhctg1p5tts8t9ptaa9k4b` (`users_id`),
ADD KEY `FKmefksuh61714f5bvh8xksbll` (`company_id`),
ADD KEY `FKhhdcswje5gbj53lrojshs4jfe` (`on_duty_workgroup_id`),
ADD KEY `FKijli71u1xdj4jjatn07uli2o3` (`questionnaire_id`);
--
-- 表的索引 `workgroup_app`
--
ALTER TABLE `workgroup_app`
ADD PRIMARY KEY (`workgroup_id`,`app_id`),
ADD KEY `FK28p3187fuoiyg8uiehglrosdn` (`app_id`);
--
-- 表的索引 `workgroup_users`
--
ALTER TABLE `workgroup_users`
ADD PRIMARY KEY (`users_id`,`workgroup_id`),
ADD KEY `FKbqylj5djqf0oi2yli14bf6ucq` (`workgroup_id`);
--
-- 表的索引 `workgroup_worktime`
--
ALTER TABLE `workgroup_worktime`
ADD PRIMARY KEY (`workgroup_id`,`worktime_id`),
ADD KEY `FK2fc5krjuew7f4g9okerprdach` (`worktime_id`);
--
-- 表的索引 `work_time`
--
ALTER TABLE `work_time`
ADD PRIMARY KEY (`id`);
--
-- 在导出的表使用AUTO_INCREMENT
--
--
-- 使用表AUTO_INCREMENT `app`
--
ALTER TABLE `app`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=854809;
--
-- 使用表AUTO_INCREMENT `authority`
--
ALTER TABLE `authority`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- 使用表AUTO_INCREMENT `category`
--
ALTER TABLE `category`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=843304;
--
-- 使用表AUTO_INCREMENT `message`
--
ALTER TABLE `message`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `pay_feature`
--
ALTER TABLE `pay_feature`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `queue`
--
ALTER TABLE `queue`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=833003;
--
-- 使用表AUTO_INCREMENT `role`
--
ALTER TABLE `role`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- 使用表AUTO_INCREMENT `thread`
--
ALTER TABLE `thread`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
--
-- 使用表AUTO_INCREMENT `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=854812;
--
-- 使用表AUTO_INCREMENT `workgroup`
--
ALTER TABLE `workgroup`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=854810;
--
-- 使用表AUTO_INCREMENT `work_time`
--
ALTER TABLE `work_time`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=854811;
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 */; | the_stack |
-- 2017-09-05T16:57:01.290
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET InternalName='_Rechnungsdisposition', Name='Rechnungsdisposition', WEBUI_NameBrowse='Rechnungsdisposition',Updated=TO_TIMESTAMP('2017-09-05 16:57:01','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=1000104
;
-- 2017-09-05T16:58:58.184
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy,Value) VALUES (0,0,540279,540462,TO_TIMESTAMP('2017-09-05 16:58:58','YYYY-MM-DD HH24:MI:SS'),100,'Y',30,TO_TIMESTAMP('2017-09-05 16:58:58','YYYY-MM-DD HH24:MI:SS'),100,'advanced edit')
;
-- 2017-09-05T16:58:58.185
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section_Trl (AD_Language,AD_UI_Section_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_UI_Section_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_UI_Section t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_UI_Section_ID=540462 AND NOT EXISTS (SELECT 1 FROM AD_UI_Section_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_UI_Section_ID=t.AD_UI_Section_ID)
;
-- 2017-09-05T16:59:00.323
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Column (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,SeqNo,Updated,UpdatedBy) VALUES (0,0,540619,540462,TO_TIMESTAMP('2017-09-05 16:59:00','YYYY-MM-DD HH24:MI:SS'),100,'Y',10,TO_TIMESTAMP('2017-09-05 16:59:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T16:59:12.791
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET AD_UI_Column_ID=540619, SeqNo=10,Updated=TO_TIMESTAMP('2017-09-05 16:59:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540056
;
-- 2017-09-05T17:00:07.653
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,546903,0,540279,540147,548107,TO_TIMESTAMP('2017-09-05 17:00:07','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Mandant',20,0,0,TO_TIMESTAMP('2017-09-05 17:00:07','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:00:58.746
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=60,Updated=TO_TIMESTAMP('2017-09-05 17:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541086
;
-- 2017-09-05T17:00:58.748
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-09-05 17:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541087
;
-- 2017-09-05T17:00:58.749
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-09-05 17:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541089
;
-- 2017-09-05T17:00:58.751
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-09-05 17:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541088
;
-- 2017-09-05T17:00:58.752
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-09-05 17:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541090
;
-- 2017-09-05T17:00:58.753
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=110,Updated=TO_TIMESTAMP('2017-09-05 17:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541084
;
-- 2017-09-05T17:00:58.755
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=120,Updated=TO_TIMESTAMP('2017-09-05 17:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541085
;
-- 2017-09-05T17:00:58.757
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-09-05 17:00:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541953
;
-- 2017-09-05T17:01:50.364
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET WidgetSize='M',Updated=TO_TIMESTAMP('2017-09-05 17:01:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548107
;
-- 2017-09-05T17:39:57.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540045,541086,TO_TIMESTAMP('2017-09-05 17:39:57','YYYY-MM-DD HH24:MI:SS'),100,'Y','quantities',20,TO_TIMESTAMP('2017-09-05 17:39:57','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:40:21.376
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547551,0,540279,541086,548108,TO_TIMESTAMP('2017-09-05 17:40:21','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Beauftragte Menge',10,0,0,TO_TIMESTAMP('2017-09-05 17:40:21','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:41:26.601
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547552,0,540279,541086,548109,TO_TIMESTAMP('2017-09-05 17:41:26','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Gelieferte Menge',20,0,0,TO_TIMESTAMP('2017-09-05 17:41:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:42:01.196
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547554,0,540279,541086,548110,TO_TIMESTAMP('2017-09-05 17:42:01','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Berechnete Menge',30,0,0,TO_TIMESTAMP('2017-09-05 17:42:01','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:43:13.868
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,546908,0,540279,541086,548111,TO_TIMESTAMP('2017-09-05 17:43:13','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zu ber. Menge',40,0,0,TO_TIMESTAMP('2017-09-05 17:43:13','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:44:00.444
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,548190,0,540279,541086,548112,TO_TIMESTAMP('2017-09-05 17:44:00','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Zu ber. Menge abw.',50,0,0,TO_TIMESTAMP('2017-09-05 17:44:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:44:51.815
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_ElementGroup (AD_Client_ID,AD_Org_ID,AD_UI_Column_ID,AD_UI_ElementGroup_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540046,541087,TO_TIMESTAMP('2017-09-05 17:44:51','YYYY-MM-DD HH24:MI:SS'),100,'Y','override',30,TO_TIMESTAMP('2017-09-05 17:44:51','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:45:31.496
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,548973,0,540279,541087,548113,TO_TIMESTAMP('2017-09-05 17:45:31','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Abrechnung ab abw.',10,0,0,TO_TIMESTAMP('2017-09-05 17:45:31','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:46:20.187
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,546912,0,540279,541087,548114,TO_TIMESTAMP('2017-09-05 17:46:20','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Rechnungsstellung',20,0,0,TO_TIMESTAMP('2017-09-05 17:46:20','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:46:46.631
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,548192,0,540279,541087,548115,TO_TIMESTAMP('2017-09-05 17:46:46','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Rechnungsstellung abw.',30,0,0,TO_TIMESTAMP('2017-09-05 17:46:46','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:47:59.361
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541022
;
-- 2017-09-05T17:48:22.273
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541017
;
-- 2017-09-05T17:48:44.954
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541018
;
-- 2017-09-05T17:49:11.285
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_Field_ID=549754, Name='Rechnungsstellung eff.',Updated=TO_TIMESTAMP('2017-09-05 17:49:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548114
;
-- 2017-09-05T17:51:56.936
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547029,0,540279,541086,548116,TO_TIMESTAMP('2017-09-05 17:51:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Preis eff.',60,0,0,TO_TIMESTAMP('2017-09-05 17:51:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:52:12.633
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,552879,0,540279,541086,548117,TO_TIMESTAMP('2017-09-05 17:52:12','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Preis abw.',70,0,0,TO_TIMESTAMP('2017-09-05 17:52:12','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:52:49.986
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547032,0,540279,541086,548118,TO_TIMESTAMP('2017-09-05 17:52:49','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Rabatt %',80,0,0,TO_TIMESTAMP('2017-09-05 17:52:49','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:53:08.385
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,547033,0,540279,541086,548119,TO_TIMESTAMP('2017-09-05 17:53:08','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Rabatt abw. %',90,0,0,TO_TIMESTAMP('2017-09-05 17:53:08','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T17:53:52.812
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541034
;
-- 2017-09-05T17:53:59.893
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541035
;
-- 2017-09-05T17:54:33.707
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_Field_ID=552878, Name='Preis',Updated=TO_TIMESTAMP('2017-09-05 17:54:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541039
;
-- 2017-09-05T17:55:04.634
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541040
;
-- 2017-09-05T17:55:13.996
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541037
;
-- 2017-09-05T17:55:19.320
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541038
;
-- 2017-09-05T17:56:41.474
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET AD_UI_Column_ID=540046, SeqNo=40,Updated=TO_TIMESTAMP('2017-09-05 17:56:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540146
;
-- 2017-09-05T17:57:17.525
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Column WHERE AD_UI_Column_ID=540048
;
-- 2017-09-05T17:57:40.496
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET AD_UI_Column_ID=540619, SeqNo=20,Updated=TO_TIMESTAMP('2017-09-05 17:57:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540059
;
-- 2017-09-05T17:57:44.363
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Column WHERE AD_UI_Column_ID=540047
;
-- 2017-09-05T17:57:49.339
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Section_Trl WHERE AD_UI_Section_ID=540034
;
-- 2017-09-05T17:57:49.341
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Section WHERE AD_UI_Section_ID=540034
;
-- 2017-09-05T17:57:54.258
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Section SET SeqNo=20,Updated=TO_TIMESTAMP('2017-09-05 17:57:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Section_ID=540462
;
-- 2017-09-05T17:58:17.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541087
;
-- 2017-09-05T17:58:17.661
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541088
;
-- 2017-09-05T17:58:17.670
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541089
;
-- 2017-09-05T17:58:17.676
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541090
;
-- 2017-09-05T17:58:21.381
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_ElementGroup WHERE AD_UI_ElementGroup_ID=540059
;
-- 2017-09-05T18:00:06.216
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541087, SeqNo=40,Updated=TO_TIMESTAMP('2017-09-05 18:00:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541949
;
-- 2017-09-05T18:00:14.681
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541087, SeqNo=50,Updated=TO_TIMESTAMP('2017-09-05 18:00:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541950
;
-- 2017-09-05T18:00:20.192
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541087, SeqNo=60,Updated=TO_TIMESTAMP('2017-09-05 18:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541951
;
-- 2017-09-05T18:00:26.153
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET AD_UI_ElementGroup_ID=541087, SeqNo=70,Updated=TO_TIMESTAMP('2017-09-05 18:00:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541952
;
-- 2017-09-05T18:03:28.645
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541049
;
-- 2017-09-05T18:21:22.014
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_UI_Element WHERE AD_UI_Element_ID=541055
;
-- 2017-09-05T18:21:56.849
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,Created,CreatedBy,IsActive,IsAdvancedField,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,554865,0,540279,541087,548120,TO_TIMESTAMP('2017-09-05 18:21:56','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Y','N','N','Total des Auftrags',5,0,0,TO_TIMESTAMP('2017-09-05 18:21:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2017-09-05T18:22:08.721
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=10,Updated=TO_TIMESTAMP('2017-09-05 18:22:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548120
;
-- 2017-09-05T18:22:11.781
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=20,Updated=TO_TIMESTAMP('2017-09-05 18:22:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548113
;
-- 2017-09-05T18:22:15.370
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=30,Updated=TO_TIMESTAMP('2017-09-05 18:22:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548114
;
-- 2017-09-05T18:22:18.333
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=40,Updated=TO_TIMESTAMP('2017-09-05 18:22:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548115
;
-- 2017-09-05T18:22:20.998
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=50,Updated=TO_TIMESTAMP('2017-09-05 18:22:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541949
;
-- 2017-09-05T18:22:23.788
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=60,Updated=TO_TIMESTAMP('2017-09-05 18:22:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541950
;
-- 2017-09-05T18:22:26.875
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=70,Updated=TO_TIMESTAMP('2017-09-05 18:22:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541951
;
-- 2017-09-05T18:22:29.929
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET SeqNo=80,Updated=TO_TIMESTAMP('2017-09-05 18:22:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541952
;
-- 2017-09-05T18:23:24.210
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_ElementGroup SET UIStyle='primary',Updated=TO_TIMESTAMP('2017-09-05 18:23:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_ElementGroup_ID=540056
;
-- 2017-09-05T18:24:34.141
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=70,Updated=TO_TIMESTAMP('2017-09-05 18:24:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548108
;
-- 2017-09-05T18:24:34.146
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=80,Updated=TO_TIMESTAMP('2017-09-05 18:24:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548109
;
-- 2017-09-05T18:24:34.151
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=90,Updated=TO_TIMESTAMP('2017-09-05 18:24:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548110
;
-- 2017-09-05T18:24:34.156
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=100,Updated=TO_TIMESTAMP('2017-09-05 18:24:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548111
;
-- 2017-09-05T18:25:16.692
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=130,Updated=TO_TIMESTAMP('2017-09-05 18:25:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=548120
;
-- 2017-09-05T18:25:16.693
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET IsDisplayedGrid='Y', SeqNoGrid=140,Updated=TO_TIMESTAMP('2017-09-05 18:25:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=541953
; | the_stack |
CREATE USER my_test_user;
GRANT CREATE ON DATABASE contrib_regression TO my_test_user;
SET SESSION AUTHORIZATION my_test_user;
-- table type is only supported in tsql dialect
CREATE TYPE tableType AS table(
a text not null,
b int primary key,
c int);
set babelfishpg_tsql.sql_dialect = 'tsql';
\tsql ON
-- table type supports all CREATE TABLE element lists
CREATE TYPE tableType AS table(
a text not null,
b int primary key,
c int);
GO
-- a table with the same name is created
select * from tableType;
GO
-- create type with same name, should fail
CREATE TYPE tableType as (d int, e int);
GO
-- create table with same name, should succeed
-- TODO: BABEL-689: Postgres doesn't support this yet, because CREATE TABLE will automatically
-- create a composite type as well, which will cause name collision
CREATE TABLE tableType(d int, e int);
GO
-- dropping the table should fail, as it depends on the table type
DROP TABLE tableType;
GO
-- dropping the table type should drop the table as well
DROP TYPE tableType;
GO
SELECT * FROM tableType;
GO
-- creating index (other than primary and unique keys) during table type creation is not
-- yet supported
-- TODO: BABEL-688: fully support TSQL CREATE TABLE syntax
CREATE TYPE tableType AS table(
a text not null,
b int primary key,
c int,
d int index idx1 nonclustered,
index idx2(c),
index idx3(e),
e varchar);
GO
-- test dotted prefixes of the table type name
-- allowed to have one dotted prefix
CREATE TYPE public.tableType AS table(a int, b int);
GO
DROP TYPE public.tableType;
GO
-- not allowed to have more than one dotted prefix
CREATE TYPE postgres.public.tableType AS table(a int, b int);
GO
CREATE TYPE tableType AS table(
a text not null,
b int primary key,
c int);
GO
-- test declaring variables with table type
create procedure table_var_procedure as
begin
declare @a int;
declare @b tableType;
insert into @b values('hello', 4, 100);
select count(*) from @b;
end;
GO
CALL table_var_procedure();
GO
DROP PROCEDURE table_var_procedure;
GO
-- test declaring table variable without table type, and doing DMLs
create procedure table_var_procedure as
begin
declare @tableVar table (a int, b int);
insert into @tableVar values(1, 100);
insert into @tableVar values(2, 200);
update @tableVar set b = 1000 where a = 1;
delete from @tableVar where a = 2;
select * from @tableVar;
end;
GO
CALL table_var_procedure();
GO
DROP PROCEDURE table_var_procedure;
GO
-- test declaring table variable with whitespace before column definition
create procedure table_var_procedure as
begin
declare @tableVar1 table
(a int, b int);
insert into @tableVar1 values(1, 100);
declare @tableVar2 table (c int, d varchar);
insert into @tableVar2 values(1, 'a');
select * from @tableVar1 t1 join @tableVar2 t2 on t1.a = t2.c;
end;
GO
CALL table_var_procedure();
GO
DROP PROCEDURE table_var_procedure;
GO
-- test MERGE on table variables
-- TODO: BABEL-877 Support MERGE
/*
create procedure merge_proc as
begin
declare @tv1 table(a int);
insert into @tv1 values (200);
declare @tv2 table(b int);
insert into @tv2 values (100);
insert into @tv2 values (200);
merge into @tv1 using @tv2 on a=b
when not matched then insert (a) values(b)
when matched then update set a = a + b;
select * from @tv1;
end;
GO
CALL merge_proc();
GO
-- result should have two rows, 400 and 100.
DROP PROCEDURE merge_proc;
GO
*/
-- test declaring a variable whose name is already used - should throw error
create procedure dup_var_name_procedure as
begin
declare @a int;
declare @a tableType;
end;
GO
-- test declaring a variable whose name is already used as table name - should work
create table @test_table (d int);
GO
create procedure dup_var_name_procedure as
begin
declare @test_table tableType;
insert into @test_table values('hello1', 1, 100);
select * from @test_table;
end;
GO
call dup_var_name_procedure();
GO
drop procedure dup_var_name_procedure;
GO
drop table @test_table;
GO
-- test assigning to table variables, should not be allowed
create table test_table(a int, b int);
GO
insert into test_table values(1, 10);
GO
create procedure assign_proc as
begin
declare @tableVar table (a int, b int);
set @tableVar = test_table;
end;
GO
-- test selecting into table variables, should not be allowed
create procedure select_into_proc as
begin
declare @tableVar table (a int, b int);
select * into @tableVar from test_table;
end;
GO
-- test truncating table variables, should not be allowed
create procedure truncate_proc as
begin
declare @tableVar table (a int, b int);
insert into @tableVar values(1, 2);
truncate table @tableVar;
select * from @tableVar;
end;
GO
-- test JOIN on table variables, on both sides
create procedure join_proc1 as
begin
declare @tableVar table (a int, b int, c int);
insert into @tableVar values(1, 2, 3);
select * from test_table t inner join @tableVar tv on t.a = tv.a;
end;
GO
CALL join_proc1();
GO
DROP PROCEDURE join_proc1;
create procedure join_proc2 as
begin
declare @tableVar table (a int, b int, c int);
insert into @tableVar values(1, 2, 3);
select * from @tableVar tv inner join test_table t on tv.a = t.a;
end;
GO
CALL join_proc2();
GO
DROP PROCEDURE join_proc2;
GO
-- test altering table variables, should not be allowed
create procedure alter_proc as
begin
declare @tableVar table (a int);
alter table @tableVar add b int;
select * from @tableVar;
end;
GO
-- test using the same variables as source and target
create procedure source_target_proc as
begin
declare @tv table (a int);
insert into @tv values (1);
insert into @tv select a+1 from @tv;
insert into @tv select a+2 from @tv;
insert into @tv select a+4 from @tv;
select * from @tv;
end;
GO
CALL source_target_proc();
GO
DROP PROCEDURE source_target_proc;
GO
-- test multiple '@' characters in table variable name
-- TODO: BABEL-476 Support variable name with multiple '@' characters
/*
create procedure nameing_proc as
begin
declare @@@tv@1@@@ as table(a int);
insert @@@tv@1@@@ values(1);
select * from @@@tv@1@@@;
end;
GO
CALL naming_proc();
GO
DROP PROCEDURE naming_proc;
GO
*/
-- test nested functions using table variables with the same name, each should
-- have its own variable
create function inner_func() returns int as
begin
declare @result int;
declare @tableVar table (a int);
insert into @tableVar values(1);
select @result = count(*) from @tableVar; -- should be 1
return @result;
end;
GO
create function outer_func() returns int as
begin
declare @result int;
declare @tableVar table(b int);
select @result = count(*) from @tableVar; -- should be 0
select @result = @result + inner_func(); -- should be 0 + 1 = 1
-- the temp table in inner_func() should have been dropped by now, so the
-- next call to inner_func() should still return 1
select @result = @result + inner_func(); -- should be 1 + 1 = 2
return @result;
end;
GO
select outer_func();
GO
DROP FUNCTION outer_func;
GO
-- test calling a function with table variables in a loop, each should have its
-- own variable
create procedure loop_func_proc as
begin
declare @result int;
declare @counter int;
select @result = 0;
set @counter = 1;
while (@counter < 6)
begin
select @result = @result + inner_func(); -- each call to inner_func should return 1
set @counter = @counter + 1;
end
select @result;
end;
GO
call loop_func_proc();
GO
DROP PROCEDURE loop_func_proc;
GO
DROP FUNCTION inner_func;
GO
-- test declaring the same variable in a loop - should not have any error, and
-- should all refer to the same underlying table
create procedure loop_proc as
begin
declare @result int;
declare @curr int;
declare @counter int;
select @result = 0;
set @counter = 1;
while (@counter < 6)
begin
declare @a tableType;
insert into @a values('hello', @counter, 100);
select @curr = count(*) from @a; -- @curr in each loop should be 1,2,3,4,5
select @result = @result + @curr;
set @counter = @counter + 1;
end
select @result;
end;
GO
call loop_proc()
GO
DROP PROCEDURE loop_proc;
GO
-- test using table variables in CTE, both in with clause and in main query
create procedure cte_proc as
begin
declare @tablevar1 tableType;
insert into @tablevar1 values('hello1', 1, 100);
declare @tablevar2 tableType;
insert into @tablevar2 values('hello1', 1, 100);
insert into @tablevar2 values('hello2', 2, 200);
WITH t1 (a) AS (SELECT a FROM @tablevar1) SELECT * FROM @tablevar2 t2 JOIN t1 ON t2.a = t1.a;
end;
GO
call cte_proc()
GO
DROP PROCEDURE cte_proc;
GO
-- BABEL-894: test PLtsql_expr->tsql_tablevars is initialized to NIL so that it
-- won't cause seg faults when looked up during execution. One place missed
-- earlier is when parsing the SET command.
create procedure pl_set_proc as
begin
set datefirst 7;
end;
GO
call pl_set_proc()
GO
DROP PROCEDURE pl_set_proc;
GO
-- test select from multiple table variables
create procedure select_multi_tablevars as
begin
declare @tablevar1 tableType;
insert into @tablevar1 values('hello1', 1, 100);
declare @tablevar2 tableType;
insert into @tablevar2 values('hello1', 1, 100);
insert into @tablevar2 values('hello2', 2, 200);
select * from @tablevar1, @tablevar2;
end;
GO
call select_multi_tablevars()
GO
DROP PROCEDURE select_multi_tablevars;
GO
-- test select from table and table variable
create procedure select_table_tablevar as
begin
declare @tablevar tableType;
insert into @tablevar values('hello1', 1, 100);
select * from test_table, @tablevar;
end;
GO
call select_table_tablevar()
GO
DROP PROCEDURE select_table_tablevar;
GO
-- test table-valued parameters
-- if no READONLY behind table-valued param: report error
create function error_func(@tableVar tableType) returns int as
begin
return 1;
end
GO
-- if READONLY on other param type: report error
create function error_func(@a int, @b int READONLY) returns int as
begin
return 1;
end
GO
-- correct syntax
create function tvp_func(@tableVar tableType READONLY) returns int as
begin
declare @result int;
select @result = count(*) from @tableVar;
return @result;
end
GO
-- test passing in a table variable whose type is different from what the function wants
-- TODO: BABEL-899: error message should be "Operand type clash: table is incompatible with tableType"
create procedure error_proc as
begin
declare @tableVar as table (a text, b int, c int);
insert into @tableVar values('hello1', 1, 100);
select tvp_func(@tableVar);
end;
GO
call error_proc()
GO
DROP PROCEDURE error_proc;
GO
create procedure tvp_proc as
begin
declare @tableVar tableType;
insert into @tablevar values('hello1', 1, 100);
select tvp_func(@tableVar);
end;
GO
call tvp_proc()
GO
DROP PROCEDURE tvp_proc;
GO
DROP FUNCTION tvp_func;
GO
-- test multiple table-valued parameters
CREATE TYPE tableType1 AS table(d int, e int);
GO
create function multi_tvp_func(@tableVar tableType READONLY,
@tableVar1 tableType1 READONLY) returns int as
begin
declare @result int;
select @result = count(*) from @tableVar tv inner join @tableVar1 tv1 on tv.b = tv1.d;
return @result;
end
GO
create procedure multi_tvp_proc as
begin
declare @v1 tableType;
declare @v2 tableType1;
insert into @v1 values('hello1', 1, 100);
insert into @v2 values(1, 100);
insert into @v2 values(2, 200);
select multi_tvp_func(@v1, @v2);
end;
GO
call multi_tvp_proc()
GO
DROP PROCEDURE multi_tvp_proc;
GO
DROP FUNCTION multi_tvp_func;
GO
DROP TYPE tableType1;
GO
-- test multi-statement table-valued functions
create function mstvf(@i int) returns @tableVar table
(
a text not null,
b int primary key,
c int
)
as
begin
insert into @tableVar values('hello1', 1, 100);
insert into @tableVar values('hello2', 2, 200);
end;
GO
select * from mstvf(1);
GO
DROP FUNCTION mstvf;
GO
-- test mstvf whose return table has only one column
create function mstvf_one_col(@i int) returns @tableVar table
(
a text not null
)
as
begin
insert into @tableVar values('hello1');
end;
GO
select * from mstvf_one_col(1);
GO
DROP FUNCTION mstvf_one_col;
GO
-- test mstvf whose return table has only one column
create function mstvf_return(@i int) returns @tableVar table
(
a text not null
)
as
begin
insert into @tableVar values('hello2');
return;
end;
GO
select * from mstvf_return(1);
GO
DROP FUNCTION mstvf_return;
GO
-- test mstvf's with same names in different schemas
create function mstvf_schema(@i int) returns @resultTable table
(
name varchar(128) not null
)
as
begin
insert into @resultTable (name) select 'test_name';
RETURN;
end;
GO
create schema test_schema;
GO
create function test_schema.mstvf_schema(@i int) returns @resultTable table
(
name1 varchar(128) not null
)
as
begin
insert into @resultTable (name1) select 'test_name1';
RETURN;
end;
GO
select * from mstvf_schema(1);
GO
select * from test_schema.mstvf_schema(1);
GO
drop function mstvf_schema;
GO
drop function test_schema.mstvf_schema;
GO
drop schema test_schema;
GO
-- test mstvf with constraints in result table
create function mstvf_constraints(@i int) returns @resultTable table
(
name varchar(128) not null,
unique (name),
id int,
primary key clustered (id)
)
as
begin
insert into @resultTable (name, id) select 'test_name', @i;
RETURN;
end;
GO
select * from mstvf_constraints(1);
GO
drop function mstvf_constraints;
GO
-- cleanup
DROP TYPE tableType;
GO
DROP TABLE test_table;
GO
\tsql OFF
reset babelfishpg_tsql.sql_dialect;
RESET SESSION AUTHORIZATION;
-- if we are able to drop the user, then it means that all the underlying tables
-- of table variables have been dropped because they depend on the user.
REVOKE CREATE ON DATABASE contrib_regression FROM my_test_user;
DROP USER my_test_user; | the_stack |
/*========================================================== 1. 创建数据库 ===========================================================*/
USE [master]
GO
--删除数据库
EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'UtilTest'
GO
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'UtilTest')
Begin
DROP DATABASE [UtilTest]
End
GO
--创建数据库
CREATE DATABASE [UtilTest]
GO
/*========================================================== 2. 创建架构 ===========================================================*/
USE [UtilTest]
GO
/* 1. Sales */
IF EXISTS (SELECT * FROM sys.schemas WHERE name = N'Sales')
DROP SCHEMA [Sales]
GO
CREATE SCHEMA [Sales] AUTHORIZATION [dbo]
GO
/* 2. Productions */
IF EXISTS (SELECT * FROM sys.schemas WHERE name = N'Productions')
DROP SCHEMA [Productions]
GO
CREATE SCHEMA [Productions] AUTHORIZATION [dbo]
GO
/* 3. Customers */
IF EXISTS (SELECT * FROM sys.schemas WHERE name = N'Customers')
DROP SCHEMA [Customers]
GO
CREATE SCHEMA [Customers] AUTHORIZATION [dbo]
GO
/*========================================================== 3. 创建表 ===========================================================*/
if exists (select 1
from sysobjects
where id = object_id('Customers.Customers')
and type = 'U')
drop table Customers.Customers
go
/*==============================================================*/
/* Table: Customers */
/*==============================================================*/
create table Customers.Customers (
CustomerId nvarchar(50) not null,
Name nvarchar(20) not null,
Nickname nvarchar(30) null,
Balance decimal(18,2) not null,
Gender int null,
Tel nvarchar(20) null,
Mobile nvarchar(20) null,
Email nvarchar(100) null,
CreationTime datetime null,
CreatorId uniqueidentifier null,
LastModificationTime datetime null,
LastModifierId uniqueidentifier null,
Version timestamp null,
constraint PK_CUSTOMERS primary key (CustomerId)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('Customers.Customers') and minor_id = 0)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers'
end
execute sp_addextendedproperty 'MS_Description',
'客户',
'schema', 'Customers', 'table', 'Customers'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CustomerId')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'CustomerId'
end
execute sp_addextendedproperty 'MS_Description',
'客户编号',
'schema', 'Customers', 'table', 'Customers', 'column', 'CustomerId'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Name')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'Name'
end
execute sp_addextendedproperty 'MS_Description',
'客户名称',
'schema', 'Customers', 'table', 'Customers', 'column', 'Name'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Nickname')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'Nickname'
end
execute sp_addextendedproperty 'MS_Description',
'昵称',
'schema', 'Customers', 'table', 'Customers', 'column', 'Nickname'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Balance')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'Balance'
end
execute sp_addextendedproperty 'MS_Description',
'余额',
'schema', 'Customers', 'table', 'Customers', 'column', 'Balance'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Gender')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'Gender'
end
execute sp_addextendedproperty 'MS_Description',
'性别',
'schema', 'Customers', 'table', 'Customers', 'column', 'Gender'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Tel')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'Tel'
end
execute sp_addextendedproperty 'MS_Description',
'联系电话',
'schema', 'Customers', 'table', 'Customers', 'column', 'Tel'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Mobile')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'Mobile'
end
execute sp_addextendedproperty 'MS_Description',
'手机号',
'schema', 'Customers', 'table', 'Customers', 'column', 'Mobile'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Email')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'Email'
end
execute sp_addextendedproperty 'MS_Description',
'电子邮件',
'schema', 'Customers', 'table', 'Customers', 'column', 'Email'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CreationTime')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'CreationTime'
end
execute sp_addextendedproperty 'MS_Description',
'创建时间',
'schema', 'Customers', 'table', 'Customers', 'column', 'CreationTime'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'CreatorId')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'CreatorId'
end
execute sp_addextendedproperty 'MS_Description',
'创建人',
'schema', 'Customers', 'table', 'Customers', 'column', 'CreatorId'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LastModificationTime')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'LastModificationTime'
end
execute sp_addextendedproperty 'MS_Description',
'最后修改时间',
'schema', 'Customers', 'table', 'Customers', 'column', 'LastModificationTime'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'LastModifierId')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'LastModifierId'
end
execute sp_addextendedproperty 'MS_Description',
'最后修改人',
'schema', 'Customers', 'table', 'Customers', 'column', 'LastModifierId'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Customers.Customers')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Version')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Customers', 'table', 'Customers', 'column', 'Version'
end
execute sp_addextendedproperty 'MS_Description',
'版本号',
'schema', 'Customers', 'table', 'Customers', 'column', 'Version'
go
if exists (select 1
from sysobjects
where id = object_id('Productions.Products')
and type = 'U')
drop table Productions.Products
go
/*==============================================================*/
/* Table: Products */
/*==============================================================*/
create table Productions.Products (
ProductId int not null,
Code nvarchar(30) not null,
Name nvarchar(200) not null,
Extends nvarchar(max) null,
Price decimal(10,2) null,
IsDeleted bit not null,
Version timestamp null,
constraint PK_PRODUCTS primary key (ProductId)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('Productions.Products') and minor_id = 0)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Productions', 'table', 'Products'
end
execute sp_addextendedproperty 'MS_Description',
'商品',
'schema', 'Productions', 'table', 'Products'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Productions.Products')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ProductId')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Productions', 'table', 'Products', 'column', 'ProductId'
end
execute sp_addextendedproperty 'MS_Description',
'商品编号',
'schema', 'Productions', 'table', 'Products', 'column', 'ProductId'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Productions.Products')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Code')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Productions', 'table', 'Products', 'column', 'Code'
end
execute sp_addextendedproperty 'MS_Description',
'商品编码',
'schema', 'Productions', 'table', 'Products', 'column', 'Code'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Productions.Products')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Name')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Productions', 'table', 'Products', 'column', 'Name'
end
execute sp_addextendedproperty 'MS_Description',
'商品名称',
'schema', 'Productions', 'table', 'Products', 'column', 'Name'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Productions.Products')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Extends')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Productions', 'table', 'Products', 'column', 'Extends'
end
execute sp_addextendedproperty 'MS_Description',
'扩展属性',
'schema', 'Productions', 'table', 'Products', 'column', 'Extends'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Productions.Products')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Price')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Productions', 'table', 'Products', 'column', 'Price'
end
execute sp_addextendedproperty 'MS_Description',
'价格',
'schema', 'Productions', 'table', 'Products', 'column', 'Price'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Productions.Products')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'IsDeleted')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Productions', 'table', 'Products', 'column', 'IsDeleted'
end
execute sp_addextendedproperty 'MS_Description',
'是否删除',
'schema', 'Productions', 'table', 'Products', 'column', 'IsDeleted'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Productions.Products')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Version')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Productions', 'table', 'Products', 'column', 'Version'
end
execute sp_addextendedproperty 'MS_Description',
'版本号',
'schema', 'Productions', 'table', 'Products', 'column', 'Version'
go
if exists (select 1
from sysobjects
where id = object_id('Sales.Orders')
and type = 'U')
drop table Sales.Orders
go
/*==============================================================*/
/* Table: Orders */
/*==============================================================*/
create table Sales.Orders (
OrderId uniqueidentifier not null,
Code nvarchar(30) not null,
Name nvarchar(200) not null,
Version timestamp null,
constraint PK_ORDERS primary key (OrderId)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('Sales.Orders') and minor_id = 0)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'Orders'
end
execute sp_addextendedproperty 'MS_Description',
'订单',
'schema', 'Sales', 'table', 'Orders'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.Orders')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OrderId')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'Orders', 'column', 'OrderId'
end
execute sp_addextendedproperty 'MS_Description',
'订单编号',
'schema', 'Sales', 'table', 'Orders', 'column', 'OrderId'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.Orders')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Code')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'Orders', 'column', 'Code'
end
execute sp_addextendedproperty 'MS_Description',
'订单编码',
'schema', 'Sales', 'table', 'Orders', 'column', 'Code'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.Orders')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Name')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'Orders', 'column', 'Name'
end
execute sp_addextendedproperty 'MS_Description',
'订单名称',
'schema', 'Sales', 'table', 'Orders', 'column', 'Name'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.Orders')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Version')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'Orders', 'column', 'Version'
end
execute sp_addextendedproperty 'MS_Description',
'版本号',
'schema', 'Sales', 'table', 'Orders', 'column', 'Version'
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('Sales.OrderItems') and o.name = 'FK_ORDERITE_REFERENCE_PRODUCTS')
alter table Sales.OrderItems
drop constraint FK_ORDERITE_REFERENCE_PRODUCTS
go
if exists (select 1
from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = 'F')
where r.fkeyid = object_id('Sales.OrderItems') and o.name = 'FK_ORDERITE_REFERENCE_ORDERS')
alter table Sales.OrderItems
drop constraint FK_ORDERITE_REFERENCE_ORDERS
go
if exists (select 1
from sysobjects
where id = object_id('Sales.OrderItems')
and type = 'U')
drop table Sales.OrderItems
go
/*==============================================================*/
/* Table: OrderItems */
/*==============================================================*/
create table Sales.OrderItems (
OrderItemId uniqueidentifier not null,
OrderId uniqueidentifier not null,
ProductId int not null,
ProductName nvarchar(200) not null,
Quantity int not null,
Price decimal(10,2) not null,
constraint PK_ORDERITEMS primary key (OrderItemId)
)
go
if exists (select 1 from sys.extended_properties
where major_id = object_id('Sales.OrderItems') and minor_id = 0)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'OrderItems'
end
execute sp_addextendedproperty 'MS_Description',
'订单明细',
'schema', 'Sales', 'table', 'OrderItems'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.OrderItems')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OrderItemId')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'OrderItemId'
end
execute sp_addextendedproperty 'MS_Description',
'订单明细编号',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'OrderItemId'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.OrderItems')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'OrderId')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'OrderId'
end
execute sp_addextendedproperty 'MS_Description',
'订单编号',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'OrderId'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.OrderItems')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ProductId')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'ProductId'
end
execute sp_addextendedproperty 'MS_Description',
'商品编号',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'ProductId'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.OrderItems')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'ProductName')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'ProductName'
end
execute sp_addextendedproperty 'MS_Description',
'商品名称',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'ProductName'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.OrderItems')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Quantity')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'Quantity'
end
execute sp_addextendedproperty 'MS_Description',
'数量',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'Quantity'
go
if exists(select 1 from sys.extended_properties p where
p.major_id = object_id('Sales.OrderItems')
and p.minor_id = (select c.column_id from sys.columns c where c.object_id = p.major_id and c.name = 'Price')
)
begin
execute sp_dropextendedproperty 'MS_Description',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'Price'
end
execute sp_addextendedproperty 'MS_Description',
'单价',
'schema', 'Sales', 'table', 'OrderItems', 'column', 'Price'
go
alter table Sales.OrderItems
add constraint FK_ORDERITE_REFERENCE_PRODUCTS foreign key (ProductId)
references Productions.Products (ProductId)
go
alter table Sales.OrderItems
add constraint FK_ORDERITE_REFERENCE_ORDERS foreign key (OrderId)
references Sales.Orders (OrderId)
go | the_stack |
--
-- XDBPM_constants should be created under XDBPM
--
alter session set current_schema = XDBPM
/
create or replace package XDBPM_USERNAME
as
function GET_USERNAME return VARCHAR2 deterministic;
end;
/
show errors
/
create or replace synonym XDB_USERNAME for XDBPM_USERNAME
/
grant execute on XDBPM_USERNAME to public
/
create or replace package body XDBPM_USERNAME
as
function GET_USERNAME return VARCHAR2 deterministic
as
begin
if (USER = 'ANONYMOUS') then
return sys_context('USERENV','CURRENT_SCHEMA');
else
return USER;
end if;
end;
--
end;
/
show errors
--
create or replace package XDBPM_CONSTANTS
as
C_PATH_HOME constant VARCHAR2(700) := '/home';
C_PATH_PUBLIC constant VARCHAR2(700) := '/publishedContent';
C_PATH_SYSTEM constant VARCHAR2(700) := '/sys';
C_PATH_SYSTEM_ACLS constant VARCHAR2(700) := C_PATH_SYSTEM || '/' || 'acls';
C_PATH_SYSTEM_SCHEMAS constant VARCHAR2(700) := C_PATH_SYSTEM || '/' || 'schemas';
C_PATH_SYSTEM_SCHEMAS_PUBLIC constant VARCHAR2(700) := C_PATH_SYSTEM_SCHEMAS || '/' || 'PUBLIC';
C_PATH_SYSTEM_SCHEMAS_PRIVATE constant VARCHAR2(700) := C_PATH_SYSTEM_SCHEMAS || '/' || XDBPM_USERNAME.GET_USERNAME();
C_ACL_ALL_PUBLIC constant VARCHAR2(700) := C_PATH_SYSTEM_ACLS || '/' || 'all_all_acl.xml';
C_ACL_ALL_OWNER constant VARCHAR2(700) := C_PATH_SYSTEM_ACLS || '/' || 'all_owner_acl.xml';
C_ACL_READONLY_ALL constant VARCHAR2(700) := C_PATH_SYSTEM_ACLS || '/' || 'ro_all_acl.xml';
C_ACL_BOOTSTRAP constant VARCHAR2(700) := C_PATH_SYSTEM_ACLS || '/' || 'bootstrap_acl.xml';
C_PATH_USER_HOME constant VARCHAR2(700) := C_PATH_HOME || '/' || XDBPM_USERNAME.GET_USERNAME();
C_PATH_USER_PUBLIC constant VARCHAR2(700) := C_PATH_PUBLIC || '/' || XDBPM_USERNAME.GET_USERNAME();
C_PATH_USER_HOME_PUBLIC constant VARCHAR2(700) := C_PATH_USER_HOME || C_PATH_PUBLIC;
C_PATH_USER_LOGGING constant VARCHAR2(128) := C_PATH_USER_HOME || '/logs';
C_PATH_USER_DEBUG constant VARCHAR2(128) := C_PATH_USER_LOGGING || '/debug';
C_PATH_USER_TRACE constant VARCHAR2(128) := C_PATH_USER_LOGGING || '/trace';
C_VERSION constant VARCHAR2(12) := 'VERSION';
C_OVERWRITE constant VARCHAR2(12) := 'OVERWRITE';
C_RAISE_ERROR constant VARCHAR2(12) := 'RAISE';
C_SKIP constant VARCHAR2(12) := 'SKIP';
C_NAMESPACE_XDBPM constant VARCHAR2(700) := 'http://xmlns.oracle.com/xdb/pm';
C_NAMESPACE_XDBPM_DEMO constant VARCHAR2(700) := C_NAMESPACE_XDBPM || '/demo';
C_NAMESPACE_XDBPM_SEARCH constant VARCHAR2(700) := C_NAMESPACE_XDBPM_DEMO || '/search';
C_NSPREFIX_XDBPM_XDBPM constant VARCHAR2(128) := 'xmlns:xdbpm="' || C_NAMESPACE_XDBPM || '"';
C_NSPREFIX_DEMO_DEMO constant VARCHAR2(128) := 'xmlns:demo="' || C_NAMESPACE_XDBPM_DEMO || '"';
C_NSPREFIX_SEARCH_SRCH constant VARCHAR2(128) := 'xmlns:srch="' || C_NAMESPACE_XDBPM_SEARCH || '"';
function FOLDER_SYSTEM return VARCHAR2 deterministic;
function FOLDER_SYSTEM_ACLS return VARCHAR2 deterministic;
function FOLDER_SYSTEM_SCHEMAS return VARCHAR2 deterministic;
function FOLDER_SYSTEM_SCHEMAS_PUBLIC return VARCHAR2 deterministic;
function FOLDER_SYSTEM_SCHEMAS_PRIVATE return VARCHAR2 deterministic;
function ACL_ALL_PUBLIC return VARCHAR2 deterministic;
function ACL_ALL_OWNER return VARCHAR2 deterministic;
function ACL_READONLY_ALL return VARCHAR2 deterministic;
function ACL_BOOTSTRAP return VARCHAR2 deterministic;
function FOLDER_HOME return VARCHAR2 deterministic;
function FOLDER_PUBLIC return VARCHAR2 deterministic;
function FOLDER_USER_HOME return VARCHAR2 deterministic;
function FOLDER_USER_PUBLIC return VARCHAR2 deterministic;
function FOLDER_USER_HOME_PUBLIC return VARCHAR2 deterministic;
function FOLDER_USER_LOGGING return VARCHAR2 deterministic;
function FOLDER_USER_DEBUG return VARCHAR2 deterministic;
function FOLDER_USER_TRACE return VARCHAR2 deterministic;
function FOLDER_USER_HOME(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic;
function FOLDER_USER_PUBLIC(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic;
function FOLDER_USER_HOME_PUBLIC(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic;
function FOLDER_USER_LOGGING(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic;
function FOLDER_USER_DEBUG(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic;
function FOLDER_USER_TRACE(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic;
function ENCODING_UTF8 return VARCHAR2 deterministic;
function ENCODING_WIN1252 return VARCHAR2 deterministic;
function ENCODING_ISOLATIN1 return VARCHAR2 deterministic;
function ENCODING_DEFAULT return VARCHAR2 deterministic;
function VERSION return VARCHAR2 deterministic;
function OVERWRITE return VARCHAR2 deterministic;
function RAISE_ERROR return VARCHAR2 deterministic;
function SKIP return VARCHAR2 deterministic;
function NAMESPACE_XDBPM return VARCHAR2 deterministic;
function NAMESPACE_XDBPM_DEMO return VARCHAR2 deterministic;
function NAMESPACE_XDBPM_SEARCH return VARCHAR2 deterministic;
function NSPREFIX_XDBPM_XDBPM return VARCHAR2 deterministic;
function NSPREFIX_DEMO_DEMO return VARCHAR2 deterministic;
function NSPREFIX_SEARCH_SRCH return VARCHAR2 deterministic;
end;
/
show errors
--
create or replace synonym XDB_CONSTANTS for XDBPM_CONSTANTS
/
grant execute on XDBPM_CONSTANTS to public
/
create or replace package body XDBPM_CONSTANTS
as
--
function FOLDER_SYSTEM return VARCHAR2 deterministic as begin return C_PATH_SYSTEM; end;
--
function FOLDER_SYSTEM_ACLS return VARCHAR2 deterministic as begin return C_PATH_SYSTEM_ACLS; end;
--
function FOLDER_SYSTEM_SCHEMAS return VARCHAR2 deterministic as begin return C_PATH_SYSTEM_SCHEMAS; end;
--
function FOLDER_SYSTEM_SCHEMAS_PUBLIC return VARCHAR2 deterministic as begin return C_PATH_SYSTEM_SCHEMAS_PUBLIC; end;
--
function FOLDER_SYSTEM_SCHEMAS_PRIVATE return VARCHAR2 deterministic as begin return C_PATH_SYSTEM_SCHEMAS_PRIVATE; end;
--
function ACL_ALL_PUBLIC return VARCHAR2 deterministic as begin return C_ACL_ALL_PUBLIC; end;
--
function ACL_ALL_OWNER return VARCHAR2 deterministic as begin return C_ACL_ALL_OWNER; end;
--
function ACL_READONLY_ALL return VARCHAR2 deterministic as begin return C_ACL_READONLY_ALL; end;
--
function ACL_BOOTSTRAP return VARCHAR2 deterministic as begin return C_ACL_BOOTSTRAP; end;
--
function FOLDER_HOME return VARCHAR2 deterministic as begin return C_PATH_HOME; end;
--
function FOLDER_PUBLIC return VARCHAR2 deterministic as begin return C_PATH_PUBLIC; end;
--
function FOLDER_USER_HOME return VARCHAR2 deterministic as begin return C_PATH_USER_HOME; end;
--
function FOLDER_USER_LOGGING return VARCHAR2 deterministic as begin return C_PATH_USER_LOGGING; end;
--
function FOLDER_USER_DEBUG return VARCHAR2 deterministic as begin return C_PATH_USER_DEBUG; end;
--
function FOLDER_USER_TRACE return VARCHAR2 deterministic as begin return C_PATH_USER_TRACE; end;
--
function FOLDER_USER_PUBLIC return VARCHAR2 deterministic as begin return C_PATH_USER_PUBLIC; end;
--
function FOLDER_USER_HOME_PUBLIC return VARCHAR2 deterministic as begin return C_PATH_USER_HOME_PUBLIC; end;
--
function FOLDER_USER_HOME(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic as begin return FOLDER_HOME() || '/' || upper(P_PRINCIPLE); end;
--
function FOLDER_USER_LOGGING(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic as begin return FOLDER_USER_HOME(P_PRINCIPLE) || '/logs'; end;
--
function FOLDER_USER_DEBUG(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic as begin return FOLDER_USER_LOGGING(P_PRINCIPLE) || '/debug'; end;
--
function FOLDER_USER_TRACE(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic as begin return FOLDER_USER_LOGGING(P_PRINCIPLE) || '/trace'; end;
--
function FOLDER_USER_PUBLIC(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic as begin return FOLDER_PUBLIC() || '/' || upper(P_PRINCIPLE); end;
--
function FOLDER_USER_HOME_PUBLIC(P_PRINCIPLE VARCHAR2) return VARCHAR2 deterministic as begin return FOLDER_USER_HOME(P_PRINCIPLE) || '/' || C_PATH_PUBLIC; end;
--
function ENCODING_UTF8 return VARCHAR2 deterministic as begin return DBMS_XDB_CONSTANTS.ENCODING_UTF8; end;
--
function ENCODING_WIN1252 return VARCHAR2 deterministic as begin return DBMS_XDB_CONSTANTS.ENCODING_WIN1252; end;
--
function ENCODING_ISOLATIN1 return VARCHAR2 deterministic as begin return DBMS_XDB_CONSTANTS.ENCODING_ISOLATIN1; end;
--
function ENCODING_DEFAULT return VARCHAR2 deterministic as begin return DBMS_XDB_CONSTANTS.ENCODING_DEFAULT; end;
--
function OVERWRITE return VARCHAR2 deterministic as begin return C_OVERWRITE; end;
--
function VERSION return VARCHAR2 deterministic as begin return C_VERSION; end;
--
function RAISE_ERROR return VARCHAR2 deterministic as begin return C_RAISE_ERROR; end;
--
function SKIP return VARCHAR2 deterministic as begin return C_SKIP; end;
--
function NAMESPACE_XDBPM return VARCHAR2 deterministic as begin return C_NAMESPACE_XDBPM; end;
--
function NAMESPACE_XDBPM_DEMO return VARCHAR2 deterministic as begin return C_NAMESPACE_XDBPM_DEMO; end;
--
function NAMESPACE_XDBPM_SEARCH return VARCHAR2 deterministic as begin return C_NAMESPACE_XDBPM_SEARCH; end;
--
function NSPREFIX_XDBPM_XDBPM return VARCHAR2 deterministic as begin return C_NSPREFIX_XDBPM_XDBPM; end;
--
function NSPREFIX_DEMO_DEMO return VARCHAR2 deterministic as begin return C_NSPREFIX_DEMO_DEMO; end;
--
function NSPREFIX_SEARCH_SRCH return VARCHAR2 deterministic as begin return C_NSPREFIX_SEARCH_SRCH; end;
--
end XDBPM_CONSTANTS;
/
show errors
--
alter session set current_schema = SYS
/ | the_stack |
SET SESSION sql_mode='';
SET NAMES 'utf8';
ALTER DATABASE `DB_NAME` CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci;
INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES
('PS_DISPLAY_MANUFACTURERS', '1', NOW(), NOW()),
('PS_ORDER_PRODUCTS_NB_PER_PAGE', '8', NOW(), NOW())
;
/* Add field MPN to tables */
ALTER TABLE `PREFIX_order_detail` ADD `product_mpn` VARCHAR(40) NULL AFTER `product_upc`;
ALTER TABLE `PREFIX_supply_order_detail` ADD `mpn` VARCHAR(40) NULL AFTER `upc`;
ALTER TABLE `PREFIX_stock` ADD `mpn` VARCHAR(40) NULL AFTER `upc`;
ALTER TABLE `PREFIX_product_attribute` ADD `mpn` VARCHAR(40) NULL AFTER `upc`;
ALTER TABLE `PREFIX_product` ADD `mpn` VARCHAR(40) NULL AFTER `upc`;
/* Delete price display precision configuration */
DELETE FROM `PREFIX_configuration` WHERE `name` = 'PS_PRICE_DISPLAY_PRECISION';
/* Set optin field value to 0 in employee table */
ALTER TABLE `PREFIX_employee` MODIFY COLUMN `optin` tinyint(1) unsigned DEFAULT NULL;
/* Increase column size */
UPDATE `PREFIX_hook` SET `name` = SUBSTRING(`name`, 1, 191);
ALTER TABLE `PREFIX_hook` CHANGE `name` `name` VARCHAR(191) NOT NULL;
ALTER TABLE `PREFIX_hook` CHANGE `title` `title` VARCHAR(255) NOT NULL;
UPDATE `PREFIX_hook_alias` SET `name` = SUBSTRING(`name`, 1, 191), `alias` = SUBSTRING(`alias`, 1, 191);
ALTER TABLE `PREFIX_hook_alias` CHANGE `name` `name` VARCHAR(191) NOT NULL;
ALTER TABLE `PREFIX_hook_alias` CHANGE `alias` `alias` VARCHAR(191) NOT NULL;
/* php:ps_1770_update_charset */
UPDATE `PREFIX_alias` SET `alias` = SUBSTRING(`alias`, 1, 191);
ALTER TABLE `PREFIX_alias` CHANGE `alias` `alias` VARCHAR(191) NOT NULL;
UPDATE `PREFIX_authorization_role` SET `slug` = SUBSTRING(`slug`, 1, 191);
ALTER TABLE `PREFIX_authorization_role` CHANGE `slug` `slug` VARCHAR(191) NOT NULL;
UPDATE `PREFIX_module_preference` SET `module` = SUBSTRING(`module`, 1, 191);
ALTER TABLE `PREFIX_module_preference` CHANGE `module` `module` VARCHAR(191) NOT NULL;
UPDATE `PREFIX_tab_module_preference` SET `module` = SUBSTRING(`module`, 1, 191);
ALTER TABLE `PREFIX_tab_module_preference` CHANGE `module` `module` VARCHAR(191) NOT NULL;
UPDATE `PREFIX_smarty_lazy_cache` SET `cache_id` = SUBSTRING(`cache_id`, 1, 191);
ALTER TABLE `PREFIX_smarty_lazy_cache` CHANGE `cache_id` `cache_id` VARCHAR(191) NOT NULL;
/* improve performance of lookup by product reference/product_supplier avoiding full table scan */
ALTER TABLE PREFIX_product
ADD INDEX reference_idx(reference),
ADD INDEX supplier_reference_idx(supplier_reference);
/* Add fields for currencies */
ALTER TABLE `PREFIX_currency` ADD `unofficial` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `active`;
ALTER TABLE `PREFIX_currency` ADD `modified` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `unofficial`;
ALTER TABLE `PREFIX_currency_lang` ADD `pattern` varchar(255) DEFAULT NULL AFTER `symbol`;
/* Utf8mb4 conversion */
ALTER TABLE `PREFIX_access` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_accessory` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_address` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_address_format` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_alias` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attachment` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attachment_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attribute` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attribute_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attribute_group_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attribute_group_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attribute_impact` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attribute_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_attribute_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_authorization_role` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_carrier` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_carrier_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_carrier_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_carrier_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_carrier_tax_rules_group_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_carrier_zone` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_cart_rule` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_product` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_carrier` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_combination` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_country` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_product_rule` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_product_rule_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_product_rule_value` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cart_rule_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_category` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_category_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_category_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_category_product` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_category_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cms` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cms_category` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cms_category_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cms_category_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cms_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cms_role` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cms_role_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_cms_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_configuration` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_configuration_kpi` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_configuration_kpi_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_configuration_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_connections` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_connections_page` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_connections_source` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_contact` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_contact_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_contact_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_country` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_country_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_country_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_currency` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_currency_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_currency_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customer` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customer_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customer_message` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customer_message_sync_imap` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customer_session` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customer_thread` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customization` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customization_field` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customization_field_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_customized_data` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_date_range` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_delivery` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_employee` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_employee_session` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_employee_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_feature` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_feature_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_feature_product` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_feature_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_feature_value` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_feature_value_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_gender` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_gender_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_group_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_group_reduction` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_group_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_guest` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_hook` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_hook_alias` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_hook_module` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_hook_module_exceptions` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_image` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_image_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_image_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_image_type` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_import_match` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_lang_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_log` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_mail` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_manufacturer` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_manufacturer_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_manufacturer_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_memcached_servers` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_message` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_message_readed` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_meta` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_meta_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_module` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_module_access` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_module_carrier` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_module_country` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_module_currency` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_module_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_module_preference` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_module_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_operating_system` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_orders` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_carrier` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_cart_rule` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_detail` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_detail_tax` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_history` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_invoice` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_invoice_payment` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_invoice_tax` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_message` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_message_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_payment` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_return` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_return_detail` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_return_state` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_return_state_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_slip` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_slip_detail` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_slip_detail_tax` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_state` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_order_state_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_pack` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_page` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_pagenotfound` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_page_type` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_page_viewed` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_attachment` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_attribute` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_attribute_combination` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_attribute_image` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_attribute_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_carrier` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_country_tax` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_download` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_group_reduction_cache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_sale` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_supplier` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_product_tag` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_profile` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_profile_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_quick_access` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_quick_access_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_range_price` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_range_weight` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_referrer` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_referrer_cache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_referrer_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_request_sql` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_required_field` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_risk` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_risk_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_search_engine` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_search_index` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_search_word` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_shop_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_shop_url` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_smarty_cache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_smarty_last_flush` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_smarty_lazy_cache` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_specific_price` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_specific_price_priority` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_specific_price_rule` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_specific_price_rule_condition` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_specific_price_rule_condition_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_state` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_stock` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_stock_available` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_stock_mvt` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_stock_mvt_reason` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_stock_mvt_reason_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_store` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_store_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_store_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supplier` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supplier_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supplier_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supply_order` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supply_order_detail` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supply_order_history` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supply_order_receipt_history` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supply_order_state` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_supply_order_state_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tab` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tab_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tab_module_preference` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tag` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tag_count` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tax` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tax_lang` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tax_rule` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tax_rules_group` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_tax_rules_group_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_timezone` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_warehouse` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_warehouse_carrier` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_warehouse_product_location` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_warehouse_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_webservice_account` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_webservice_account_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_webservice_permission` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_web_browser` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_zone` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_zone_shop` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `PREFIX_gender_lang` CHANGE `name` `name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `employee_lastname` `employee_lastname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
ALTER TABLE `PREFIX_stock_mvt` CHANGE `employee_firstname` `employee_firstname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
ALTER TABLE `PREFIX_timezone` CHANGE `name` `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `PREFIX_attribute_group` CHANGE `group_type` `group_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `PREFIX_search_word` CHANGE `word` `word` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `PREFIX_meta` CHANGE `page` `page` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `PREFIX_statssearch` CHANGE `keywords` `keywords` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `PREFIX_stock` CHANGE `reference` `reference` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `PREFIX_stock` CHANGE `ean13` `ean13` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
ALTER TABLE `PREFIX_stock` CHANGE `isbn` `isbn` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
ALTER TABLE `PREFIX_stock` CHANGE `upc` `upc` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
ALTER TABLE `PREFIX_attribute_lang` CHANGE `name` `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `PREFIX_connections` CHANGE `http_referer` `http_referer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
ALTER TABLE `PREFIX_product_download` CHANGE `display_filename` `display_filename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
/* Doctrine update happens too late to update the new enabled field, so we preset everything here */
ALTER TABLE `PREFIX_tab` ADD enabled TINYINT(1) NOT NULL;
/* PHP:ps_1770_preset_tab_enabled(); */;
/* PHP:ps_1770_update_order_status_colors(); */;
INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`) VALUES
(NULL, 'displayAdminOrderTop', 'Admin Order Top', 'This hook displays content at the top of the order view page'),
(NULL, 'displayAdminOrderSide', 'Admin Order Side Column', 'This hook displays content in the order view page in the side column under the customer view'),
(NULL, 'displayAdminOrderSideBottom', 'Admin Order Side Column Bottom', 'This hook displays content in the order view page at the bottom of the side column'),
(NULL, 'displayAdminOrderMain', 'Admin Order Main Column', 'This hook displays content in the order view page in the main column under the details view'),
(NULL, 'displayAdminOrderMainBottom', 'Admin Order Main Column Bottom', 'This hook displays content in the order view page at the bottom of the main column'),
(NULL, 'displayAdminOrderTabLink', 'Admin Order Tab Link', 'This hook displays new tab links on the order view page'),
(NULL, 'displayAdminOrderTabContent', 'Admin Order Tab Content', 'This hook displays new tab contents on the order view page'),
(NULL, 'actionGetAdminOrderButtons', 'Admin Order Buttons', 'This hook is used to generate the buttons collection on the order view page (see ActionsBarButtonsCollection)'),
(NULL, 'displayFooterCategory', 'Category footer', 'This hook adds new blocks under the products listing in a category/search'),
(NULL, 'displayBackOfficeOrderActions', 'Admin Order Actions', 'This hook displays content in the order view page after action buttons (or aliased to side column in migrated page)'),
(NULL, 'actionAdminAdminPreferencesControllerPostProcessBefore', 'On post-process in Admin Preferences', 'This hook is called on Admin Preferences post-process before processing the form'),
(NULL, 'displayAdditionalCustomerAddressFields', 'Display additional customer address fields', 'This hook allows to display extra field values added in an address form using hook ''additionalCustomerAddressFields'''),
(NULL, 'displayAdminProductsExtra', 'Admin Product Extra Module Tab', 'This hook displays extra content in the Module tab on the product edit page'),
(NULL, 'actionFrontControllerInitBefore', 'Perform actions before front office controller initialization', 'This hook is launched before the initialization of all front office controllers'),
(NULL, 'actionFrontControllerInitAfter', 'Perform actions after front office controller initialization', 'This hook is launched after the initialization of all front office controllers'),
(NULL, 'actionAdminControllerInitAfter', 'Perform actions after admin controller initialization', 'This hook is launched after the initialization of all admin controllers'),
(NULL, 'actionAdminControllerInitBefore', 'Perform actions before admin controller initialization', 'This hook is launched before the initialization of all admin controllers'),
(NULL, 'actionControllerInitAfter', 'Perform actions after controller initialization', 'This hook is launched after the initialization of all controllers'),
(NULL, 'actionControllerInitBefore', 'Perform actions before controller initialization', 'This hook is launched before the initialization of all controllers'),
(NULL, 'actionAdminLoginControllerBefore', 'Perform actions before admin login controller initialization', 'This hook is launched before the initialization of the login controller'),
(NULL, 'actionAdminLoginControllerLoginBefore', 'Perform actions before admin login controller login action initialization', 'This hook is launched before the initialization of the login action in login controller'),
(NULL, 'actionAdminLoginControllerLoginAfter', 'Perform actions after admin login controller login action initialization', 'This hook is launched after the initialization of the login action in login controller'),
(NULL, 'actionAdminLoginControllerForgotBefore', 'Perform actions before admin login controller forgot action initialization', 'This hook is launched before the initialization of the forgot action in login controller'),
(NULL, 'actionAdminLoginControllerForgotAfter', 'Perform actions after admin login controller forgot action initialization', 'This hook is launched after the initialization of the forgot action in login controller'),
(NULL, 'actionAdminLoginControllerResetBefore', 'Perform actions before admin login controller reset action initialization', 'This hook is launched before the initialization of the reset action in login controller'),
(NULL, 'actionAdminLoginControllerResetAfter', 'Perform actions after admin login controller reset action initialization', 'This hook is launched after the initialization of the reset action in login controller'),
(NULL, 'displayHeader', 'Pages html head section', 'This hook adds additional elements in the head section of your pages (head section of html)')
;
INSERT INTO `PREFIX_hook_alias` (`name`, `alias`) VALUES
('displayAdminOrderTop', 'displayInvoice'),
('displayAdminOrderSide', 'displayBackOfficeOrderActions'),
('actionFrontControllerInitAfter', 'actionFrontControllerAfterInit')
;
/* Add refund amount on order detail, and fill new columns via data in order_slip_detail table */
ALTER TABLE `PREFIX_order_detail` ADD `total_refunded_tax_excl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000' AFTER `original_wholesale_price`;
ALTER TABLE `PREFIX_order_detail` ADD `total_refunded_tax_incl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000' AFTER `total_refunded_tax_excl`;
ALTER TABLE `PREFIX_group_reduction` CHANGE `reduction` `reduction` DECIMAL(5, 4) NOT NULL DEFAULT '0.0000';
ALTER TABLE `PREFIX_product_group_reduction_cache` CHANGE `reduction` `reduction` DECIMAL(5, 4) NOT NULL DEFAULT '0.0000';
ALTER TABLE `PREFIX_order_slip` CHANGE `amount` `amount` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
ALTER TABLE `PREFIX_order_slip` CHANGE `shipping_cost_amount` `shipping_cost_amount` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
ALTER TABLE `PREFIX_order_payment` CHANGE `amount` `amount` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
/* attribute_impact price */
UPDATE `PREFIX_attribute_impact` SET `price` = RIGHT(`price`, 17) WHERE LENGTH(`price`) > 17;
ALTER TABLE `PREFIX_attribute_impact` CHANGE `price` `price` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
/* cart_rule minimum_amount & reduction_amount */
UPDATE `PREFIX_cart_rule` SET `minimum_amount` = RIGHT(`minimum_amount`, 17) WHERE LENGTH(`minimum_amount`) > 17;
UPDATE `PREFIX_cart_rule` SET `reduction_amount` = RIGHT(`reduction_amount`, 17) WHERE LENGTH(`reduction_amount`) > 17;
ALTER TABLE `PREFIX_cart_rule` CHANGE `minimum_amount` `minimum_amount` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
ALTER TABLE `PREFIX_cart_rule` CHANGE `reduction_amount` `reduction_amount` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
/* group reduction */
UPDATE `PREFIX_group` SET `reduction` = RIGHT(`reduction`, 6) WHERE LENGTH(`reduction`) > 6;
ALTER TABLE `PREFIX_group` CHANGE `reduction` `reduction` DECIMAL(5, 2) NOT NULL DEFAULT '0.00';
/* order_detail reduction_percent, group_reduction & ecotax */
UPDATE `PREFIX_order_detail` SET `reduction_percent` = RIGHT(`reduction_percent`, 6) WHERE LENGTH(`reduction_percent`) > 6;
UPDATE `PREFIX_order_detail` SET `group_reduction` = RIGHT(`group_reduction`, 6) WHERE LENGTH(`group_reduction`) > 6;
UPDATE `PREFIX_order_detail` SET `ecotax` = RIGHT(`ecotax`, 18) WHERE LENGTH(`ecotax`) > 18;
ALTER TABLE `PREFIX_order_detail` CHANGE `reduction_percent` `reduction_percent` DECIMAL(5, 2) NOT NULL DEFAULT '0.00';
ALTER TABLE `PREFIX_order_detail` CHANGE `group_reduction` `group_reduction` DECIMAL(5, 2) NOT NULL DEFAULT '0.00';
ALTER TABLE `PREFIX_order_detail` CHANGE `ecotax` `ecotax` DECIMAL(17, 6) NOT NULL DEFAULT '0.000000';
/* product additional_shipping_cost */
UPDATE `PREFIX_product` SET `additional_shipping_cost` = RIGHT(`additional_shipping_cost`, 17) WHERE LENGTH(`additional_shipping_cost`) > 17;
ALTER TABLE `PREFIX_product` CHANGE `additional_shipping_cost` `additional_shipping_cost` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
/* product_shop additional_shipping_cost */
UPDATE `PREFIX_product_shop` SET `additional_shipping_cost` = RIGHT(`additional_shipping_cost`, 17) WHERE LENGTH(`additional_shipping_cost`) > 17;
ALTER TABLE `PREFIX_product_shop` CHANGE `additional_shipping_cost` `additional_shipping_cost` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
/* order_cart_rule value & value_tax_excl */
UPDATE `PREFIX_order_cart_rule` SET `value` = RIGHT(`value`, 17) WHERE LENGTH(`value`) > 17;
UPDATE `PREFIX_order_cart_rule` SET `value_tax_excl` = RIGHT(`value_tax_excl`, 17) WHERE LENGTH(`value_tax_excl`) > 17;
ALTER TABLE `PREFIX_order_cart_rule` CHANGE `value` `value` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
ALTER TABLE `PREFIX_order_cart_rule` CHANGE `value_tax_excl` `value_tax_excl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000';
/* add deleted field */
ALTER TABLE `PREFIX_order_cart_rule` ADD `deleted` TINYINT(1) UNSIGNED NOT NULL;
UPDATE
`PREFIX_order_detail` `od`
SET
`od`.`total_refunded_tax_excl` = IFNULL((
SELECT SUM(`osd`.`amount_tax_excl`)
FROM `PREFIX_order_slip_detail` `osd`
WHERE `osd`.`id_order_detail` = `od`.`id_order_detail`
), 0),
`od`.`total_refunded_tax_incl` = IFNULL((
SELECT SUM(`osd`.`amount_tax_incl`)
FROM `PREFIX_order_slip_detail` `osd`
WHERE `osd`.`id_order_detail` = `od`.`id_order_detail`
), 0)
;
INSERT IGNORE INTO `PREFIX_hook` (`id_hook`, `name`, `title`, `description`, `position`)
VALUES (NULL, 'actionOrderMessageFormBuilderModifier', 'Modify order message identifiable object form',
'This hook allows to modify order message identifiable object forms content by modifying form builder data or FormBuilder itself',
'1'),
(NULL, 'actionCatalogPriceRuleFormBuilderModifier', 'Modify catalog price rule identifiable object form',
'This hook allows to modify catalog price rule identifiable object forms content by modifying form builder data or FormBuilder itself',
'1'),
(NULL, 'actionAttachmentFormBuilderModifier', 'Modify attachment identifiable object form',
'This hook allows to modify attachment identifiable object forms content by modifying form builder data or FormBuilder itself',
'1'),
(NULL, 'actionBeforeUpdateFeatureFormHandler', 'Modify feature identifiable object data before updating it',
'This hook allows to modify feature identifiable object forms data before it was updated', '1'),
(NULL, 'actionBeforeUpdateOrderMessageFormHandler',
'Modify order message identifiable object data before updating it',
'This hook allows to modify order message identifiable object forms data before it was updated', '1'),
(NULL, 'actionBeforeUpdateCatalogPriceRuleFormHandler',
'Modify catalog price rule identifiable object data before updating it',
'This hook allows to modify catalog price rule identifiable object forms data before it was updated', '1'),
(NULL, 'actionBeforeUpdateAttachmentFormHandler',
'Modify attachment identifiable object data before updating it',
'This hook allows to modify attachment identifiable object forms data before it was updated', '1'),
(NULL, 'actionAfterUpdateOrderMessageFormHandler',
'Modify order message identifiable object data after updating it',
'This hook allows to modify order message identifiable object forms data after it was updated', '1'),
(NULL, 'actionAfterUpdateCatalogPriceRuleFormHandler',
'Modify catalog price rule identifiable object data after updating it',
'This hook allows to modify catalog price rule identifiable object forms data after it was updated', '1'),
(NULL, 'actionAfterUpdateAttachmentFormHandler', 'Modify attachment identifiable object data after updating it',
'This hook allows to modify attachment identifiable object forms data after it was updated', '1'),
(NULL, 'actionBeforeCreateFeatureFormHandler', 'Modify feature identifiable object data before creating it',
'This hook allows to modify feature identifiable object forms data before it was created', '1'),
(NULL, 'actionBeforeCreateOrderMessageFormHandler',
'Modify order message identifiable object data before creating it',
'This hook allows to modify order message identifiable object forms data before it was created', '1'),
(NULL, 'actionBeforeCreateCatalogPriceRuleFormHandler',
'Modify catalog price rule identifiable object data before creating it',
'This hook allows to modify catalog price rule identifiable object forms data before it was created', '1'),
(NULL, 'actionBeforeCreateAttachmentFormHandler',
'Modify attachment identifiable object data before creating it',
'This hook allows to modify attachment identifiable object forms data before it was created', '1'),
(NULL, 'actionAfterCreateOrderMessageFormHandler',
'Modify order message identifiable object data after creating it',
'This hook allows to modify order message identifiable object forms data after it was created', '1'),
(NULL, 'actionAfterCreateCatalogPriceRuleFormHandler',
'Modify catalog price rule identifiable object data after creating it',
'This hook allows to modify catalog price rule identifiable object forms data after it was created', '1'),
(NULL, 'actionAfterCreateAttachmentFormHandler', 'Modify attachment identifiable object data after creating it',
'This hook allows to modify attachment identifiable object forms data after it was created', '1'),
(NULL, 'actionMerchandiseReturnForm', 'Modify merchandise return options form content',
'This hook allows to modify merchandise return options form FormBuilder', '1'),
(NULL, 'actionCreditSlipForm', 'Modify credit slip options form content',
'This hook allows to modify credit slip options form FormBuilder', '1'),
(NULL, 'actionMerchandiseReturnSave', 'Modify merchandise return options form saved data',
'This hook allows to modify data of merchandise return options form after it was saved', '1'),
(NULL, 'actionCreditSlipSave', 'Modify credit slip options form saved data',
'This hook allows to modify data of credit slip options form after it was saved', '1'),
(NULL, 'actionEmptyCategoryGridDefinitionModifier', 'Modify empty category grid definition',
'This hook allows to alter empty category grid columns, actions and filters', '1'),
(NULL, 'actionNoQtyProductWithCombinationGridDefinitionModifier',
'Modify no qty product with combination grid definition',
'This hook allows to alter no qty product with combination grid columns, actions and filters', '1'),
(NULL, 'actionNoQtyProductWithoutCombinationGridDefinitionModifier',
'Modify no qty product without combination grid definition',
'This hook allows to alter no qty product without combination grid columns, actions and filters', '1'),
(NULL, 'actionDisabledProductGridDefinitionModifier', 'Modify disabled product grid definition',
'This hook allows to alter disabled product grid columns, actions and filters', '1'),
(NULL, 'actionProductWithoutImageGridDefinitionModifier', 'Modify product without image grid definition',
'This hook allows to alter product without image grid columns, actions and filters', '1'),
(NULL, 'actionProductWithoutDescriptionGridDefinitionModifier',
'Modify product without description grid definition',
'This hook allows to alter product without description grid columns, actions and filters', '1'),
(NULL, 'actionProductWithoutPriceGridDefinitionModifier', 'Modify product without price grid definition',
'This hook allows to alter product without price grid columns, actions and filters', '1'),
(NULL, 'actionOrderGridDefinitionModifier', 'Modify order grid definition',
'This hook allows to alter order grid columns, actions and filters', '1'),
(NULL, 'actionCatalogPriceRuleGridDefinitionModifier', 'Modify catalog price rule grid definition',
'This hook allows to alter catalog price rule grid columns, actions and filters', '1'),
(NULL, 'actionOrderMessageGridDefinitionModifier', 'Modify order message grid definition',
'This hook allows to alter order message grid columns, actions and filters', '1'),
(NULL, 'actionAttachmentGridDefinitionModifier', 'Modify attachment grid definition',
'This hook allows to alter attachment grid columns, actions and filters', '1'),
(NULL, 'actionAttributeGroupGridDefinitionModifier', 'Modify attribute group grid definition',
'This hook allows to alter attribute group grid columns, actions and filters', '1'),
(NULL, 'actionMerchandiseReturnGridDefinitionModifier', 'Modify merchandise return grid definition',
'This hook allows to alter merchandise return grid columns, actions and filters', '1'),
(NULL, 'actionTaxRulesGroupGridDefinitionModifier', 'Modify tax rules group grid definition',
'This hook allows to alter tax rules group grid columns, actions and filters', '1'),
(NULL, 'actionAddressGridDefinitionModifier', 'Modify address grid definition',
'This hook allows to alter address grid columns, actions and filters', '1'),
(NULL, 'actionCreditSlipGridDefinitionModifier', 'Modify credit slip grid definition',
'This hook allows to alter credit slip grid columns, actions and filters', '1'),
(NULL, 'actionEmptyCategoryGridQueryBuilderModifier', 'Modify empty category grid query builder',
'This hook allows to alter Doctrine query builder for empty category grid', '1'),
(NULL, 'actionNoQtyProductWithCombinationGridQueryBuilderModifier',
'Modify no qty product with combination grid query builder',
'This hook allows to alter Doctrine query builder for no qty product with combination grid', '1'),
(NULL, 'actionNoQtyProductWithoutCombinationGridQueryBuilderModifier',
'Modify no qty product without combination grid query builder',
'This hook allows to alter Doctrine query builder for no qty product without combination grid', '1'),
(NULL, 'actionDisabledProductGridQueryBuilderModifier', 'Modify disabled product grid query builder',
'This hook allows to alter Doctrine query builder for disabled product grid', '1'),
(NULL, 'actionProductWithoutImageGridQueryBuilderModifier', 'Modify product without image grid query builder',
'This hook allows to alter Doctrine query builder for product without image grid', '1'),
(NULL, 'actionProductWithoutDescriptionGridQueryBuilderModifier',
'Modify product without description grid query builder',
'This hook allows to alter Doctrine query builder for product without description grid', '1'),
(NULL, 'actionProductWithoutPriceGridQueryBuilderModifier', 'Modify product without price grid query builder',
'This hook allows to alter Doctrine query builder for product without price grid', '1'),
(NULL, 'actionOrderGridQueryBuilderModifier', 'Modify order grid query builder',
'This hook allows to alter Doctrine query builder for order grid', '1'),
(NULL, 'actionCatalogPriceRuleGridQueryBuilderModifier', 'Modify catalog price rule grid query builder',
'This hook allows to alter Doctrine query builder for catalog price rule grid', '1'),
(NULL, 'actionOrderMessageGridQueryBuilderModifier', 'Modify order message grid query builder',
'This hook allows to alter Doctrine query builder for order message grid', '1'),
(NULL, 'actionAttachmentGridQueryBuilderModifier', 'Modify attachment grid query builder',
'This hook allows to alter Doctrine query builder for attachment grid', '1'),
(NULL, 'actionAttributeGroupGridQueryBuilderModifier', 'Modify attribute group grid query builder',
'This hook allows to alter Doctrine query builder for attribute group grid', '1'),
(NULL, 'actionMerchandiseReturnGridQueryBuilderModifier', 'Modify merchandise return grid query builder',
'This hook allows to alter Doctrine query builder for merchandise return grid', '1'),
(NULL, 'actionTaxRulesGroupGridQueryBuilderModifier', 'Modify tax rules group grid query builder',
'This hook allows to alter Doctrine query builder for tax rules group grid', '1'),
(NULL, 'actionAddressGridQueryBuilderModifier', 'Modify address grid query builder',
'This hook allows to alter Doctrine query builder for address grid', '1'),
(NULL, 'actionCreditSlipGridQueryBuilderModifier', 'Modify credit slip grid query builder',
'This hook allows to alter Doctrine query builder for credit slip grid', '1'),
(NULL, 'actionEmptyCategoryGridDataModifier', 'Modify empty category grid data',
'This hook allows to modify empty category grid data', '1'),
(NULL, 'actionNoQtyProductWithCombinationGridDataModifier', 'Modify no qty product with combination grid data',
'This hook allows to modify no qty product with combination grid data', '1'),
(NULL, 'actionNoQtyProductWithoutCombinationGridDataModifier',
'Modify no qty product without combination grid data',
'This hook allows to modify no qty product without combination grid data', '1'),
(NULL, 'actionDisabledProductGridDataModifier', 'Modify disabled product grid data',
'This hook allows to modify disabled product grid data', '1'),
(NULL, 'actionProductWithoutImageGridDataModifier', 'Modify product without image grid data',
'This hook allows to modify product without image grid data', '1'),
(NULL, 'actionProductWithoutDescriptionGridDataModifier', 'Modify product without description grid data',
'This hook allows to modify product without description grid data', '1'),
(NULL, 'actionProductWithoutPriceGridDataModifier', 'Modify product without price grid data',
'This hook allows to modify product without price grid data', '1'),
(NULL, 'actionOrderGridDataModifier', 'Modify order grid data', 'This hook allows to modify order grid data',
'1'),
(NULL, 'actionCatalogPriceRuleGridDataModifier', 'Modify catalog price rule grid data',
'This hook allows to modify catalog price rule grid data', '1'),
(NULL, 'actionOrderMessageGridDataModifier', 'Modify order message grid data',
'This hook allows to modify order message grid data', '1'),
(NULL, 'actionAttachmentGridDataModifier', 'Modify attachment grid data',
'This hook allows to modify attachment grid data', '1'),
(NULL, 'actionAttributeGroupGridDataModifier', 'Modify attribute group grid data',
'This hook allows to modify attribute group grid data', '1'),
(NULL, 'actionMerchandiseReturnGridDataModifier', 'Modify merchandise return grid data',
'This hook allows to modify merchandise return grid data', '1'),
(NULL, 'actionTaxRulesGroupGridDataModifier', 'Modify tax rules group grid data',
'This hook allows to modify tax rules group grid data', '1'),
(NULL, 'actionAddressGridDataModifier', 'Modify address grid data',
'This hook allows to modify address grid data', '1'),
(NULL, 'actionCreditSlipGridDataModifier', 'Modify credit slip grid data',
'This hook allows to modify credit slip grid data', '1'),
(NULL, 'actionEmptyCategoryGridFilterFormModifier', 'Modify empty category grid filters',
'This hook allows to modify filters for empty category grid', '1'),
(NULL, 'actionNoQtyProductWithCombinationGridFilterFormModifier',
'Modify no qty product with combination grid filters',
'This hook allows to modify filters for no qty product with combination grid', '1'),
(NULL, 'actionNoQtyProductWithoutCombinationGridFilterFormModifier',
'Modify no qty product without combination grid filters',
'This hook allows to modify filters for no qty product without combination grid', '1'),
(NULL, 'actionDisabledProductGridFilterFormModifier', 'Modify disabled product grid filters',
'This hook allows to modify filters for disabled product grid', '1'),
(NULL, 'actionProductWithoutImageGridFilterFormModifier', 'Modify product without image grid filters',
'This hook allows to modify filters for product without image grid', '1'),
(NULL, 'actionProductWithoutDescriptionGridFilterFormModifier',
'Modify product without description grid filters',
'This hook allows to modify filters for product without description grid', '1'),
(NULL, 'actionProductWithoutPriceGridFilterFormModifier', 'Modify product without price grid filters',
'This hook allows to modify filters for product without price grid', '1'),
(NULL, 'actionOrderGridFilterFormModifier', 'Modify order grid filters',
'This hook allows to modify filters for order grid', '1'),
(NULL, 'actionCatalogPriceRuleGridFilterFormModifier', 'Modify catalog price rule grid filters',
'This hook allows to modify filters for catalog price rule grid', '1'),
(NULL, 'actionOrderMessageGridFilterFormModifier', 'Modify order message grid filters',
'This hook allows to modify filters for order message grid', '1'),
(NULL, 'actionAttachmentGridFilterFormModifier', 'Modify attachment grid filters',
'This hook allows to modify filters for attachment grid', '1'),
(NULL, 'actionAttributeGroupGridFilterFormModifier', 'Modify attribute group grid filters',
'This hook allows to modify filters for attribute group grid', '1'),
(NULL, 'actionMerchandiseReturnGridFilterFormModifier', 'Modify merchandise return grid filters',
'This hook allows to modify filters for merchandise return grid', '1'),
(NULL, 'actionTaxRulesGroupGridFilterFormModifier', 'Modify tax rules group grid filters',
'This hook allows to modify filters for tax rules group grid', '1'),
(NULL, 'actionAddressGridFilterFormModifier', 'Modify address grid filters',
'This hook allows to modify filters for address grid', '1'),
(NULL, 'actionCreditSlipGridFilterFormModifier', 'Modify credit slip grid filters',
'This hook allows to modify filters for credit slip grid', '1'),
(NULL, 'actionEmptyCategoryGridPresenterModifier', 'Modify empty category grid template data',
'This hook allows to modify data which is about to be used in template for empty category grid', '1'),
(NULL, 'actionNoQtyProductWithCombinationGridPresenterModifier',
'Modify no qty product with combination grid template data',
'This hook allows to modify data which is about to be used in template for no qty product with combination grid',
'1'),
(NULL, 'actionNoQtyProductWithoutCombinationGridPresenterModifier',
'Modify no qty product without combination grid template data',
'This hook allows to modify data which is about to be used in template for no qty product without combination grid',
'1'),
(NULL, 'actionDisabledProductGridPresenterModifier', 'Modify disabled product grid template data',
'This hook allows to modify data which is about to be used in template for disabled product grid', '1'),
(NULL, 'actionProductWithoutImageGridPresenterModifier', 'Modify product without image grid template data',
'This hook allows to modify data which is about to be used in template for product without image grid', '1'),
(NULL, 'actionProductWithoutDescriptionGridPresenterModifier',
'Modify product without description grid template data',
'This hook allows to modify data which is about to be used in template for product without description grid',
'1'),
(NULL, 'actionProductWithoutPriceGridPresenterModifier', 'Modify product without price grid template data',
'This hook allows to modify data which is about to be used in template for product without price grid', '1'),
(NULL, 'actionOrderGridPresenterModifier', 'Modify order grid template data',
'This hook allows to modify data which is about to be used in template for order grid', '1'),
(NULL, 'actionCatalogPriceRuleGridPresenterModifier', 'Modify catalog price rule grid template data',
'This hook allows to modify data which is about to be used in template for catalog price rule grid', '1'),
(NULL, 'actionOrderMessageGridPresenterModifier', 'Modify order message grid template data',
'This hook allows to modify data which is about to be used in template for order message grid', '1'),
(NULL, 'actionAttachmentGridPresenterModifier', 'Modify attachment grid template data',
'This hook allows to modify data which is about to be used in template for attachment grid', '1'),
(NULL, 'actionAttributeGroupGridPresenterModifier', 'Modify attribute group grid template data',
'This hook allows to modify data which is about to be used in template for attribute group grid', '1'),
(NULL, 'actionMerchandiseReturnGridPresenterModifier', 'Modify merchandise return grid template data',
'This hook allows to modify data which is about to be used in template for merchandise return grid', '1'),
(NULL, 'actionTaxRulesGroupGridPresenterModifier', 'Modify tax rules group grid template data',
'This hook allows to modify data which is about to be used in template for tax rules group grid', '1'),
(NULL, 'actionAddressGridPresenterModifier', 'Modify address grid template data',
'This hook allows to modify data which is about to be used in template for address grid', '1'),
(NULL, 'actionCreditSlipGridPresenterModifier', 'Modify credit slip grid template data',
'This hook allows to modify data which is about to be used in template for credit slip grid', '1'),
(NULL, 'displayAfterTitleTag', 'After title tag', 'Use this hook to add content after title tag', '1')
;
/* Update wrong hook names */
UPDATE `PREFIX_hook_module` AS hm
INNER JOIN `PREFIX_hook` AS hfrom ON hm.id_hook = hfrom.id_hook AND hfrom.name = 'actionAdministrationPageFormSave'
INNER JOIN `PREFIX_hook` AS hto ON hto.name = 'actionAdministrationPageSave'
SET hm.id_hook = hto.id_hook;
DELETE FROM `PREFIX_hook` WHERE name = 'actionAdministrationPageFormSave';
UPDATE `PREFIX_hook_module` AS hm
INNER JOIN `PREFIX_hook` AS hfrom ON hm.id_hook = hfrom.id_hook AND hfrom.name = 'actionMaintenancePageFormSave'
INNER JOIN `PREFIX_hook` AS hto ON hto.name = 'actionMaintenancePageSave'
SET hm.id_hook = hto.id_hook;
DELETE FROM `PREFIX_hook` WHERE name = 'actionMaintenancePageFormSave';
UPDATE `PREFIX_hook_module` AS hm
INNER JOIN `PREFIX_hook` AS hfrom ON hm.id_hook = hfrom.id_hook AND hfrom.name = 'actionPerformancePageFormSave'
INNER JOIN `PREFIX_hook` AS hto ON hto.name = 'actionPerformancePageSave'
SET hm.id_hook = hto.id_hook;
DELETE FROM `PREFIX_hook` WHERE name = 'actionPerformancePageFormSave';
UPDATE `PREFIX_hook_module` AS hm
INNER JOIN `PREFIX_hook` AS hfrom ON hm.id_hook = hfrom.id_hook AND hfrom.name = 'actionFrontControllerAfterInit'
INNER JOIN `PREFIX_hook` AS hto ON hto.name = 'actionFrontControllerInitAfter'
SET hm.id_hook = hto.id_hook;
DELETE FROM `PREFIX_hook` WHERE name = 'actionFrontControllerAfterInit';
/* Update wrong hook alias */
UPDATE `PREFIX_hook_alias` SET name = 'displayHeader', alias = 'Header' WHERE name = 'Header' AND alias = 'displayHeader'; | the_stack |
CREATE OR REPLACE FUNCTION dlm.enable_dlm_triggers(p_table_name text, p_silent boolean DEFAULT false)
RETURNS void AS
$BODY$
DECLARE
v_trigger_select_sql text;
v_trigger_view_row dlm.triggers;
BEGIN
v_trigger_select_sql = '
SELECT v.*
FROM dlm.triggers v
JOIN public.AD_Table t ON lower(t.TableName)=lower(v.table_name)
AND t.IsDLM=''Y'' /* ignore not-DLM tables because they might now even have e.g. DLMLevel columns */
JOIN AD_Column c ON c.AD_Table_ID=t.AD_Table_ID AND lower(c.ColumnName)=lower(v.column_name)
WHERE c.IsDLMPartitionBoundary=''N''
AND lower(v.foreign_table_name) = lower('''|| p_table_name ||''')';
/* Iterate the dlm.triggers view and enable the triggers for each FK constraint.
*/
FOR v_trigger_view_row IN
EXECUTE v_trigger_select_sql
LOOP
BEGIN
EXECUTE v_trigger_view_row.enable_dlm_trigger_ddl;
IF p_silent = FALSE THEN
RAISE NOTICE 'enable_dlm_triggers - %: Enabled dlm trigger analog to FK constraint %', p_table_name, v_trigger_view_row.constraint_name;
END IF;
EXCEPTION
WHEN undefined_object /*SQLState 42704*/ THEN RAISE WARNING 'enable_dlm_triggers - %: No such trigger, SQL statement % failed. Nothing do to.', p_table_name, v_trigger_view_row.enable_dlm_trigger_ddl;
END;
END LOOP;
END
$BODY$
LANGUAGE plpgsql VOLATILE;
COMMENT ON FUNCTION dlm.enable_dlm_triggers(text, boolean) IS
'Uses the view dlm.triggers to enablle tiggers for the given p_table_name which were created using the dlm.triggers view.
If called with p_silent=false, is invokes "RAISE NOTICE" on each triggers that it enabled.
If if disabling an individual trigger fails, it logs a warning and goes on.
See gh #489.'
;
CREATE OR REPLACE FUNCTION dlm.disable_dlm_triggers(p_table_name text, p_silent boolean DEFAULT false)
RETURNS void AS
$BODY$
DECLARE
v_trigger_select_sql text;
v_trigger_view_row dlm.triggers;
BEGIN
v_trigger_select_sql = '
SELECT v.*
FROM dlm.triggers v
JOIN public.AD_Table t ON lower(t.TableName)=lower(v.table_name)
AND t.IsDLM=''Y'' /* ignore not-DLM tables because they might now even have e.g. DLMLevel columns */
JOIN AD_Column c ON c.AD_Table_ID=t.AD_Table_ID AND lower(c.ColumnName)=lower(v.column_name)
WHERE c.IsDLMPartitionBoundary=''N''
AND lower(v.foreign_table_name) = lower('''|| p_table_name ||''')';
/* Iterate the dlm.triggers view and disable the triggers for each FK constraint.
*/
FOR v_trigger_view_row IN
EXECUTE v_trigger_select_sql
LOOP
BEGIN
EXECUTE v_trigger_view_row.disable_dlm_trigger_ddl;
IF p_silent = FALSE THEN
RAISE NOTICE 'disable_dlm_triggers - %: Disabled dlm trigger analog to FK constraint %', p_table_name, v_trigger_view_row.constraint_name;
END IF;
EXCEPTION
WHEN undefined_object /*SQLState 42704*/ THEN RAISE WARNING 'No such trigger, SQL statement % failed. Nothing do to.', v_trigger_view_row.disable_dlm_trigger_ddl;
END;
END LOOP;
END
$BODY$
LANGUAGE plpgsql VOLATILE;
COMMENT ON FUNCTION dlm.disable_dlm_triggers(text, boolean) IS
'Uses the view dlm.triggers to disable tiggers for the given p_table_name which were created using the dlm.triggers view.
If called with p_silent=false, is invokes "RAISE NOTICE" on each triggers that it enabled.
If if disabling an individual trigger fails, it logs a warning and goes on.
See gh #489.'
;
-- declare the function to load rows into the massmigrate_records table
DROP FUNCTION IF EXISTS dlm.load_production_table_rows(text, int);
CREATE OR REPLACE FUNCTION dlm.load_production_table_rows(IN p_tableName text DEFAULT NULL, IN p_limit int DEFAULT 1000000)
RETURNS TABLE (TableName varchar, UpdateCount int, Massmigrate_ID int)
AS
$BODY$
DECLARE
v_insert_sql character varying;
v_inserted integer;
v_config_line record;
BEGIN
--
SELECT m.massmigrate_id, t.TableName, m.WhereClause INTO v_config_line
FROM dlm.massmigrate m
JOIN AD_Table t ON t.AD_Table_ID=m.AD_Table_ID
WHERE status IN ('pending', 'load_rows')
AND lower(COALESCE(p_tableName, t.TableName)) = lower(t.TableName)
ORDER BY m.massmigrate_id -- we order it just to be somewhat predictable
LIMIT 1;
IF v_config_line IS NULL
THEN
RAISE INFO 'load_production_table_rows: Found no dlm.massmigrate record with status=''update_rows''; p_tableName=%; nothing to do.', p_tableName;
RETURN; -- see RETURN and RETURN QUERY in https://www.postgresql.org/docs/9.5/static/plpgsql-control-structures.html
END IF;
UPDATE dlm.massmigrate m set status='load_rows' where m.massmigrate_id=v_config_line.massmigrate_id;
v_insert_sql :=
'INSERT INTO dlm.massmigrate_records (massmigrate_id, TableName, Record_ID)
SELECT '||
v_config_line.massmigrate_id||','''||
v_config_line.TableName||''','||
v_config_line.TableName||'_ID
FROM '||v_config_line.TableName||'
WHERE '||v_config_line.WhereClause||'
AND COALESCE('||v_config_line.TableName||'.DLM_Level,0) < 2
/* don''t insert records that were already inserted */
AND NOT EXISTS (select 1 from dlm.massmigrate_records r where r.Record_ID='||v_config_line.TableName||'_ID AND r.TableName='''||v_config_line.TableName||''')
LIMIT '||p_limit||'
;';
RAISE INFO 'load_production_table_rows - %: Going to load references to table rows into dlm.massmigrate_records using WHERE=% and LIMIT=%',
v_config_line.TableName, v_config_line.WhereClause, p_limit;
--RAISE NOTICE 'Going to execute %', v_insert_sql;
EXECUTE v_insert_sql;
GET DIAGNOSTICS v_inserted = ROW_COUNT;
RAISE INFO 'load_production_table_rows - %: Inserted % references into dlm.massmigrate_records', v_config_line.TableName, v_inserted;
IF v_inserted = 0 THEN
RAISE INFO 'load_production_table_rows - %: Update status of massmigrate_id=% row to "done", because there were no matching rows to update.', v_config_line.TableName, v_config_line.massmigrate_id;
UPDATE dlm.massmigrate m set status='done' where m.massmigrate_id=v_config_line.massmigrate_id;
ELSIF v_inserted >= p_limit THEN
RAISE INFO 'load_production_table_rows - %: Update status of massmigrate_id=% row to "load_rows", because there are still rows to load left.', v_config_line.TableName, v_config_line.massmigrate_id;
UPDATE dlm.massmigrate m set status='load_rows' where m.massmigrate_id=v_config_line.massmigrate_id;
ELSE
--we now inserted all the rows go to next stage
RAISE INFO 'load_production_table_rows - %: Update status of massmigrate_id=% row to "update_rows" because all rows were loaded now.', v_config_line.TableName, v_config_line.massmigrate_id;
UPDATE dlm.massmigrate m set status='update_rows' where m.massmigrate_id=v_config_line.massmigrate_id;
END IF;
RETURN QUERY SELECT v_config_line.TableName::varchar, v_inserted, v_config_line.massmigrate_id;
RETURN;
END
$BODY$
LANGUAGE plpgsql VOLATILE;
COMMENT ON FUNCTION dlm.load_production_table_rows(text, int) IS
'Function to get rows into the dlm.massmigrate_records table.
This function works in tandem with the update_production_table function.
If a not-null p_tableName is given (case-insensitive), then only dlm.massmigrate records which reference the respective table are considered.
The optional int param (default=100000) tells the function how many rows to load each time.
Note that it''s allowed to update dlm.massmigrate back to "pending" or "load_rows" and rerun this function, in order to pick up (new) records that were not yet matched by earlier runs.
But also note that as of now, this function does not care for records which were added to massmigrate_records earlier, but do not qualify anymore!
';
DROP FUNCTION IF EXISTS dlm.update_production_table(text, int );
CREATE OR REPLACE FUNCTION dlm.update_production_table(IN p_tableName text DEFAULT NULL, IN p_limit int DEFAULT 1000000)
RETURNS TABLE (TableName varchar, UpdateCount int, Massmigrate_ID int)
AS
$BODY$
DECLARE
v_update_production_table_sql character varying;
v_to_update integer;
v_config_line record;
BEGIN
SELECT m.massmigrate_id, m.DLM_Partition_ID, t.TableName INTO v_config_line
FROM dlm.massmigrate m
JOIN AD_Table t ON t.AD_Table_ID=m.AD_Table_ID
WHERE status IN ('update_rows')
AND lower(COALESCE(p_tableName, t.TableName)) = lower(t.TableName)
ORDER BY m.massmigrate_id -- we order it just to be somewhat predictable
LIMIT 1 /* we only want one table at a time to make disabling triggers and everything easier */
;
IF v_config_line IS NULL
THEN
RAISE INFO 'update_production_table: Found no dlm.massmigrate record with status=''update_rows''; p_tableName=%; nothing to do.', p_tableName;
RETURN; -- see RETURN and RETURN QUERY in https://www.postgresql.org/docs/9.5/static/plpgsql-control-structures.html
END IF;
RAISE INFO 'update_production_table - %: Going to load max % references from dlm.massmigrate_records into a temporary table', v_config_line.TableName, p_limit;
-- create a temporary table and load 100000 records into it.
-- those 100000 records reference the production-table records which we are going to update in this run of the function
CREATE TEMPORARY TABLE massmigrate_records_temp AS
SELECT r.massmigrate_records_ID, r.Record_ID, r.TableName
FROM dlm.massmigrate_records r
WHERE r.IsDone='N' AND r.massmigrate_id=v_config_line.massmigrate_id
ORDER BY r.massmigrate_records_id
LIMIT p_limit;
GET DIAGNOSTICS v_to_update = ROW_COUNT;
RAISE INFO 'update_production_table - %: Loaded % rows from dlm.massmigrate_records into a temporary table', v_config_line.TableName, v_to_update;
IF v_to_update > 0
THEN
-- there are records to update, so update the production table and also set the respective massmigrate_records rows to IsDone='Y'
RAISE INFO 'update_production_table - %: Going to update % rows to DLM_Level=2', v_config_line.TableName, v_to_update;
-- disable DLM-triggers for table v_config_line.TableName
PERFORM dlm.disable_dlm_triggers(v_config_line.TableName, true); /*p_silent=true*/
v_update_production_table_sql := '
UPDATE '||v_config_line.TableName||'
SET DLM_Level=2, DLM_Partition_ID='||v_config_line.DLM_Partition_ID||'
FROM massmigrate_records_temp t
WHERE '||v_config_line.TableName||'_ID=t.Record_ID;';
EXECUTE v_update_production_table_sql;
-- re-enable DLM-triggers for table v_config_line.TableName
PERFORM dlm.disable_dlm_triggers(v_config_line.TableName, true); /*p_silent=true*/
UPDATE dlm.massmigrate_records r SET IsDone='Y'
FROM massmigrate_records_temp t
WHERE t.massmigrate_records_ID=r.massmigrate_records_ID;
END IF;
DROP TABLE massmigrate_records_temp;
IF v_to_update < p_limit
THEN
-- no more rows to update for the current massmigrate; go to 'done'
RAISE INFO 'update_production_table - %: Update status of massmigrate_id=% row to "done"', v_config_line.TableName, v_config_line.massmigrate_id;
UPDATE dlm.massmigrate m set status='done' where m.massmigrate_id=v_config_line.massmigrate_id;
END IF;
RETURN QUERY SELECT v_config_line.TableName, v_to_update, v_config_line.massmigrate_id;
RETURN;
END
$BODY$
LANGUAGE plpgsql VOLATILE;
COMMENT ON FUNCTION dlm.update_production_table(text, int) IS
'Function to update production rows which have a referencing row in dlm.massmigrate_records.
This function works in tandem with the load_production_table_rows function.
If a not-null p_tableName is given (case-insensitive), then only dlm.massmigrate records which reference the respective table are considered.
The optional int param (default=100000) tells the function how many rows to load each time.
'; | the_stack |
-- menu admin
UPDATE `sys_menu_admin` SET `icon` = 'book' WHERE `name` = 'Blogs';
-- page builder
DELETE FROM `sys_page_compose` WHERE `Page` IN ('index', 'profile') AND `Desc` IN ('Recently posted blogs', 'Blogs calendar', 'Member blog block');
DELETE FROM `sys_page_compose` WHERE `Func` IN ('PostActions', 'PostRate', 'PostOverview', 'PostCategories', 'PostFeature', 'PostTags', 'PostView', 'PostComments', 'PostSocialSharing') AND `Page` = 'bx_blogs';
DELETE FROM `sys_page_compose` WHERE `Func` IN ('Top', 'Latest', 'Calendar') AND `Page` = 'bx_blogs_home';
UPDATE `sys_page_compose` SET `Column` = 0, `Order` = 0 WHERE `Page` = 'bx_blogs' OR `Page` = 'bx_blogs_home';
INSERT INTO `sys_page_compose` (`ID`, `Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES
(NULL, 'index', '1140px', 'Recently posted blogs', '_bx_blog_Blogs', 0, 0, 'PHP', 'return BxDolService::call(''blogs'', ''blogs_index_page'');', 1, 71.9, 'non,memb', 0),
(NULL, 'index', '1140px', 'Blogs calendar', '_bx_blog_Calendar', 0, 0, 'PHP', 'return BxDolService::call(''blogs'', ''blogs_calendar_index_page'', array($iBlockID));', 0, 28.1, 'non,memb', 0),
(NULL, 'profile', '1140px', 'Member blog block', '_bx_blog_Blog', 0, 0, 'PHP', 'return BxDolService::call(''blogs'', ''blogs_profile_page'', array($this->oProfileGen->_iProfileID));', 1, 71.9, 'non,memb', 0);
INSERT INTO `sys_page_compose` (`ID`, `Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES
(NULL, 'bx_blogs', '1140px', '', '_Title', 1, 0, 'PostView', '', 0, 71.9, 'non,memb', 0),
(NULL, 'bx_blogs', '1140px', '', '_Comments', 1, 1, 'PostComments', '', 1, 71.9, 'non,memb', 0),
(NULL, 'bx_blogs', '1140px', '', '_bx_blog_post_info', 2, 0, 'PostOverview', '', 1, 28.1, 'non,memb', 0),
(NULL, 'bx_blogs', '1140px', '', '_Rate', 2, 1, 'PostRate', '', 1, 28.1, 'non,memb', 0),
(NULL, 'bx_blogs', '1140px', '', '_Actions', 2, 2, 'PostActions', '', 1, 28.1, 'non,memb', 0),
(NULL, 'bx_blogs', '1140px', '', '_sys_block_title_social_sharing', 2, 3, 'PostSocialSharing', '', 1, 28.1, 'non,memb', 0),
(NULL, 'bx_blogs', '1140px', '', '_bx_blog_Categories', 2, 4, 'PostCategories', '', 0, 28.1, 'non,memb', 0),
(NULL, 'bx_blogs', '1140px', '', '_Tags', 2, 5, 'PostTags', '', 1, 28.1, 'non,memb', 0),
(NULL, 'bx_blogs', '1140px', '', '_bx_blog_Featured_Posts', 0, 0, 'PostFeature', '', 1, 28.1, 'non,memb', 0),
(NULL, 'bx_blogs_home', '1140px', '', '_bx_blog_Latest_posts', 1, 1, 'Latest', '', 1, 71.9, 'non,memb', 0),
(NULL, 'bx_blogs_home', '1140px', '', '_bx_blog_Top_blog', 2, 2, 'Top', '', 1, 28.1, 'non,memb', 0),
(NULL, 'bx_blogs_home', '1140px', '', '_bx_blog_Calendar', 2, 1, 'Calendar', '', 0, 28.1, 'non,memb', 0);
-- stat site
UPDATE `sys_stat_site` SET `Title` = 'bx_blog_stat', `AdminLink` = 'modules/boonex/blogs/post_mod_blog.php', `AdminQuery` = 'SELECT COUNT(*) FROM `[db_prefix]_posts` WHERE `PostStatus`=''disapproval''', `IconName` = 'book' WHERE `Name` = 'blg';
-- menu top
SET @iMenuBlogs = (SELECT `ID` FROM `sys_menu_top` WHERE `Parent` = 0 AND `Type` = 'top' AND `Name` = 'Blogs');
UPDATE `sys_menu_top` SET `Picture` = 'book', `Icon` = 'book' WHERE `ID` = @iMenuBlogs;
UPDATE `sys_menu_top` SET `Picture` = '' WHERE `Parent` = @iMenuBlogs OR (`Name` = 'Profile Blog' AND (`Parent` = 4 OR `Parent` = 9));
UPDATE `sys_menu_top` SET `Name` = 'Blog Post' WHERE `Name` = 'bx_blogpost_view' AND `Parent` = 0;
UPDATE `sys_menu_top` SET `Caption` = '_sys_calendar' WHERE `Name` = 'Blog Calendar' AND `Caption` = '_bx_blog_Calendar';
-- menu member
SET @iMemberMenuParent = (SELECT `ID` FROM `sys_menu_member` WHERE `Name` = 'AddContent');
SET @iMemberMenuOrder = (SELECT MAX(`Order`) + 1 FROM `sys_menu_member` WHERE `Parent` = IFNULL(@iMemberMenuParent, -1));
DELETE FROM `sys_menu_member` WHERE `Name` = 'bx_blogs';
INSERT INTO `sys_menu_member` SET `Name` = 'bx_blogs', `Eval` = 'return BxDolService::call(''blogs'', ''get_member_menu_item_add_content'');', `Type` = 'linked_item', `Parent` = IFNULL(@iMemberMenuParent, 0), `Order` = IFNULL(@iMemberMenuOrder, 1);
-- objects: actions
DELETE FROM `sys_objects_actions` WHERE `Type` = 'bx_blogs' AND `Caption` IN ('_Add Post', '_bx_blog_Blogs_Home', '_Edit', '_bx_blog_Back_to_Blog', '{sbs_blogs_title}');
DELETE FROM `sys_objects_actions` WHERE `Type` = 'bx_blogs' AND (`Eval` LIKE '%_bx_blog_My_blog%' OR `Eval` LIKE '%_Feature it%' OR `Eval` LIKE '%_Delete%' OR `Eval` LIKE '%sSACaption%');
DELETE FROM `sys_objects_actions` WHERE `Type` = 'bx_blogs_m' AND `Caption` IN ('_bx_blog_Back_to_Blog', '_Add Post');
DELETE FROM `sys_objects_actions` WHERE `Type` = 'bx_blogs_m' AND (`Eval` LIKE '%_bx_blog_RSS%' OR `Eval` LIKE '%_bx_blog_Edit_blog%' OR `Eval` LIKE '%_bx_blog_Delete_blog%');
INSERT INTO `sys_objects_actions` (`ID`, `Caption`, `Icon`, `Url`, `Script`, `Eval`, `Order`, `Type`, `bDisplayInSubMenuHeader`) VALUES
(NULL, '_Add Post', 'plus', '{evalResult}', '', 'if ({only_menu} == 1)\r\n return (getParam(''permalinks_blogs'') == ''on'') ? ''blogs/my_page/add/'' : ''modules/boonex/blogs/blogs.php?action=my_page&mode=add'';\r\nelse\r\n return null;', 1, 'bx_blogs', 1),
(NULL, '{evalResult}', 'book', '{blog_owner_link}', '', 'if ({only_menu} == 1)\r\nreturn _t(''_bx_blog_My_blog'');\r\nelse\r\nreturn null;', 2, 'bx_blogs', 1),
(NULL, '_bx_blog_Blogs_Home', 'book', '{evalResult}', '', 'if ({only_menu} == 1)\r\n return (getParam(''permalinks_blogs'') == ''on'') ? ''blogs/home/'' : ''modules/boonex/blogs/blogs.php?action=home'';\r\nelse\r\n return null;', 3, 'bx_blogs', 0),
(NULL, '{evalResult}', 'star-empty', '{post_entry_url}&do=cfs&id={post_id}', '', '$iPostFeature = (int)''{post_featured}'';\r\nif (({visitor_id}=={owner_id} && {owner_id}>0) || {admin_mode} == true) {\r\nreturn ($iPostFeature==1) ? _t(''_De-Feature it'') : _t(''_Feature it'');\r\n}\r\nelse\r\nreturn null;', 4, 'bx_blogs', 0),
(NULL, '_Edit', 'edit', '{evalResult}', '', 'if (({visitor_id}=={owner_id} && {owner_id}>0) || {admin_mode} == true || {edit_allowed}) {\r\n return (getParam(''permalinks_blogs'') == ''on'') ? ''blogs/my_page/edit/{post_id}'' : ''modules/boonex/blogs/blogs.php?action=edit_post&EditPostID={post_id}'';\r\n}\r\nelse\r\n return null;', 5, 'bx_blogs', 0),
(NULL, '{evalResult}', 'remove', '', 'iDelPostID = {post_id}; sWorkUrl = ''{work_url}''; if (confirm(''{sure_label}'')) { window.open (sWorkUrl+''?action=delete_post&DeletePostID=''+iDelPostID,''_self''); }', '$oModule = BxDolModule::getInstance(''BxBlogsModule'');\r\n if (({visitor_id}=={owner_id} && {owner_id}>0) || {admin_mode} == true || $oModule->isAllowedPostDelete({owner_id})) {\r\nreturn _t(''_Delete'');\r\n}\r\nelse\r\nreturn null;', 6, 'bx_blogs', 0),
(NULL, '{evalResult}', 'ok-circle', '{post_inside_entry_url}&sa={sSAAction}', '', '$sButAct = ''{sSACaption}'';\r\nif ({admin_mode} == true || {allow_approve}) {\r\nreturn $sButAct;\r\n}\r\nelse\r\nreturn null;', 7, 'bx_blogs', 0),
(NULL, '{sbs_blogs_title}', 'paper-clip', '', '{sbs_blogs_script}', '', 8, 'bx_blogs', 0),
(NULL, '_bx_blog_Back_to_Blog', 'book', '{evalResult}', '', 'return ''{blog_owner_link}'';\r\n', 9, 'bx_blogs', 0);
INSERT INTO `sys_objects_actions` (`ID`, `Caption`, `Icon`, `Url`, `Script`, `Eval`, `Order`, `Type`, `bDisplayInSubMenuHeader`) VALUES
(NULL, '{evalResult}', 'rss', '{site_url}rss_factory.php?action=blogs&pid={owner_id}', '', 'return _t(''_bx_blog_RSS'');', 1, 'bx_blogs_m', 0),
(NULL, '_bx_blog_Back_to_Blog', 'book', '{blog_owner_link}', '', '', 2, 'bx_blogs_m', 0),
(NULL, '_Add Post', 'plus', '{evalResult}', '', 'if (({visitor_id}=={owner_id} && {owner_id}>0) || {admin_mode}==true)\r\nreturn (getParam(''permalinks_blogs'') == ''on'') ? ''blogs/my_page/add/'' : ''modules/boonex/blogs/blogs.php?action=my_page&mode=add'';\r\nelse\r\nreturn null;', 3, 'bx_blogs_m', 1),
(NULL, '{evalResult}', 'edit', '', 'PushEditAtBlogOverview(''{blog_id}'', ''{blog_description_js}'', ''{owner_id}'');', 'if (({visitor_id}=={owner_id} && {owner_id}>0) || {admin_mode}==true)\r\nreturn _t(''_bx_blog_Edit_blog'');\r\nelse\r\nreturn null;', 4, 'bx_blogs_m', 1),
(NULL, '{evalResult}', 'remove', '', 'if (confirm(''{sure_label}'')) window.open (''{work_url}?action=delete_blog&DeleteBlogID={blog_id}'',''_self'');', 'if (({visitor_id}=={owner_id} && {owner_id}>0) || {admin_mode}==true)\r\nreturn _t(''_bx_blog_Delete_blog'');\r\nelse\r\nreturn null;', 5, 'bx_blogs_m', 0);
-- subscriptions
SET @iSbsTypeRate = (SELECT `id` FROM `sys_sbs_types` WHERE `unit` = 'bx_blogs' AND `action` = 'rate');
SET @iSbsTypeMain = (SELECT `id` FROM `sys_sbs_types` WHERE `unit` = 'bx_blogs' AND `action` = '' AND `template` = '');
UPDATE `sys_sbs_entries` SET `subscription_id` = @iSbsTypeMain WHERE `subscription_id` = @iSbsTypeRate;
DELETE FROM `sys_sbs_types` WHERE `id` = @iSbsTypeRate;
OPTIMIZE TABLE `sys_sbs_types`;
-- email templates
DELETE FROM `sys_email_templates` WHERE `Name` IN ('t_sbsBlogpostsComments', 't_sbsBlogpostsRates');
INSERT INTO `sys_email_templates`(`Name`, `Subject`, `Body`, `Desc`, `LangID`) VALUES
('t_sbsBlogpostsComments', 'New Comments To A Blog Post', '<bx_include_auto:_email_header.html />\r\n\r\n<p><b>Dear <RealName></b>,</p>\r\n\r\n<p>The <a href="<ViewLink>">blog post you subscribed to got new comments</a>!</p>\r\n\r\n<bx_include_auto:_email_footer.html />', 'Subscription: new comments to blog post', 0);
-- menu mobile
DELETE FROM `sys_menu_mobile` WHERE `type` = 'bx_blogs';
SET @iMaxOrderHomepage = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `page` = 'homepage');
SET @iMaxOrderProfile = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `page` = 'profile');
INSERT INTO `sys_menu_mobile` (`type`, `page`, `title`, `icon`, `action`, `action_data`, `eval_bubble`, `eval_hidden`, `order`, `active`) VALUES
('bx_blogs', 'homepage', '_bx_blog_Blogs', '{site_url}modules/boonex/blogs/templates/base/images/icons/mobile_icon.png', 100, '{site_url}modules/boonex/blogs/blogs.php?action=mobile&mode=last', '', '', @iMaxOrderHomepage, 1),
('bx_blogs', 'profile', '_bx_blog_Blog', '', 100, '{site_url}modules/boonex/blogs/blogs.php?action=mobile&mode=user&id={profile_id}', 'return BxDolService::call(''blogs'', ''get_posts_count_for_member'', array(''{profile_id}''));', '', @iMaxOrderProfile, 1);
-- objects: sitemap
DELETE FROM `sys_objects_site_maps` WHERE `object` = 'bx_blogs';
SET @iMaxOrderSiteMaps = (SELECT MAX(`order`)+1 FROM `sys_objects_site_maps`);
INSERT INTO `sys_objects_site_maps` (`object`, `title`, `priority`, `changefreq`, `class_name`, `class_file`, `order`, `active`) VALUES
('bx_blogs', '_bx_blog_blog_posts', '0.8', 'auto', 'BxBlogsSiteMapsPosts', 'modules/boonex/blogs/classes/BxBlogsSiteMapsPosts.php', @iMaxOrderSiteMaps, 1);
-- objects: chart
DELETE FROM `sys_objects_charts` WHERE `object` = 'bx_blogs';
SET @iMaxOrderCharts = (SELECT MAX(`order`)+1 FROM `sys_objects_charts`);
INSERT INTO `sys_objects_charts` (`object`, `title`, `table`, `field_date_ts`, `field_date_dt`, `query`, `active`, `order`) VALUES
('bx_blogs', '_bx_blog_chart', 'bx_blogs_posts', 'PostDate', '', '', 1, @iMaxOrderCharts);
-- delete unused language keys
DELETE `sys_localization_strings` FROM `sys_localization_strings`, `sys_localization_keys` WHERE `sys_localization_keys`.`ID` = `sys_localization_strings`.`IDKey` AND `sys_localization_keys`.`Key` IN('_bx_blog_Articles','_bx_blog_Under_Development','_bx_blog_admin_blog','_bx_blog_sbs_main','_bx_blog_sbs_rates','_bx_blog_user_made_blog_post');
DELETE FROM `sys_localization_keys` WHERE `Key` IN('_bx_blog_Articles','_bx_blog_Under_Development','_bx_blog_admin_blog','_bx_blog_sbs_main','_bx_blog_sbs_rates','_bx_blog_user_made_blog_post');
-- update module version
UPDATE `sys_modules` SET `version` = '1.1.0' WHERE `uri` = 'blogs' AND `version` = '1.0.9'; | the_stack |
-- section 1: range partitioned table, the boundary of last partition is NOT MAXVALUE
-- create range partitioned table
create table altertable_rangeparttable
(
c1 int,
c2 float,
c3 real,
c4 text
)
partition by range (c1, c2, c3, c4)
(
partition altertable_rangeparttable_p1 values less than (10, 10.00, 19.156, 'h'),
partition altertable_rangeparttable_p2 values less than (20, 20.89, 23.75, 'k'),
partition altertable_rangeparttable_p3 values less than (30, 30.45, 32.706, 's')
);
create index index_altertable_rangeparttable_local1 on altertable_rangeparttable (c1, c2) local
(
partition index_altertable_rangeparttable_local1_srp1_index_local tablespace PG_DEFAULT,
partition index_altertable_rangeparttable_local1_srp2_index_local tablespace PG_DEFAULT,
partition index_altertable_rangeparttable_local1_srp3_index_local tablespace PG_DEFAULT
);
create index index_altertable_rangeparttable_local2 on altertable_rangeparttable (c1, (c1+c2)) local
(
partition index_altertable_rangeparttable_local2_srp1_index_local tablespace PG_DEFAULT,
partition index_altertable_rangeparttable_local2_srp2_index_local tablespace PG_DEFAULT,
partition index_altertable_rangeparttable_local2_srp3_index_local tablespace PG_DEFAULT
);
-- fail: name conflict with existing partitions
alter table altertable_rangeparttable add partition altertable_rangeparttable_p3 values less than (38);
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: length of maxvalue not equal with number of partition keys
alter table altertable_rangeparttable add partition altertable_rangeparttable_p4 values less than (35, 39.05, 'x');
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: partition boundary can not contain null
alter table altertable_rangeparttable add partition altertable_rangeparttable_p4 values less than (NULL, 44.15, 48.897, 'X');
alter table altertable_rangeparttable add partition altertable_rangeparttable_p4 values less than (40, NULL, 48.897, 'X');
alter table altertable_rangeparttable add partition altertable_rangeparttable_p4 values less than (40, 44.15, NULL, 'X');
alter table altertable_rangeparttable add partition altertable_rangeparttable_p4 values less than (40, 44.15, 48.897, NULL);
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: boudary of new adding partition NOT behind boudary of last partition
alter table altertable_rangeparttable add partition altertable_rangeparttable_p4 values less than (5, 4.15, 8.28, 'd');
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: add a partition whose boundary is the same as the last partition's boundary
alter table altertable_rangeparttable add partition altertable_rangeparttable_p4 values less than (30, 30.45, 32.706, 's');
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: add a new partition p4
alter table altertable_rangeparttable add partition altertable_rangeparttable_p4 values less than (36, 45.25, 37.39, 'u') tablespace PG_DEFAULT;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: add a new partition p4
alter table altertable_rangeparttable add partition altertable_rangeparttable_p40 values less than (36, 45.25, 37.39, 'u') tablespace PG_DEFAULT;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: add 2 partition in 1 alter table statement
alter table altertable_rangeparttable add partition altertable_rangeparttable_p6 values less than (MAXVALUE, MAXVALUE, MAXVALUE, MAXVALUE), add partition altertable_rangeparttable_p5 values less than (MAXVALUE, MAXVALUE, 58.02, 'w');
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: add 2 partition in 1 alter table statement
alter table altertable_rangeparttable add partition altertable_rangeparttable_p5 values less than (MAXVALUE, MAXVALUE, 58.02, 'w'), add partition altertable_rangeparttable_p6 values less than (MAXVALUE, MAXVALUE, MAXVALUE, MAXVALUE);
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: drop 2 partition in 1 alter table statement
alter table altertable_rangeparttable drop partition altertable_rangeparttable_p5, drop partition altertable_rangeparttable_p6;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: add a new partition whose boundaries contain MAXVALUE.
alter table altertable_rangeparttable add partition altertable_rangeparttable_p5 values less than (MAXVALUE, MAXVALUE, 58.02, 'w');
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: boundaries are all MAXVALUE
alter table altertable_rangeparttable add partition altertable_rangeparttable_p6 values less than (MAXVALUE, MAXVALUE, MAXVALUE, MAXVALUE);
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: no more partition can be added
alter table altertable_rangeparttable add partition altertable_rangeparttable_p7 values less than (66, 49.25, 99.69, 'w');
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: drop not existing partition
alter table altertable_rangeparttable drop partition altertable_rangeparttable_p8;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: p6 , not exist
alter table altertable_rangeparttable drop partition for (MAXVALUE, MAXVALUE, MAXVALUE, MAXVALUE);
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: drop partition p3
alter table altertable_rangeparttable drop partition altertable_rangeparttable_p3;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: drop partition p5, boundary not full
alter table altertable_rangeparttable drop partition for (40, 40.00, 45.004);
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: drop partition p5
alter table altertable_rangeparttable drop partition for (40, 40.00, 45.004, 'v');
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- fail: drop partition p5, already dropped in last step
alter table altertable_rangeparttable drop partition altertable_rangeparttable_p5;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: drop partition p4(-->p6)
alter table altertable_rangeparttable drop partition for (36, 45.25, 37.39, 'u');
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- success: p2, p4
alter table altertable_rangeparttable drop partition altertable_rangeparttable_p2, drop partition altertable_rangeparttable_p4;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- should not tips: "Cannot drop the only partition of a partitioned table"
-- but: partition "XXX" does not exist
alter table altertable_rangeparttable drop partition altertable_rangeparttable_p2;
-- fail: drop partition p1, the last one
alter table altertable_rangeparttable drop partition altertable_rangeparttable_p1;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'altertable_rangeparttable' or relname = 'index_altertable_rangeparttable_local1' or relname = 'index_altertable_rangeparttable_local2'
)
select relname, boundaries from pg_partition
where parentid in (select oid from partitioned_obj_oids)
order by relname;
-- drop table
drop table altertable_rangeparttable;
-- section 2: interval partitioned table
-- create interval partitioned table
-- create table intervalPartTable
--(
-- c1 timestamp,
-- c2 float,
-- c3 real,
-- c4 text
--)
--partition by range (c1)
--interval (interval '2 23:56:45' day to second)
--(
-- partition p1 values less than ('2012-01-01'),
-- partition p2 values less than ('2012-02-01'),
-- partition p3 values less than ('2012-03-01')
--);
--create index index_intervalPartTable_local1 on intervalPartTable (c1, c2) local
--(
-- partition srp1_index_local tablespace PG_DEFAULT,
-- partition srp2_index_local tablespace PG_DEFAULT,
-- partition srp3_index_local tablespace PG_DEFAULT
--);
--create index index_intervalPartTable_local2 on intervalPartTable (c1, (c2+c3)) local
--(
-- partition srp1_index_local tablespace PG_DEFAULT,
-- partition srp2_index_local tablespace PG_DEFAULT,
-- partition srp3_index_local tablespace PG_DEFAULT
--);
-- fail: add partition p4, can not add partition against interval partitioned table
--alter table intervalPartTable add partition p1 values less than ('2012-09-01');
--select relname, boundaries from pg_partition order by relname;
-- dpl set off 2014-01-20
--insert into intervalPartTable values ('2013-04-01');
--insert into intervalPartTable values ('2013-05-01');
--insert into intervalPartTable values ('2013-06-01');
--alter table intervalPartTable drop partition for ('2013-06-01');
--alter table intervalPartTable drop partition for ('2013-05-01');
--alter table intervalPartTable drop partition for ('2013-04-01');
-- fail: annot drop last range partition of interval partitioned table
--alter table intervalPartTable drop partition p3;
--select relname, boundaries from pg_partition order by relname;
-- success: drop partition p1, p2
--alter table intervalPartTable drop partition p2;
--select relname, boundaries from pg_partition order by relname;
--alter table intervalPartTable drop partition p1;
--select relname, boundaries from pg_partition order by relname;
-- drop table
--drop table intervalPartTable;
CREATE TABLE DBA_IND_PARTITIONS_TABLE_011_1(
C_CHAR_3 CHAR(10),
C_VARCHAR_3 VARCHAR(1024),
C_INT INTEGER,
C_NUMERIC numeric(10,5),
C_TS_WITHOUT TIMESTAMP WITHOUT TIME ZONE)
partition by range (C_CHAR_3,C_VARCHAR_3,C_INT,C_TS_WITHOUT)
(
partition DBA_IND_PARTITIONS_011_1_1 values less than ('D', 'd', 400, '2000-04-01'),
partition DBA_IND_PARTITIONS_011_1_2 values less than ('G', 'g', 700, '2000-07-01')
);
select relname ,boundaries from pg_partition
where parentid = (select oid from pg_class where relname = 'dba_ind_partitions_table_011_1')
order by 1, 2;
alter table DBA_IND_PARTITIONS_TABLE_011_1 add partition DBA_IND_PARTITIONS_011_1_3 values less than ('Z', 'z',1000, '2000-10-01');
select relname ,boundaries from pg_partition where upper(relname) = upper('DBA_IND_PARTITIONS_011_1_3') order by 1, 2;
drop table DBA_IND_PARTITIONS_TABLE_011_1;
----------------------------------------------------------------------
--test the alter row movement
create table altertable_rowmovement_table
(
c1 int,
c2 int
)
partition by range (c1)
(
partition altertable_rowmovement_table_p0 values less than (50),
partition altertable_rowmovement_table_p1 values less than (100),
partition altertable_rowmovement_table_p2 values less than (150)
);
select relname, relrowmovement from pg_class where upper(relname) = upper('ALTERTABLE_ROWMOVEMENT_TABLE') order by 1, 2;
-- relrowmovement = f
alter table altertable_rowmovement_table disable row movement;
select relname, relrowmovement from pg_class where upper(relname) = upper('ALTERTABLE_ROWMOVEMENT_TABLE') order by 1, 2;
-- relrowmovement = f
alter table altertable_rowmovement_table enable row movement;
select relname, relrowmovement from pg_class where upper(relname) = upper('ALTERTABLE_ROWMOVEMENT_TABLE') order by 1, 2;
-- relrowmovement = t
alter table altertable_rowmovement_table disable row movement;
select relname, relrowmovement from pg_class where upper(relname) = upper('ALTERTABLE_ROWMOVEMENT_TABLE') order by 1, 2;
-- relrowmovement = f
alter table altertable_rowmovement_table enable row movement, disable row movement;
select relname, relrowmovement from pg_class where upper(relname) = upper('ALTERTABLE_ROWMOVEMENT_TABLE') order by 1, 2;
-- relrowmovement = f
alter table altertable_rowmovement_table add partition altertable_rowmovement_table_p3 values less than (200), enable row movement;
select relname, relrowmovement from pg_class where upper(relname) = upper('ALTERTABLE_ROWMOVEMENT_TABLE') order by 1, 2;
-- relrowmovement = t
drop table altertable_rowmovement_table;
--test the "movement" keyword ,use the "movement" key word as table name and column name
create table movement
(
movement int
);
--create table succeed
drop table movement;
--test the non partitoned table , view , sequence
create table altertable_rowmovement_table
(
c1 int ,
c2 int
);
alter table altertable_rowmovement_table enable row movement;
--error
alter table altertable_rowmovement_table disable row movement;
--error
create view altertable_rowmovement_view as select * from altertable_rowmovement_table;
alter table altertable_rowmovement_view enable row movement;
--error
alter table altertable_rowmovement_view disable row movement;
--error
alter view altertable_rowmovement_view enable row movement;
--error
alter view altertable_rowmovement_view disable row movement;
--error
drop view altertable_rowmovement_view;
create sequence altertable_rowmovement_seq;
alter table altertable_rowmovement_seq enable row movement;
--error
alter table altertable_rowmovement_seq disable row movement;
--error
alter sequence altertable_rowmovement_seq enable row movement;
--error
alter sequence altertable_rowmovement_seq disable row movement;
--error
drop sequence altertable_rowmovement_seq;
drop table altertable_rowmovement_table;
CREATE SCHEMA fvt_data_partition_alter_table;
CREATE TABLE fvt_data_partition_alter_table.TAB_OTHER_SQL_CMD_ANALYZE_013
(
ANALYZE_COL_1 CHAR(102400),
ANALYZE_COL_2 VARCHAR(1024),
ANALYZE_COL_3 INTEGER,
ANALYZE_COL_4 numeric(10,5),
ANALYZE_COL_5 TIMESTAMP WITHOUT TIME ZONE
)
partition by range (ANALYZE_COL_3)
(
partition PAR_ANALYZE_013_1 values less than (400),
partition PAR_ANALYZE_013_2 values less than (700),
partition PAR_ANALYZE_013_3 values less than (1000)
);
INSERT INTO fvt_data_partition_alter_table.TAB_OTHER_SQL_CMD_ANALYZE_013 values(null,'abcdefg',111,1.0,null),('DEFGHIJ','defghij',444,4.44,'2000-04-04 04:04:04'),('GHIJKLM','ghijklm',777,7.77,'2000-07-07 07:07:07'),('B','bcdefghfsdaf',222,2.22222,null),('CD','cdefghifdsa',333,3.33333,'2000-03-03 03:03:03'),('EFGH','efghijk',555,5.55,'2000-05-05 05:05:05'),('FGHIJK',null,666,6.666666,'2000-06-06 06:06:06'),('HIJKLMN','hijklmn',888,8.88,'2000-08-08 08:08:08'),('I',null,999,9.99999,'2000-09-09 09:09:09');
ANALYZE fvt_data_partition_alter_table.TAB_OTHER_SQL_CMD_ANALYZE_013;
SELECT RELNAME,STAATTNUM,STANULLFRAC,STAWIDTH FROM PG_CLASS,PG_STATISTIC WHERE PG_STATISTIC.STARELID = PG_CLASS.oid and PG_CLASS.RELNAME = 'tab_other_sql_cmd_analyze_013' order by 1, 2, 3, 4;
ALTER TABLE fvt_data_partition_alter_table.TAB_OTHER_SQL_CMD_ANALYZE_013 DROP ANALYZE_COL_5;
SELECT RELNAME,STAATTNUM,STANULLFRAC,STAWIDTH FROM PG_CLASS,PG_STATISTIC WHERE PG_STATISTIC.STARELID = PG_CLASS.oid and PG_CLASS.RELNAME = 'tab_other_sql_cmd_analyze_013' order by 1, 2, 3, 4;
ANALYZE fvt_data_partition_alter_table.TAB_OTHER_SQL_CMD_ANALYZE_013;
SELECT RELNAME,STAATTNUM,STANULLFRAC,STAWIDTH FROM PG_CLASS,PG_STATISTIC WHERE PG_STATISTIC.STARELID = PG_CLASS.oid and PG_CLASS.RELNAME = 'tab_other_sql_cmd_analyze_013' order by 1, 2, 3, 4;
DROP SCHEMA fvt_data_partition_alter_table CASCADE;
-- Added by j0021848
--
---- Tese For ALTER TABLE ADD table_constraint [ NOT VALID ]
--
CREATE TABLE TEST_CON (A INT4, B INT)
PARTITION BY RANGE (A)
(
PARTITION TEST_CON_P0 VALUES LESS THAN (50),
PARTITION TEST_CON_P1 VALUES LESS THAN (100),
PARTITION TEST_CON_P2 VALUES LESS THAN (MAXVALUE)
);
SELECT P.RELNAME, P.PARTTYPE, P.PARTSTRATEGY, P.BOUNDARIES, C.RELNAME AS PARENT FROM PG_PARTITION P LEFT JOIN PG_CLASS C ON (P.PARENTID = C.OID)
where P.parentid = (select oid from pg_class where relname = 'test_con')
ORDER BY P.RELNAME;
-- CHECK CONSTRAINT
INSERT INTO TEST_CON VALUES (10, 10);
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_CHECK_NOT_VALID CHECK(A < 0) NOT VALID;
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
ALTER TABLE TEST_CON VALIDATE CONSTRAINT TEST_CHECK_NOT_VALID;
ALTER TABLE TEST_CON DROP CONSTRAINT TEST_CHECK_NOT_VALID;
ALTER TABLE TEST_CON ADD CHECK(A < 0) NOT VALID;
ALTER TABLE TEST_CON VALIDATE CONSTRAINT TEST_CON_A_CHECK;
ALTER TABLE TEST_CON DROP CONSTRAINT TEST_CON_A_CHECK;
ALTER TABLE TEST_CON ADD CHECK(A > 0) NOT VALID;
ALTER TABLE TEST_CON VALIDATE CONSTRAINT TEST_CON_A_CHECK;
ALTER TABLE TEST_CON DROP CONSTRAINT TEST_CON_A_CHECK;
-- UNIQUE CONSTRAINT
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_UIQUE_A_NOT_VALID UNIQUE (A) NOT VALID; -- ERROR: UNIQUE CONSTRAINTS CANNOT BE MARKED NOT VALID
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_UIQUE_VALID UNIQUE (A);
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
INSERT INTO TEST_CON VALUES (20, 201), (20, 202);
ALTER TABLE TEST_CON DROP CONSTRAINT IF EXISTS TEST_UIQUE_VALID;
ALTER TABLE TEST_CON ADD UNIQUE (A);
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
INSERT INTO TEST_CON VALUES (20, 201), (20, 202);
ALTER TABLE TEST_CON DROP CONSTRAINT IF EXISTS TEST_CON_A_KEY;
-- PRIMARY KEY CONSTRAINT
INSERT INTO TEST_CON VALUES (NULL, NULL);
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_PRIMARY_KEY_A_NOT_VALID PRIMARY KEY (A) NOT VALID; -- ERROR: UNIQUE constraints cannot be marked NOT VALID
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_PRIMARY_KEY_A_VALID PRIMARY KEY (A); -- ERROR: column "A" contains null values
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_PRIMARY_KEY_B_VALID PRIMARY KEY (B); -- ERROR: unique index columns must contain the partition key and collation must be default collation
DELETE FROM TEST_CON WHERE A IS NULL;
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_PRIMARY_KEY_A_VALID PRIMARY KEY (A);
INSERT INTO TEST_CON VALUES (NULL, NULL);
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
ALTER TABLE TEST_CON DROP CONSTRAINT IF EXISTS TEST_PRIMARY_KEY_A_VALID;
ALTER TABLE TEST_CON ADD PRIMARY KEY (A);
INSERT INTO TEST_CON VALUES (NULL, NULL);
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
ALTER TABLE TEST_CON DROP CONSTRAINT IF EXISTS TEST_CON_PKEY;
-- EXCLUDE CONSTRAINT
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_EXCLUDE_NOT_VALID EXCLUDE (A WITH =) NOT VALID; -- ERROR: EXCLUDE constraints cannot be marked NOT VALID
ALTER TABLE TEST_CON ADD CONSTRAINT TEST_EXCLUDE_VALID EXCLUDE (A WITH =); -- ERROR: Partitioned table does not support EXCLUDE index
--
---- Tese For ALTER TABLE ADD table_constraint_using_index
--
-- partitioned index does not support index with expression columns
-- ERROR: unique index columns must contain the partition key and the collation must be default collation
CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (INT4UP(A)) LOCAL;
--ERROR: partitioned table does not support global index
-- NEEDTOADJUST -- CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (INT4UP(A));
-- partitioned index does not support partial index
-- ERROR: syntax error at or near "LOCAL"
CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (A) WHERE (A < 100) LOCAL;
-- ERROR: partitioned table does not support global index
-- NEEDTOADJUST -- CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (A) WHERE (A < 100);
-- partitioned index does not support b-tree index without default sort ordering
CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (A DESC NULLS LAST) LOCAL;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'index_on_test_con' or relname = 'test_con'
)
SELECT P.RELNAME, P.PARTTYPE, P.PARTSTRATEGY, C.RELNAME AS PARENT FROM PG_PARTITION P LEFT JOIN PG_CLASS C ON (P.PARENTID = C.OID)
where P.parentid in (select oid from partitioned_obj_oids)
order by 1, 2, 3, 4;
-- ERROR: index "INDEX_ON_TEST_CON" does not have default sorting behavior
ALTER TABLE TEST_CON ADD CONSTRAINT CON UNIQUE USING INDEX INDEX_ON_TEST_CON;
DROP INDEX INDEX_ON_TEST_CON;
-- If PRIMARY KEY is specified, then this command will attempt to do ALTER COLUMN SET NOT NULL against each index's column
INSERT INTO TEST_CON VALUES (NULL, NULL);
CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (A) LOCAL;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'index_on_test_con' or relname = 'test_con'
)
SELECT P.RELNAME, P.PARTTYPE, P.PARTSTRATEGY, P.BOUNDARIES, C.RELNAME AS PARENT FROM PG_PARTITION P LEFT JOIN PG_CLASS C ON (P.PARENTID = C.OID)
where P.parentid in (select oid from partitioned_obj_oids)
order by 1, 2, 3, 4;
ALTER TABLE TEST_CON ADD PRIMARY KEY USING INDEX INDEX_ON_TEST_CON; -- ERROR: column "A" contains null values
DELETE FROM TEST_CON;
INSERT INTO TEST_CON VALUES (50, NULL);
ALTER TABLE TEST_CON ADD PRIMARY KEY USING INDEX INDEX_ON_TEST_CON;
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
ALTER TABLE TEST_CON DROP CONSTRAINT INDEX_ON_TEST_CON;
-- 1. If a constraint name is not provided, the constraint will be named the same as the index.
-- 2. After this command is executed, the index is "owned" by the constraint
CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (A) LOCAL;
ALTER TABLE TEST_CON ADD PRIMARY KEY USING INDEX INDEX_ON_TEST_CON;
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
ALTER TABLE TEST_CON DROP CONSTRAINT INDEX_ON_TEST_CON;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'test_con'
)
SELECT P.RELNAME, P.PARTTYPE, P.PARTSTRATEGY, P.BOUNDARIES, C.RELNAME AS PARENT FROM PG_PARTITION P LEFT JOIN PG_CLASS C ON (P.PARENTID = C.OID)
where P.parentid in (select oid from partitioned_obj_oids)
ORDER BY 1, 2, 3, 4, 5;
CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (A) LOCAL;
ALTER TABLE TEST_CON ADD UNIQUE USING INDEX INDEX_ON_TEST_CON;
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
ALTER TABLE TEST_CON DROP CONSTRAINT INDEX_ON_TEST_CON;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'test_con'
)
SELECT P.RELNAME, P.PARTTYPE, P.PARTSTRATEGY, P.BOUNDARIES, C.RELNAME AS PARENT FROM PG_PARTITION P LEFT JOIN PG_CLASS C ON (P.PARENTID = C.OID)
where P.parentid in (select oid from partitioned_obj_oids)
ORDER BY 1, 2 , 3, 4, 5;
-- 1. If a constraint name is provided then the index will be renamed to match the constraint name.
-- 2. After this command is executed, the index is "owned" by the constraint
CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (A) LOCAL;
ALTER TABLE TEST_CON ADD CONSTRAINT CON UNIQUE USING INDEX INDEX_ON_TEST_CON;
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'con' or relname = 'test_con'
)
SELECT P.RELNAME, P.PARTTYPE, P.PARTSTRATEGY, P.BOUNDARIES, C.RELNAME AS PARENT FROM PG_PARTITION P LEFT JOIN PG_CLASS C ON (P.PARENTID = C.OID)
where P.parentid in (select oid from partitioned_obj_oids)
order by 1, 2, 3, 4, 5;
SELECT SCHEMANAME, TABLENAME, INDEXNAME FROM PG_INDEXES WHERE upper(TABLENAME) = upper('TEST_CON') order by 1, 2, 3;
ALTER TABLE TEST_CON ADD CONSTRAINT CON_PK PRIMARY KEY USING INDEX INDEX_ON_TEST_CON; -- ERROR: index "INDEX_ON_TEST_CON" does not exist
ALTER TABLE TEST_CON ADD CONSTRAINT CON_PK PRIMARY KEY USING INDEX CON; -- ERROR: index "CON" is already associated with a constraint
ALTER TABLE TEST_CON DROP CONSTRAINT CON;
CREATE UNIQUE INDEX INDEX_ON_TEST_CON ON TEST_CON (A) LOCAL;
ALTER TABLE TEST_CON ADD CONSTRAINT CON_PK PRIMARY KEY USING INDEX INDEX_ON_TEST_CON;
SELECT CON.CONNAME, CON.CONTYPE, CON.CONVALIDATED, CLA.RELNAME AS CONRELNAME FROM PG_CONSTRAINT CON LEFT JOIN PG_CLASS CLA ON(CON. CONRELID = CLA.OID) WHERE upper(CLA.RELNAME) = upper('TEST_CON') order by 1, 2, 3, 4;
with partitioned_obj_oids as
(
select oid
from pg_class
where relname = 'con_pk' or relname = 'test_con'
)
SELECT P.RELNAME, P.PARTTYPE, P.PARTSTRATEGY, P.BOUNDARIES, C.RELNAME AS PARENT FROM PG_PARTITION P LEFT JOIN PG_CLASS C ON (P.PARENTID = C.OID)
where P.parentid in (select oid from partitioned_obj_oids)
order by 1, 2, 3, 4, 5;
SELECT SCHEMANAME, TABLENAME, INDEXNAME FROM PG_INDEXES WHERE upper(TABLENAME) = upper('TEST_CON');
ALTER TABLE TEST_CON ADD CONSTRAINT CON_PK2 PRIMARY KEY USING INDEX INDEX_ON_TEST_CON; -- ERROR: index "INDEX_ON_TEST_CON" does not exist
ALTER TABLE TEST_CON ADD CONSTRAINT CON_PK2 PRIMARY KEY USING INDEX CON_PK; -- ERROR: index "CON_PK" is already associated with a constraint
ALTER TABLE TEST_CON DROP CONSTRAINT CON_PK;
--
---- clean up
--
DROP TABLE TEST_CON; | the_stack |
-- 29.01.2016 14:34
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,542956,0,'ShowIntCurrency',TO_TIMESTAMP('2016-01-29 14:34:42','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.fresh','Y','Zusätzliche Bilanzwährung','Zusätzliche Bilanzwährung',TO_TIMESTAMP('2016-01-29 14:34:42','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 29.01.2016 14:34
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=542956 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 29.01.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,DefaultValue,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,Updated,UpdatedBy,Version) VALUES (0,553127,542956,0,20,188,'N','ShowIntCurrency',TO_TIMESTAMP('2016-01-29 14:35:06','YYYY-MM-DD HH24:MI:SS'),100,'N','N','de.metas.fresh',1,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','Zusätzliche Bilanzwährung',TO_TIMESTAMP('2016-01-29 14:35:06','YYYY-MM-DD HH24:MI:SS'),100,1)
;
-- 29.01.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=553127 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 29.01.2016 14:35
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_ElementValue ADD ShowIntCurrency CHAR(1) DEFAULT 'N' CHECK (ShowIntCurrency IN ('Y','N')) NOT NULL
;
-- 29.01.2016 14:44
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,542957,0,'Foreign_Currency_ID',TO_TIMESTAMP('2016-01-29 14:44:56','YYYY-MM-DD HH24:MI:SS'),100,'U','Y','Foreign_Currency_ID','Foreign_Currency_ID',TO_TIMESTAMP('2016-01-29 14:44:56','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 29.01.2016 14:44
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=542957 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 29.01.2016 14:45
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET EntityType='de.metas.fresh',Updated=TO_TIMESTAMP('2016-01-29 14:45:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542957
;
-- 29.01.2016 14:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,DDL_NoForeignKey,EntityType,FieldLength,IsActive,IsAdvancedText,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsCalculated,IsDimension,IsEncrypted,IsGenericZoomKeyColumn,IsGenericZoomOrigin,IsIdentifier,IsKey,IsLazyLoading,IsMandatory,IsParent,IsSelectionColumn,IsStaleable,IsSyncDatabase,IsTranslated,IsUpdateable,IsUseDocSequence,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,553138,542957,0,19,112,188,'N','Foreign_Currency_ID',TO_TIMESTAMP('2016-01-29 14:48:14','YYYY-MM-DD HH24:MI:SS'),100,'N','de.metas.fresh',10,'Y','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','Foreign_Currency_ID',0,TO_TIMESTAMP('2016-01-29 14:48:14','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 29.01.2016 14:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=553138 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 29.01.2016 14:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE C_ElementValue ADD Foreign_Currency_ID NUMERIC(10) DEFAULT NULL
;
-- 29.01.2016 14:48
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET MandatoryLogic='@ShowIntCurrency@ = ''Y''',Updated=TO_TIMESTAMP('2016-01-29 14:48:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=553138
;
-- 29.01.2016 14:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET AD_Column_ID=553127, Description=NULL, Help=NULL, Name='Zusätzliche Bilanzwährung', SeqNo=185, SeqNoGrid=185,Updated=TO_TIMESTAMP('2016-01-29 14:58:53','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2076
;
-- 29.01.2016 14:58
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field_Trl SET IsTranslated='N' WHERE AD_Field_ID=2076
;
-- 29.01.2016 16:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic=NULL,Updated=TO_TIMESTAMP('2016-01-29 16:11:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2076
;
-- 29.01.2016 16:12
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SeqNo=210, SeqNoGrid=210,Updated=TO_TIMESTAMP('2016-01-29 16:12:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2076
;
-- 29.01.2016 16:20
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element SET Name='Fremdwährung', PrintName='Fremdwährung',Updated=TO_TIMESTAMP('2016-01-29 16:20:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=542957
;
-- 29.01.2016 16:20
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=542957
;
-- 29.01.2016 16:20
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET ColumnName='Foreign_Currency_ID', Name='Fremdwährung', Description=NULL, Help=NULL WHERE AD_Element_ID=542957
;
-- 29.01.2016 16:20
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Foreign_Currency_ID', Name='Fremdwährung', Description=NULL, Help=NULL, AD_Element_ID=542957 WHERE UPPER(ColumnName)='FOREIGN_CURRENCY_ID' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 29.01.2016 16:20
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process_Para SET ColumnName='Foreign_Currency_ID', Name='Fremdwährung', Description=NULL, Help=NULL WHERE AD_Element_ID=542957 AND IsCentrallyMaintained='Y'
;
-- 29.01.2016 16:20
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Fremdwährung', Description=NULL, Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=542957) AND IsCentrallyMaintained='Y'
;
-- 29.01.2016 16:20
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_PrintFormatItem pi SET PrintName='Fremdwährung', Name='Fremdwährung' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=542957)
;
-- 29.01.2016 16:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,DisplayLogic,EntityType,IncludedTabHeight,IsActive,IsCentrallyMaintained,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,553138,556596,0,132,77,TO_TIMESTAMP('2016-01-29 16:21:22','YYYY-MM-DD HH24:MI:SS'),100,14,'ShowIntCurrency = ''Y''','de.metas.fresh',0,'Y','Y','Y','Y','N','N','N','N','Y','Fremdwährung',210,210,1,1,TO_TIMESTAMP('2016-01-29 16:21:22','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 29.01.2016 16:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=556596 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 29.01.2016 16:21
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET DisplayLogic='@ShowIntCurrency@ = ''Y''',Updated=TO_TIMESTAMP('2016-01-29 16:21:31','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556596
;
-- 29.01.2016 16:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET AD_Reference_ID=18,Updated=TO_TIMESTAMP('2016-01-29 16:22:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=553138
;
commit;
-- 29.01.2016 16:22
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO t_alter_column values('c_elementvalue','Foreign_Currency_ID','NUMERIC(10)',null,'NULL')
;
commit;
-- 29.01.2016 16:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsSameLine='N',Updated=TO_TIMESTAMP('2016-01-29 16:23:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2076
;
-- 29.01.2016 16:23
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SeqNo=220, SeqNoGrid=220,Updated=TO_TIMESTAMP('2016-01-29 16:23:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=556596
; | the_stack |
--- configuration -------------------------------------------------------------------------------------------------------
-- plugin
--
UPDATE configuration SET value = jsonb_set(value, '{plugin, default}', '"OMF"') WHERE value->'plugin'->>'value'='PI_Server_V2';
UPDATE configuration SET value = jsonb_set(value, '{plugin, value}', '"OMF"') WHERE value->'plugin'->>'value'='PI_Server_V2';
-- PIServerEndpoint
--
UPDATE configuration SET value = jsonb_set(value, '{PIServerEndpoint, options}', $$["PI Web API","Connector Relay","OSIsoft Cloud Services","Edge Data Store"]$$) WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{PIServerEndpoint, description}', '"Select the endpoint among PI Web API, Connector Relay, OSIsoft Cloud Services or Edge Data Store"') WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{PIServerEndpoint, order}', '"1"') WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{PIServerEndpoint, displayName}', '"Endpoint"') WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{PIServerEndpoint, default}', '"Connector Relay"') WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{PIServerEndpoint, value}', '"Connector Relay"') WHERE value->'plugin'->>'value'='OMF' AND value->'PIServerEndpoint'->>'value'='Auto Discovery';
UPDATE configuration SET value = jsonb_set(value, '{PIServerEndpoint, value}', '"Connector Relay"') WHERE value->'plugin'->>'value'='OMF' AND value->'PIServerEndpoint'->>'value'='cr';
UPDATE configuration SET value = jsonb_set(value, '{PIServerEndpoint, value}', '"PI Web API"') WHERE value->'plugin'->>'value'='OMF' AND value->'PIServerEndpoint'->>'value'='piwebapi';
-- ServerHostname
-- Note: This is a new config item and its value extract from old URL config item
--
UPDATE configuration SET value = value || '{"ServerHostname": {"default": "localhost", "validity": "PIServerEndpoint != \"OSIsoft Cloud Services\"", "description": "Hostname of the server running the endpoint either PI Web API or Connector Relay or Edge Data Store", "displayName": "Server hostname", "type": "string", "order": "2"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
WITH K AS (
SELECT key from configuration where (value->>'plugin')::jsonb->'value'='"OMF"'
)
UPDATE configuration AS t_cfg SET value=jsonb_set(value, '{ServerHostname, value}',
(SELECT to_json((string_to_array(split_part(((value->>'URL')::jsonb->'value')::text, '/', 3), ':'))[1])::jsonb
FROM configuration c where (value->>'plugin')::jsonb->'value'='"OMF"' AND t_cfg.key = c.key)
) WHERE key in (select key from K);
-- ServerPort
-- Note: This is a new config item and its value extract from old URL config item
--
UPDATE configuration SET value = value || '{"ServerPort": {"default": "0", "validity": "PIServerEndpoint != \"OSIsoft Cloud Services\"", "description": "Port on which the endpoint either PI Web API or Connector Relay or Edge Data Store is listening, 0 will use the default one", "displayName": "Server port, 0=use the default", "type": "integer", "order": "3"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
WITH K AS (
SELECT key from configuration where (value->>'plugin')::jsonb->'value'='"OMF"'
)
UPDATE configuration AS t_cfg SET value=jsonb_set(value, '{ServerPort, value}',
(SELECT to_json((string_to_array(split_part(((value->>'URL')::jsonb->'value')::text, '/', 3), ':'))[2])::jsonb
FROM configuration c where (value->>'plugin')::jsonb->'value'='"OMF"' AND t_cfg.key = c.key)
) WHERE key in (select key from K);
-- URL
-- Note: Removed URL config item as it is replaced by ServerHostname & ServerPort
--
UPDATE configuration SET value = value - 'URL' WHERE value ->'plugin'->>'value'='OMF';
-- producerToken
--
UPDATE configuration SET value = jsonb_set(value, '{producerToken, order}', '"4"') WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{producerToken, validity}', '"PIServerEndpoint == \"Connector Relay\""') WHERE value->'plugin'->>'value'='OMF';
-- source
--
UPDATE configuration SET value = jsonb_set(value, '{source, order}', '"5"') WHERE value->'plugin'->>'value'='OMF';
-- StaticData
--
UPDATE configuration SET value = jsonb_set(value, '{StaticData, order}', '"6"') WHERE value->'plugin'->>'value'='OMF';
-- OMFRetrySleepTime
--
UPDATE configuration SET value = jsonb_set(value, '{OMFRetrySleepTime, order}', '"7"') WHERE value->'plugin'->>'value'='OMF';
-- OMFMaxRetry
--
UPDATE configuration SET value = jsonb_set(value, '{OMFMaxRetry, order}', '"8"') WHERE value->'plugin'->>'value'='OMF';
-- OMFHttpTimeout
--
UPDATE configuration SET value = jsonb_set(value, '{OMFHttpTimeout, order}', '"9"') WHERE value->'plugin'->>'value'='OMF';
-- formatInteger
--
UPDATE configuration SET value = jsonb_set(value, '{formatInteger, order}', '"10"') WHERE value->'plugin'->>'value'='OMF';
-- formatNumber
--
UPDATE configuration SET value = jsonb_set(value, '{formatNumber, order}', '"11"') WHERE value->'plugin'->>'value'='OMF';
-- compression
--
UPDATE configuration SET value = jsonb_set(value, '{compression, order}', '"12"') WHERE value->'plugin'->>'value'='OMF';
-- DefaultAFLocation
-- Note: This is a new config item and its default & value extract from old AFHierarchy1Level config item
--
UPDATE configuration SET value = value || '{"DefaultAFLocation": {"validity": "PIServerEndpoint != \"PI Web API\"", "description": "Defines the hierarchies tree in Asset Framework in which the assets will be created, each level is separated by /, PI Web API only.", "displayName": "Asset Framework hierarchies tree", "type": "string", "order": "13"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
WITH K AS (
SELECT key from configuration where (value->>'plugin')::jsonb->'value'='"OMF"'
)
UPDATE configuration AS t_cfg SET value=jsonb_set(value, '{DefaultAFLocation, default}',
(SELECT value->'AFHierarchy1Level'->'default'
FROM configuration c where (value->>'plugin')::jsonb->'value'='"OMF"' AND t_cfg.key = c.key)
) WHERE key in (select key from K);
WITH K AS (
SELECT key from configuration where (value->>'plugin')::jsonb->'value'='"OMF"'
)
UPDATE configuration AS t_cfg SET value=jsonb_set(value, '{DefaultAFLocation, value}',
(SELECT value->'AFHierarchy1Level'->'value'
FROM configuration c where (value->>'plugin')::jsonb->'value'='"OMF"' AND t_cfg.key = c.key)
) WHERE key in (select key from K);
-- AFHierarchy1Level
-- Note: Removed AFHierarchy1Level config item as it is replaced by new config item DefaultAFLocation
--
UPDATE configuration SET value = value - 'AFHierarchy1Level' WHERE value ->'plugin'->>'value'='OMF';
-- AFMap
-- Note: This is a new config item
--
UPDATE configuration SET value = value || '{"AFMap": {"default": "{}", "value": "{}", "validity": "PIServerEndpoint != \"PI Web API\"", "description": "Defines a SET of rules to address WHERE assets should be placed in the AF hierarchy.", "displayName": "Asset Framework hierarchies rules", "type": "JSON", "order": "14"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
-- notBlockingErrors
--
UPDATE configuration SET value = jsonb_set(value, '{notBlockingErrors, order}', '"15"') WHERE value->'plugin'->>'value'='OMF';
-- streamId
--
UPDATE configuration SET value = jsonb_set(value, '{streamId, order}', '"16"') WHERE value->'plugin'->>'value'='OMF';
-- PIWebAPIAuthenticationMethod
--
UPDATE configuration SET value = jsonb_set(value, '{PIWebAPIAuthenticationMethod, order}', '"17"') WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{PIWebAPIAuthenticationMethod, validity}', '"PIServerEndpoint != \"PI Web API\""') WHERE value->'plugin'->>'value'='OMF';
-- PIWebAPIUserId
--
UPDATE configuration SET value = jsonb_set(value, '{PIWebAPIUserId, order}', '"18"') WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{PIWebAPIUserId, validity}', '"PIServerEndpoint != \"PI Web API\""') WHERE value->'plugin'->>'value'='OMF';
-- PIWebAPIPassword
--
UPDATE configuration SET value = jsonb_set(value, '{PIWebAPIPassword, order}', '"19"') WHERE value->'plugin'->>'value'='OMF';
UPDATE configuration SET value = jsonb_set(value, '{PIWebAPIPassword, validity}', '"PIServerEndpoint != \"PI Web API\""') WHERE value->'plugin'->>'value'='OMF';
-- PIWebAPIKerberosKeytabFileName
-- Note: This is a new config item
--
UPDATE configuration SET value = value || '{"PIWebAPIKerberosKeytabFileName": {"default": "piwebapi_kerberos_https.keytab", "value": "piwebapi_kerberos_https.keytab", "validity": "PIWebAPIAuthenticationMethod == \"kerberos\"", "description": "Keytab file name used for Kerberos authentication in PI Web API.", "displayName": "PI Web API Kerberos keytab file", "type": "string", "order": "20"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
---
--- OCS configuration
--- NOTE- All config items are new one's for OCS
-- OCSNamespace
--
UPDATE configuration SET value = value || '{"OCSNamespace": {"default": "name_space", "value": "name_space", "validity": "PIServerEndpoint == \"OSIsoft Cloud Services\"", "description": "Specifies the OCS namespace WHERE the information are stored and it is used for the interaction with the OCS API", "displayName": "OCS Namespace", "type": "string", "order": "21"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
-- OCSTenantId
--
UPDATE configuration SET value = value || '{"OCSTenantId": {"default": "ocs_tenant_id", "value": "ocs_tenant_id", "validity": "PIServerEndpoint == \"OSIsoft Cloud Services\"", "description": "Tenant id associated to the specific OCS account", "displayName": "OCS Tenant ID", "type": "string", "order": "22"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
-- OCSClientId
--
UPDATE configuration SET value = value || '{"OCSClientId": {"default": "ocs_client_id", "value": "ocs_client_id", "validity": "PIServerEndpoint == \"OSIsoft Cloud Services\"", "description": "Client id associated to the specific OCS account, it is used to authenticate the source for using the OCS API", "displayName": "OCS Client ID", "type": "string", "order": "23"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
-- OCSClientSecret
--
UPDATE configuration SET value = value || '{"OCSClientSecret": {"default": "ocs_client_secret", "value": "ocs_client_secret", "validity": "PIServerEndpoint == \"OSIsoft Cloud Services\"", "description": "Client secret associated to the specific OCS account, it is used to authenticate the source for using the OCS API", "displayName": "OCS Client Secret", "type": "password", "order": "24"}}'::jsonb WHERE value->'plugin'->>'value'='OMF';
--- plugin_data -------------------------------------------------------------------------------------------------------
-- plugin_data
--
UPDATE plugin_data SET key = REPLACE(key,'PI_Server_V2','OMF') WHERE POSITION('PI_Server_V2' in key) > 0;
--- asset_tracker -------------------------------------------------------------------------------------------------------
UPDATE asset_tracker SET plugin = 'OMF' WHERE plugin in ('PI_Server_V2', 'ocs_V2'); | the_stack |
-- 2021-05-27T06:00:17.619Z
-- URL zum Konzept
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained,IsEncrypted,IsMandatory,IsRange,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,540938,542011,17,'SetCreditStatus',TO_TIMESTAMP('2021-05-27 08:00:17','YYYY-MM-DD HH24:MI:SS'),100,'D',1,'Y','N','Y','N','N','N','SetCreditStatus',20,TO_TIMESTAMP('2021-05-27 08:00:17','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-05-27T06:00:17.625Z
-- URL zum Konzept
INSERT INTO AD_Process_Para_Trl (AD_Language,AD_Process_Para_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Process_Para_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Process_Para t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Process_Para_ID=542011 AND NOT EXISTS (SELECT 1 FROM AD_Process_Para_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Process_Para_ID=t.AD_Process_Para_ID)
;
-- 2021-05-27T06:05:41.705Z
-- URL zum Konzept
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,579259,0,TO_TIMESTAMP('2021-05-27 08:05:41','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Credit Status','Credit Status',TO_TIMESTAMP('2021-05-27 08:05:41','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-05-27T06:05:41.722Z
-- URL zum Konzept
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=579259 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2021-05-27T06:06:13.816Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Kreditstatus', PrintName='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:06:13','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579259 AND AD_Language='de_CH'
;
-- 2021-05-27T06:06:13.844Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579259,'de_CH')
;
-- 2021-05-27T06:06:23.278Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Kreditstatus', PrintName='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:06:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579259 AND AD_Language='de_DE'
;
-- 2021-05-27T06:06:23.278Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579259,'de_DE')
;
-- 2021-05-27T06:06:23.283Z
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(579259,'de_DE')
;
-- 2021-05-27T06:06:23.287Z
-- URL zum Konzept
UPDATE AD_Column SET ColumnName=NULL, Name='Kreditstatus', Description=NULL, Help=NULL WHERE AD_Element_ID=579259
;
-- 2021-05-27T06:06:23.287Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName=NULL, Name='Kreditstatus', Description=NULL, Help=NULL WHERE AD_Element_ID=579259 AND IsCentrallyMaintained='Y'
;
-- 2021-05-27T06:06:23.288Z
-- URL zum Konzept
UPDATE AD_Field SET Name='Kreditstatus', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=579259) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 579259)
;
-- 2021-05-27T06:06:23.312Z
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Kreditstatus', Name='Kreditstatus' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=579259)
;
-- 2021-05-27T06:06:23.313Z
-- URL zum Konzept
UPDATE AD_Tab SET Name='Kreditstatus', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 579259
;
-- 2021-05-27T06:06:23.314Z
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Kreditstatus', Description=NULL, Help=NULL WHERE AD_Element_ID = 579259
;
-- 2021-05-27T06:06:23.315Z
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Kreditstatus', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 579259
;
-- 2021-05-27T06:06:35.760Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-05-27 08:06:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579259 AND AD_Language='en_US'
;
-- 2021-05-27T06:06:35.764Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579259,'en_US')
;
-- 2021-05-27T06:06:51.396Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Kreditstatus', PrintName='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:06:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579259 AND AD_Language='nl_NL'
;
-- 2021-05-27T06:06:51.400Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579259,'nl_NL')
;
-- 2021-05-27T06:07:37.081Z
-- URL zum Konzept
UPDATE AD_Process_Para SET AD_Element_ID=2181, ColumnName='SOCreditStatus', Description='Kreditstatus des Geschäftspartners', Help='Credit Management is inactive if Credit Status is No Credit Check, Credit Stop or if the Credit Limit is 0.
If active, the status is set automatically set to Credit Hold, if the Total Open Balance (including Vendor activities) is higher then the Credit Limit. It is set to Credit Watch, if above 90% of the Credit Limit and Credit OK otherwise.', Name='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:07:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=542011
;
-- 2021-05-27T06:16:10.806Z
-- URL zum Konzept
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,541325,TO_TIMESTAMP('2021-05-27 08:16:10','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','CreditStatus',TO_TIMESTAMP('2021-05-27 08:16:10','YYYY-MM-DD HH24:MI:SS'),100,'L')
;
-- 2021-05-27T06:16:10.846Z
-- URL zum Konzept
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Reference_ID=541325 AND NOT EXISTS (SELECT 1 FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 2021-05-27T06:16:25.483Z
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='Y', Name='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:16:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Reference_ID=541325
;
-- 2021-05-27T06:16:30.830Z
-- URL zum Konzept
UPDATE AD_Reference_Trl SET Name='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:16:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Reference_ID=541325
;
-- 2021-05-27T06:16:36.006Z
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-05-27 08:16:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Reference_ID=541325
;
-- 2021-05-27T06:16:40.680Z
-- URL zum Konzept
UPDATE AD_Reference_Trl SET IsTranslated='Y', Name='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:16:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Reference_ID=541325
;
-- 2021-05-27T06:17:44.304Z
-- URL zum Konzept
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541325,542616,TO_TIMESTAMP('2021-05-27 08:17:44','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Kredit Stop',TO_TIMESTAMP('2021-05-27 08:17:44','YYYY-MM-DD HH24:MI:SS'),100,'S','CreditStop')
;
-- 2021-05-27T06:17:44.308Z
-- URL zum Konzept
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542616 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-05-27T06:17:54.092Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-05-27 08:17:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542616
;
-- 2021-05-27T06:17:58.150Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-05-27 08:17:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542616
;
-- 2021-05-27T06:18:08.803Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y', Name='Credit Stop',Updated=TO_TIMESTAMP('2021-05-27 08:18:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542616
;
-- 2021-05-27T06:18:52.576Z
-- URL zum Konzept
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541325,542617,TO_TIMESTAMP('2021-05-27 08:18:52','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Kredit OK',TO_TIMESTAMP('2021-05-27 08:18:52','YYYY-MM-DD HH24:MI:SS'),100,'O','KreditOK')
;
-- 2021-05-27T06:18:52.579Z
-- URL zum Konzept
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542617 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-05-27T06:19:03.312Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y', Name='Credit OK',Updated=TO_TIMESTAMP('2021-05-27 08:19:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542617
;
-- 2021-05-27T06:19:10.387Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-05-27 08:19:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542617
;
-- 2021-05-27T06:19:15.431Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-05-27 08:19:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542617
;
-- 2021-05-27T06:20:21.556Z
-- URL zum Konzept
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541325,542618,TO_TIMESTAMP('2021-05-27 08:20:21','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Calculate',TO_TIMESTAMP('2021-05-27 08:20:21','YYYY-MM-DD HH24:MI:SS'),100,'U','Calculate')
;
-- 2021-05-27T06:20:21.567Z
-- URL zum Konzept
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Ref_List_ID=542618 AND NOT EXISTS (SELECT 1 FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 2021-05-27T06:20:51.054Z
-- URL zum Konzept
UPDATE AD_Process_Para SET AD_Reference_Value_ID=541325,Updated=TO_TIMESTAMP('2021-05-27 08:20:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=542011
;
-- 2021-05-27T06:23:37.572Z
-- URL zum Konzept
UPDATE AD_Process_Para SET IsMandatory='Y',Updated=TO_TIMESTAMP('2021-05-27 08:23:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=542011
;
-- 2021-05-27T06:31:08.970Z
-- URL zum Konzept
UPDATE AD_Process_Para SET IsActive='N',Updated=TO_TIMESTAMP('2021-05-27 08:31:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=541273
;
-- 2021-05-27T06:50:58.360Z
-- URL zum Konzept
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,Description,EntityType,Help,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,579260,0,'setCreditStatus',TO_TIMESTAMP('2021-05-27 08:50:58','YYYY-MM-DD HH24:MI:SS'),100,'Kreditstatus des Geschäftspartners','D','Credit Management is inactive if Credit Status is No Credit Check, Credit Stop or if the Credit Limit is 0.
If active, the status is set automatically set to Credit Hold, if the Total Open Balance (including Vendor activities) is higher then the Credit Limit. It is set to Credit Watch, if above 90% of the Credit Limit and Credit OK otherwise.','Y','CreditStatus','CreditStatus',TO_TIMESTAMP('2021-05-27 08:50:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-05-27T06:50:58.369Z
-- URL zum Konzept
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, CommitWarning,Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Element_ID, t.CommitWarning,t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y' OR l.IsBaseLanguage='Y') AND t.AD_Element_ID=579260 AND NOT EXISTS (SELECT 1 FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 2021-05-27T06:51:05.674Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-05-27 08:51:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579260 AND AD_Language='en_US'
;
-- 2021-05-27T06:51:05.675Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579260,'en_US')
;
-- 2021-05-27T06:51:17.963Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET Name='Kreditstatus', PrintName='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:51:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579260 AND AD_Language='nl_NL'
;
-- 2021-05-27T06:51:17.964Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579260,'nl_NL')
;
-- 2021-05-27T06:51:26.263Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Kreditstatus', PrintName='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:51:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579260 AND AD_Language='de_DE'
;
-- 2021-05-27T06:51:26.266Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579260,'de_DE')
;
-- 2021-05-27T06:51:26.279Z
-- URL zum Konzept
/* DDL */ select update_ad_element_on_ad_element_trl_update(579260,'de_DE')
;
-- 2021-05-27T06:51:26.289Z
-- URL zum Konzept
UPDATE AD_Column SET ColumnName='setCreditStatus', Name='Kreditstatus', Description='Kreditstatus des Geschäftspartners', Help='Credit Management is inactive if Credit Status is No Credit Check, Credit Stop or if the Credit Limit is 0.
If active, the status is set automatically set to Credit Hold, if the Total Open Balance (including Vendor activities) is higher then the Credit Limit. It is set to Credit Watch, if above 90% of the Credit Limit and Credit OK otherwise.' WHERE AD_Element_ID=579260
;
-- 2021-05-27T06:51:26.290Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='setCreditStatus', Name='Kreditstatus', Description='Kreditstatus des Geschäftspartners', Help='Credit Management is inactive if Credit Status is No Credit Check, Credit Stop or if the Credit Limit is 0.
If active, the status is set automatically set to Credit Hold, if the Total Open Balance (including Vendor activities) is higher then the Credit Limit. It is set to Credit Watch, if above 90% of the Credit Limit and Credit OK otherwise.', AD_Element_ID=579260 WHERE UPPER(ColumnName)='SETCREDITSTATUS' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 2021-05-27T06:51:26.292Z
-- URL zum Konzept
UPDATE AD_Process_Para SET ColumnName='setCreditStatus', Name='Kreditstatus', Description='Kreditstatus des Geschäftspartners', Help='Credit Management is inactive if Credit Status is No Credit Check, Credit Stop or if the Credit Limit is 0.
If active, the status is set automatically set to Credit Hold, if the Total Open Balance (including Vendor activities) is higher then the Credit Limit. It is set to Credit Watch, if above 90% of the Credit Limit and Credit OK otherwise.' WHERE AD_Element_ID=579260 AND IsCentrallyMaintained='Y'
;
-- 2021-05-27T06:51:26.293Z
-- URL zum Konzept
UPDATE AD_Field SET Name='Kreditstatus', Description='Kreditstatus des Geschäftspartners', Help='Credit Management is inactive if Credit Status is No Credit Check, Credit Stop or if the Credit Limit is 0.
If active, the status is set automatically set to Credit Hold, if the Total Open Balance (including Vendor activities) is higher then the Credit Limit. It is set to Credit Watch, if above 90% of the Credit Limit and Credit OK otherwise.' WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=579260) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 579260)
;
-- 2021-05-27T06:51:26.314Z
-- URL zum Konzept
UPDATE AD_PrintFormatItem pi SET PrintName='Kreditstatus', Name='Kreditstatus' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=579260)
;
-- 2021-05-27T06:51:26.315Z
-- URL zum Konzept
UPDATE AD_Tab SET Name='Kreditstatus', Description='Kreditstatus des Geschäftspartners', Help='Credit Management is inactive if Credit Status is No Credit Check, Credit Stop or if the Credit Limit is 0.
If active, the status is set automatically set to Credit Hold, if the Total Open Balance (including Vendor activities) is higher then the Credit Limit. It is set to Credit Watch, if above 90% of the Credit Limit and Credit OK otherwise.', CommitWarning = NULL WHERE AD_Element_ID = 579260
;
-- 2021-05-27T06:51:26.317Z
-- URL zum Konzept
UPDATE AD_WINDOW SET Name='Kreditstatus', Description='Kreditstatus des Geschäftspartners', Help='Credit Management is inactive if Credit Status is No Credit Check, Credit Stop or if the Credit Limit is 0.
If active, the status is set automatically set to Credit Hold, if the Total Open Balance (including Vendor activities) is higher then the Credit Limit. It is set to Credit Watch, if above 90% of the Credit Limit and Credit OK otherwise.' WHERE AD_Element_ID = 579260
;
-- 2021-05-27T06:51:26.317Z
-- URL zum Konzept
UPDATE AD_Menu SET Name = 'Kreditstatus', Description = 'Kreditstatus des Geschäftspartners', WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 579260
;
-- 2021-05-27T06:51:35.208Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Kreditstatus', PrintName='Kreditstatus',Updated=TO_TIMESTAMP('2021-05-27 08:51:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=579260 AND AD_Language='de_CH'
;
-- 2021-05-27T06:51:35.208Z
-- URL zum Konzept
/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(579260,'de_CH')
;
-- 2021-05-27T06:52:02.509Z
-- URL zum Konzept
UPDATE AD_Process_Para SET AD_Element_ID=579260, ColumnName='setCreditStatus',Updated=TO_TIMESTAMP('2021-05-27 08:52:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=542011
;
-- 2021-05-27T07:11:25.361Z
-- URL zum Konzept
UPDATE AD_Ref_List SET Name='Berechnen lassen',Updated=TO_TIMESTAMP('2021-05-27 09:11:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=542618
;
-- 2021-05-27T07:11:35.836Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y', Name='Berechnen lassen',Updated=TO_TIMESTAMP('2021-05-27 09:11:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_CH' AND AD_Ref_List_ID=542618
;
-- 2021-05-27T07:11:40.590Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y', Name='Berechnen lassen',Updated=TO_TIMESTAMP('2021-05-27 09:11:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='de_DE' AND AD_Ref_List_ID=542618
;
-- 2021-05-27T07:11:47.095Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET IsTranslated='Y',Updated=TO_TIMESTAMP('2021-05-27 09:11:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='en_US' AND AD_Ref_List_ID=542618
;
-- 2021-05-27T07:11:52.057Z
-- URL zum Konzept
UPDATE AD_Ref_List_Trl SET Name='Berechnen lassen',Updated=TO_TIMESTAMP('2021-05-27 09:11:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Language='nl_NL' AND AD_Ref_List_ID=542618
; | the_stack |
-- 2021-08-30T09:52:26.718Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (AD_Client_ID,AD_Element_ID,AD_Menu_ID,AD_Org_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy) VALUES (0,579577,541743,0,TO_TIMESTAMP('2021-08-30 12:52:26','YYYY-MM-DD HH24:MI:SS'),100,'D','C_User_Assigned_Role','Y','N','N','N','N','Nutzer Rolle',TO_TIMESTAMP('2021-08-30 12:52:26','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-08-30T09:52:26.724Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name,WEBUI_NameBrowse,WEBUI_NameNew,WEBUI_NameNewBreadcrumb, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Menu_ID, t.Description,t.Name,t.WEBUI_NameBrowse,t.WEBUI_NameNew,t.WEBUI_NameNewBreadcrumb, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Menu_ID=541743 AND NOT EXISTS (SELECT 1 FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 2021-08-30T09:52:26.726Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID,0, 'Y', now(), 100, now(), 100,t.AD_Tree_ID, 541743, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.AD_Table_ID=116 AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=541743)
;
-- 2021-08-30T09:52:26.755Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_menu_translation_from_ad_element(579577)
;
-- 2021-08-30T09:52:27.450Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=540864, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=541743 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.799Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=541743 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.801Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=1, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000028 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.801Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=2, Updated=now(), UpdatedBy=100 WHERE Node_ID=541168 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.802Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=3, Updated=now(), UpdatedBy=100 WHERE Node_ID=540816 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.803Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=4, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000032 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.804Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=5, Updated=now(), UpdatedBy=100 WHERE Node_ID=541102 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.805Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=6, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000090 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.806Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=7, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000029 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.807Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=8, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000091 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.807Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=9, Updated=now(), UpdatedBy=100 WHERE Node_ID=541135 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.808Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=10, Updated=now(), UpdatedBy=100 WHERE Node_ID=540850 AND AD_Tree_ID=10
;
-- 2021-08-30T09:52:32.809Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000025, SeqNo=11, Updated=now(), UpdatedBy=100 WHERE Node_ID=540848 AND AD_Tree_ID=10
;
-- 2021-08-30T09:53:16.994Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Menu SET Action='W', AD_Window_ID=541195,Updated=TO_TIMESTAMP('2021-08-30 12:53:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID=541743
;
-- 2021-08-30T10:08:40.007Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Tab (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Tab_ID,AD_Table_ID,AD_Window_ID,AllowQuickInput,Created,CreatedBy,EntityType,HasTree,ImportFields,InternalName,IsActive,IsAdvancedTab,IsCheckParentsChanged,IsGenericZoomTarget,IsGridModeOnly,IsInfoTab,IsInsertRecord,IsQueryOnLoad,IsReadOnly,IsRefreshAllOnActivate,IsRefreshViewOnChangeEvents,IsSearchActive,IsSearchCollapsed,IsSingleRow,IsSortTab,IsTranslationTab,MaxQueryRecords,Name,Processing,SeqNo,TabLevel,Updated,UpdatedBy) VALUES (0,575553,579579,0,544281,541777,123,'Y',TO_TIMESTAMP('2021-08-30 13:08:39','YYYY-MM-DD HH24:MI:SS'),100,'D','N','N','C_User_Assigned_Role','Y','N','Y','N','N','N','Y','Y','N','N','N','Y','Y','N','N','N',0,'User Role Assignments','N',280,0,TO_TIMESTAMP('2021-08-30 13:08:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-08-30T10:08:40.009Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, CommitWarning,Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Tab_ID, t.CommitWarning,t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Tab_ID=544281 AND NOT EXISTS (SELECT 1 FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID)
;
-- 2021-08-30T10:08:40.011Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_tab_translation_from_ad_element(579579)
;
-- 2021-08-30T10:08:40.013Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Tab(544281)
;
-- 2021-08-30T10:09:34.469Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET TabLevel=2,Updated=TO_TIMESTAMP('2021-08-30 13:09:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=544281
;
-- 2021-08-30T10:10:00.151Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,575554,653405,0,544281,0,TO_TIMESTAMP('2021-08-30 13:10:00','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','Nutzer Rolle',0,10,0,1,1,TO_TIMESTAMP('2021-08-30 13:10:00','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-08-30T10:10:00.153Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Field_ID=653405 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2021-08-30T10:10:00.155Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(579577)
;
-- 2021-08-30T10:10:00.157Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=653405
;
-- 2021-08-30T10:10:00.157Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(653405)
;
-- 2021-08-30T10:10:10.164Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Org_ID,AD_Tab_ID,ColumnDisplayLength,Created,CreatedBy,DisplayLength,EntityType,IncludedTabHeight,IsActive,IsDisplayed,IsDisplayedGrid,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,SeqNoGrid,SortNo,SpanX,SpanY,Updated,UpdatedBy) VALUES (0,575552,653406,0,544281,0,TO_TIMESTAMP('2021-08-30 13:10:10','YYYY-MM-DD HH24:MI:SS'),100,0,'D',0,'Y','Y','Y','N','N','N','N','N','User Role Assignments',0,20,0,1,1,TO_TIMESTAMP('2021-08-30 13:10:10','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-08-30T10:10:10.166Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language, t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y'AND (l.IsSystemLanguage='Y') AND t.AD_Field_ID=653406 AND NOT EXISTS (SELECT 1 FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 2021-08-30T10:10:10.167Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select update_FieldTranslation_From_AD_Name_Element(579579)
;
-- 2021-08-30T10:10:10.170Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_Element_Link WHERE AD_Field_ID=653406
;
-- 2021-08-30T10:10:10.170Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ select AD_Element_Link_Create_Missing_Field(653406)
;
-- 2021-08-30T10:12:58.454Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Element (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_ElementGroup_ID,AD_UI_Element_ID,AD_UI_ElementType,Created,CreatedBy,IsActive,IsAdvancedField,IsAllowFiltering,IsDisplayed,IsDisplayedGrid,IsDisplayed_SideList,IsMultiLine,Labels_Selector_Field_ID,Labels_Tab_ID,MultiLine_LinesCount,Name,SeqNo,SeqNoGrid,SeqNo_SideList,Updated,UpdatedBy) VALUES (0,0,496,540831,588403,'L',TO_TIMESTAMP('2021-08-30 13:12:58','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','N','Y','N','N','N',653405,544281,0,'Labels',10,0,0,TO_TIMESTAMP('2021-08-30 13:12:58','YYYY-MM-DD HH24:MI:SS'),100)
;
-- 2021-08-30T10:16:00.559Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Etiketten',Updated=TO_TIMESTAMP('2021-08-30 13:16:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=588403
;
-- 2021-08-30T12:51:00.145Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET TechnicalNote='Used to maintain roles that can be assigned to users. Not related to AD_Role, it is more of a lightweight configurable labels (or roles).
Similar to AD_User_Attribute.Attribute but:
- Allows maintenance, instead of relying on a static List reference
- IsUniqueForBPartner column can specify that a role can only be assigned to a single user per bpartner',Updated=TO_TIMESTAMP('2021-08-30 15:51:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=541776
;
-- 2021-08-30T13:10:54.734Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Table SET TechnicalNote='Used to maintain User to Role(C_User_Role) associations. Not related to AD_Role.',Updated=TO_TIMESTAMP('2021-08-30 16:10:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=541777
;
-- 2021-08-30T13:14:36.710Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_UI_Element SET Name='Rollen',Updated=TO_TIMESTAMP('2021-08-30 16:14:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_UI_Element_ID=588403
; | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.